Chromium Code Reviews| 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 72d1876fe07a8c2bb93ed83fda2e0e9faffd4880..f86746626204eb7f3b764367d8ffc908a98b0ed4 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp |
| @@ -70,6 +70,14 @@ static void adjustClipRectsForChildren(const LayoutBoxModelObject& layoutObject, |
| } |
| } |
| +static LayoutRect overflowOrControlClip(const LayoutBox& box, |
| + const LayoutPoint& location, |
| + OverlayScrollbarClipBehavior behavior) { |
| + if (box.hasControlClip()) |
| + return box.controlClipRect(location); |
| + return box.overflowClipRect(location, behavior); |
| +} |
| + |
| static void applyClipRects(const ClipRectsContext& context, |
| const LayoutBoxModelObject& layoutObject, |
| LayoutPoint offset, |
| @@ -87,8 +95,8 @@ static void applyClipRects(const ClipRectsContext& context, |
| if (box.hasOverflowClip() || |
| (box.isSVGRoot() && toLayoutSVGRoot(&box)->shouldApplyViewportClip()) || |
| box.styleRef().containsPaint() || box.hasControlClip()) { |
| - ClipRect newOverflowClip = |
| - box.overflowClipRect(offset, context.overlayScrollbarClipBehavior); |
| + ClipRect newOverflowClip = overflowOrControlClip( |
|
pdr.
2017/01/20 19:17:36
Can you make the same change in PaintPropertyTreeB
chrishtr
2017/01/20 22:51:10
Added a TODO. Will do this in another CL because t
|
| + box, offset, context.overlayScrollbarClipBehavior); |
| newOverflowClip.setHasRadius(box.styleRef().hasBorderRadius()); |
| clipRects.setOverflowClipRect( |
| intersection(newOverflowClip, clipRects.overflowClipRect())); |
| @@ -352,9 +360,10 @@ void PaintLayerClipper::calculateRects( |
| // Update the clip rects that will be passed to child layers. |
| if (shouldClipOverflow(context)) { |
| - foregroundRect.intersect( |
| - toLayoutBox(layoutObject) |
| - .overflowClipRect(offset, context.overlayScrollbarClipBehavior)); |
| + LayoutRect overflowOrControlClipRect = |
| + overflowOrControlClip(toLayoutBox(layoutObject), offset, |
| + context.overlayScrollbarClipBehavior); |
| + foregroundRect.intersect(overflowOrControlClipRect); |
| if (layoutObject.styleRef().hasBorderRadius()) |
| foregroundRect.setHasRadius(true); |