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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 2461463004: Resize background-attachment: fixed when inertTopControls is enabled. (Closed)
Patch Set: Created 4 years, 2 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: 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();

Powered by Google App Engine
This is Rietveld 408576698