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

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: Adding a mitigation for the perf regression to Element::recalcStyle. 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
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/dom/ContainerNodeAlgorithms.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNodeAlgorithms.h
diff --git a/Source/core/dom/ContainerNodeAlgorithms.h b/Source/core/dom/ContainerNodeAlgorithms.h
index f02eb7f8112349de45de79c7e0e709bba834eb3c..992fac515beaa9d48a5b16d815671a3ab7b6163b 100644
--- a/Source/core/dom/ContainerNodeAlgorithms.h
+++ b/Source/core/dom/ContainerNodeAlgorithms.h
@@ -218,14 +218,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);
}
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/dom/ContainerNodeAlgorithms.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698