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

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

Issue 18276003: Avoid N^2 walk placing renderers when building the render tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adding test expectations Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 inline void ChildNodeInsertionNotifier::notify(Node* node) 213 inline void ChildNodeInsertionNotifier::notify(Node* node)
214 { 214 {
215 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 215 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
216 216
217 InspectorInstrumentation::didInsertDOMNode(node->document(), node); 217 InspectorInstrumentation::didInsertDOMNode(node->document(), node);
218 218
219 RefPtr<Document> protectDocument(node->document()); 219 RefPtr<Document> protectDocument(node->document());
220 RefPtr<Node> protectNode(node); 220 RefPtr<Node> protectNode(node);
221 InsertionCallbackDeferer insertionCallbackDeferer;
221 222
222 if (m_insertionPoint->inDocument()) 223 if (m_insertionPoint->inDocument())
223 notifyNodeInsertedIntoDocument(node); 224 notifyNodeInsertedIntoDocument(node);
224 else if (node->isContainerNode()) 225 else if (node->isContainerNode())
225 notifyNodeInsertedIntoTree(toContainerNode(node)); 226 notifyNodeInsertedIntoTree(toContainerNode(node));
226 227
227 for (size_t i = 0; i < m_postInsertionNotificationTargets.size(); ++i) 228 for (size_t i = m_postInsertionNotificationTargets.size(); i; --i)
228 m_postInsertionNotificationTargets[i]->didNotifySubtreeInsertions(m_inse rtionPoint); 229 m_postInsertionNotificationTargets[i - 1]->didNotifySubtreeInsertions(m_ insertionPoint);
esprehn 2013/07/11 01:24:32 This looks strange, insertedInto happens during ap
leviw_travelin_and_unemployed 2013/07/11 01:35:11 Looking into it, but I've verified we fail 3 tests
229 } 230 }
230 231
231 232
232 inline void ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument(Node* node) 233 inline void ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument(Node* node)
233 { 234 {
234 ASSERT(m_insertionPoint->inDocument()); 235 ASSERT(m_insertionPoint->inDocument());
235 node->removedFrom(m_insertionPoint); 236 node->removedFrom(m_insertionPoint);
236 237
237 if (node->isContainerNode()) 238 if (node->isContainerNode())
238 notifyDescendantRemovedFromDocument(toContainerNode(node)); 239 notifyDescendantRemovedFromDocument(toContainerNode(node));
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 for (Node* child = m_root->firstChild(); child; child = child->nextSibli ng()) 330 for (Node* child = m_root->firstChild(); child; child = child->nextSibli ng())
330 collectFrameOwners(child); 331 collectFrameOwners(child);
331 } 332 }
332 333
333 disconnectCollectedFrameOwners(); 334 disconnectCollectedFrameOwners();
334 } 335 }
335 336
336 } // namespace WebCore 337 } // namespace WebCore
337 338
338 #endif // ContainerNodeAlgorithms_h 339 #endif // ContainerNodeAlgorithms_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698