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

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

Issue 232013002: Rewind the DocumentLifecycle when dirtying state (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address Ojan's comments Created 6 years, 8 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 9678701ff802e3b60ea82c77ccce05ee372d2a36..1b8b85dbf1bea5fa2308c50dafab58199473d13c 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1580,7 +1580,7 @@ void Document::scheduleRenderTreeUpdate()
ASSERT(needsRenderTreeUpdate());
page()->animator().scheduleVisualUpdate();
- m_lifecycle.advanceTo(DocumentLifecycle::StyleRecalcPending);
+ m_lifecycle.ensureStateAtMost(DocumentLifecycle::VisualUpdatePending);
InspectorInstrumentation::didScheduleStyleRecalculation(this);
}
@@ -2630,9 +2630,16 @@ bool Document::shouldScheduleLayout() const
//
// (a) Only schedule a layout once the stylesheets are loaded.
// (b) Only schedule layout once we have a body element.
+ if (!isActive())
+ return false;
+
+ if (isRenderingReady() && body())
+ return true;
- return (isRenderingReady() && body())
- || (documentElement() && !isHTMLHtmlElement(*documentElement()));
+ if (documentElement() && !isHTMLHtmlElement(*documentElement()))
+ return true;
+
+ return false;
}
int Document::elapsedTime() const
« 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