1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
5 <script src=
"xpath-test-pre.js"></script>
8 <p>Test for
<a href=
"http://bugs.webkit.org/show_bug.cgi?id=15436">bug
15436</a>:
9 Wrong proximity positions for XPath reverse axes.
</p>
21 <div id=
"console"></div>
25 shouldBe("document.evaluate('preceding-sibling::*[1]', document.getElementById('d3'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d2'");
27 shouldBe("document.evaluate('preceding::*[1]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d21'");
28 shouldBe("document.evaluate('preceding::*[2]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d2'");
29 shouldBe("document.evaluate('preceding::*[3]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d1'");
30 shouldBe("document.evaluate('preceding::*[4]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.tagName", "'A'");
31 shouldBe("document.evaluate('preceding::*[5]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.tagName", "'P'");
33 shouldBe("document.evaluate('ancestor::*[1]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d3'");
35 shouldBe("document.evaluate('ancestor-or-self::*[1]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d31'");