Re: [csswg-drafts] [css-images-4][css-overflow-3] How do `object-overflow` and `object-view-box` interact with `overflow` and `overflow-clip-margin`? (#7144)

We can't reuse 'overflow' for this, as it is based on different assumptions that aren't quite compatible with how replaced element contents behave. The big one is that 'overflow' clips at the padding edge, while replaced contents are clipped at the content edge; the other is that, as noted, none of the scrollable values are viable. Trying to cram this behavior into 'overflow' isn't a great idea, imo.

I agree this interaction needs clarification, tho. I can see two possibilities:

1. The object-* properties affect the "content" of the replaced element, which is analogous to children of the element, so 'overflow' should apply "after" 'object-overflow'. In other words, 'object-overflow' just tells the replaced element's contents whether to clip themselves to the content area or not; if they don't, then they potentially become ordinary overflowing content and 'overflow' applies to those overhanging bits. (This implies that replaced elements could sprout scrollbars due to object-overflow + overflow, unless we explicitly disallow that and treat the scrollable values as "clip" on replaced elements.)
2. The content of a replaced element is, as far as CSS is concerned, the element's problem, and so whatever it does is similar to other painting effects caused by the element itself, like shadows. 'overflow' continues to have no effect.

I lean slightly towards (2) for simplicity, but would be fine with either.

'overflow-clip-margin' is currently defined to solely affect "overflow: clip" and other things using the "overflow-clip edge" (like "contain: paint"). So it would have an effect on replaced elements with "contain:paint" in either of the above two choices, and replaced elements with "overflow:clip" if we go with (1). We shouldn't need to define anything special for this; the behavior will just fall out naturally.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7144#issuecomment-1079442804 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 25 March 2022 21:20:29 UTC