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

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

Issue 17054002: Element::recalcStyle() overly reattach()-es InsertionPoints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For landing 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
« no previous file with comments | « Source/core/dom/shadow/InsertionPoint.cpp ('k') | Source/core/html/shadow/HTMLShadowElement.cpp » ('j') | 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 fc40ea28119bf6fcbc608b8217aa42c25d944a7c..4780751a18aca586711f657738b4958305a7da38 100644
--- a/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/Source/core/dom/shadow/ShadowRoot.cpp
@@ -145,6 +145,14 @@ void ShadowRoot::recalcStyle(StyleChange change)
if (styleChangeType() == FullStyleChange)
change = Force;
+ 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);
« no previous file with comments | « Source/core/dom/shadow/InsertionPoint.cpp ('k') | Source/core/html/shadow/HTMLShadowElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698