Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Unified Diff: Source/core/dom/ContainerNode.h

Issue 16951003: Fix broken AttachContext from r152289 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed failing test (/fast/forms/file/input-file-re-render.html) Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/ContainerNode.h
diff --git a/Source/core/dom/ContainerNode.h b/Source/core/dom/ContainerNode.h
index e25b30826bc3ec4efe27958568601e0d59142fb6..1af89093e81fbf3bd9dd8d3321511b5229443d47 100644
--- a/Source/core/dom/ContainerNode.h
+++ b/Source/core/dom/ContainerNode.h
@@ -127,10 +127,10 @@ public:
// 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();
+ void attachChildren(const AttachContext& = AttachContext());
void attachChildrenLazily();
- void detachChildren();
- void detachChildrenIfNeeded();
+ void detachChildren(const AttachContext& = AttachContext());
+ void detachChildrenIfNeeded(const AttachContext& = AttachContext());
void disconnectDescendantFrames();
@@ -196,12 +196,15 @@ inline ContainerNode::ContainerNode(TreeScope* treeScope, ConstructionType type)
{
}
-inline void ContainerNode::attachChildren()
+inline void ContainerNode::attachChildren(const AttachContext& context)
{
+ AttachContext childrenContext(context);
+ childrenContext.resolvedStyle = 0;
+
for (Node* child = firstChild(); child; child = child->nextSibling()) {
ASSERT(!child->attached() || childAttachedAllowedWhenAttachingChildren(this));
if (!child->attached())
- child->attach();
+ child->attach(childrenContext);
}
}
@@ -212,18 +215,24 @@ inline void ContainerNode::attachChildrenLazily()
child->lazyAttach();
}
-inline void ContainerNode::detachChildrenIfNeeded()
+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();
+ child->detach(childrenContext);
}
}
-inline void ContainerNode::detachChildren()
+inline void ContainerNode::detachChildren(const AttachContext& context)
{
+ AttachContext childrenContext(context);
+ childrenContext.resolvedStyle = 0;
+
for (Node* child = firstChild(); child; child = child->nextSibling())
- child->detach();
+ child->detach(childrenContext);
}
inline unsigned Node::childNodeCount() const

Powered by Google App Engine
This is Rietveld 408576698