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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2289833002: Disable clipping on root scroller's ancestors. (Closed)
Patch Set: Also setNeedsCompositingUpdate from TopDocumentRootScrollerController Created 4 years, 3 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/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 2195dd2dd6621e590f95d99727aba23516cab2d1..288c35e5d3954370a2b0fc82fae901f04e0ec6ff 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -449,6 +449,12 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
if (m_owningLayer.needsCompositedScrolling())
needsDescendantsClippingLayer = false;
+ // We disable clipping on ancestor layers of the root scroller to give it
+ // the same behavior w.r.t top controls as the real root layer. See the
+ // RootScrollerController class for more details.
+ if (m_owningLayer.hasRootScrollerAsDescendant())
+ needsDescendantsClippingLayer = false;
+
const PaintLayer* scrollParent = this->scrollParent();
// This is required because compositing layers are parented according to the z-order hierarchy, yet
@@ -456,7 +462,8 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
// PaintLayer that is an ancestor in the layoutObject hierarchy, but a sibling in the z-order
// hierarchy. Further, that sibling need not be composited at all. In such scenarios, an ancestor
// clipping layer is necessary to apply the composited clip for this layer.
- bool needsAncestorClip = owningLayerClippedByLayerNotAboveCompositedAncestor(scrollParent);
+ bool needsAncestorClip = owningLayerClippedByLayerNotAboveCompositedAncestor(scrollParent)
+ && !m_owningLayer.clippingContainer()->enclosingLayer()->hasRootScrollerAsDescendant();
if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer))
layerConfigChanged = true;
@@ -1689,7 +1696,6 @@ bool CompositedLayerMapping::updateScrollingLayers(bool needsScrollingLayers)
// Outer layer which corresponds with the scroll view.
m_scrollingLayer = createGraphicsLayer(CompositingReasonLayerForScrollingContainer);
m_scrollingLayer->setDrawsContent(false);
- m_scrollingLayer->setMasksToBounds(true);
// Inner layer which renders the content that scrolls.
m_scrollingContentsLayer = createGraphicsLayer(CompositingReasonLayerForScrollingContents);
@@ -1705,6 +1711,9 @@ bool CompositedLayerMapping::updateScrollingLayers(bool needsScrollingLayers)
scrollingCoordinator->scrollableAreasDidChange();
}
}
+
+ m_scrollingLayer->setMasksToBounds(
+ !m_owningLayer.hasRootScrollerAsDescendant());
} else if (m_scrollingLayer) {
m_scrollingLayer = nullptr;
m_scrollingContentsLayer = nullptr;

Powered by Google App Engine
This is Rietveld 408576698