diff options
Diffstat (limited to 'LayoutTests/fast/xpath/nan-to-boolean.html')
-rw-r--r-- | LayoutTests/fast/xpath/nan-to-boolean.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/LayoutTests/fast/xpath/nan-to-boolean.html b/LayoutTests/fast/xpath/nan-to-boolean.html new file mode 100644 index 0000000..8380233 --- /dev/null +++ b/LayoutTests/fast/xpath/nan-to-boolean.html @@ -0,0 +1,26 @@ +<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.layoutTestController) + layoutTestController.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> |