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

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: Reversing the snapshotting logic to fix a bug, and updating test expectations. 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
« Source/core/dom/Element.cpp ('K') | « Source/core/dom/Text.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/shadow/ShadowRoot.cpp
diff --git a/Source/core/dom/shadow/ShadowRoot.cpp b/Source/core/dom/shadow/ShadowRoot.cpp
index fc01f8ee4fffeaf8fa59d3013b84204dd9ac5038..ce1592024228c641115666ed6e3b04048c47337e 100644
--- a/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/Source/core/dom/shadow/ShadowRoot.cpp
@@ -142,7 +142,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())
« Source/core/dom/Element.cpp ('K') | « Source/core/dom/Text.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698