Give Node::didNotifySubtreeInsertions() a better name
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jun 2015 21:14:51 +0000 (21:14 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jun 2015 21:14:51 +0000 (21:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146170

Reviewed by Darin Adler.

didNotifySubtreeInsertions() is not a good name. It sounds like we are notifying the subtree insertions, which doesn't make sense.

This function is really about notifying the Node that the subtree it's a part of has finished being inserted into the DOM
(i.e. all nodes have received their call to insertedInto()). Change the name to finishedInsertingSubtree() to better reflect this.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::notifyChildInserted):
* dom/ContainerNodeAlgorithms.h:
(WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
(WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
* dom/Element.cpp:
(WebCore::Element::addShadowRoot):
* dom/Node.h:
(WebCore::Node::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::Node::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::ScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* dom/ScriptElement.h:
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::insertedInto):
(WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* html/HTMLFrameElementBase.h:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::insertedInto):
(WebCore::HTMLScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* html/HTMLScriptElement.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::insertedInto):
(WebCore::SVGFEImageElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* svg/SVGFEImageElement.h:
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::insertedInto):
(WebCore::SVGMPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::SVGMPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* svg/SVGMPathElement.h:
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::insertedInto):
(WebCore::SVGScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::SVGScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* svg/SVGScriptElement.h:
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::insertedInto):
(WebCore::SVGTRefElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::SVGTRefElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* svg/SVGTRefElement.h:
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::insertedInto):
(WebCore::SVGTextPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* svg/SVGTextPathElement.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::insertedInto):
(WebCore::SVGSMILElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
(WebCore::SVGSMILElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
* svg/animation/SVGSMILElement.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@185813 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNodeAlgorithms.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/ScriptElement.cpp
Source/WebCore/dom/ScriptElement.h
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/html/HTMLFrameElementBase.h
Source/WebCore/html/HTMLScriptElement.cpp
Source/WebCore/html/HTMLScriptElement.h
Source/WebCore/svg/SVGFEImageElement.cpp
Source/WebCore/svg/SVGFEImageElement.h
Source/WebCore/svg/SVGMPathElement.cpp
Source/WebCore/svg/SVGMPathElement.h
Source/WebCore/svg/SVGScriptElement.cpp
Source/WebCore/svg/SVGScriptElement.h
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGTRefElement.h
Source/WebCore/svg/SVGTextPathElement.cpp
Source/WebCore/svg/SVGTextPathElement.h
Source/WebCore/svg/animation/SVGSMILElement.cpp
Source/WebCore/svg/animation/SVGSMILElement.h

index 964b793..b7dc918 100644 (file)
@@ -1,3 +1,70 @@
+2015-06-19  Andy Estes  <aestes@apple.com>
+
+        Give Node::didNotifySubtreeInsertions() a better name
+        https://bugs.webkit.org/show_bug.cgi?id=146170
+
+        Reviewed by Darin Adler.
+
+        didNotifySubtreeInsertions() is not a good name. It sounds like we are notifying the subtree insertions, which doesn't make sense.
+
+        This function is really about notifying the Node that the subtree it's a part of has finished being inserted into the DOM
+        (i.e. all nodes have received their call to insertedInto()). Change the name to finishedInsertingSubtree() to better reflect this.
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::notifyChildInserted):
+        * dom/ContainerNodeAlgorithms.h:
+        (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
+        (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
+        * dom/Element.cpp:
+        (WebCore::Element::addShadowRoot):
+        * dom/Node.h:
+        (WebCore::Node::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::Node::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::ScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * dom/ScriptElement.h:
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore::HTMLFrameElementBase::insertedInto):
+        (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * html/HTMLFrameElementBase.h:
+        * html/HTMLScriptElement.cpp:
+        (WebCore::HTMLScriptElement::insertedInto):
+        (WebCore::HTMLScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * html/HTMLScriptElement.h:
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::insertedInto):
+        (WebCore::SVGFEImageElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * svg/SVGFEImageElement.h:
+        * svg/SVGMPathElement.cpp:
+        (WebCore::SVGMPathElement::insertedInto):
+        (WebCore::SVGMPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * svg/SVGMPathElement.h:
+        * svg/SVGScriptElement.cpp:
+        (WebCore::SVGScriptElement::insertedInto):
+        (WebCore::SVGScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * svg/SVGScriptElement.h:
+        * svg/SVGTRefElement.cpp:
+        (WebCore::SVGTRefElement::insertedInto):
+        (WebCore::SVGTRefElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * svg/SVGTRefElement.h:
+        * svg/SVGTextPathElement.cpp:
+        (WebCore::SVGTextPathElement::insertedInto):
+        (WebCore::SVGTextPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * svg/SVGTextPathElement.h:
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::insertedInto):
+        (WebCore::SVGSMILElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
+        (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
+        * svg/animation/SVGSMILElement.h:
+
 2015-06-21  Philip Chimento  <philip.chimento@gmail.com>
 
         libwebkit2gtk fails to link without opengl
index 1d6cba7..e75858e 100644 (file)
@@ -347,7 +347,7 @@ void ContainerNode::notifyChildInserted(Node& child, ChildChangeSource source)
     childrenChanged(change);
 
     for (auto& target : postInsertionNotificationTargets)
-        target->didNotifySubtreeInsertions();
+        target->finishedInsertingSubtree();
 }
 
 void ContainerNode::notifyChildRemoved(Node& child, Node* previousSibling, Node* nextSibling, ChildChangeSource source)
index 0a97532..58c608e 100644 (file)
@@ -195,7 +195,7 @@ namespace Private {
 inline void ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument(Node& node, NodeVector& postInsertionNotificationTargets)
 {
     ASSERT(m_insertionPoint.inDocument());
-    if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node.insertedInto(m_insertionPoint))
+    if (Node::InsertionShouldCallFinishedInsertingSubtree == node.insertedInto(m_insertionPoint))
         postInsertionNotificationTargets.append(node);
     if (is<ContainerNode>(node))
         notifyDescendantInsertedIntoDocument(downcast<ContainerNode>(node), postInsertionNotificationTargets);
@@ -206,7 +206,7 @@ inline void ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree(ContainerNode
     NoEventDispatchAssertion assertNoEventDispatch;
     ASSERT(!m_insertionPoint.inDocument());
 
-    if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node.insertedInto(m_insertionPoint))
+    if (Node::InsertionShouldCallFinishedInsertingSubtree == node.insertedInto(m_insertionPoint))
         postInsertionNotificationTargets.append(node);
     notifyDescendantInsertedIntoTree(node, postInsertionNotificationTargets);
 }
index ac2b572..ccc639a 100644 (file)
@@ -1636,7 +1636,7 @@ void Element::addShadowRoot(Ref<ShadowRoot>&& newShadowRoot)
     ChildNodeInsertionNotifier(*this).notify(shadowRoot, postInsertionNotificationTargets);
 
     for (auto& target : postInsertionNotificationTargets)
-        target->didNotifySubtreeInsertions();
+        target->finishedInsertingSubtree();
 
     resetNeedsNodeRenderingTraversalSlowPath();
 
index b188937..f7688ea 100644 (file)
@@ -468,17 +468,17 @@ public:
     // Implementation can determine the type of subtree by seeing insertionPoint->inDocument().
     // For a performance reason, notifications are delivered only to ContainerNode subclasses if the insertionPoint is out of document.
     //
-    // There are another callback named didNotifyDescendantInsertions(), which is called after all the descendant is notified.
-    // Only a few subclasses actually need this. To utilize this, the node should return InsertionShouldCallDidNotifyDescendantInsertions
+    // There is another callback named finishedInsertingSubtree(), which is called after all descendants are notified.
+    // Only a few subclasses actually need this. To utilize this, the node should return InsertionShouldCallFinishedInsertingSubtree
     // from insrtedInto().
     //
     enum InsertionNotificationRequest {
         InsertionDone,
-        InsertionShouldCallDidNotifySubtreeInsertions
+        InsertionShouldCallFinishedInsertingSubtree
     };
 
     virtual InsertionNotificationRequest insertedInto(ContainerNode& insertionPoint);
-    virtual void didNotifySubtreeInsertions() { }
+    virtual void finishedInsertingSubtree() { }
 
     // Notifies the node that it is no longer part of the tree.
     //
index bb9ff9e..cb2690c 100644 (file)
@@ -79,12 +79,12 @@ ScriptElement::~ScriptElement()
     stopLoadRequest();
 }
 
-bool ScriptElement::shouldNotifySubtreeInsertions(ContainerNode& insertionPoint)
+bool ScriptElement::shouldCallFinishedInsertingSubtree(ContainerNode& insertionPoint)
 {
     return insertionPoint.inDocument() && !m_parserInserted;
 }
 
-void ScriptElement::didNotifySubtreeInsertions()
+void ScriptElement::finishedInsertingSubtree()
 {
     ASSERT(!m_parserInserted);
     prepareScript(); // FIXME: Provide a real starting line number here.
index bdbe667..b7e73d0 100644 (file)
@@ -69,8 +69,8 @@ protected:
     bool forceAsync() const { return m_forceAsync; }
 
     // Helper functions used by our parent classes.
-    bool shouldNotifySubtreeInsertions(ContainerNode&);
-    void didNotifySubtreeInsertions();
+    bool shouldCallFinishedInsertingSubtree(ContainerNode&);
+    void finishedInsertingSubtree();
     void childrenChanged();
     void handleSourceAttribute(const String& sourceUrl);
     void handleAsyncAttribute();
index 60ae5cb..7361c5b 100644 (file)
@@ -133,11 +133,11 @@ Node::InsertionNotificationRequest HTMLFrameElementBase::insertedInto(ContainerN
 {
     HTMLFrameOwnerElement::insertedInto(insertionPoint);
     if (insertionPoint.inDocument())
-        return InsertionShouldCallDidNotifySubtreeInsertions;
+        return InsertionShouldCallFinishedInsertingSubtree;
     return InsertionDone;
 }
 
-void HTMLFrameElementBase::didNotifySubtreeInsertions()
+void HTMLFrameElementBase::finishedInsertingSubtree()
 {
     if (!inDocument())
         return;
index fc7d616..013cba0 100644 (file)
@@ -52,7 +52,7 @@ protected:
 
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
     virtual InsertionNotificationRequest insertedInto(ContainerNode&) override final;
-    virtual void didNotifySubtreeInsertions() override final;
+    virtual void finishedInsertingSubtree() override final;
     virtual void didAttachRenderers() override;
 
 private:
index 402477c..6951146 100644 (file)
@@ -70,12 +70,12 @@ void HTMLScriptElement::parseAttribute(const QualifiedName& name, const AtomicSt
 Node::InsertionNotificationRequest HTMLScriptElement::insertedInto(ContainerNode& insertionPoint)
 {
     HTMLElement::insertedInto(insertionPoint);
-    return shouldNotifySubtreeInsertions(insertionPoint) ? InsertionShouldCallDidNotifySubtreeInsertions : InsertionDone;
+    return shouldCallFinishedInsertingSubtree(insertionPoint) ? InsertionShouldCallFinishedInsertingSubtree : InsertionDone;
 }
 
-void HTMLScriptElement::didNotifySubtreeInsertions()
+void HTMLScriptElement::finishedInsertingSubtree()
 {
-    ScriptElement::didNotifySubtreeInsertions();
+    ScriptElement::finishedInsertingSubtree();
 }
 
 void HTMLScriptElement::setText(const String &value)
index 9c1e84c..e39c10c 100644 (file)
@@ -46,7 +46,7 @@ private:
 
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
     virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
-    virtual void didNotifySubtreeInsertions() override;
+    virtual void finishedInsertingSubtree() override;
     virtual void childrenChanged(const ChildChange&) override;
 
     virtual bool isURLAttribute(const Attribute&) const override;
index 6904a77..86d6fba 100644 (file)
@@ -143,10 +143,10 @@ void SVGFEImageElement::svgAttributeChanged(const QualifiedName& attrName)
 Node::InsertionNotificationRequest SVGFEImageElement::insertedInto(ContainerNode& rootParent)
 {
     SVGFilterPrimitiveStandardAttributes::insertedInto(rootParent);
-    return InsertionShouldCallDidNotifySubtreeInsertions;
+    return InsertionShouldCallFinishedInsertingSubtree;
 }
 
-void SVGFEImageElement::didNotifySubtreeInsertions()
+void SVGFEImageElement::finishedInsertingSubtree()
 {
     buildPendingResource();
 }
index e796521..0671b44 100644 (file)
@@ -45,7 +45,7 @@ public:
 private:
     SVGFEImageElement(const QualifiedName&, Document&);
 
-    virtual void didNotifySubtreeInsertions() override;
+    virtual void finishedInsertingSubtree() override;
 
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
     virtual void svgAttributeChanged(const QualifiedName&) override;
index c577b3a..55c0e68 100644 (file)
@@ -90,11 +90,11 @@ Node::InsertionNotificationRequest SVGMPathElement::insertedInto(ContainerNode&
 {
     SVGElement::insertedInto(rootParent);
     if (rootParent.inDocument())
-        return InsertionShouldCallDidNotifySubtreeInsertions;
+        return InsertionShouldCallFinishedInsertingSubtree;
     return InsertionDone;
 }
 
-void SVGMPathElement::didNotifySubtreeInsertions()
+void SVGMPathElement::finishedInsertingSubtree()
 {
     buildPendingResource();
 }
index 9dccee6..cef597f 100644 (file)
@@ -53,7 +53,7 @@ private:
     virtual void svgAttributeChanged(const QualifiedName&) override;
 
     virtual bool rendererIsNeeded(const RenderStyle&) override { return false; }
-    virtual void didNotifySubtreeInsertions() override;
+    virtual void finishedInsertingSubtree() override;
 
     void notifyParentOfPathChange(ContainerNode*);
 
index 55797b0..6f3ca83 100644 (file)
@@ -79,12 +79,12 @@ Node::InsertionNotificationRequest SVGScriptElement::insertedInto(ContainerNode&
     SVGElement::insertedInto(rootParent);
     if (rootParent.inDocument())
         SVGExternalResourcesRequired::insertedIntoDocument(this);
-    return shouldNotifySubtreeInsertions(rootParent) ? InsertionShouldCallDidNotifySubtreeInsertions : InsertionDone;
+    return shouldCallFinishedInsertingSubtree(rootParent) ? InsertionShouldCallFinishedInsertingSubtree : InsertionDone;
 }
 
-void SVGScriptElement::didNotifySubtreeInsertions()
+void SVGScriptElement::finishedInsertingSubtree()
 {
-    ScriptElement::didNotifySubtreeInsertions();
+    ScriptElement::finishedInsertingSubtree();
 }
 
 void SVGScriptElement::childrenChanged(const ChildChange& change)
index aa88187..4c1aa08 100644 (file)
@@ -42,7 +42,7 @@ private:
 
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
     virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
-    virtual void didNotifySubtreeInsertions() override;
+    virtual void finishedInsertingSubtree() override;
     virtual void childrenChanged(const ChildChange&) override;
 
     virtual void svgAttributeChanged(const QualifiedName&) override;
index 85c854d..225a304 100644 (file)
@@ -258,11 +258,11 @@ Node::InsertionNotificationRequest SVGTRefElement::insertedInto(ContainerNode& r
 {
     SVGElement::insertedInto(rootParent);
     if (rootParent.inDocument())
-        return InsertionShouldCallDidNotifySubtreeInsertions;
+        return InsertionShouldCallFinishedInsertingSubtree;
     return InsertionDone;
 }
 
-void SVGTRefElement::didNotifySubtreeInsertions()
+void SVGTRefElement::finishedInsertingSubtree()
 {
     buildPendingResource();
 }
index 71d8f73..b703bf7 100644 (file)
@@ -47,7 +47,7 @@ private:
 
     virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
     virtual void removedFrom(ContainerNode&) override;
-    virtual void didNotifySubtreeInsertions() override;
+    virtual void finishedInsertingSubtree() override;
 
     virtual void clearTarget() override;
 
index 68abbed..52ae14f 100644 (file)
@@ -176,10 +176,10 @@ void SVGTextPathElement::buildPendingResource()
 Node::InsertionNotificationRequest SVGTextPathElement::insertedInto(ContainerNode& rootParent)
 {
     SVGTextContentElement::insertedInto(rootParent);
-    return InsertionShouldCallDidNotifySubtreeInsertions;
+    return InsertionShouldCallFinishedInsertingSubtree;
 }
 
-void SVGTextPathElement::didNotifySubtreeInsertions()
+void SVGTextPathElement::finishedInsertingSubtree()
 {
     buildPendingResource();
 }
index 8b96fe9..7e34a5d 100644 (file)
@@ -112,7 +112,7 @@ public:
     static Ref<SVGTextPathElement> create(const QualifiedName&, Document&);
 
 protected:
-    virtual void didNotifySubtreeInsertions() override;
+    virtual void finishedInsertingSubtree() override;
 
 private:
     SVGTextPathElement(const QualifiedName&, Document&);
index 7be918a..9ce0a3d 100644 (file)
@@ -260,10 +260,10 @@ Node::InsertionNotificationRequest SVGSMILElement::insertedInto(ContainerNode& r
     if (m_timeContainer)
         m_timeContainer->notifyIntervalsChanged();
 
-    return InsertionShouldCallDidNotifySubtreeInsertions;
+    return InsertionShouldCallFinishedInsertingSubtree;
 }
 
-void SVGSMILElement::didNotifySubtreeInsertions()
+void SVGSMILElement::finishedInsertingSubtree()
 {
     buildPendingResource();
 }
index 929a54e..75d260a 100644 (file)
@@ -119,7 +119,7 @@ protected:
     virtual void setTargetElement(SVGElement*);
     virtual void setAttributeName(const QualifiedName&);
 
-    virtual void didNotifySubtreeInsertions() override;
+    virtual void finishedInsertingSubtree() override;
 
 private:
     void buildPendingResource() override;