Re: [csswg-drafts] [css-sizing] clarification around Compressible Replaced Elements and min-content size (#5665)

> In an unlikely scenario, the implementors of the respective engines think the other engine is right.

Heh. So, from the higher-level principles side of things:
- This behavior was specced as a result of compat requirements. See https://github.com/w3c/csswg-drafts/issues/765 and [CSSWG resolution](https://lists.w3.org/Archives/Public/www-style/2017Aug/0037.html).
- The goal of a `min-content` size is to prevent overflow / collapsing to zero such that the element’s content is unviewable.
- Specifying `width: min-content` should give the same results as a float or table sized into a zero-width container, as its intention was to give a syntax for representing the bottom edge of the CSS2 shrink-to-fit (`fit-content`) size range.
- Arguably, the percentage is acting as a clamp on the actual min-content size the same way a length would, except because we don't know what the percentage resolves to yet we're treating it as zero(ish) during intrinsic contribution computations. So having the min-content size and min-content contribution diverge here isn't unreasonable, for the same reason they diverge with `max-width: 100px`.
- The `auto` value of `min-width` is clamped by the `width` and `max-width` so that an explicit value by the author always overrides the implied minimum. See https://www.w3.org/TR/css-flexbox-1/#min-size-auto However `min-width: min-content` does not get clamped, and always takes priority the same way `min-width: 100px` does. We could apply that same logic here for percentages, we just currently don't (clamping is limited to "definite" percentages).

So overall my take is that compressible elements is about the min-content contribution only, not about the min-content size. We should fix the spec to be clear about that, and consistent with the CSSWG resolution.

We might also consider whether a percentage size or max-size should have a similar clamping effect on the <em>automatic minimum size</em> used in Flexbox and Grid.

Anyway, that's my take on it. Interested to hear from @dholbert / @MatsPalmgren / @tabatkins also. :) 

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


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

Received on Tuesday, 27 October 2020 21:04:11 UTC