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

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: Created 5 years, 1 month 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 7bb1bae8ee63a317d586216baf13caabb48db6be..952029810cf562498b8636b304803b5329708ab5 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -268,10 +268,27 @@ void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context, Clip
adjustClipRectsForChildren(m_layoutObject, clipRects);
if ((m_layoutObject.hasOverflowClip() && shouldRespectOverflowClip(context)) || m_layoutObject.hasClip()) {
- // 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);
+ PaintLayer* layer = m_layoutObject.layer();
+ LayoutPoint offset;
+ if (!layer->enclosingPaginationLayer()) {
+ // 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.
+
+ // TODO(mstensho): Switch to always using convertToLayerCoords() (see code further
chrishtr 2015/11/19 23:31:41 localToContainerPoint is actually incorrect here,
mstensho (USE GERRIT) 2015/11/20 10:37:15 Makes sense.
chrishtr 2015/12/08 22:56:07 The point I was getting at with asking what the ro
+ // below). Using localToContainerPoint() unfortunately seems necessary in some rare
+ // cases, but isn't it bad that we need to cross transformed layer boundaries here?
+ // localToContainerPoint() is multicol-aware (as well as being transforms-aware, which
+ // is the reason why it's called here in the first place, in favor of
+ // convertToLayerCoords()), in that it converts from flowthread coordinates to visual
+ // coordinates. That won't work, because clip rectangles are... well... rectangles, so
+ // they are calculated before everything is sliced and translated into columns (at
+ // which point each column will get its own slice of the clip rectangle).
+ offset = roundedLayoutPoint(m_layoutObject.localToContainerPoint(FloatPoint(), context.rootLayer->layoutObject()));
+ } else {
+ m_layoutObject.layer()->convertToLayerCoords(context.rootLayer, offset);
+ }
+ applyClipRects(context, m_layoutObject, offset, clipRects);
}
}

Powered by Google App Engine
This is Rietveld 408576698