Bug 15988 - REGRESSION: XPath preceding-axis query misses nested elements
Summary: REGRESSION: XPath preceding-axis query misses nested elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: HasReduction, Regression
Depends on:
Blocks:
 
Reported: 2007-11-14 12:17 PST by Khoo Yit Phang
Modified: 2007-11-15 22:01 PST (History)
1 user (show)

See Also:


Attachments
Test case in XHTML and inline Javascript. (1.63 KB, application/xhtml+xml)
2007-11-14 12:18 PST, Khoo Yit Phang
no flags Details
Equivalent query in XSLT, to be applied to the test XHTML file. (692 bytes, application/xml)
2007-11-14 12:21 PST, Khoo Yit Phang
no flags Details
proposed fix (5.37 KB, patch)
2007-11-15 08:43 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Khoo Yit Phang 2007-11-14 12:17:27 PST
In the nightlies (but not Safari 3.0.3 for Tiger), when performing an XPath query with a preceding axis, some nodes which do precede the context node are not returned. It seems to occur when these missed nodes are nested in another node. E.g.:

<div id="test">
    <span id="A"/>
    <div><span id="B">
        <span id="C"/>
    </span></div>
    <span id="D"/>
</div>

The query "preceding::xhtml:span" on span#D will not return span#C.
Comment 1 Khoo Yit Phang 2007-11-14 12:18:30 PST
Created attachment 17274 [details]
Test case in XHTML and inline Javascript.
Comment 2 Khoo Yit Phang 2007-11-14 12:21:54 PST
Created attachment 17275 [details]
Equivalent query in XSLT, to be applied to the test XHTML file.
Comment 3 Alexey Proskuryakov 2007-11-15 06:41:17 PST
I probably broke it when fixing bug 15436.
Comment 4 Alexey Proskuryakov 2007-11-15 08:43:03 PST
Created attachment 17294 [details]
proposed fix
Comment 5 Darin Adler 2007-11-15 09:37:51 PST
Comment on attachment 17294 [details]
proposed fix

r=me

I love test cases!
Comment 6 Alexey Proskuryakov 2007-11-15 22:01:17 PST
Committed revision 27835.