Re: [csswg-drafts] [css-sizing] Intrinsic sizes for stretchable replaced elements (#13149)

> I'm not sure if I'm getting this. When does this fallback kick in? It's still when resolving the value of each property right?

Its the same logic when a length can't resolve. For example: 50% (or stretch or similar) on min-height, height & max-height has the same behaviour.

 - `min-height: 50%` can't resolve fallback to 0
 - `max-height: 50%` can't resolve fallback to Infinity
 - `height: 50%` can't resolve - main-length is indefinite.

(https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/length_utils.h;l=124;drc=405f385dce2db578ff3b2301686d231ee8f0b042)

The fallback happens at the very end. E.g.
 - Try and resolve the main block-length. May be indefinite.
 - Try and resolve the main inline-length. May be indefinite.
 - Nothing resolved so fallback to stretching if available size is definite. (step 3 in general algorithm above).

> In Servo that would be a bit annoying because the logic that resolves min/max-content (taking sizing constraints from the other axis into account) is not property-specific.

Its not property specific in Blink either. However min/max-content may be unresolvable, and the logic has to handle this. (e.g. for the initial block-size calculations you need to treat `min-block-size: max-content` as indefinite which resolves as zero).

> The logic that resolves sizing values is property-specific, but currently doesn't have access to the sizing constraints from the other axis.

You need this for `width: max-content; height: 50px` through right?

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


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

Received on Tuesday, 31 March 2026 17:19:36 UTC