Index: third_party/WebKit/Source/core/layout/LayoutView.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
index f211a982b81cdf218b5e0441a5a251c52b194d3a..6e5bbf09012e2e1d53e4a08f8e72c507e3c2b3f4 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
@@ -247,6 +247,8 @@ void LayoutView::layout() { |
SubtreeLayoutScope layoutScope(*this); |
+ LayoutRect oldLayoutOverflowRect = layoutOverflowRect(); |
+ |
// Use calcWidth/Height to get the new width/height, since this will take the |
// full page zoom factor into account. |
bool relayoutChildren = |
@@ -281,6 +283,17 @@ void LayoutView::layout() { |
layoutContent(); |
+ if (layoutOverflowRect() != oldLayoutOverflowRect) { |
+ // The document element paints the viewport background, so we need to |
+ // invalidate it when layout overflow changes. |
+ // FIXME: Improve viewport background styling/invalidation/painting. |
+ // crbug.com/475115 |
+ if (Element* documentElement = document().documentElement()) { |
+ if (LayoutObject* rootObject = documentElement->layoutObject()) |
+ rootObject->setShouldDoFullPaintInvalidation(); |
+ } |
+ } |
+ |
#if ENABLE(ASSERT) |
checkLayoutState(); |
#endif |