Avoid inconsistency in Node::inDocument due to DOMSubtreeModified dispatch
authoradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Feb 2012 03:22:10 +0000 (03:22 +0000)
committeradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Feb 2012 03:22:10 +0000 (03:22 +0000)
commitfc1551d0360c058faf03d1b0a0fcef02ed4390c8
treec90ab8f87723922b8c354f32d6d66967ec73d3e9
parent60ef566208ed09f56485b6749551b6b7cd4bfe75
Avoid inconsistency in Node::inDocument due to DOMSubtreeModified dispatch
https://bugs.webkit.org/show_bug.cgi?id=76087

Reviewed by Ryosuke Niwa.

Source/WebCore:

Move post-removal notifications after call to Node::removeFromDocument
to avoid inconsistent state of Node::inDocument() and thus avoid
inconsistent state in DocumentOrderedMap.

Tests: fast/dom/getElementById-consistency.html
       fast/dom/getElementById-consistency2.html

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeChild):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::updateReferencedText): Fixed to work with new timing of DOMSubtreeModified dispatch.

LayoutTests:

* fast/dom/getElementById-consistency-expected.txt: Added.
* fast/dom/getElementById-consistency.html: Added.
* fast/dom/getElementById-consistency2-expected.txt: Added.
* fast/dom/getElementById-consistency2.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/getElementById-consistency-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/getElementById-consistency.html [new file with mode: 0644]
LayoutTests/fast/dom/getElementById-consistency2-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/getElementById-consistency2.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/svg/SVGTRefElement.cpp