Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / xpath / id-path.html
blob533f59e96789332a37dfaa52aa9b616431cbe2f2
1 <body>
2 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12485">bug 12485</a>:
3 XPath id() function doesn't work as root in paths.</p>
5 <div id="a"><div></div></div>
6 <div id="bb"><div></div></div>
7 <div id="ccc"><div></div></div>
9 <script>
10 if (window.testRunner)
11 testRunner.dumpAsText();
13 var UNORDERED_NODE_SNAPSHOT_TYPE = 6;
15 try {
16 result = document.evaluate("id('a bb ccc')[@id != 'ccc']/div", document.body, null, UNORDERED_NODE_SNAPSHOT_TYPE, null);
18 if (2 == result.snapshotLength)
19 document.write("SUCCESS");
20 else
21 document.write("FAILURE: " + result.snapshotLength + " result nodes (should be 2)");
22 } catch (ex) {
23 document.write("FAILURE: " + ex);
25 </script>
26 </body>