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

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

Issue 23606020: Remove lots of code related synchronously attaching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix asserts 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 6cb67b9fa1bd8983a19a7548382bfb5bcafcd199..dffcad0468172d8837691b03b4fe1c43139febad 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1310,6 +1310,8 @@ void Element::removedFrom(ContainerNode* insertionPoint)
void Element::attach(const AttachContext& context)
{
+ ASSERT(document().inStyleRecalc());
+
PostAttachCallbackDisabler callbackDisabler(this);
StyleResolverParentPusher parentPusher(this);
WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
@@ -1324,10 +1326,6 @@ 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);
@@ -1353,11 +1351,7 @@ void Element::attach(const AttachContext& context)
}
}
- // 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);
+ InspectorInstrumentation::didRecalculateStyleForElement(this);
}
void Element::unregisterNamedFlowContentNode()
@@ -1766,18 +1760,12 @@ 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