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

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

Issue 168193002: Fix compositing chicken and egg problem in updateControlTints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add protectors 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/FrameView.h ('k') | Source/core/page/FocusController.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 bbf65c0fe63032ff03bb7fb97eb0ce714ecb0a49..14950cb6e07bd62937fa889d2ebbd1cb516d6b5b 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2627,12 +2627,13 @@ void FrameView::updateControlTints()
// FIXME: Why do we need this for hasCustomScrollbars?
// FIXME: supportsControlTints is currently true for a bunch of platforms.
- // It should only be for Mac 10.6.
if (!RenderTheme::theme().supportsControlTints() && !hasCustomScrollbars())
return;
- if (needsLayout())
- layout();
+ // Updating layout can run script, which can tear down the FrameView.
+ RefPtr<FrameView> protector(this);
+ updateLayoutAndStyleForPainting();
+
// FIXME: The use of paint seems like overkill: crbug.com/236892
GraphicsContext context(0); // NULL canvas to get a non-painting context.
context.setUpdatingControlTints(true);
@@ -2778,6 +2779,16 @@ void FrameView::paintOverhangAreas(GraphicsContext* context, const IntRect& hori
ScrollView::paintOverhangAreas(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect);
}
+void FrameView::updateLayoutAndStyleForPainting()
+{
+ // Updating layout can run script, which can tear down the FrameView.
+ RefPtr<FrameView> protector(this);
+
+ updateLayoutAndStyleIfNeededRecursive();
+ if (RenderView* view = renderView())
+ view->compositor()->updateCompositingLayers();
+}
+
void FrameView::updateLayoutAndStyleIfNeededRecursive()
{
// We have to crawl our entire tree looking for any FrameViews that need
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698