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

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

Issue 2194273002: Fix border radius on composited children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now working on basic test cases Created 4 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 71347c9ed0c82e8c6d1e1a8cb69c0e963733c402..945f6145d9001df3e957db0c4fd0f54fc21555cf 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -319,6 +319,23 @@ void PaintLayerClipper::calculateRects(
calculateRectsWithGeometryMapper(context, paintDirtyRect, layerBounds,
backgroundRect, foregroundRect,
offsetFromRoot);
+
+ // CSS clip (different than clipping due to overflow) can clip to any box,
chrishtr 2016/11/16 23:56:32 The code you are inserting here is SPv2-specific.
Stephen Chennney 2016/11/17 18:05:48 I shouldn't be; I think I was being over-zealous.
+ // even if it falls outside of the border box.
+ LayoutBoxModelObject& layoutObject = *m_layer.layoutObject();
+ LayoutPoint offset;
+ if (offsetFromRoot)
+ offset = *offsetFromRoot;
+ else
+ m_layer.convertToLayerCoords(context.rootLayer, offset);
+ if (layoutObject.hasClip()) {
+ // Clip applies to *us* as well, so go ahead and update the damageRect.
+ LayoutRect newPosClip = toLayoutBox(layoutObject).clipRect(offset);
+ backgroundRect.intersect(newPosClip);
+ backgroundRect.setIsClippedByClipCss();
+ foregroundRect.intersect(newPosClip);
+ foregroundRect.setIsClippedByClipCss();
+ }
return;
}
@@ -344,9 +361,10 @@ void PaintLayerClipper::calculateRects(
// Update the clip rects that will be passed to child layers.
if (shouldClipOverflow(context)) {
- foregroundRect.intersect(
+ LayoutRect offsetOverflowClipRect =
toLayoutBox(layoutObject)
- .overflowClipRect(offset, context.overlayScrollbarClipBehavior));
+ .overflowClipRect(offset, context.overlayScrollbarClipBehavior);
+ foregroundRect.intersect(offsetOverflowClipRect);
if (layoutObject.styleRef().hasBorderRadius())
foregroundRect.setHasRadius(true);
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipper.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698