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

Unified Diff: WebCore/dom/ContainerNode.cpp

Issue 3403012: Merge 67357 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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: WebCore/dom/ContainerNode.cpp
===================================================================
--- WebCore/dom/ContainerNode.cpp (revision 67709)
+++ WebCore/dom/ContainerNode.cpp (working copy)
@@ -72,7 +72,6 @@
removeAllChildrenInContainer<Node, ContainerNode>(this);
}
-
void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent)
{
NodeVector children;
@@ -82,10 +81,14 @@
for (unsigned i = 0; i < children.size(); ++i) {
ExceptionCode ec = 0;
+ if (children[i]->attached())
+ children[i]->detach();
// FIXME: We need a no mutation event version of adoptNode.
RefPtr<Node> child = document()->adoptNode(children[i].release(), ec);
ASSERT(!ec);
- parserAddChild(child.release());
+ parserAddChild(child.get());
+ if (attached() && !child->attached())
+ child->attach();
}
}

Powered by Google App Engine
This is Rietveld 408576698