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

Unified Diff: Source/core/dom/shadow/ShadowRoot.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: Merging ToT Created 7 years, 7 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/shadow/ShadowRoot.cpp
diff --git a/Source/core/dom/shadow/ShadowRoot.cpp b/Source/core/dom/shadow/ShadowRoot.cpp
index 83df7d57a0ac95fe239537683a356d2a6f242638..1772fa5fdc217d222eff3272954af89b17f1f044 100644
--- a/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/Source/core/dom/shadow/ShadowRoot.cpp
@@ -148,7 +148,7 @@ void ShadowRoot::recalcStyle(StyleChange change)
if (styleChangeType() == FullStyleChange)
change = Force;
- for (Node* child = firstChild(); child; child = child->nextSibling()) {
+ for (Node* child = lastChild(); child; child = child->previousSibling()) {
if (child->isElementNode())
toElement(child)->recalcStyle(change);
else if (child->isTextNode())
« Source/core/css/SiblingTraversalStrategies.h ('K') | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698