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

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

Issue 23526031: Revert 157422 "Remove lots of code related synchronously attaching" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « no previous file | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 527588ec6479904569634411922fa6941f0d4835..6cb67b9fa1bd8983a19a7548382bfb5bcafcd199 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1324,6 +1324,10 @@ void Element::attach(const AttachContext& context)
data->resetStyleState();
}
+ // FIXME: Remove this once we lazyAttach everywhere.
+ if (!document().inStyleRecalc() && (this == document().documentElement() || this == document().body()))
+ document().setNeedsStyleRecalc(LocalStyleChange);
+
NodeRenderingContext(this, context.resolvedStyle).createRendererForElementIfNeeded();
createPseudoElementIfNeeded(BEFORE);
@@ -1349,7 +1353,11 @@ void Element::attach(const AttachContext& context)
}
}
- InspectorInstrumentation::didRecalculateStyleForElement(this);
+ // FIXME: It doesn't appear safe to call didRecalculateStyleForElement when
+ // not in a Document::recalcStyle. Since we're hopefully going to always
+ // lazyAttach in the future that problem should go away.
+ if (document().inStyleRecalc())
+ InspectorInstrumentation::didRecalculateStyleForElement(this);
}
void Element::unregisterNamedFlowContentNode()
@@ -1758,12 +1766,18 @@ void Element::removeAllEventListeners()
void Element::beginParsingChildren()
{
clearIsParsingChildrenFinished();
+ StyleResolver* styleResolver = document().styleResolverIfExists();
+ if (styleResolver && attached())
+ styleResolver->pushParentElement(this);
}
void Element::finishParsingChildren()
{
+ ContainerNode::finishParsingChildren();
setIsParsingChildrenFinished();
checkForSiblingStyleChanges(this, renderStyle(), true, lastChild(), 0, 0);
+ if (StyleResolver* styleResolver = document().styleResolverIfExists())
+ styleResolver->popParentElement(this);
if (isCustomElement())
CustomElement::didFinishParsingChildren(this);
}
« no previous file with comments | « no previous file | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698