Bug 44377

Summary: TreeWalker traversal order is wrong when skipping and rejecting
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: DOMAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, kling, sam, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: OS X 10.5   
URL: http://www-archive.mozilla.org/docs/dom/samples/treewalkerdemo.xml
Attachments:
Description Flags
Add some tests (that all pass when bug 35296 is fixed)
none
Patch
sam: review+
Patch none

Description Simon Fraser (smfr) 2010-08-20 21:07:27 PDT
When the NodeFilter skips or rejects nodes, the traversal order is all wrong (and doesn't match Firefox).
Comment 1 Simon Fraser (smfr) 2010-08-20 21:12:45 PDT
I have some tests that work fine, but when I load
http://www-archive.mozilla.org/docs/dom/samples/treewalkerdemo.xml
and hit the "All datatypes" button, the result is different from Firefox.
Comment 2 Simon Fraser (smfr) 2010-08-20 21:17:30 PDT
Created attachment 65020 [details]
Add some tests (that all pass when bug 35296 is fixed)
Comment 3 Simon Fraser (smfr) 2010-08-20 22:34:20 PDT
I was able to reduce a problem not covered by these tests. Will attach later.
Comment 4 Simon Fraser (smfr) 2010-08-21 12:22:07 PDT
Created attachment 65031 [details]
Patch
Comment 5 Simon Fraser (smfr) 2010-08-21 13:30:15 PDT
Created attachment 65034 [details]
Patch
Comment 6 Simon Fraser (smfr) 2010-08-21 13:30:58 PDT
Comment on attachment 65034 [details]
Patch

Oops, attached the same patch again.
Comment 7 Andreas Kling 2010-08-24 06:23:19 PDT
Comment on attachment 65031 [details]
Patch

LGTM (not a reviewer though.)

Of note: This change will make WebKit pass 2 additional tests on the IE Test Center (previous- and nextSibling() with NodeFilter)
Comment 8 WebKit Review Bot 2010-08-24 11:49:20 PDT
http://trac.webkit.org/changeset/65914 might have broken GTK Linux 64-bit Debug
The following changes are on the blame list:
http://trac.webkit.org/changeset/65913
http://trac.webkit.org/changeset/65914
http://trac.webkit.org/changeset/65915
Comment 9 Simon Fraser (smfr) 2010-08-24 13:08:26 PDT
Comment on attachment 65020 [details]
Add some tests (that all pass when bug 35296 is fixed)

http://trac.webkit.org/changeset/65914
Comment 10 Simon Fraser (smfr) 2010-08-24 13:09:22 PDT
http://trac.webkit.org/changeset/65926