When the NodeFilter skips or rejects nodes, the traversal order is all wrong (and doesn't match Firefox).
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.
Created attachment 65020 [details] Add some tests (that all pass when bug 35296 is fixed)
I was able to reduce a problem not covered by these tests. Will attach later.
Created attachment 65031 [details] Patch
Created attachment 65034 [details] Patch
Comment on attachment 65034 [details] Patch Oops, attached the same patch again.
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)
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 on attachment 65020 [details] Add some tests (that all pass when bug 35296 is fixed) http://trac.webkit.org/changeset/65914
http://trac.webkit.org/changeset/65926