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

Unified Diff: Source/core/dom/shadow/ShadowRoot.cpp

Issue 15680005: Element::recalcStyle() overly reattach()-es InsertionPoints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated test and test expectations 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
« Source/core/dom/Node.cpp ('K') | « Source/core/dom/shadow/InsertionPoint.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 83df7d57a0ac95fe239537683a356d2a6f242638..a0153d9041a18ee0155e17d99eaba7c070eacc89 100644
--- a/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/Source/core/dom/shadow/ShadowRoot.cpp
@@ -138,6 +138,13 @@ void ShadowRoot::recalcStyle(StyleChange change)
{
// ShadowRoot doesn't support custom callbacks.
ASSERT(!hasCustomStyleCallbacks());
+ if (!attached()) {
+ attach();
+ // attach recalculates the style for all children. No need to do it twice.
+ clearNeedsStyleRecalc();
+ clearChildNeedsStyleRecalc();
+ return;
+ }
StyleResolver* styleResolver = document()->styleResolver();
styleResolver->pushParentShadowRoot(this);
« Source/core/dom/Node.cpp ('K') | « Source/core/dom/shadow/InsertionPoint.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698