RESOLVED FIXED 15436
Wrong proximity positions for XPath reverse axes
https://bugs.webkit.org/show_bug.cgi?id=15436
Summary Wrong proximity positions for XPath reverse axes
nanto_vi (TOYAMA Nao)
Reported 2007-10-09 07:30:51 PDT
In XPath 1.0, the context position of a node in a node-set for a reverse axis is defined by reverse document order [1]. But WebKit uses document order for ancestor, ancestor-or-self, and preceding axes and arbitrary order for preceding axis. Think the following code: <ul> <li id="li1">foo</li> <li id="li2">bar</li> <li id="li3">baz</li> </ul> <script type="text/javascript"> alert(document.evaluate('preceding-sibling::*[1]', document.getElementById('li3'), null, 8, null) .singleNodeValue.id); </script> WebKit alerts "li1" while Gecko and Opera alerts "li2". This is revealed by amachang's XPath test (see the URL field). [1] http://www.w3.org/TR/1999/REC-xpath-19991116#predicates
Attachments
test case (for fast/xpath) (1.26 KB, text/html)
2007-10-09 09:59 PDT, Alexey Proskuryakov
no flags
proposed fix (7.19 KB, patch)
2007-10-09 11:15 PDT, Alexey Proskuryakov
andersca: review+
Alexey Proskuryakov
Comment 1 2007-10-09 09:59:07 PDT
Created attachment 16597 [details] test case (for fast/xpath)
Alexey Proskuryakov
Comment 2 2007-10-09 11:15:55 PDT
Created attachment 16598 [details] proposed fix
Anders Carlsson
Comment 3 2007-10-09 12:16:16 PDT
Comment on attachment 16598 [details] proposed fix r=me
Alexey Proskuryakov
Comment 4 2007-10-09 12:24:59 PDT
Committed revision 26174 (feature branch). It would be nice to include the whole test in our regression suite. I tried to find the author and sent an e-mail asking for permission, but I could have got it wrong...
Note You need to log in before you can comment on or make changes to this bug.