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

Unified Diff: Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp

Issue 146023008: Add layout states to DocumentLifecycle state machine (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Whitelist one more transition' Created 6 years, 10 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/frame/DeprecatedScheduleStyleRecalcDuringLayout.h ('k') | Source/core/frame/FrameView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp
diff --git a/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp b/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..94367d821680aac14467d1f1de7bd75adab1289a
--- /dev/null
+++ b/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/frame/DeprecatedScheduleStyleRecalcDuringLayout.h"
+
+#include "wtf/Assertions.h"
+
+namespace WebCore {
+
+DeprecatedScheduleStyleRecalcDuringLayout::DeprecatedScheduleStyleRecalcDuringLayout(DocumentLifecycle& lifecycle)
+ : m_lifecycle(lifecycle)
+ , m_deprecatedTransition(DocumentLifecycle::InPerformLayout, DocumentLifecycle::StyleRecalcPending)
+ , m_wasInPerformLayout(lifecycle.state() == DocumentLifecycle::InPerformLayout)
+{
+}
+
+DeprecatedScheduleStyleRecalcDuringLayout::~DeprecatedScheduleStyleRecalcDuringLayout()
+{
+ // This block of code is intended to restore the state machine to the
+ // proper state. The style recalc will still have been schedule, however.
+ if (m_wasInPerformLayout && m_lifecycle.state() != DocumentLifecycle::InPerformLayout) {
+ ASSERT(m_lifecycle.state() == DocumentLifecycle::StyleRecalcPending);
+ m_lifecycle.advanceTo(DocumentLifecycle::InPerformLayout);
+ }
+}
+
+}
« no previous file with comments | « Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.h ('k') | Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698