| 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 1911f30359bc5b578b46aa761e95adb7989be47d..97f82e3ec500a8273a3a365b0c18f642b3fbd848 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
|
| @@ -424,16 +424,31 @@ PaintResult PaintLayerPainter::PaintLayerContents(
|
| ClipRectsCacheSlot cache_slot = (paint_flags & kPaintLayerUncachedClipRects)
|
| ? kUncachedClipRects
|
| : kPaintingClipRects;
|
| +#ifndef NDEBUG
|
| + static bool shown_once = false;
|
| + if (!shown_once) {
|
| + showLayerTree(&paint_layer_);
|
| + shown_once = true;
|
| + }
|
| +#endif
|
| 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 =
|
| + 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 +1020,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,
|
|
|