WebCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Mar 2008 01:07:58 +0000 (01:07 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Mar 2008 01:07:58 +0000 (01:07 +0000)
commite20ca97ccd4bbc4d854a887e999c00c434e66234
treea85d7d71dc33a53a9b8fbb0ce028e9a829132270
parent43bfcccda80f3211ece5ebb1a9aa60ff8c8e6df8
WebCore:

2008-03-25  Darin Adler  <darin@apple.com>

        Reviewed by Anders.

        - fix http://bugs.webkit.org/show_bug.cgi?id=17252
          Acid3 test removing Nodes during NodeIterator walk fails (affects Acid3 test 2)

        Test: traversal/acid3-test-2.html

        * bindings/js/JSNodeIteratorCustom.cpp:
        (WebCore::JSNodeIterator::nextNode): Update since result is PassRefPtr.
        (WebCore::JSNodeIterator::previousNode): Ditto.
        * dom/NodeIterator.cpp:
        (WebCore::NodeIterator::nextNode): Changed result to PassRefPtr. Added code to
        track both the current candidate (which needs to move along to the next node
        if current node is deleted) and the current provisional result (passed to acceptNode,
        and needs to be returned even if it's deleted).
        (WebCore::NodeIterator::previousNode): Ditto.
        (WebCore::NodeIterator::nodeWillBeRemoved): Call updateForNodeRemoval for
        m_candidateNode as well as m_referenceNode.
        * dom/NodeIterator.h: Use PassRefPtr for return values.

LayoutTests:

2008-03-25  Darin Adler  <darin@apple.com>

        Reviewed by Anders.

        - test for http://bugs.webkit.org/show_bug.cgi?id=17252
          Acid3 test removing Nodes during NodeIterator walk fails (affects Acid3 test 2)

        * traversal/acid3-test-2-expected.txt: Added.
        * traversal/acid3-test-2.html: Added.
        * traversal/resources/acid3-test-2.js: Added.
        * traversal/resources/exception-forwarding.js: Removed bogus extra line of code.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/traversal/acid3-test-2-expected.txt [new file with mode: 0644]
LayoutTests/traversal/acid3-test-2.html [new file with mode: 0644]
LayoutTests/traversal/resources/acid3-test-2.js [new file with mode: 0644]
LayoutTests/traversal/resources/exception-forwarding.js
WebCore/ChangeLog
WebCore/bindings/js/JSNodeIteratorCustom.cpp
WebCore/dom/NodeIterator.cpp
WebCore/dom/NodeIterator.h