Open heycam opened 3 years ago
i.e. it should look like this:
The CSS Working Group just discussed Fragmented elements with clip-path
, and agreed to the following:
RESOLVED: masking should follow same rules as backgrounds with regards to box-decoration-break
RESOLVED: clip-path and masking should follow same rules as backgrounds with regards to box-decoration-break
https://drafts.fxtf.org/css-masking-1/#the-clip-path
I don't see anything in the CSS Masking spec that defines how clip-path interacts with box-decoration-break, or more broadly how multiple fragments influence the clipping that's applied. My expectation is that it would work like masks, where the reference box (specified in the clip-path property, unlike for masks where it's in mask-origin) is either computed separately for each fragment (when box-decoration-break is slice) or once over a hypothetical unfragmented box (when box-decoration-break is clone).
There's a very brief reference to box-decoration-break in https://drafts.fxtf.org/css-masking-1/#mask-positioning-area but nothing similar for clip-path.
Here's a test that doesn't have interop:
The way I guess it should work is:
box-decoration-break: slice
case, theinset(25% 2ch 25% 0)
would first be applied to the unfragmented element, which would result in both fragments having their top and bottom quarters chopped off and the second fragment having its last two characters chopped off. The blue border should be shown on the left of the first fragment, since the default reference box for the clip-path should be the border box.box-decoration-break: clone
case, both fragments would have their top and bottom quarters chopped off and both would have their last two characters chopped off. The blue border should be shown on the left of both fragments, since the default reference box for the clip-path should be the border box.