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

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

Issue 435733002: Have getChildNodes() take a ContainerNode in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index 8c20d806aca347a6e5ae6344e7aec2aeadda5aa2..dec61172bc1d12b3b1666a6c89c0ce5a7531aab9 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -66,14 +66,15 @@ unsigned NoEventDispatchAssertion::s_count = 0;
static void collectChildrenAndRemoveFromOldParent(Node& node, NodeVector& nodes, ExceptionState& exceptionState)
{
- if (!node.isDocumentFragment()) {
- nodes.append(&node);
- if (ContainerNode* oldParent = node.parentNode())
- oldParent->removeChild(&node, exceptionState);
+ if (node.isDocumentFragment()) {
+ DocumentFragment& fragment = toDocumentFragment(node);
+ getChildNodes(fragment, nodes);
+ fragment.removeChildren();
return;
}
- getChildNodes(node, nodes);
- toContainerNode(node).removeChildren();
+ nodes.append(&node);
+ if (ContainerNode* oldParent = node.parentNode())
+ oldParent->removeChild(&node, exceptionState);
}
#if !ENABLE(OILPAN)

Powered by Google App Engine
This is Rietveld 408576698