Assert that Node::insertedInto doesn't fire an event
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Oct 2017 05:52:38 +0000 (05:52 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Oct 2017 05:52:38 +0000 (05:52 +0000)
commitc1ebd31e9371838abf585230a6be93419c0f2cc9
tree39938c07b5c33c05aade660ca47453d13c4f33bb
parent950fd2e304c4987d07a02544ede7003cae80e30c
Assert that Node::insertedInto doesn't fire an event
https://bugs.webkit.org/show_bug.cgi?id=178376
<rdar://problem/35022857>

Reviewed by Daniel Bates.

Fixed the assertion in notifyChildNodeInserted since this function MUST NOT dispatch an event,
and moved a bunch of event-dispatching code from Node::insertedInto into Node::finishedInsertingSubtree.

No new tests since the existing tests cover the behavioral change.

* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted): Fixed the assertion.
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::finishedInsertingSubtree): Extracted from insertedInto since
checkStyleSheet can dispatch an event.
* dom/ProcessingInstruction.h:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedInto):
(WebCore::HTMLBodyElement::finishedInsertingSubtree): Extracted from insertedInto since
setIntegralAttribute could dispatch DOMAttrModified synchronously.
* html/HTMLBodyElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/ContainerNodeAlgorithms.cpp
Source/WebCore/dom/ProcessingInstruction.cpp
Source/WebCore/dom/ProcessingInstruction.h
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLBodyElement.h