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

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

Issue 1217943010: Add a FrameView lifecycle method that just updates layout, style and compositing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 79009f972ba2f911f6ad9fab63c014e3bc887fee..633f5647d792da141de0e4e58e5de39c263b652b 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2483,12 +2483,22 @@ void FrameView::updateWidgetPositionsIfNeeded()
updateWidgetPositions();
}
-void FrameView::updateLayoutAndStyleForPainting()
+void FrameView::updateAllLifecyclePhases()
{
- frame().localFrameRoot()->view()->updateLayoutAndStyleForPaintingInternal();
+ frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal();
}
-void FrameView::updateLayoutAndStyleForPaintingInternal()
+void FrameView::updateLifecycleToCompositingClean()
+{
+ frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive();
+ LayoutView* view = layoutView();
+ if (view)
+ view->compositor()->updateIfNeededRecursive();
+
+ ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean);
+}
+
+void FrameView::updateAllLifecyclePhasesInternal()
{
// This must be called from the root frame, since it recurses down, not up. Otherwise the lifecycles of the frames might be out of sync.
ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalFrame()));
@@ -2496,7 +2506,7 @@ void FrameView::updateLayoutAndStyleForPaintingInternal()
// Updating layout can run script, which can tear down the FrameView.
RefPtrWillBeRawPtr<FrameView> protector(this);
- updateLayoutAndStyleIfNeededRecursive();
+ updateStyleAndLayoutIfNeededRecursive();
LayoutView* view = layoutView();
if (view) {
@@ -2534,7 +2544,7 @@ void FrameView::updateFrameTimingRequestsIfNeeded()
}
}
-void FrameView::updateLayoutAndStyleIfNeededRecursive()
+void FrameView::updateStyleAndLayoutIfNeededRecursive()
{
// We have to crawl our entire subtree looking for any FrameViews that need
// layout and make sure they are up to date.
@@ -2561,7 +2571,7 @@ void FrameView::updateLayoutAndStyleIfNeededRecursive()
}
for (const auto& frameView : frameViews)
- frameView->updateLayoutAndStyleIfNeededRecursive();
+ frameView->updateStyleAndLayoutIfNeededRecursive();
// When an <iframe> gets composited, it triggers an extra style recalc in its containing FrameView.
// To avoid pushing an invalid tree for display, we have to check for this case and do another

Powered by Google App Engine
This is Rietveld 408576698