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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/ContainerNodeAlgorithms.h
diff --git a/Source/core/dom/ContainerNodeAlgorithms.h b/Source/core/dom/ContainerNodeAlgorithms.h
index 5e09a6b5255e434963d940634226bd6522e943f3..d591b77ea79170b99cf7acb08ed0d16375cc3ded 100644
--- a/Source/core/dom/ContainerNodeAlgorithms.h
+++ b/Source/core/dom/ContainerNodeAlgorithms.h
@@ -219,14 +219,15 @@ inline void ChildNodeInsertionNotifier::notify(Node* node)
RefPtr<Document> protectDocument(node->document());
RefPtr<Node> protectNode(node);
+ InsertionCallbackDeferer insertionCallbackDeferer;
if (m_insertionPoint->inDocument())
notifyNodeInsertedIntoDocument(node);
else if (node->isContainerNode())
notifyNodeInsertedIntoTree(toContainerNode(node));
- for (size_t i = 0; i < m_postInsertionNotificationTargets.size(); ++i)
- m_postInsertionNotificationTargets[i]->didNotifySubtreeInsertions(m_insertionPoint);
+ for (size_t i = m_postInsertionNotificationTargets.size(); i; --i)
+ m_postInsertionNotificationTargets[i - 1]->didNotifySubtreeInsertions(m_insertionPoint);
}

Powered by Google App Engine
This is Rietveld 408576698