Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Oct 2017 10:34:31 +0000 (10:34 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Oct 2017 10:34:31 +0000 (10:34 +0000)
commitcb40425946938478802e42181d3b765890f43e16
treea76a89f09c33a4f60c5d50b4702207a007ee7889
parent495ef2aeb717825211110b513871d6e89e2b9d44
Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
https://bugs.webkit.org/show_bug.cgi?id=178504

Reviewed by Antti Koivisto.

Consolidated calls to notifyChildNodeInserted, childrenChanged, didFinishInsertingNode, and
dispatchChildInsertionEvents for inserting a node by executeNodeInsertionWithScriptAssertion,
a new templatefunction which takes a closure to do the node insertion to make exactly when
the script becomes runnable clear.

Added an exception to SVGTRefElement::updateReferencedText since this code mutates user agent
shadow root during insertedInto, and turned ChildChangeSource into an enum class.

* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
* dom/ContainerNode.cpp:
(WebCore::executeNodeInsertionWithScriptAssertion): Extracted.
(WebCore::ContainerNode::takeAllChildrenFrom): Deployed executeNodeInsertionWithScriptAssertion.
(WebCore::ContainerNode::insertBefore): Ditto.
(WebCore::ContainerNode::changeForChildInsertion): Deleted.
(WebCore::ContainerNode::notifyChildInserted): Deleted.
(WebCore::ContainerNode::parserInsertBefore): Deployed executeNodeInsertionWithScriptAssertion.
(WebCore::ContainerNode::replaceChild): Ditto.
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::parserRemoveChild):
(WebCore::ContainerNode::replaceAllChildren): Ditto.
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
(WebCore::ContainerNode::parserAppendChild): Ditto.
(WebCore::ContainerNode::childrenChanged):
(WebCore::ContainerNode::updateTreeAfterInsertion): Deleted.
* dom/ContainerNode.h:
* dom/Element.cpp:
(WebCore::Element::childrenChanged):
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::childrenChanged):
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::childrenChanged):
* svg/SVGElement.cpp:
(WebCore::SVGElement::childrenChanged):
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::childrenChanged):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::childrenChanged):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::childrenChanged):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::childrenChanged):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::childrenChanged):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::childrenChanged):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::updateReferencedText): Allow DOM mutations inside the user agent shadow tree here.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/CharacterData.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNode.h
Source/WebCore/dom/Element.cpp
Source/WebCore/html/HTMLOutputElement.cpp
Source/WebCore/svg/SVGClipPathElement.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGFELightElement.cpp
Source/WebCore/svg/SVGFilterElement.cpp
Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
Source/WebCore/svg/SVGGradientElement.cpp
Source/WebCore/svg/SVGMarkerElement.cpp
Source/WebCore/svg/SVGMaskElement.cpp
Source/WebCore/svg/SVGPatternElement.cpp
Source/WebCore/svg/SVGTRefElement.cpp