1 <html> 2 <body> 3 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12807">bug 12807</a>: 4 XPath incorrectly converts NaN to boolean.</p> 5 6 <div></div> 7 <div id="r_01"></div> 8 9 <script> 10 if (window.layoutTestController) 11 layoutTestController.dumpAsText(); 12 13 try { 14 15 result = document.evaluate("//div[number(substring-after(@id,'r_')) or false()]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); 16 17 if (1 == result.snapshotLength) 18 document.write("SUCCESS"); 19 else 20 document.write("FAILURE: " + result.snapshotLength + " result nodes (should be 1)"); 21 } catch (ex) { 22 document.write("FAILURE: " + ex); 23 } 24 </script> 25 </body> 26 </html> 27