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

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
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/html/HTMLFormControlElementTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 5d67dc924e04a052fb8c34ce580be8ccf318aa01..8ecf29b0e64c4c9aba3b5af5941e2073d80b2d4f 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2517,6 +2517,14 @@ void FrameView::updateWidgetPositionsIfNeeded()
void FrameView::updateLayoutAndStyleForPainting()
{
+ frame().localFrameRoot()->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);
@@ -2545,7 +2553,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
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/html/HTMLFormControlElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698