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/Document.cpp

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/ContainerNodeAlgorithms.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 6f6aa1f26a94ecabfb16cc4b7f83b79bbe850c21..f5d6e674eb7bec2631125e00060583b463bc750d 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1698,7 +1698,7 @@ void Document::recalcStyle(StyleChange change)
renderer()->setStyle(documentStyle.release());
}
- for (Node* n = firstChild(); n; n = n->nextSibling()) {
+ for (Node* n = lastChild(); n; n = n->previousSibling()) {
if (!n->isElementNode())
continue;
Element* element = toElement(n);
« no previous file with comments | « Source/core/dom/ContainerNodeAlgorithms.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698