Changeset 185813 in webkit


Ignore:
Timestamp:
Jun 21, 2015, 2:14:51 PM (10 years ago)
Author:
aestes@apple.com
Message:

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:
Location:
trunk/Source/WebCore
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185805 r185813  
     12015-06-19  Andy Estes  <aestes@apple.com>
     2
     3        Give Node::didNotifySubtreeInsertions() a better name
     4        https://bugs.webkit.org/show_bug.cgi?id=146170
     5
     6        Reviewed by Darin Adler.
     7
     8        didNotifySubtreeInsertions() is not a good name. It sounds like we are notifying the subtree insertions, which doesn't make sense.
     9
     10        This function is really about notifying the Node that the subtree it's a part of has finished being inserted into the DOM
     11        (i.e. all nodes have received their call to insertedInto()). Change the name to finishedInsertingSubtree() to better reflect this.
     12
     13        * dom/ContainerNode.cpp:
     14        (WebCore::ContainerNode::notifyChildInserted):
     15        * dom/ContainerNodeAlgorithms.h:
     16        (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
     17        (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
     18        * dom/Element.cpp:
     19        (WebCore::Element::addShadowRoot):
     20        * dom/Node.h:
     21        (WebCore::Node::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     22        (WebCore::Node::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     23        * dom/ScriptElement.cpp:
     24        (WebCore::ScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     25        (WebCore::ScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     26        * dom/ScriptElement.h:
     27        * html/HTMLFrameElementBase.cpp:
     28        (WebCore::HTMLFrameElementBase::insertedInto):
     29        (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     30        (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     31        * html/HTMLFrameElementBase.h:
     32        * html/HTMLScriptElement.cpp:
     33        (WebCore::HTMLScriptElement::insertedInto):
     34        (WebCore::HTMLScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     35        (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     36        * html/HTMLScriptElement.h:
     37        * svg/SVGFEImageElement.cpp:
     38        (WebCore::SVGFEImageElement::insertedInto):
     39        (WebCore::SVGFEImageElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     40        (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     41        * svg/SVGFEImageElement.h:
     42        * svg/SVGMPathElement.cpp:
     43        (WebCore::SVGMPathElement::insertedInto):
     44        (WebCore::SVGMPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     45        (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     46        * svg/SVGMPathElement.h:
     47        * svg/SVGScriptElement.cpp:
     48        (WebCore::SVGScriptElement::insertedInto):
     49        (WebCore::SVGScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     50        (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     51        * svg/SVGScriptElement.h:
     52        * svg/SVGTRefElement.cpp:
     53        (WebCore::SVGTRefElement::insertedInto):
     54        (WebCore::SVGTRefElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     55        (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     56        * svg/SVGTRefElement.h:
     57        * svg/SVGTextPathElement.cpp:
     58        (WebCore::SVGTextPathElement::insertedInto):
     59        (WebCore::SVGTextPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     60        (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     61        * svg/SVGTextPathElement.h:
     62        * svg/animation/SVGSMILElement.cpp:
     63        (WebCore::SVGSMILElement::insertedInto):
     64        (WebCore::SVGSMILElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
     65        (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
     66        * svg/animation/SVGSMILElement.h:
     67
    1682015-06-21  Philip Chimento  <philip.chimento@gmail.com>
    269
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r185435 r185813  
    348348
    349349    for (auto& target : postInsertionNotificationTargets)
    350         target->didNotifySubtreeInsertions();
     350        target->finishedInsertingSubtree();
    351351}
    352352
  • trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h

    r185435 r185813  
    196196{
    197197    ASSERT(m_insertionPoint.inDocument());
    198     if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node.insertedInto(m_insertionPoint))
     198    if (Node::InsertionShouldCallFinishedInsertingSubtree == node.insertedInto(m_insertionPoint))
    199199        postInsertionNotificationTargets.append(node);
    200200    if (is<ContainerNode>(node))
     
    207207    ASSERT(!m_insertionPoint.inDocument());
    208208
    209     if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node.insertedInto(m_insertionPoint))
     209    if (Node::InsertionShouldCallFinishedInsertingSubtree == node.insertedInto(m_insertionPoint))
    210210        postInsertionNotificationTargets.append(node);
    211211    notifyDescendantInsertedIntoTree(node, postInsertionNotificationTargets);
  • trunk/Source/WebCore/dom/Element.cpp

    r185435 r185813  
    16371637
    16381638    for (auto& target : postInsertionNotificationTargets)
    1639         target->didNotifySubtreeInsertions();
     1639        target->finishedInsertingSubtree();
    16401640
    16411641    resetNeedsNodeRenderingTraversalSlowPath();
  • trunk/Source/WebCore/dom/Node.h

    r185423 r185813  
    469469    // For a performance reason, notifications are delivered only to ContainerNode subclasses if the insertionPoint is out of document.
    470470    //
    471     // There are another callback named didNotifyDescendantInsertions(), which is called after all the descendant is notified.
    472     // Only a few subclasses actually need this. To utilize this, the node should return InsertionShouldCallDidNotifyDescendantInsertions
     471    // There is another callback named finishedInsertingSubtree(), which is called after all descendants are notified.
     472    // Only a few subclasses actually need this. To utilize this, the node should return InsertionShouldCallFinishedInsertingSubtree
    473473    // from insrtedInto().
    474474    //
    475475    enum InsertionNotificationRequest {
    476476        InsertionDone,
    477         InsertionShouldCallDidNotifySubtreeInsertions
     477        InsertionShouldCallFinishedInsertingSubtree
    478478    };
    479479
    480480    virtual InsertionNotificationRequest insertedInto(ContainerNode& insertionPoint);
    481     virtual void didNotifySubtreeInsertions() { }
     481    virtual void finishedInsertingSubtree() { }
    482482
    483483    // Notifies the node that it is no longer part of the tree.
  • trunk/Source/WebCore/dom/ScriptElement.cpp

    r185769 r185813  
    8080}
    8181
    82 bool ScriptElement::shouldNotifySubtreeInsertions(ContainerNode& insertionPoint)
     82bool ScriptElement::shouldCallFinishedInsertingSubtree(ContainerNode& insertionPoint)
    8383{
    8484    return insertionPoint.inDocument() && !m_parserInserted;
    8585}
    8686
    87 void ScriptElement::didNotifySubtreeInsertions()
     87void ScriptElement::finishedInsertingSubtree()
    8888{
    8989    ASSERT(!m_parserInserted);
  • trunk/Source/WebCore/dom/ScriptElement.h

    r185769 r185813  
    7070
    7171    // Helper functions used by our parent classes.
    72     bool shouldNotifySubtreeInsertions(ContainerNode&);
    73     void didNotifySubtreeInsertions();
     72    bool shouldCallFinishedInsertingSubtree(ContainerNode&);
     73    void finishedInsertingSubtree();
    7474    void childrenChanged();
    7575    void handleSourceAttribute(const String& sourceUrl);
  • trunk/Source/WebCore/html/HTMLFrameElementBase.cpp

    r185423 r185813  
    134134    HTMLFrameOwnerElement::insertedInto(insertionPoint);
    135135    if (insertionPoint.inDocument())
    136         return InsertionShouldCallDidNotifySubtreeInsertions;
     136        return InsertionShouldCallFinishedInsertingSubtree;
    137137    return InsertionDone;
    138138}
    139139
    140 void HTMLFrameElementBase::didNotifySubtreeInsertions()
     140void HTMLFrameElementBase::finishedInsertingSubtree()
    141141{
    142142    if (!inDocument())
  • trunk/Source/WebCore/html/HTMLFrameElementBase.h

    r185423 r185813  
    5353    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
    5454    virtual InsertionNotificationRequest insertedInto(ContainerNode&) override final;
    55     virtual void didNotifySubtreeInsertions() override final;
     55    virtual void finishedInsertingSubtree() override final;
    5656    virtual void didAttachRenderers() override;
    5757
  • trunk/Source/WebCore/html/HTMLScriptElement.cpp

    r185769 r185813  
    7171{
    7272    HTMLElement::insertedInto(insertionPoint);
    73     return shouldNotifySubtreeInsertions(insertionPoint) ? InsertionShouldCallDidNotifySubtreeInsertions : InsertionDone;
     73    return shouldCallFinishedInsertingSubtree(insertionPoint) ? InsertionShouldCallFinishedInsertingSubtree : InsertionDone;
    7474}
    7575
    76 void HTMLScriptElement::didNotifySubtreeInsertions()
     76void HTMLScriptElement::finishedInsertingSubtree()
    7777{
    78     ScriptElement::didNotifySubtreeInsertions();
     78    ScriptElement::finishedInsertingSubtree();
    7979}
    8080
  • trunk/Source/WebCore/html/HTMLScriptElement.h

    r185769 r185813  
    4747    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
    4848    virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
    49     virtual void didNotifySubtreeInsertions() override;
     49    virtual void finishedInsertingSubtree() override;
    5050    virtual void childrenChanged(const ChildChange&) override;
    5151
  • trunk/Source/WebCore/svg/SVGFEImageElement.cpp

    r185423 r185813  
    144144{
    145145    SVGFilterPrimitiveStandardAttributes::insertedInto(rootParent);
    146     return InsertionShouldCallDidNotifySubtreeInsertions;
     146    return InsertionShouldCallFinishedInsertingSubtree;
    147147}
    148148
    149 void SVGFEImageElement::didNotifySubtreeInsertions()
     149void SVGFEImageElement::finishedInsertingSubtree()
    150150{
    151151    buildPendingResource();
  • trunk/Source/WebCore/svg/SVGFEImageElement.h

    r185503 r185813  
    4646    SVGFEImageElement(const QualifiedName&, Document&);
    4747
    48     virtual void didNotifySubtreeInsertions() override;
     48    virtual void finishedInsertingSubtree() override;
    4949
    5050    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
  • trunk/Source/WebCore/svg/SVGMPathElement.cpp

    r185423 r185813  
    9191    SVGElement::insertedInto(rootParent);
    9292    if (rootParent.inDocument())
    93         return InsertionShouldCallDidNotifySubtreeInsertions;
     93        return InsertionShouldCallFinishedInsertingSubtree;
    9494    return InsertionDone;
    9595}
    9696
    97 void SVGMPathElement::didNotifySubtreeInsertions()
     97void SVGMPathElement::finishedInsertingSubtree()
    9898{
    9999    buildPendingResource();
  • trunk/Source/WebCore/svg/SVGMPathElement.h

    r185503 r185813  
    5454
    5555    virtual bool rendererIsNeeded(const RenderStyle&) override { return false; }
    56     virtual void didNotifySubtreeInsertions() override;
     56    virtual void finishedInsertingSubtree() override;
    5757
    5858    void notifyParentOfPathChange(ContainerNode*);
  • trunk/Source/WebCore/svg/SVGScriptElement.cpp

    r185769 r185813  
    8080    if (rootParent.inDocument())
    8181        SVGExternalResourcesRequired::insertedIntoDocument(this);
    82     return shouldNotifySubtreeInsertions(rootParent) ? InsertionShouldCallDidNotifySubtreeInsertions : InsertionDone;
     82    return shouldCallFinishedInsertingSubtree(rootParent) ? InsertionShouldCallFinishedInsertingSubtree : InsertionDone;
    8383}
    8484
    85 void SVGScriptElement::didNotifySubtreeInsertions()
     85void SVGScriptElement::finishedInsertingSubtree()
    8686{
    87     ScriptElement::didNotifySubtreeInsertions();
     87    ScriptElement::finishedInsertingSubtree();
    8888}
    8989
  • trunk/Source/WebCore/svg/SVGScriptElement.h

    r185769 r185813  
    4343    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
    4444    virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
    45     virtual void didNotifySubtreeInsertions() override;
     45    virtual void finishedInsertingSubtree() override;
    4646    virtual void childrenChanged(const ChildChange&) override;
    4747
  • trunk/Source/WebCore/svg/SVGTRefElement.cpp

    r185423 r185813  
    259259    SVGElement::insertedInto(rootParent);
    260260    if (rootParent.inDocument())
    261         return InsertionShouldCallDidNotifySubtreeInsertions;
     261        return InsertionShouldCallFinishedInsertingSubtree;
    262262    return InsertionDone;
    263263}
    264264
    265 void SVGTRefElement::didNotifySubtreeInsertions()
     265void SVGTRefElement::finishedInsertingSubtree()
    266266{
    267267    buildPendingResource();
  • trunk/Source/WebCore/svg/SVGTRefElement.h

    r185503 r185813  
    4848    virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
    4949    virtual void removedFrom(ContainerNode&) override;
    50     virtual void didNotifySubtreeInsertions() override;
     50    virtual void finishedInsertingSubtree() override;
    5151
    5252    virtual void clearTarget() override;
  • trunk/Source/WebCore/svg/SVGTextPathElement.cpp

    r185423 r185813  
    177177{
    178178    SVGTextContentElement::insertedInto(rootParent);
    179     return InsertionShouldCallDidNotifySubtreeInsertions;
    180 }
    181 
    182 void SVGTextPathElement::didNotifySubtreeInsertions()
     179    return InsertionShouldCallFinishedInsertingSubtree;
     180}
     181
     182void SVGTextPathElement::finishedInsertingSubtree()
    183183{
    184184    buildPendingResource();
  • trunk/Source/WebCore/svg/SVGTextPathElement.h

    r185503 r185813  
    113113
    114114protected:
    115     virtual void didNotifySubtreeInsertions() override;
     115    virtual void finishedInsertingSubtree() override;
    116116
    117117private:
  • trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp

    r185423 r185813  
    261261        m_timeContainer->notifyIntervalsChanged();
    262262
    263     return InsertionShouldCallDidNotifySubtreeInsertions;
    264 }
    265 
    266 void SVGSMILElement::didNotifySubtreeInsertions()
     263    return InsertionShouldCallFinishedInsertingSubtree;
     264}
     265
     266void SVGSMILElement::finishedInsertingSubtree()
    267267{
    268268    buildPendingResource();
  • trunk/Source/WebCore/svg/animation/SVGSMILElement.h

    r185423 r185813  
    120120    virtual void setAttributeName(const QualifiedName&);
    121121
    122     virtual void didNotifySubtreeInsertions() override;
     122    virtual void finishedInsertingSubtree() override;
    123123
    124124private:
Note: See TracChangeset for help on using the changeset viewer.