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

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, 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/shadow/ShadowRoot.cpp
diff --git a/Source/core/dom/shadow/ShadowRoot.cpp b/Source/core/dom/shadow/ShadowRoot.cpp
index 075eb774ce1ba8e4c09527736f4377c3c11e667e..d409799d1d8ce9af52521dc022ee2fa2afe7be5a 100644
--- a/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/Source/core/dom/shadow/ShadowRoot.cpp
@@ -148,7 +148,7 @@ void ShadowRoot::recalcStyle(StyleChange change)
StyleResolver* styleResolver = document()->styleResolver();
styleResolver->pushParentShadowRoot(this);
- 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())

Powered by Google App Engine
This is Rietveld 408576698