| 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
|
|
|