- From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
- Date: Mon, 14 Apr 2025 16:13:17 +0000
- To: public-css-archive@w3.org
Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-sizing] How to handle min-content being bigger than max-context? == There seems to be the assumption that the min-content size can't exceed the max-content size. For example, [CSS Grid](https://drafts.csswg.org/css-grid/#minimum-contribution) has a note stating > min-content contribution ≤ max-content contribution However, consider this case: ```html <!DOCTYPE html> <style>span { display: inline-block; margin-right: -50px }</style> <div style="width: min-content; border: solid">aaaaaaaaaaaa<span></span></div> <div style="width: max-content; border: solid">aaaaaaaaaaaa<span></span></div> ``` When we avoid wrapping lines as per `max-content`, then the negative margin of the span makes the line shorter than when wrapping lines as per `min-content`! Browsers don't agree: - Firefox just allows `min-content` to be bigger than `max-content` - Blink ceils the min-content to not exceed the max-content - WebKit floors the max-content to be at least as big as the min-content - Servo is currently like Firefox but in a bunch of places we assume `min-content <= max-content`, leading to assert failures. I plan to align with WebKit for now, since typically in case of conflict CSS tends to choose the maximum amount. | Firefox, Servo | Blink | WebKit | | - | - | - | |  |  |  | Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12076 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 14 April 2025 16:13:18 UTC