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

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: 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
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | Source/core/dom/Element.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.h
diff --git a/Source/core/dom/ContainerNode.h b/Source/core/dom/ContainerNode.h
index da683f2197ddfa8bdde1c68f6baeee576a0d9411..eeb065e816e4435e672039451a7f2fe16656891b 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,16 @@ inline ContainerNode::ContainerNode(TreeScope* treeScope, ConstructionType type)
{
}
-inline void ContainerNode::attachChildren()
+inline void ContainerNode::attachChildren(const AttachContext& context)
{
+ // the resolved style need not be passed to the children, as it represents only the parent's style
+ AttachContext childrenContext(context);
+ childrenContext.resolvedStyle = 0;
esprehn 2013/06/13 18:20:42 You should put this inside the constructor to just
stavila 2013/06/13 21:10:06 You mean the copy constructor should set by defaul
+
for (Node* child = firstChild(); child; child = child->nextSibling()) {
ASSERT(!child->attached() || childAttachedAllowedWhenAttachingChildren(this));
if (!child->attached())
- child->attach();
+ child->attach(childrenContext);
}
}
@@ -212,18 +216,26 @@ inline void ContainerNode::attachChildrenLazily()
child->lazyAttach();
}
-inline void ContainerNode::detachChildrenIfNeeded()
+inline void ContainerNode::detachChildrenIfNeeded(const AttachContext& context)
{
+ // the resolved style need not be passed to the children, as it represents only the parent's style
+ 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)
{
+ // the resolved style need not be passed to the children, as it represents only the parent's style
+ AttachContext childrenContext(context);
esprehn 2013/06/13 18:20:42 Please remove all the comments here, this should b
+ childrenContext.resolvedStyle = 0;
+
for (Node* child = firstChild(); child; child = child->nextSibling())
- child->detach();
+ child->detach(childrenContext);
}
inline unsigned Node::childNodeCount() const
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | Source/core/dom/Element.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698