Title: [269161] trunk/Source/WebCore
Revision
269161
Author
[email protected]
Date
2020-10-29 12:24:41 -0700 (Thu, 29 Oct 2020)

Log Message

Make WebCore::ContainerNode::ChildChangeType enum class
https://bugs.webkit.org/show_bug.cgi?id=218298
Patch by Tetsuharu Ohzeki <[email protected]> on 2020-10-29
Reviewed by Darin Adler.

And this patch moved to `ChildChangeType` to under `ChildChange`.
This patch also move `ChildChangeSource` to under `ChildChange` and specify a base type.

* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
(WebCore::CharacterData::notifyParentAfterChange):
* dom/CharacterData.h:
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeAllChildrenWithScriptAssertion):
(WebCore::ContainerNode::removeNodeWithScriptAssertion):
(WebCore::executeNodeInsertionWithScriptAssertion):
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::parserInsertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::parserRemoveChild):
(WebCore::ContainerNode::replaceAllChildrenWithNewText):
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
(WebCore::ContainerNode::parserAppendChild):
(WebCore::affectsElements):
(WebCore::ContainerNode::childrenChanged):
(WebCore::ContainerNode::replaceChildren):
* dom/ContainerNode.h:
(WebCore::ContainerNode::ChildChange::isInsertion const):
* dom/Element.cpp:
(WebCore::Element::childrenChanged):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::childrenChanged):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
* html/HTMLElement.h:
* 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (269160 => 269161)


--- trunk/Source/WebCore/ChangeLog	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/ChangeLog	2020-10-29 19:24:41 UTC (rev 269161)
@@ -1,3 +1,64 @@
+2020-10-29  Tetsuharu Ohzeki  <[email protected]>
+
+        Make WebCore::ContainerNode::ChildChangeType enum class
+        https://bugs.webkit.org/show_bug.cgi?id=218298
+        Reviewed by Darin Adler.
+
+        And this patch moved to `ChildChangeType` to under `ChildChange`.
+        This patch also move `ChildChangeSource` to under `ChildChange` and specify a base type.
+
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::parserAppendData):
+        (WebCore::CharacterData::setDataAndUpdate):
+        (WebCore::CharacterData::notifyParentAfterChange):
+        * dom/CharacterData.h:
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion):
+        (WebCore::ContainerNode::removeNodeWithScriptAssertion):
+        (WebCore::executeNodeInsertionWithScriptAssertion):
+        (WebCore::ContainerNode::takeAllChildrenFrom):
+        (WebCore::ContainerNode::insertBefore):
+        (WebCore::ContainerNode::parserInsertBefore):
+        (WebCore::ContainerNode::replaceChild):
+        (WebCore::ContainerNode::removeChild):
+        (WebCore::ContainerNode::parserRemoveChild):
+        (WebCore::ContainerNode::replaceAllChildrenWithNewText):
+        (WebCore::ContainerNode::removeChildren):
+        (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
+        (WebCore::ContainerNode::parserAppendChild):
+        (WebCore::affectsElements):
+        (WebCore::ContainerNode::childrenChanged):
+        (WebCore::ContainerNode::replaceChildren):
+        * dom/ContainerNode.h:
+        (WebCore::ContainerNode::ChildChange::isInsertion const):
+        * dom/Element.cpp:
+        (WebCore::Element::childrenChanged):
+        * dom/ShadowRoot.cpp:
+        (WebCore::ShadowRoot::childrenChanged):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
+        * html/HTMLElement.h:
+        * 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):
+
 2020-10-29  Sihui Liu  <[email protected]>
 
         Unreviewed, reverting r268192.

Modified: trunk/Source/WebCore/dom/CharacterData.cpp (269160 => 269161)


--- trunk/Source/WebCore/dom/CharacterData.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/dom/CharacterData.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -105,7 +105,7 @@
     if (is<Text>(*this) && parentNode())
         downcast<Text>(*this).updateRendererAfterContentChange(oldLength, 0);
 
-    notifyParentAfterChange(ContainerNode::ChildChangeSource::Parser);
+    notifyParentAfterChange(ContainerNode::ChildChange::Source::Parser);
 
     auto mutationRecipients = MutationObserverInterestGroup::createForCharacterDataMutation(*this);
     if (UNLIKELY(mutationRecipients))
