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()) |