Re: [csswg-drafts] [css-sizing] How to handle min-content being bigger than max-content? (#12076)

The Houdini Task Force just discussed `[css-sizing] How to handle min-content being bigger than max-content?`, and agreed to the following:

* `RESOLVED: if min-content is > max-content, floor max-content to match`

<details><summary>The full IRC log of that discussion</summary>
&lt;alisonmaher> oriol: if you have elements w/ neg margin and place all on same line, you can get smaller size than if you break after each<br>
&lt;alisonmaher> ...algo for min/max content relies on the oposite. You can get max size smaller than min<br>
&lt;alisonmaher> ...this was breaking asserts<br>
&lt;alisonmaher> ...firefox accepts this as fine<br>
&lt;alisonmaher> ...blink in the inline block case used smaller, in flex it is the bigger one<br>
&lt;alisonmaher> ...webkit floored to zero for items, but sometimes get extra space<br>
&lt;alisonmaher> ...in servo I took max of max/min content for the max-content<br>
&lt;alisonmaher> ... should be more inteligent rather than breaking everywhere<br>
&lt;alisonmaher> ...?? that seems hard to do<br>
&lt;alisonmaher> ... dbaron proposed this. Would be good to get his thoughts<br>
&lt;alisonmaher> TabAtkins: the other part of his comment is that max content calc is prob correct, and shouldnt' have min content less than max if we can avoid<br>
&lt;alisonmaher> ...I think we can resolve min content should be &lt;= max content<br>
&lt;alisonmaher> ...talk to dbaron about if clamp or more smart heuristic<br>
&lt;alisonmaher> florian: even if wrapping makes you larger, and infinite space, you won't wrap<br>
&lt;alisonmaher> TabAtkins: if you have small space could do something smarter<br>
&lt;alisonmaher> dbaron: I don't have a strong opinion<br>
&lt;alisonmaher> ...want to have min and max be coherent and wanting to get right result push in opposite directions<br>
&lt;alisonmaher> TabAtkins: min work is to clamp min by max content size<br>
&lt;alisonmaher> emilio: that isn't a lot of work<br>
&lt;alisonmaher> florian: if you do this and layout at min content, you will overflow<br>
&lt;alisonmaher> ...that isn't gret<br>
&lt;alisonmaher> iank_: pref oriol's proposal. We clamp in other cases for blink<br>
&lt;alisonmaher> ...surprised by line layout, need to investigate<br>
&lt;alisonmaher> fantasai: can see doing something different for text<br>
&lt;alisonmaher> ...for inline layout a good way to do it to layout on one line and then pull chunks off of it<br>
&lt;alisonmaher> ...you don't want to do it piece by piece. It makes sense to start with one line and then go from there to decide breaks<br>
&lt;alisonmaher> iank_: we do max content that way. For min content we just use max content result<br>
&lt;alisonmaher> ...have fast path and slow path. Think that is what is going on<br>
&lt;alisonmaher> ...we do max content as you describe though<br>
&lt;alisonmaher> oriol: clamping min content - what's weird is that you start adding 1px wide items at end, eventually increases max content, and then no longer need to clamp<br>
&lt;alisonmaher> fantasai: the problem of clamping is that if you have a box to layout into, lay it out at max content, put wrappable content in it. Suppsed to hit, but hit edge before you put everything in, then you wrap<br>
&lt;alisonmaher> ...then aren't operating at max content anymore and can overflow<br>
&lt;alisonmaher> ...that doesn't work because we don't layout at once<br>
&lt;alisonmaher> ...need to floor max by min content<br>
&lt;alisonmaher> oriol: that is what servo does<br>
&lt;alisonmaher> TabAtkins: min wins<br>
&lt;alisonmaher> iank_: good with that<br>
&lt;alisonmaher> oriol: there is a test for flex that follows this<br>
&lt;alisonmaher> ...blink was inconsistent in inline case<br>
&lt;alisonmaher> florian: maybe browser can come up with a different intelligent behvior<br>
&lt;alisonmaher> TabAtkins: that's possible<br>
&lt;alisonmaher> PROPOSED: if min-content is > max-content, floor max-content to match<br>
&lt;alisonmaher> RESOLVED: if min-content is > max-content, floor max-content to match<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12076#issuecomment-3210845970 using your GitHub account


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

Received on Thursday, 21 August 2025 14:27:52 UTC