blob: 28b91da3bd34989c891ec7c3e861d5398ea61d4b [file] [log] [blame]
<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>