Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
| index 38c53c90b479757e07031b7dd0e8d4e876a60c71..15c530832f6410aa617a936753eb3235b6de40f2 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
| @@ -425,15 +425,23 @@ PaintResult PaintLayerPainter::PaintLayerContents( |
| ? kUncachedClipRects |
| : kPaintingClipRects; |
| LayoutPoint offset_to_clipper; |
| - PaintLayer* paint_layer_for_fragments = &paint_layer_; |
| + const PaintLayer* paint_layer_for_fragments = &paint_layer_; |
| if (paint_flags & kPaintLayerPaintingAncestorClippingMaskPhase) { |
| - // Compute fragments and their clips with respect to the clipping |
| - // container. The paint rect is in this layer's space, so convert it |
| - // to the clipper's layer's space. The rootLayer is also changed to |
| - // the clipper's layer to simplify coordinate system adjustments. |
| - // The change to rootLayer must persist to correctly record the clips. |
| + // Compute fragments and their clips with respect to the outermost |
| + // clipping container. This handles nested border radius by including |
| + // all of them in the mask. |
| + // |
| + // The paint rect is in this layer's space, so convert it to the clipper's |
| + // layer's space. The rootLayer is also changed to the clipper's layer to |
| + // simplify coordinate system adjustments. The change to rootLayer must |
| + // persist to correctly record the clips. |
| paint_layer_for_fragments = |
| paint_layer_.ClippingContainer()->EnclosingLayer(); |
| + while (const PaintLayer* new_clip_root = |
|
chrishtr
2017/06/09 22:45:28
You can stop at the PaintLayer indicated by Compos
Stephen Chennney
2017/06/12 14:43:29
Will do.
|
| + paint_layer_for_fragments->ClippingContainer() |
| + ->EnclosingLayer()) { |
| + paint_layer_for_fragments = new_clip_root; |
| + } |
| local_painting_info.root_layer = paint_layer_for_fragments; |
| paint_layer_.ConvertToLayerCoords(local_painting_info.root_layer, |
| offset_to_clipper); |
| @@ -1005,9 +1013,6 @@ void PaintLayerPainter::PaintFragmentWithPhase( |
| break; |
| } |
| - // TODO(schenney): Nested border-radius clips are not applied to composited |
| - // children, probably due to an incorrect clipRoot. |
| - // https://bugs.chromium.org/p/chromium/issues/detail?id=672561 |
| clip_recorder.emplace(context, paint_layer_.GetLayoutObject(), clip_type, |
| clip_rect, painting_info.root_layer, |
| fragment.pagination_offset, paint_flags, |