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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 static void dispatchChildInsertionEvents(Node&); 60 static void dispatchChildInsertionEvents(Node&);
61 static void dispatchChildRemovalEvents(Node&); 61 static void dispatchChildRemovalEvents(Node&);
62 62
63 #if ENABLE(ASSERT) 63 #if ENABLE(ASSERT)
64 unsigned NoEventDispatchAssertion::s_count = 0; 64 unsigned NoEventDispatchAssertion::s_count = 0;
65 #endif 65 #endif
66 66
67 static void collectChildrenAndRemoveFromOldParent(Node& node, NodeVector& nodes, ExceptionState& exceptionState) 67 static void collectChildrenAndRemoveFromOldParent(Node& node, NodeVector& nodes, ExceptionState& exceptionState)
68 { 68 {
69 if (!node.isDocumentFragment()) { 69 if (node.isDocumentFragment()) {
70 nodes.append(&node); 70 DocumentFragment& fragment = toDocumentFragment(node);
71 if (ContainerNode* oldParent = node.parentNode()) 71 getChildNodes(fragment, nodes);
72 oldParent->removeChild(&node, exceptionState); 72 fragment.removeChildren();
73 return; 73 return;
74 } 74 }
75 getChildNodes(node, nodes); 75 nodes.append(&node);
76 toContainerNode(node).removeChildren(); 76 if (ContainerNode* oldParent = node.parentNode())
77 oldParent->removeChild(&node, exceptionState);
77 } 78 }
78 79
79 #if !ENABLE(OILPAN) 80 #if !ENABLE(OILPAN)
80 void ContainerNode::removeDetachedChildren() 81 void ContainerNode::removeDetachedChildren()
81 { 82 {
82 ASSERT(!connectedSubframeCount()); 83 ASSERT(!connectedSubframeCount());
83 ASSERT(needsAttach()); 84 ASSERT(needsAttach());
84 removeDetachedChildrenInContainer(*this); 85 removeDetachedChildrenInContainer(*this);
85 } 86 }
86 #endif 87 #endif
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 return true; 1421 return true;
1421 1422
1422 if (node->isElementNode() && toElement(node)->shadow()) 1423 if (node->isElementNode() && toElement(node)->shadow())
1423 return true; 1424 return true;
1424 1425
1425 return false; 1426 return false;
1426 } 1427 }
1427 #endif 1428 #endif
1428 1429
1429 } // namespace blink 1430 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698