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

Unified Diff: Source/core/dom/Element.cpp

Issue 14604003: When there are no more stylesheets schedule the recalc async (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Refactor based on review 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
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index cd5ec5507c759d96843ce953036e240e368103cb..d51a64aaf6b715aae0a71000b18e5dcc8f16711f 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1281,6 +1281,14 @@ void Element::createRendererIfNeeded()
void Element::attach()
{
+ // We update the style in the document if needed so that our parent style
+ // is always up to date before creating our renderer otherwise our style
+ // can inherit the wrong values. If we end up updating the style we'll
+ // also get attached.
+ document()->updateStyleIfNeeded();
eseidel 2013/05/12 09:24:58 This only occurs for Elements, since they're the o
+ if (attached())
+ return;
+
PostAttachCallbackDisabler callbackDisabler(this);
StyleResolverParentPusher parentPusher(this);
WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
« Source/core/dom/Document.cpp ('K') | « Source/core/dom/DocumentStyleSheetCollection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698