Re: [csswg-drafts] [css-sizing] Stretch-fitting inline size next to floats. (#4028)

It's worth noting that in Firefox and WebKit, when `width: auto` stretches, floats shrink the available space for non-replaced elements that establish an independent formatting context, but not for replaced:

```html
<!DOCTYPE html>
<div style="width: 100px; border: solid">
  <div style="float: left; width: 50px; height: 100px; background: magenta"></div>
  <div style="display: flow-root; background: yellow; aspect-ratio: 1"></div>
  <svg viewbox="0 0 1 1" style="display: block; background: cyan"></svg>
</div>
```

| Firefox & WebKit | Chrome |
| - | - |
| ![](https://github.com/user-attachments/assets/ecf9c0c9-60eb-4f7b-a8e7-6feefdb53b1b) | ![](https://github.com/user-attachments/assets/1879f502-63e3-439e-acbf-5daa6f768e9f) |

In Servo we don't support `<svg>`, but using another replaced element with `width: stretch` we also behave like Firefox and WebKit. I consider that to be a bug, though: https://github.com/servo/servo/issues/37861

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


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

Received on Friday, 4 July 2025 11:35:09 UTC