Changeset 185813 in webkit
- Timestamp:
- Jun 21, 2015, 2:14:51 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r185805 r185813 1 2015-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 1 68 2015-06-21 Philip Chimento <philip.chimento@gmail.com> 2 69 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r185435 r185813 348 348 349 349 for (auto& target : postInsertionNotificationTargets) 350 target-> didNotifySubtreeInsertions();350 target->finishedInsertingSubtree(); 351 351 } 352 352 -
trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h
r185435 r185813 196 196 { 197 197 ASSERT(m_insertionPoint.inDocument()); 198 if (Node::InsertionShouldCall DidNotifySubtreeInsertions== node.insertedInto(m_insertionPoint))198 if (Node::InsertionShouldCallFinishedInsertingSubtree == node.insertedInto(m_insertionPoint)) 199 199 postInsertionNotificationTargets.append(node); 200 200 if (is<ContainerNode>(node)) … … 207 207 ASSERT(!m_insertionPoint.inDocument()); 208 208 209 if (Node::InsertionShouldCall DidNotifySubtreeInsertions== node.insertedInto(m_insertionPoint))209 if (Node::InsertionShouldCallFinishedInsertingSubtree == node.insertedInto(m_insertionPoint)) 210 210 postInsertionNotificationTargets.append(node); 211 211 notifyDescendantInsertedIntoTree(node, postInsertionNotificationTargets); -
trunk/Source/WebCore/dom/Element.cpp
r185435 r185813 1637 1637 1638 1638 for (auto& target : postInsertionNotificationTargets) 1639 target-> didNotifySubtreeInsertions();1639 target->finishedInsertingSubtree(); 1640 1640 1641 1641 resetNeedsNodeRenderingTraversalSlowPath(); -
trunk/Source/WebCore/dom/Node.h
r185423 r185813 469 469 // For a performance reason, notifications are delivered only to ContainerNode subclasses if the insertionPoint is out of document. 470 470 // 471 // There are another callback named didNotifyDescendantInsertions(), which is called after all the descendant isnotified.472 // Only a few subclasses actually need this. To utilize this, the node should return InsertionShouldCall DidNotifyDescendantInsertions471 // 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 473 473 // from insrtedInto(). 474 474 // 475 475 enum InsertionNotificationRequest { 476 476 InsertionDone, 477 InsertionShouldCall DidNotifySubtreeInsertions477 InsertionShouldCallFinishedInsertingSubtree 478 478 }; 479 479 480 480 virtual InsertionNotificationRequest insertedInto(ContainerNode& insertionPoint); 481 virtual void didNotifySubtreeInsertions() { }481 virtual void finishedInsertingSubtree() { } 482 482 483 483 // Notifies the node that it is no longer part of the tree. -
trunk/Source/WebCore/dom/ScriptElement.cpp
r185769 r185813 80 80 } 81 81 82 bool ScriptElement::should NotifySubtreeInsertions(ContainerNode& insertionPoint)82 bool ScriptElement::shouldCallFinishedInsertingSubtree(ContainerNode& insertionPoint) 83 83 { 84 84 return insertionPoint.inDocument() && !m_parserInserted; 85 85 } 86 86 87 void ScriptElement:: didNotifySubtreeInsertions()87 void ScriptElement::finishedInsertingSubtree() 88 88 { 89 89 ASSERT(!m_parserInserted); -
trunk/Source/WebCore/dom/ScriptElement.h
r185769 r185813 70 70 71 71 // Helper functions used by our parent classes. 72 bool should NotifySubtreeInsertions(ContainerNode&);73 void didNotifySubtreeInsertions();72 bool shouldCallFinishedInsertingSubtree(ContainerNode&); 73 void finishedInsertingSubtree(); 74 74 void childrenChanged(); 75 75 void handleSourceAttribute(const String& sourceUrl); -
trunk/Source/WebCore/html/HTMLFrameElementBase.cpp
r185423 r185813 134 134 HTMLFrameOwnerElement::insertedInto(insertionPoint); 135 135 if (insertionPoint.inDocument()) 136 return InsertionShouldCall DidNotifySubtreeInsertions;136 return InsertionShouldCallFinishedInsertingSubtree; 137 137 return InsertionDone; 138 138 } 139 139 140 void HTMLFrameElementBase:: didNotifySubtreeInsertions()140 void HTMLFrameElementBase::finishedInsertingSubtree() 141 141 { 142 142 if (!inDocument()) -
trunk/Source/WebCore/html/HTMLFrameElementBase.h
r185423 r185813 53 53 virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; 54 54 virtual InsertionNotificationRequest insertedInto(ContainerNode&) override final; 55 virtual void didNotifySubtreeInsertions() override final;55 virtual void finishedInsertingSubtree() override final; 56 56 virtual void didAttachRenderers() override; 57 57 -
trunk/Source/WebCore/html/HTMLScriptElement.cpp
r185769 r185813 71 71 { 72 72 HTMLElement::insertedInto(insertionPoint); 73 return should NotifySubtreeInsertions(insertionPoint) ? InsertionShouldCallDidNotifySubtreeInsertions: InsertionDone;73 return shouldCallFinishedInsertingSubtree(insertionPoint) ? InsertionShouldCallFinishedInsertingSubtree : InsertionDone; 74 74 } 75 75 76 void HTMLScriptElement:: didNotifySubtreeInsertions()76 void HTMLScriptElement::finishedInsertingSubtree() 77 77 { 78 ScriptElement:: didNotifySubtreeInsertions();78 ScriptElement::finishedInsertingSubtree(); 79 79 } 80 80 -
trunk/Source/WebCore/html/HTMLScriptElement.h
r185769 r185813 47 47 virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; 48 48 virtual InsertionNotificationRequest insertedInto(ContainerNode&) override; 49 virtual void didNotifySubtreeInsertions() override;49 virtual void finishedInsertingSubtree() override; 50 50 virtual void childrenChanged(const ChildChange&) override; 51 51 -
trunk/Source/WebCore/svg/SVGFEImageElement.cpp
r185423 r185813 144 144 { 145 145 SVGFilterPrimitiveStandardAttributes::insertedInto(rootParent); 146 return InsertionShouldCall DidNotifySubtreeInsertions;146 return InsertionShouldCallFinishedInsertingSubtree; 147 147 } 148 148 149 void SVGFEImageElement:: didNotifySubtreeInsertions()149 void SVGFEImageElement::finishedInsertingSubtree() 150 150 { 151 151 buildPendingResource(); -
trunk/Source/WebCore/svg/SVGFEImageElement.h
r185503 r185813 46 46 SVGFEImageElement(const QualifiedName&, Document&); 47 47 48 virtual void didNotifySubtreeInsertions() override;48 virtual void finishedInsertingSubtree() override; 49 49 50 50 virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; -
trunk/Source/WebCore/svg/SVGMPathElement.cpp
r185423 r185813 91 91 SVGElement::insertedInto(rootParent); 92 92 if (rootParent.inDocument()) 93 return InsertionShouldCall DidNotifySubtreeInsertions;93 return InsertionShouldCallFinishedInsertingSubtree; 94 94 return InsertionDone; 95 95 } 96 96 97 void SVGMPathElement:: didNotifySubtreeInsertions()97 void SVGMPathElement::finishedInsertingSubtree() 98 98 { 99 99 buildPendingResource(); -
trunk/Source/WebCore/svg/SVGMPathElement.h
r185503 r185813 54 54 55 55 virtual bool rendererIsNeeded(const RenderStyle&) override { return false; } 56 virtual void didNotifySubtreeInsertions() override;56 virtual void finishedInsertingSubtree() override; 57 57 58 58 void notifyParentOfPathChange(ContainerNode*); -
trunk/Source/WebCore/svg/SVGScriptElement.cpp
r185769 r185813 80 80 if (rootParent.inDocument()) 81 81 SVGExternalResourcesRequired::insertedIntoDocument(this); 82 return should NotifySubtreeInsertions(rootParent) ? InsertionShouldCallDidNotifySubtreeInsertions: InsertionDone;82 return shouldCallFinishedInsertingSubtree(rootParent) ? InsertionShouldCallFinishedInsertingSubtree : InsertionDone; 83 83 } 84 84 85 void SVGScriptElement:: didNotifySubtreeInsertions()85 void SVGScriptElement::finishedInsertingSubtree() 86 86 { 87 ScriptElement:: didNotifySubtreeInsertions();87 ScriptElement::finishedInsertingSubtree(); 88 88 } 89 89 -
trunk/Source/WebCore/svg/SVGScriptElement.h
r185769 r185813 43 43 virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; 44 44 virtual InsertionNotificationRequest insertedInto(ContainerNode&) override; 45 virtual void didNotifySubtreeInsertions() override;45 virtual void finishedInsertingSubtree() override; 46 46 virtual void childrenChanged(const ChildChange&) override; 47 47 -
trunk/Source/WebCore/svg/SVGTRefElement.cpp
r185423 r185813 259 259 SVGElement::insertedInto(rootParent); 260 260 if (rootParent.inDocument()) 261 return InsertionShouldCall DidNotifySubtreeInsertions;261 return InsertionShouldCallFinishedInsertingSubtree; 262 262 return InsertionDone; 263 263 } 264 264 265 void SVGTRefElement:: didNotifySubtreeInsertions()265 void SVGTRefElement::finishedInsertingSubtree() 266 266 { 267 267 buildPendingResource(); -
trunk/Source/WebCore/svg/SVGTRefElement.h
r185503 r185813 48 48 virtual InsertionNotificationRequest insertedInto(ContainerNode&) override; 49 49 virtual void removedFrom(ContainerNode&) override; 50 virtual void didNotifySubtreeInsertions() override;50 virtual void finishedInsertingSubtree() override; 51 51 52 52 virtual void clearTarget() override; -
trunk/Source/WebCore/svg/SVGTextPathElement.cpp
r185423 r185813 177 177 { 178 178 SVGTextContentElement::insertedInto(rootParent); 179 return InsertionShouldCall DidNotifySubtreeInsertions;180 } 181 182 void SVGTextPathElement:: didNotifySubtreeInsertions()179 return InsertionShouldCallFinishedInsertingSubtree; 180 } 181 182 void SVGTextPathElement::finishedInsertingSubtree() 183 183 { 184 184 buildPendingResource(); -
trunk/Source/WebCore/svg/SVGTextPathElement.h
r185503 r185813 113 113 114 114 protected: 115 virtual void didNotifySubtreeInsertions() override;115 virtual void finishedInsertingSubtree() override; 116 116 117 117 private: -
trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp
r185423 r185813 261 261 m_timeContainer->notifyIntervalsChanged(); 262 262 263 return InsertionShouldCall DidNotifySubtreeInsertions;264 } 265 266 void SVGSMILElement:: didNotifySubtreeInsertions()263 return InsertionShouldCallFinishedInsertingSubtree; 264 } 265 266 void SVGSMILElement::finishedInsertingSubtree() 267 267 { 268 268 buildPendingResource(); -
trunk/Source/WebCore/svg/animation/SVGSMILElement.h
r185423 r185813 120 120 virtual void setAttributeName(const QualifiedName&); 121 121 122 virtual void didNotifySubtreeInsertions() override;122 virtual void finishedInsertingSubtree() override; 123 123 124 124 private:
Note:
See TracChangeset
for help on using the changeset viewer.