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

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

Issue 150423004: Move Document::m_inStyleRecalc into DocumentLifecycle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename state Created 6 years, 11 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/Document.h ('k') | Source/core/dom/DocumentLifecycle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index aae58dd8cb95fb376936800d57d8fddd5915a598..ff3da601998d2d10b0c702f91723b6b4764e7b80 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -454,7 +454,6 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
, m_readyState(Complete)
, m_bParsing(false)
, m_hasPendingStyleRecalc(false)
- , m_inStyleRecalc(false)
, m_gotoAnchorNeededAfterStylesheetsLoad(false)
, m_containsValidityStyleRules(false)
, m_updateFocusAppearanceRestoresSelection(false)
@@ -1606,7 +1605,7 @@ void Document::unscheduleStyleRecalc()
bool Document::hasPendingForcedStyleRecalc() const
{
- return m_hasPendingStyleRecalc && !m_inStyleRecalc && styleChangeType() >= SubtreeStyleChange;
+ return m_hasPendingStyleRecalc && !inStyleRecalc() && styleChangeType() >= SubtreeStyleChange;
}
void Document::updateDistributionIfNeeded()
@@ -1714,7 +1713,7 @@ void Document::recalcStyle(StyleRecalcChange change)
if (!isActive() || !view())
return;
- if (m_inStyleRecalc)
+ if (inStyleRecalc())
return;
TRACE_EVENT0("webkit", "Document::recalcStyle");
@@ -1743,7 +1742,7 @@ void Document::recalcStyle(StyleRecalcChange change)
{
PostAttachCallbacks::SuspendScope suspendPostAttachCallbacks;
RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates;
- TemporaryChange<bool> changeInStyleRecalc(m_inStyleRecalc, true);
+ m_lifecycle.advanceTo(DocumentLifecycle::InStyleRecalc);
if (styleChangeType() >= SubtreeStyleChange)
change = Force;
@@ -1791,6 +1790,9 @@ void Document::recalcStyle(StyleRecalcChange change)
m_styleEngine->resetCSSFeatureFlags(resolver.ensureRuleFeatureSet());
resolver.clearStyleSharingList();
}
+
+ ASSERT(inStyleRecalc());
+ m_lifecycle.advanceTo(DocumentLifecycle::Clean);
}
InspectorInstrumentation::didRecalculateStyle(cookie);
@@ -2064,7 +2066,7 @@ void Document::attach(const AttachContext& context)
ContainerNode::attach(context);
- m_lifecycle.advanceTo(DocumentLifecycle::Active);
+ m_lifecycle.advanceTo(DocumentLifecycle::Clean);
}
void Document::detach(const AttachContext& context)
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentLifecycle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698