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

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

Issue 2923683002: Fix nested border radius with composited child. (Closed)
Patch Set: Fix the issue with missing masks Created 3 years, 6 months 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/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,

Powered by Google App Engine
This is Rietveld 408576698