<html> <body> <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12807">bug 12807</a>: XPath incorrectly converts NaN to boolean.</p> <div></div> <div id="r_01"></div> <script> if (window.testRunner) testRunner.dumpAsText(); try { result = document.evaluate("//div[number(substring-after(@id,'r_')) or false()]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); if (1 == result.snapshotLength) document.write("SUCCESS"); else document.write("FAILURE: " + result.snapshotLength + " result nodes (should be 1)"); } catch (ex) { document.write("FAILURE: " + ex); } </script> </body> </html>