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 f62c87aafa731a32b379d26cb4567f325c546df7..689a2e62516f30398948da0f547f737e4b45290d 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
@@ -205,7 +205,9 @@ void LayoutView::checkLayoutState() { |
} |
#endif |
-void LayoutView::setShouldDoFullPaintInvalidationOnResizeIfNeeded() { |
+void LayoutView::setShouldDoFullPaintInvalidationOnResizeIfNeeded( |
+ bool widthChanged, |
+ bool heightChanged) { |
// When background-attachment is 'fixed', we treat the viewport (instead of |
// the 'root' i.e. html or body) as the background positioning area, and we |
// should fully invalidate on viewport resize if the background image is not |
@@ -214,15 +216,10 @@ void LayoutView::setShouldDoFullPaintInvalidationOnResizeIfNeeded() { |
if (style()->hasFixedBackgroundImage() && |
(!m_compositor || |
!m_compositor->needsFixedRootBackgroundLayer(layer()))) { |
- IncludeScrollbarsInRect includeScrollbars = |
- RuntimeEnabledFeatures::rootLayerScrollingEnabled() ? IncludeScrollbars |
- : ExcludeScrollbars; |
- if ((offsetWidth() != viewWidth(includeScrollbars) && |
- mustInvalidateFillLayersPaintOnWidthChange( |
- style()->backgroundLayers())) || |
- (offsetHeight() != viewHeight(includeScrollbars) && |
- mustInvalidateFillLayersPaintOnHeightChange( |
- style()->backgroundLayers()))) |
+ if ((widthChanged && mustInvalidateFillLayersPaintOnWidthChange( |
+ style()->backgroundLayers())) || |
+ (heightChanged && mustInvalidateFillLayersPaintOnHeightChange( |
+ style()->backgroundLayers()))) |
setShouldDoFullPaintInvalidation(PaintInvalidationBoundsChange); |
} |
} |
@@ -231,7 +228,12 @@ void LayoutView::layout() { |
if (!document().paginated()) |
setPageLogicalHeight(LayoutUnit()); |
- setShouldDoFullPaintInvalidationOnResizeIfNeeded(); |
+ IncludeScrollbarsInRect includeScrollbars = |
+ RuntimeEnabledFeatures::rootLayerScrollingEnabled() ? IncludeScrollbars |
+ : ExcludeScrollbars; |
+ FloatSize viewSize(frameView()->visibleContentSize(includeScrollbars)); |
+ setShouldDoFullPaintInvalidationOnResizeIfNeeded( |
+ offsetWidth() != viewSize.width(), offsetHeight() != viewSize.height()); |
if (pageLogicalHeight() && shouldUsePrintingLayout()) { |
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth(); |