[csswg-drafts] [css-sizing-3] Content contribution of min-inline-size:fit-content and max-inline-size:fit-content (#10721)

bfgeek has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-sizing-3] Content contribution of min-inline-size:fit-content and max-inline-size:fit-content ==
We came across this from a bug report submitted to us, and basically it comes down to these cases:

```
<!DOCTYPE html>
<div style="width: fit-content; border: solid 10px;">
  <div style="max-width: fit-content; width: 100000px;">
    abc def ehg
  </div>
</div>
```
https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=12976

```
<!DOCTYPE html>
<div style="width: fit-content; border: solid 10px;">
  <div style="min-width: fit-content; width: 10px;">
    abc def ehg
  </div>
</div>
```
https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=12977

Basically:
 - For Blink - The available-size is indefinite (during the content contribution calculation) so we'll throw away the `fit-content`, and just treat the `min-inline-size`, and `max-inline-size` as 0, and Infinity respectively.
 - For Gecko - The available-size is indefinite; for the `min-inline-size` - `fit-content` becomes `min-content`, and for `max-inline-size` - `fit-content` becomes `max-content`.

Gecko's behaviour here is reasonable (at least to me), but isn't in the spec (from my reading).
cc/ @tabatkins 


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10721 using your GitHub account


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

Received on Friday, 9 August 2024 17:52:59 UTC