Changeset 152197 in webkit
- Timestamp:
- Jun 28, 2013 5:01:37 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r152196 r152197 1 2013-06-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 Remove unused attachChildrenLazily method and make attach/detachChildren private 4 https://bugs.webkit.org/show_bug.cgi?id=118016 5 6 Reviewed by Darin Adler. 7 8 Merge https://chromium.googlesource.com/chromium/blink/+/009520dc31c9458e0cf71cf212fa5688c4ca68b0 9 10 No one should be manually trying to attach or detach all their children so there's 11 no reason for these methods to be public. 12 13 In doing this I realized that attachChildrenLazily is not used and can be removed. 14 15 I also realized that we were detaching all our children before the ShadowRoots which 16 is sad since the InsertionPoints will call detach() on them as well, and then when we 17 call ContainerNode::detach at the end of Element::detach we'll go detach them again! 18 This patch makes it so we only go through and detach them twice instead of three times. 19 In the future we should figure out a way to only do this once. 20 21 * dom/ContainerNode.h: 22 * dom/Element.cpp: 23 (WebCore::Element::detach): 24 1 25 2013-06-28 Alexey Proskuryakov <ap@apple.com> 2 26 -
trunk/Source/WebCore/dom/ContainerNode.h
r151839 r152197 119 119 virtual void childrenChanged(bool createdByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); 120 120 121 void attachChildren(const AttachContext& = AttachContext());122 void attachChildrenLazily();123 void detachChildren(const AttachContext& = AttachContext());124 void detachChildrenIfNeeded(const AttachContext& = AttachContext());125 126 121 void disconnectDescendantFrames(); 127 122 … … 147 142 void removeBetween(Node* previousChild, Node* nextChild, Node* oldChild); 148 143 void insertBeforeCommon(Node* nextChild, Node* oldChild); 144 145 void attachChildren(const AttachContext& = AttachContext()); 146 void detachChildren(const AttachContext& = AttachContext()); 149 147 150 148 static void dispatchPostAttachCallbacks(); … … 194 192 if (!child->attached()) 195 193 child->attach(childrenContext); 196 }197 }198 199 inline void ContainerNode::attachChildrenLazily()200 {201 for (Node* child = firstChild(); child; child = child->nextSibling())202 if (!child->attached())203 child->lazyAttach();204 }205 206 inline void ContainerNode::detachChildrenIfNeeded(const AttachContext& context)207 {208 AttachContext childrenContext(context);209 childrenContext.resolvedStyle = 0;210 211 for (Node* child = firstChild(); child; child = child->nextSibling()) {212 if (child->attached())213 child->detach(childrenContext);214 194 } 215 195 } -
trunk/Source/WebCore/dom/Element.cpp
r152088 r152197 1479 1479 } 1480 1480 1481 if (ElementShadow* shadow = this->shadow()) { 1482 detachChildrenIfNeeded(context); 1481 if (ElementShadow* shadow = this->shadow()) 1483 1482 shadow->detach(context); 1484 }1485 1483 1486 1484 // Do not remove the element's hovered and active status
Note: See TracChangeset
for help on using the changeset viewer.