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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp

Issue 1459943002: Clip abspos descendants correctly in all columns (not just the first). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review - possible alternative Created 5 years 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/paint/PaintLayerClipper.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
index 0ff40ac98a76e1f0088eed1ff66a42638ab3a422..769234c559a067b5e1fdb31b97e52dfe362e5f88 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -268,10 +268,17 @@ void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context, Clip
adjustClipRectsForChildren(m_layoutObject, clipRects);
if ((m_layoutObject.hasOverflowClip() && shouldRespectOverflowClip(context)) || m_layoutObject.hasClip()) {
+ const PaintLayer* layer = m_layoutObject.layer();
+ const PaintLayer* layerToStopAt = context.rootLayer;
+ if (const PaintLayer* paginationLayer = layer->enclosingPaginationLayer()) {
+ // Stop at the multicol container, unless the root layer is also inside it.
+ if (layerToStopAt->enclosingPaginationLayer() != paginationLayer)
+ layerToStopAt = paginationLayer;
chrishtr 2015/12/14 21:39:51 Why not just require users of PaintLayerClipper to
+ }
// This offset cannot use convertToLayerCoords, because sometimes our rootLayer may be across
// some transformed layer boundary, for example, in the PaintLayerCompositor overlapMap, where
// clipRects are needed in view space.
- applyClipRects(context, m_layoutObject, roundedLayoutPoint(m_layoutObject.localToContainerPoint(FloatPoint(), context.rootLayer->layoutObject())), clipRects);
+ applyClipRects(context, m_layoutObject, roundedLayoutPoint(m_layoutObject.localToContainerPoint(FloatPoint(), layerToStopAt->layoutObject())), clipRects);
}
}

Powered by Google App Engine
This is Rietveld 408576698