1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 2 <html> 3 <head> 4 <link rel="stylesheet" href="../js/resources/js-test-style.css"> 5 <script src="../js/resources/js-test-pre.js"></script> 6 <script src="xpath-test-pre.js"></script> 7 </head> 8 <body> 9 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=15436">bug 15436</a>: 10 Wrong proximity positions for XPath reverse axes.</p> 11 12 <div id="d"> 13 <div id="d1"></div> 14 <div id="d2"> 15 <div id="d21"></div> 16 </div> 17 <div id="d3"> 18 <div id="d31"></div> 19 </div> 20 </div> 21 22 <div id="console"></div> 23 24 <script> 25 26 shouldBe("document.evaluate('preceding-sibling::*[1]', document.getElementById('d3'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d2'"); 27 28 shouldBe("document.evaluate('preceding::*[1]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d21'"); 29 shouldBe("document.evaluate('preceding::*[2]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d2'"); 30 shouldBe("document.evaluate('preceding::*[3]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d1'"); 31 shouldBe("document.evaluate('preceding::*[4]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.tagName", "'A'"); 32 shouldBe("document.evaluate('preceding::*[5]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.tagName", "'P'"); 33 34 shouldBe("document.evaluate('ancestor::*[1]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d3'"); 35 36 shouldBe("document.evaluate('ancestor-or-self::*[1]', document.getElementById('d31'), null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.id", "'d31'"); 37 38 var successfullyParsed = true; 39 40 </script> 41 <script src="../js/resources/js-test-post.js"></script> 42 </body> 43 </html> 44