diff options
Diffstat (limited to 'LayoutTests/fast/xpath/id-path.html')
-rw-r--r-- | LayoutTests/fast/xpath/id-path.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/LayoutTests/fast/xpath/id-path.html b/LayoutTests/fast/xpath/id-path.html new file mode 100644 index 0000000..28b91da --- /dev/null +++ b/LayoutTests/fast/xpath/id-path.html @@ -0,0 +1,26 @@ +<body> +<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12485">bug 12485</a>: +XPath id() function doesn't work as root in paths.</p> + + <div id="a"><div></div></div> + <div id="bb"><div></div></div> + <div id="ccc"><div></div></div> + +<script> + if (window.layoutTestController) + layoutTestController.dumpAsText(); + + var UNORDERED_NODE_SNAPSHOT_TYPE = 6; + + try { + result = document.evaluate("id('a bb ccc')[@id != 'ccc']/div", document.body, null, UNORDERED_NODE_SNAPSHOT_TYPE, null); + + if (2 == result.snapshotLength) + document.write("SUCCESS"); + else + document.write("FAILURE: " + result.snapshotLength + " result nodes (should be 2)"); + } catch (ex) { + document.write("FAILURE: " + ex); + } +</script> +</body> |