W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2020

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

From: fantasai via GitHub <sysbot+gh@w3.org>
Date: Tue, 27 Oct 2020 21:04:09 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-717538234-1603832648-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:21 UTC