2010-08-24 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Aug 2010 20:08:41 +0000 (20:08 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Aug 2010 20:08:41 +0000 (20:08 +0000)
commit152059253a5d43218b875410bc13e0530578dc82
tree5016a5ad24dadcc8d6e5af3a1739fcf20c1ab87f
parentab0a0e451a30e26297ef2a89f8e0c564ece72c1c
2010-08-24  Simon Fraser  <simon.fraser@apple.com>

        Reviewed by Sam Weinig.

        TreeWalker traversal order is wrong when skipping and rejecting
        https://bugs.webkit.org/show_bug.cgi?id=44377

        TreeWalker's nextSibling() and previousSibling() behaved incorrectly
        when traversing down a subtree where all nodes are skipped; it backed all
        the way up to the root of the subtree, then jump to the subtree's parentNode.
        This would skip later siblings.

        Fix by resetting 'node' when traversing to children so that node = node->parentNode()
        gets the correct node later.

        Test: fast/dom/TreeWalker/traversal-skip-most.html

        * dom/TreeWalker.cpp:
        (WebCore::TreeWalker::previousSibling):
        (WebCore::TreeWalker::nextSibling):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip-most.js [new file with mode: 0644]
LayoutTests/fast/dom/TreeWalker/traversal-skip-most-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/TreeWalker/traversal-skip-most.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/TreeWalker.cpp