@@ -191,12 +191,12 @@
     if (document().frame())
         document().frame()->selection().textWasReplaced(this, offsetOfReplacedData, oldLength, newLength);
 
-    notifyParentAfterChange(ContainerNode::ChildChangeSource::API);
+    notifyParentAfterChange(ContainerNode::ChildChange::Source::API);
 
     dispatchModifiedEvent(oldData);
 }
 
-void CharacterData::notifyParentAfterChange(ContainerNode::ChildChangeSource source)
+void CharacterData::notifyParentAfterChange(ContainerNode::ChildChange::Source source)
 {
     document().incDOMTreeVersion();
 
@@ -204,7 +204,7 @@
         return;
 
     ContainerNode::ChildChange change = {
-        ContainerNode::TextChanged,
+        ContainerNode::ChildChange::Type::TextChanged,
         ElementTraversal::previousSibling(*this),
         ElementTraversal::nextSibling(*this),
         source

Modified: trunk/Source/WebCore/dom/CharacterData.h (269160 => 269161)


--- trunk/Source/WebCore/dom/CharacterData.h	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/dom/CharacterData.h	2020-10-29 19:24:41 UTC (rev 269161)
@@ -65,7 +65,7 @@
 private:
     String nodeValue() const final;
     ExceptionOr<void> setNodeValue(const String&) final;
-    void notifyParentAfterChange(ContainerNode::ChildChangeSource);
+    void notifyParentAfterChange(ContainerNode::ChildChange::Source);
 
     String m_data;
 };

Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (269160 => 269161)


--- trunk/Source/WebCore/dom/ContainerNode.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -78,11 +78,11 @@
 ScriptDisallowedScope::EventAllowedScope* ScriptDisallowedScope::EventAllowedScope::s_currentScope = nullptr;
 #endif
 
-ALWAYS_INLINE NodeVector ContainerNode::removeAllChildrenWithScriptAssertion(ChildChangeSource source, DeferChildrenChanged deferChildrenChanged)
+ALWAYS_INLINE NodeVector ContainerNode::removeAllChildrenWithScriptAssertion(ChildChange::Source source, DeferChildrenChanged deferChildrenChanged)
 {
     auto children = collectChildNodes(*this);
 
-    if (source == ContainerNode::ChildChangeSource::API) {
+    if (source == ChildChange::Source::API) {
         ChildListMutationScope mutation(*this);
         for (auto& child : children) {
             mutation.willRemoveChild(child.get());
@@ -90,7 +90,7 @@
             dispatchChildRemovalEvents(child);
         }
     } else {
-        ASSERT(source == ContainerNode::ChildChangeSource::Parser);
+        ASSERT(source == ChildChange::Source::Parser);
         ScriptDisallowedScope::InMainThread scriptDisallowedScope;
         if (UNLIKELY(document().hasMutationObserversOfType(MutationObserver::ChildList))) {
             ChildListMutationScope mutation(*this);
@@ -115,12 +115,12 @@
     }
 
     if (deferChildrenChanged == DeferChildrenChanged::No)
-        childrenChanged(ContainerNode::ChildChange { ContainerNode::AllChildrenRemoved, nullptr, nullptr, source });
+        childrenChanged(ContainerNode::ChildChange { ChildChange::Type::AllChildrenRemoved, nullptr, nullptr, source });
 
     return children;
 }
 
-ALWAYS_INLINE bool ContainerNode::removeNodeWithScriptAssertion(Node& childToRemove, ChildChangeSource source)
+ALWAYS_INLINE bool ContainerNode::removeNodeWithScriptAssertion(Node& childToRemove, ChildChange::Source source)
 {
     Ref<Node> protectedChildToRemove(childToRemove);
     ASSERT_WITH_SECURITY_IMPLICATION(childToRemove.parentNode() == this);
@@ -130,7 +130,7 @@
     }
 
     ASSERT_WITH_SECURITY_IMPLICATION(ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree(childToRemove));
-    if (source == ContainerNode::ChildChangeSource::API) {
+    if (source == ChildChange::Source::API) {
         childToRemove.notifyMutationObserversNodeWillDetach();
         dispatchChildRemovalEvents(protectedChildToRemove);
         if (childToRemove.parentNode() != this)
@@ -137,7 +137,7 @@
             return false;
     }
 
-    if (source == ContainerNode::ChildChangeSource::Parser) {
+    if (source == ChildChange::Source::Parser) {
         // FIXME: Merge these two code paths. It's a bug in the parser not to update connectedSubframeCount in time.
         disconnectSubframesIfNeeded(*this, DescendantsOnly);
     } else {
@@ -166,7 +166,11 @@
         removeBetween(previousSibling.get(), nextSibling.get(), childToRemove);
         notifyChildNodeRemoved(*this, childToRemove);
 
-        change.type = is<Element>(childToRemove) ? ElementRemoved : (is<Text>(childToRemove) ? TextRemoved : NonContentsChildRemoved);
+        change.type = is<Element>(childToRemove) ?
+            ChildChange::Type::ElementRemoved :
+            (is<Text>(childToRemove) ?
+                ChildChange::Type::TextRemoved :
+                ChildChange::Type::NonContentsChildRemoved);
         change.previousSiblingElement = (!previousSibling || is<Element>(*previousSibling)) ? downcast<Element>(previousSibling.get()) : ElementTraversal::previousSibling(*previousSibling);
         change.nextSiblingElement = (!nextSibling || is<Element>(*nextSibling)) ? downcast<Element>(nextSibling.get()) : ElementTraversal::nextSibling(*nextSibling);
         change.source = source;
@@ -182,7 +186,7 @@
 
 template<typename DOMInsertionWork>
 static ALWAYS_INLINE void executeNodeInsertionWithScriptAssertion(ContainerNode& containerNode, Node& child,
-    ContainerNode::ChildChangeSource source, ReplacedAllChildren replacedAllChildren, DOMInsertionWork doNodeInsertion)
+    ContainerNode::ChildChange::Source source, ReplacedAllChildren replacedAllChildren, DOMInsertionWork doNodeInsertion)
 {
     NodeVector postInsertionNotificationTargets;
     {
@@ -198,10 +202,14 @@
 
     // FIXME: Move childrenChanged into ScriptDisallowedScope block.
     if (replacedAllChildren == ReplacedAllChildren::Yes)
-        containerNode.childrenChanged(ContainerNode::ChildChange { ContainerNode::AllChildrenReplaced, nullptr, nullptr, source });
+        containerNode.childrenChanged(ContainerNode::ChildChange { ContainerNode::ChildChange::Type::AllChildrenReplaced, nullptr, nullptr, source });
     else {
         containerNode.childrenChanged(ContainerNode::ChildChange {
-            child.isElementNode() ? ContainerNode::ElementInserted : (child.isTextNode() ? ContainerNode::TextInserted : ContainerNode::NonContentsChildInserted),
+            child.isElementNode() ?
+                ContainerNode::ChildChange::Type::ElementInserted :
+                (child.isTextNode() ?
+                    ContainerNode::ChildChange::Type::TextInserted :
+                    ContainerNode::ChildChange::Type::NonContentsChildInserted),
             ElementTraversal::previousSibling(child),
             ElementTraversal::nextSibling(child),
             source
@@ -212,7 +220,7 @@
     for (auto& target : postInsertionNotificationTargets)
         target->didFinishInsertingNode();
 
-    if (source == ContainerNode::ChildChangeSource::API)
+    if (source == ContainerNode::ChildChange::Source::API)
         dispatchChildInsertionEvents(child);
 }
 
@@ -261,7 +269,7 @@
 {
     ASSERT(oldParent);
 
-    auto children = oldParent->removeAllChildrenWithScriptAssertion(ChildChangeSource::Parser);
+    auto children = oldParent->removeAllChildrenWithScriptAssertion(ChildChange::Source::Parser);
 
     // FIXME: assert that we don't dispatch events here since this container node is still disconnected.
     for (auto& child : children) {
@@ -411,7 +419,7 @@
         if (child->parentNode())
             break;
 
-        executeNodeInsertionWithScriptAssertion(*this, child.get(), ChildChangeSource::API, ReplacedAllChildren::No, [&] {
+        executeNodeInsertionWithScriptAssertion(*this, child.get(), ChildChange::Source::API, ReplacedAllChildren::No, [&] {
             child->setTreeScopeRecursively(treeScope());
             insertBeforeCommon(next, child);
         });
@@ -470,7 +478,7 @@
     if (nextChild.previousSibling() == &newChild || &nextChild == &newChild) // nothing to do
         return;
 
-    executeNodeInsertionWithScriptAssertion(*this, newChild, ChildChangeSource::Parser, ReplacedAllChildren::No, [&] {
+    executeNodeInsertionWithScriptAssertion(*this, newChild, ChildChange::Source::Parser, ReplacedAllChildren::No, [&] {
         if (&document() != &newChild.document())
             document().adoptNode(newChild);
 
@@ -544,7 +552,7 @@
         if (child->parentNode())
             break;
 
-        executeNodeInsertionWithScriptAssertion(*this, child.get(), ChildChangeSource::API, ReplacedAllChildren::No, [&] {
+        executeNodeInsertionWithScriptAssertion(*this, child.get(), ChildChange::Source::API, ReplacedAllChildren::No, [&] {
             child->setTreeScopeRecursively(treeScope());
             if (refChild)
                 insertBeforeCommon(*refChild, child.get());
@@ -574,7 +582,7 @@
     if (oldChild.parentNode() != this)
         return Exception { NotFoundError };
 
-    if (!removeNodeWithScriptAssertion(oldChild, ChildChangeSource::API))
+    if (!removeNodeWithScriptAssertion(oldChild, ChildChange::Source::API))
         return Exception { NotFoundError };
 
     rebuildSVGExtensionsElementsIfNecessary();
@@ -619,7 +627,7 @@
 
 void ContainerNode::parserRemoveChild(Node& oldChild)
 {
-    removeNodeWithScriptAssertion(oldChild, ChildChangeSource::Parser);
+    removeNodeWithScriptAssertion(oldChild, ChildChange::Source::Parser);
 }
 
 // https://dom.spec.whatwg.org/#concept-node-replace-all
@@ -647,9 +655,9 @@
 
     Ref<ContainerNode> protectedThis(*this);
     ChildListMutationScope mutation(*this);
-    removeAllChildrenWithScriptAssertion(ChildChangeSource::API, DeferChildrenChanged::Yes);
+    removeAllChildrenWithScriptAssertion(ChildChange::Source::API, DeferChildrenChanged::Yes);
 
-    executeNodeInsertionWithScriptAssertion(*this, node.get(), ChildChangeSource::API, ReplacedAllChildren::Yes, [&] {
+    executeNodeInsertionWithScriptAssertion(*this, node.get(), ChildChange::Source::API, ReplacedAllChildren::Yes, [&] {
         ASSERT(!ensurePreInsertionValidity(node, nullptr).hasException());
         InspectorInstrumentation::willInsertDOMNode(document(), *this);
         node->setTreeScopeRecursively(treeScope());
@@ -674,7 +682,7 @@
         return;
 
     Ref<ContainerNode> protectedThis(*this);
-    removeAllChildrenWithScriptAssertion(ChildChangeSource::API);
+    removeAllChildrenWithScriptAssertion(ChildChange::Source::API);
 
     rebuildSVGExtensionsElementsIfNecessary();
     dispatchSubtreeModifiedEvent();
@@ -725,7 +733,7 @@
             break;
 
         // Append child to the end of the list
-        executeNodeInsertionWithScriptAssertion(*this, child.get(), ChildChangeSource::API, ReplacedAllChildren::No, [&] {
+        executeNodeInsertionWithScriptAssertion(*this, child.get(), ChildChange::Source::API, ReplacedAllChildren::No, [&] {
             child->setTreeScopeRecursively(treeScope());
             appendChildCommon(child);
         });
@@ -741,7 +749,7 @@
     ASSERT(!newChild.isDocumentFragment());
     ASSERT(!hasTagName(HTMLNames::templateTag));
 
-    executeNodeInsertionWithScriptAssertion(*this, newChild, ChildChangeSource::Parser, ReplacedAllChildren::No, [&] {
+    executeNodeInsertionWithScriptAssertion(*this, newChild, ChildChange::Source::Parser, ReplacedAllChildren::No, [&] {
         if (&document() != &newChild.document())
             document().adoptNode(newChild);
 
@@ -754,16 +762,16 @@
 static bool affectsElements(const ContainerNode::ChildChange& change)
 {
     switch (change.type) {
-    case ContainerNode::ElementInserted:
-    case ContainerNode::ElementRemoved:
-    case ContainerNode::AllChildrenRemoved:
-    case ContainerNode::AllChildrenReplaced:
+    case ContainerNode::ChildChange::Type::ElementInserted:
+    case ContainerNode::ChildChange::Type::ElementRemoved:
+    case ContainerNode::ChildChange::Type::AllChildrenRemoved:
+    case ContainerNode::ChildChange::Type::AllChildrenReplaced:
         return true;
-    case ContainerNode::TextInserted:
-    case ContainerNode::TextRemoved:
-    case ContainerNode::TextChanged:
-    case ContainerNode::NonContentsChildInserted:
-    case ContainerNode::NonContentsChildRemoved:
+    case ContainerNode::ChildChange::Type::TextInserted:
+    case ContainerNode::ChildChange::Type::TextRemoved:
+    case ContainerNode::ChildChange::Type::TextChanged:
+    case ContainerNode::ChildChange::Type::NonContentsChildInserted:
+    case ContainerNode::ChildChange::Type::NonContentsChildRemoved:
         return false;
     }
     ASSERT_NOT_REACHED();
@@ -780,7 +788,7 @@
     // FIXME: Unclear why it's always safe to skip this when parser is adding children.
     // FIXME: Seems like it's equally safe to skip for TextInserted and TextRemoved as for TextChanged.
     // FIXME: Should use switch for change type so we remember to update when adding new types.
-    if (change.source == ChildChangeSource::API && change.type != TextChanged)
+    if (change.source == ChildChange::Source::API && change.type != ChildChange::Type::TextChanged)
         document().updateRangesAfterChildrenChanged(*this);
 
     invalidateNodeListAndCollectionCachesInAncestors();
@@ -972,7 +980,7 @@
     // step 3
     auto protectedThis = makeRef(*this);
     ChildListMutationScope mutation(*this);
-    removeAllChildrenWithScriptAssertion(ChildChangeSource::API, DeferChildrenChanged::No);
+    removeAllChildrenWithScriptAssertion(ChildChange::Source::API, DeferChildrenChanged::No);
 
     if (node) {
         if (auto appendResult = appendChildWithoutPreInsertionValidityCheck(*node); appendResult.hasException())

Modified: trunk/Source/WebCore/dom/ContainerNode.h (269160 => 269161)


--- trunk/Source/WebCore/dom/ContainerNode.h	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/dom/ContainerNode.h	2020-10-29 19:24:41 UTC (rev 269161)
@@ -73,27 +73,28 @@
 
     void cloneChildNodes(ContainerNode& clone);
 
-    enum ChildChangeType { ElementInserted, ElementRemoved, TextInserted, TextRemoved, TextChanged, AllChildrenRemoved, NonContentsChildRemoved, NonContentsChildInserted, AllChildrenReplaced };
-    enum class ChildChangeSource { Parser, API };
     struct ChildChange {
-        ChildChangeType type;
+        enum class Type : uint8_t { ElementInserted, ElementRemoved, TextInserted, TextRemoved, TextChanged, AllChildrenRemoved, NonContentsChildRemoved, NonContentsChildInserted, AllChildrenReplaced };
+        enum class Source : bool { Parser, API };
+
+        ChildChange::Type type;
         Element* previousSiblingElement;
         Element* nextSiblingElement;
-        ChildChangeSource source;
+        ChildChange::Source source;
 
         bool isInsertion() const
         {
             switch (type) {
-            case ElementInserted:
-            case TextInserted:
-            case NonContentsChildInserted:
-            case AllChildrenReplaced:
+            case ChildChange::Type::ElementInserted:
+            case ChildChange::Type::TextInserted:
+            case ChildChange::Type::NonContentsChildInserted:
+            case ChildChange::Type::AllChildrenReplaced:
                 return true;
-            case ElementRemoved:
-            case TextRemoved:
-            case TextChanged:
-            case AllChildrenRemoved:
-            case NonContentsChildRemoved:
+            case ChildChange::Type::ElementRemoved:
+            case ChildChange::Type::TextRemoved:
+            case ChildChange::Type::TextChanged:
+            case ChildChange::Type::AllChildrenRemoved:
+            case ChildChange::Type::NonContentsChildRemoved:
                 return false;
             }
             ASSERT_NOT_REACHED();
@@ -145,8 +146,8 @@
 private:
     void executePreparedChildrenRemoval();
     enum class DeferChildrenChanged { Yes, No };
-    NodeVector removeAllChildrenWithScriptAssertion(ChildChangeSource, DeferChildrenChanged = DeferChildrenChanged::No);
-    bool removeNodeWithScriptAssertion(Node&, ChildChangeSource);
+    NodeVector removeAllChildrenWithScriptAssertion(ChildChange::Source, DeferChildrenChanged = DeferChildrenChanged::No);
+    bool removeNodeWithScriptAssertion(Node&, ChildChange::Source);
 
     void removeBetween(Node* previousChild, Node* nextChild, Node& oldChild);
     ExceptionOr<void> appendChildWithoutPreInsertionValidityCheck(Node&);

Modified: trunk/Source/WebCore/dom/Element.cpp (269160 => 269161)


--- trunk/Source/WebCore/dom/Element.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/dom/Element.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -2621,30 +2621,30 @@
 void Element::childrenChanged(const ChildChange& change)
 {
     ContainerNode::childrenChanged(change);
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         checkForEmptyStyleChange(*this);
     else {
-        SiblingCheckType checkType = change.type == ElementRemoved ? SiblingElementRemoved : Other;
+        auto checkType = change.type == ChildChange::Type::ElementRemoved ? SiblingElementRemoved : Other;
         checkForSiblingStyleChanges(*this, checkType, change.previousSiblingElement, change.nextSiblingElement);
     }
 
     if (ShadowRoot* shadowRoot = this->shadowRoot()) {
         switch (change.type) {
-        case ElementInserted:
-        case ElementRemoved:
+        case ChildChange::Type::ElementInserted:
+        case ChildChange::Type::ElementRemoved:
             // For elements, we notify shadowRoot in Element::insertedIntoAncestor and Element::removedFromAncestor.
             break;
-        case AllChildrenRemoved:
-        case AllChildrenReplaced:
+        case ChildChange::Type::AllChildrenRemoved:
+        case ChildChange::Type::AllChildrenReplaced:
             shadowRoot->didRemoveAllChildrenOfShadowHost();
             break;
-        case TextInserted:
-        case TextRemoved:
-        case TextChanged:
+        case ChildChange::Type::TextInserted:
+        case ChildChange::Type::TextRemoved:
+        case ChildChange::Type::TextChanged:
             shadowRoot->didChangeDefaultSlot();
             break;
-        case NonContentsChildInserted:
-        case NonContentsChildRemoved:
+        case ChildChange::Type::NonContentsChildInserted:
+        case ChildChange::Type::NonContentsChildRemoved:
             break;
         }
     }

Modified: trunk/Source/WebCore/dom/ShadowRoot.cpp (269160 => 269161)


--- trunk/Source/WebCore/dom/ShadowRoot.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/dom/ShadowRoot.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -128,17 +128,17 @@
 
     // FIXME: Avoid always invalidating style just for first-child, etc... as done in Element::childrenChanged.
     switch (childChange.type) {
-    case ElementInserted:
-    case ElementRemoved:
+    case ChildChange::Type::ElementInserted:
+    case ChildChange::Type::ElementRemoved:
         m_host->invalidateStyleForSubtreeInternal();
         break;
-    case TextInserted:
-    case TextRemoved:
-    case TextChanged:
-    case AllChildrenRemoved:
-    case NonContentsChildRemoved:
-    case NonContentsChildInserted:
-    case AllChildrenReplaced:
+    case ChildChange::Type::TextInserted:
+    case ChildChange::Type::TextRemoved:
+    case ChildChange::Type::TextChanged:
+    case ChildChange::Type::AllChildrenRemoved:
+    case ChildChange::Type::NonContentsChildRemoved:
+    case ChildChange::Type::NonContentsChildInserted:
+    case ChildChange::Type::AllChildrenReplaced:
         break;
     }
 }

Modified: trunk/Source/WebCore/html/HTMLElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/html/HTMLElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/html/HTMLElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -946,7 +946,7 @@
         invalidateStyleForSubtree();
 }
 
-void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Element* beforeChange, ChildChangeType changeType)
+void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Element* beforeChange, ChildChange::Type changeType)
 {
     // FIXME: This function looks suspicious.
 
@@ -955,7 +955,7 @@
 
     RefPtr<Node> oldMarkedNode;
     if (beforeChange)
-        oldMarkedNode = changeType == ElementInserted ? ElementTraversal::nextSibling(*beforeChange) : beforeChange->nextSibling();
+        oldMarkedNode = changeType == ChildChange::Type::ElementInserted ? ElementTraversal::nextSibling(*beforeChange) : beforeChange->nextSibling();
 
     while (oldMarkedNode && elementAffectsDirectionality(*oldMarkedNode))
         oldMarkedNode = oldMarkedNode->nextSibling();

Modified: trunk/Source/WebCore/html/HTMLElement.h (269160 => 269161)


--- trunk/Source/WebCore/html/HTMLElement.h	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/html/HTMLElement.h	2020-10-29 19:24:41 UTC (rev 269161)
@@ -151,7 +151,7 @@
 
     void dirAttributeChanged(const AtomString&);
     void adjustDirectionalityIfNeededAfterChildAttributeChanged(Element* child);
-    void adjustDirectionalityIfNeededAfterChildrenChanged(Element* beforeChange, ChildChangeType);
+    void adjustDirectionalityIfNeededAfterChildrenChanged(Element* beforeChange, ChildChange::Type);
     TextDirection directionality(Node** strongDirectionalityTextNode= 0) const;
 
     static void populateEventHandlerNameMap(EventHandlerNameMap&, const QualifiedName* const table[], size_t tableSize);

Modified: trunk/Source/WebCore/html/HTMLOutputElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/html/HTMLOutputElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/html/HTMLOutputElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -79,7 +79,7 @@
 {
     HTMLFormControlElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser || m_isSetTextContentInProgress) {
+    if (change.source == ChildChange::Source::Parser || m_isSetTextContentInProgress) {
         m_isSetTextContentInProgress = false;
         return;
     }

Modified: trunk/Source/WebCore/svg/SVGClipPathElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/svg/SVGClipPathElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/svg/SVGClipPathElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -79,7 +79,7 @@
 {
     SVGGraphicsElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         return;
 
     if (RenderObject* object = renderer())

Modified: trunk/Source/WebCore/svg/SVGElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/svg/SVGElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/svg/SVGElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -874,7 +874,7 @@
 {
     StyledElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         return;
     invalidateInstances();
 }

Modified: trunk/Source/WebCore/svg/SVGFELightElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/svg/SVGFELightElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/svg/SVGFELightElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -151,7 +151,7 @@
 {
     SVGElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         return;
     auto parent = makeRefPtr(parentNode());
     if (!parent)

Modified: trunk/Source/WebCore/svg/SVGFilterElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/svg/SVGFilterElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/svg/SVGFilterElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -110,7 +110,7 @@
 {
     SVGElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         return;
 
     if (RenderObject* object = renderer())

Modified: trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp (269160 => 269161)


--- trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -88,7 +88,7 @@
 {
     SVGElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         return;
     invalidate();
 }

Modified: trunk/Source/WebCore/svg/SVGGradientElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/svg/SVGGradientElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/svg/SVGGradientElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -91,7 +91,7 @@
 {
     SVGElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         return;
 
     if (RenderObject* object = renderer())

Modified: trunk/Source/WebCore/svg/SVGMarkerElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/svg/SVGMarkerElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/svg/SVGMarkerElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -116,7 +116,7 @@
 {
     SVGElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         return;
 
     if (RenderObject* object = renderer())

Modified: trunk/Source/WebCore/svg/SVGMaskElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/svg/SVGMaskElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/svg/SVGMaskElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -116,7 +116,7 @@
 {
     SVGElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         return;
 
     if (RenderObject* object = renderer())

Modified: trunk/Source/WebCore/svg/SVGPatternElement.cpp (269160 => 269161)


--- trunk/Source/WebCore/svg/SVGPatternElement.cpp	2020-10-29 19:15:49 UTC (rev 269160)
+++ trunk/Source/WebCore/svg/SVGPatternElement.cpp	2020-10-29 19:24:41 UTC (rev 269161)
@@ -129,7 +129,7 @@
 {
     SVGElement::childrenChanged(change);
 
-    if (change.source == ChildChangeSource::Parser)
+    if (change.source == ChildChange::Source::Parser)
         return;
 
     if (RenderObject* object = renderer())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to