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

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

Issue 1126883002: Change all one-off lifecycle callers to FrameView::updateLayoutAndStyleForPainting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 d87e41d8b487faed68e5364b46bce7bf08ff60fd..7fa5774f4b4f81457cebf8c7004e53649af26cd6 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2539,6 +2539,18 @@ void FrameView::updateWidgetPositionsIfNeeded()
void FrameView::updateLayoutAndStyleForPainting()
{
+ LocalFrame* startFrame = &frame();
+ while (startFrame != page()->mainFrame() && startFrame->tree().parent()->isLocalFrame()) {
+ startFrame = toLocalFrame(startFrame->tree().parent());
+ }
+ startFrame->view()->updateLayoutAndStyleForPaintingInternal();
+}
+
+void FrameView::updateLayoutAndStyleForPaintingInternal()
+{
+ // 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()));
+
// Updating layout can run script, which can tear down the FrameView.
RefPtrWillBeRawPtr<FrameView> protector(this);
@@ -2567,7 +2579,7 @@ void FrameView::updateLayoutAndStyleForPainting()
void FrameView::updateLayoutAndStyleIfNeededRecursive()
{
- // We have to crawl our entire tree looking for any FrameViews that need
+ // We have to crawl our entire subtree looking for any FrameViews that need
// layout and make sure they are up to date.
// Mac actually tests for intersection with the dirty region and tries not to
// update layout for frames that are outside the dirty region. Not only does this seem

Powered by Google App Engine
This is Rietveld 408576698