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

Unified Diff: Source/core/rendering/RenderLayer.cpp

Issue 848163002: [New Multicolumn] Clip correctly if the "root" layer is inside the multicol container. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | « LayoutTests/fast/multicol/composited-relpos-in-clipped-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 436aeb4d4c4c4d43d0b7043d532370e1a797c3d3..32136e171e9a3ae9745b27bdbbbf999c0e9d39be 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -1565,7 +1565,8 @@ void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer*
// Make the dirty rect relative to the fragmentation context (multicol container, etc.).
RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginationLayer()->renderer());
LayoutPoint offsetOfPaginationLayerFromRoot; // Visual offset from the root layer to the nearest fragmentation context.
- if (rootLayer->enclosingPaginationLayer() == enclosingPaginationLayer()) {
+ bool rootLayerIsInsidePaginationLayer = rootLayer->enclosingPaginationLayer() == enclosingPaginationLayer();
+ if (rootLayerIsInsidePaginationLayer) {
// The root layer is in the same fragmentation context as this layer, so we need to look
// inside it and subtract the offset between the fragmentation context and the root layer.
offsetOfPaginationLayerFromRoot = -rootLayer->visualOffsetFromAncestor(enclosingPaginationLayer());
@@ -1584,11 +1585,14 @@ void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer*
// Get the parent clip rects of the pagination layer, since we need to intersect with that when painting column contents.
ClipRect ancestorClipRect = dirtyRect;
- if (enclosingPaginationLayer()->parent()) {
- ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, inOverlayScrollbarSizeRelevancy);
+ if (const RenderLayer* paginationParentLayer = enclosingPaginationLayer()->parent()) {
+ const RenderLayer* ancestorLayer = rootLayerIsInsidePaginationLayer ? paginationParentLayer : rootLayer;
+ ClipRectsContext clipRectsContext(ancestorLayer, clipRectsCacheSlot, inOverlayScrollbarSizeRelevancy);
if (respectOverflowClip == IgnoreOverflowClip)
clipRectsContext.setIgnoreOverflowClip();
ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipRect(clipRectsContext);
+ if (rootLayerIsInsidePaginationLayer)
+ ancestorClipRect.moveBy(-rootLayer->visualOffsetFromAncestor(ancestorLayer));
ancestorClipRect.intersect(dirtyRect);
}
« no previous file with comments | « LayoutTests/fast/multicol/composited-relpos-in-clipped-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698