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

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

Issue 9910031: Merge 111895 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 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 | « Source/WebCore/dom/ContainerNode.h ('k') | Source/WebCore/editing/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/ContainerNode.cpp
===================================================================
--- Source/WebCore/dom/ContainerNode.cpp (revision 112578)
+++ Source/WebCore/dom/ContainerNode.cpp (working copy)
@@ -56,25 +56,18 @@
typedef pair<NodeCallback, CallbackParameters> CallbackInfo;
typedef Vector<CallbackInfo> NodeCallbackQueue;
-typedef Vector<RefPtr<Node>, 1> NodeVector;
static NodeCallbackQueue* s_postAttachCallbackQueue;
static size_t s_attachDepth;
static bool s_shouldReEnableMemoryCacheCallsAfterAttach;
-static inline void collectNodes(Node* node, NodeVector& nodes)
-{
- for (Node* child = node->firstChild(); child; child = child->nextSibling())
- nodes.append(child);
-}
-
static void collectTargetNodes(Node* node, NodeVector& nodes)
{
if (node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) {
nodes.append(node);
return;
}
- collectNodes(node, nodes);
+ getChildNodes(node, nodes);
}
void ContainerNode::removeAllChildren()
@@ -85,7 +78,7 @@
void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent)
{
NodeVector children;
- collectNodes(oldParent, children);
+ getChildNodes(oldParent, children);
oldParent->removeAllChildren();
for (unsigned i = 0; i < children.size(); ++i) {
@@ -387,7 +380,7 @@
RefPtr<Node> protect(this);
NodeVector children;
- collectNodes(this, children);
+ getChildNodes(this, children);
for (size_t i = 0; i < children.size(); ++i) {
if (children[i]->parentNode() != this) // Check for child being removed from subtree while removing.
continue;
@@ -414,7 +407,7 @@
container->document()->incDOMTreeVersion();
NodeVector children;
- collectNodes(container, children);
+ getChildNodes(container, children);
#if ENABLE(MUTATION_OBSERVERS)
ChildListMutationScope mutation(container);
@@ -814,7 +807,7 @@
insertedIntoTree(false);
NodeVector children;
- collectNodes(this, children);
+ getChildNodes(this, children);
for (size_t i = 0; i < children.size(); ++i) {
// If we have been removed from the document during this loop, then
// we don't want to tell the rest of our children that they've been
@@ -836,7 +829,7 @@
removedFromTree(false);
NodeVector children;
- collectNodes(this, children);
+ getChildNodes(this, children);
for (size_t i = 0; i < children.size(); ++i) {
// If we have been added to the document during this loop, then we
// don't want to tell the rest of our children that they've been
« no previous file with comments | « Source/WebCore/dom/ContainerNode.h ('k') | Source/WebCore/editing/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698