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

> Disagree. If width: min-content produces a certain width, then min-width: min-content should enforce that same size as a minimum. No different than here:

So I think this is where we differ. The stretching is really a last resort. "There is no reasonable size for the replaced element to be, stretching is the least worst option".

The stretch here isn't really "min-content" its more "min-content couldn't resolve". See the general algorithm I wrote above.

> And also ignoring inline-lengths, right? Otherwise this would be 0x0:

Sort of. I guess you could consider that step ignoring inline-lengths as well. That line was explicitly for stretchable replaced elements. The canvas isn't stretchable and follows the general algorithm I wrote below. Specifically:

`<canvas width="50" height="50" style="width: 0; min-width: min-content; height: 0px; min-height: max-content; border: solid magenta"></canvas>`

 - While computing the "block content" size, if we need to calculate the "inline content" size, we use the natural size (step (2) line (4) above). Results in 50px.
 - The "block content" size is "50px" (step (1) line (2) above).
 - The "block sizes" are: {min: 50px , main: 0px , max: Infinity} - block-size is 50px (step (1) above).
 - The "inline sizes" are: {min: 50px, main: 0px, max: Infinity} (use the block-size for the "inline content" size of 50px - step (2) line (2) above).
 - Final size 50x50.

> That is, webkit-based option 1 from OP is still reasonable.

I'm not sure I understand. You definitely don't want to be using the default object size for the stretchable case (unless a very weird compat thing with percentages that I can get into later).

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


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

Received on Saturday, 28 March 2026 21:18:34 UTC