[csswg-drafts] [css-grid-1][css-sizing-3] aspect-ratio-only boxes should be able to size to grid container (#4228)

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

== [css-grid-1][css-sizing-3] aspect-ratio-only boxes should be able to size to grid container ==
If we put an image which has only an aspect ratio into an auto-row/auto-column grid cell in a fixed-size grid...

- We try to find the range of size for the auto tracks by finding the min/max contributions of its items.
- The grid item, being an image with no size, has a min-content contribution of zero. [According to css-sizing-3](https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes), it takes its max-content size from the available space (if that is definite) or else falls back to 300px.
- The available space to a grid item when finding its max-content contribution is undefined. :(

(We don't run into this problem for non-replaced elements, because their min/max-content contributions don't refer to the available space in the inline dimension, and for orthogonal flows we do define the available space.)

The available logical width we provide to an item with an aspect ratio and no size should either be the “available grid space” (the size of the grid container if definite), or it should be infinity. (Infinity in this case will resolve to an image width of 300px/ICB size depending on issue #4218.) In the case where the grid container's size is definite, do we want to use it instead?

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

Received on Tuesday, 20 August 2019 23:18:16 UTC