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; |