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

Side by Side Diff: Source/core/dom/ContainerNodeAlgorithms.h

Issue 15871005: Avoid N^2 walk placing renderers when building the render tree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merging ToT Created 7 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 213
214 inline void ChildNodeInsertionNotifier::notify(Node* node) 214 inline void ChildNodeInsertionNotifier::notify(Node* node)
215 { 215 {
216 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 216 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
217 217
218 InspectorInstrumentation::didInsertDOMNode(node->document(), node); 218 InspectorInstrumentation::didInsertDOMNode(node->document(), node);
219 219
220 RefPtr<Document> protectDocument(node->document()); 220 RefPtr<Document> protectDocument(node->document());
221 RefPtr<Node> protectNode(node); 221 RefPtr<Node> protectNode(node);
222 InsertionCallbackDeferer insertionCallbackDeferer;
222 223
223 if (m_insertionPoint->inDocument()) 224 if (m_insertionPoint->inDocument())
224 notifyNodeInsertedIntoDocument(node); 225 notifyNodeInsertedIntoDocument(node);
225 else if (node->isContainerNode()) 226 else if (node->isContainerNode())
226 notifyNodeInsertedIntoTree(toContainerNode(node)); 227 notifyNodeInsertedIntoTree(toContainerNode(node));
227 228
228 for (size_t i = 0; i < m_postInsertionNotificationTargets.size(); ++i) 229 for (size_t i = m_postInsertionNotificationTargets.size(); i; --i)
229 m_postInsertionNotificationTargets[i]->didNotifySubtreeInsertions(m_inse rtionPoint); 230 m_postInsertionNotificationTargets[i - 1]->didNotifySubtreeInsertions(m_ insertionPoint);
230 } 231 }
231 232
232 233
233 inline void ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument(Node* node) 234 inline void ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument(Node* node)
234 { 235 {
235 ASSERT(m_insertionPoint->inDocument()); 236 ASSERT(m_insertionPoint->inDocument());
236 node->removedFrom(m_insertionPoint); 237 node->removedFrom(m_insertionPoint);
237 238
238 if (node->isContainerNode()) 239 if (node->isContainerNode())
239 notifyDescendantRemovedFromDocument(toContainerNode(node)); 240 notifyDescendantRemovedFromDocument(toContainerNode(node));
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 for (Node* child = m_root->firstChild(); child; child = child->nextSibli ng()) 331 for (Node* child = m_root->firstChild(); child; child = child->nextSibli ng())
331 collectFrameOwners(child); 332 collectFrameOwners(child);
332 } 333 }
333 334
334 disconnectCollectedFrameOwners(); 335 disconnectCollectedFrameOwners();
335 } 336 }
336 337
337 } // namespace WebCore 338 } // namespace WebCore
338 339
339 #endif // ContainerNodeAlgorithms_h 340 #endif // ContainerNodeAlgorithms_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698