Title: [152197] trunk/Source/WebCore
- Revision
- 152197
- Author
- [email protected]
- Date
- 2013-06-28 17:01:37 -0700 (Fri, 28 Jun 2013)
Log Message
Remove unused attachChildrenLazily method and make attach/detachChildren private
https://bugs.webkit.org/show_bug.cgi?id=118016
Reviewed by Darin Adler.
Merge https://chromium.googlesource.com/chromium/blink/+/009520dc31c9458e0cf71cf212fa5688c4ca68b0
No one should be manually trying to attach or detach all their children so there's
no reason for these methods to be public.
In doing this I realized that attachChildrenLazily is not used and can be removed.
I also realized that we were detaching all our children before the ShadowRoots which
is sad since the InsertionPoints will call detach() on them as well, and then when we
call ContainerNode::detach at the end of Element::detach we'll go detach them again!
This patch makes it so we only go through and detach them twice instead of three times.
In the future we should figure out a way to only do this once.
* dom/ContainerNode.h:
* dom/Element.cpp:
(WebCore::Element::detach):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (152196 => 152197)
--- trunk/Source/WebCore/ChangeLog 2013-06-28 23:57:16 UTC (rev 152196)
+++ trunk/Source/WebCore/ChangeLog 2013-06-29 00:01:37 UTC (rev 152197)
@@ -1,3 +1,27 @@
+2013-06-28 Ryosuke Niwa <[email protected]>
+
+ Remove unused attachChildrenLazily method and make attach/detachChildren private
+ https://bugs.webkit.org/show_bug.cgi?id=118016
+
+ Reviewed by Darin Adler.
+
+ Merge https://chromium.googlesource.com/chromium/blink/+/009520dc31c9458e0cf71cf212fa5688c4ca68b0
+
+ No one should be manually trying to attach or detach all their children so there's
+ no reason for these methods to be public.
+
+ In doing this I realized that attachChildrenLazily is not used and can be removed.
+
+ I also realized that we were detaching all our children before the ShadowRoots which
+ is sad since the InsertionPoints will call detach() on them as well, and then when we
+ call ContainerNode::detach at the end of Element::detach we'll go detach them again!
+ This patch makes it so we only go through and detach them twice instead of three times.
+ In the future we should figure out a way to only do this once.
+
+ * dom/ContainerNode.h:
+ * dom/Element.cpp:
+ (WebCore::Element::detach):
+
2013-06-28 Alexey Proskuryakov <[email protected]>
[Mac] Crash when loading is stopped from -didReceiveResponse
Modified: trunk/Source/WebCore/dom/ContainerNode.h (152196 => 152197)
--- trunk/Source/WebCore/dom/ContainerNode.h 2013-06-28 23:57:16 UTC (rev 152196)
+++ trunk/Source/WebCore/dom/ContainerNode.h 2013-06-29 00:01:37 UTC (rev 152197)
@@ -118,11 +118,6 @@
// node that is of the type CDATA_SECTION_NODE, TEXT_NODE or COMMENT_NODE has changed its value.
virtual void childrenChanged(bool createdByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
- void attachChildren(const AttachContext& = AttachContext());
- void attachChildrenLazily();
- void detachChildren(const AttachContext& = AttachContext());
- void detachChildrenIfNeeded(const AttachContext& = AttachContext());
-
void disconnectDescendantFrames();
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const { return true; }
@@ -147,6 +142,9 @@
void removeBetween(Node* previousChild, Node* nextChild, Node* oldChild);
void insertBeforeCommon(Node* nextChild, Node* oldChild);
+ void attachChildren(const AttachContext& = AttachContext());
+ void detachChildren(const AttachContext& = AttachContext());
+
static void dispatchPostAttachCallbacks();
void suspendPostAttachCallbacks();
void resumePostAttachCallbacks();
@@ -196,24 +194,6 @@
}
}
-inline void ContainerNode::attachChildrenLazily()
-{
- for (Node* child = firstChild(); child; child = child->nextSibling())
- if (!child->attached())
- child->lazyAttach();
-}
-
-inline void ContainerNode::detachChildrenIfNeeded(const AttachContext& context)
-{
- AttachContext childrenContext(context);
- childrenContext.resolvedStyle = 0;
-
- for (Node* child = firstChild(); child; child = child->nextSibling()) {
- if (child->attached())
- child->detach(childrenContext);
- }
-}
-
inline void ContainerNode::detachChildren(const AttachContext& context)
{
AttachContext childrenContext(context);
Modified: trunk/Source/WebCore/dom/Element.cpp (152196 => 152197)
--- trunk/Source/WebCore/dom/Element.cpp 2013-06-28 23:57:16 UTC (rev 152196)
+++ trunk/Source/WebCore/dom/Element.cpp 2013-06-29 00:01:37 UTC (rev 152197)
@@ -1478,10 +1478,8 @@
data->resetDynamicRestyleObservations();
}
- if (ElementShadow* shadow = this->shadow()) {
- detachChildrenIfNeeded(context);
+ if (ElementShadow* shadow = this->shadow())
shadow->detach(context);
- }
// Do not remove the element's hovered and active status
// if performing a reattach.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes