-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-grid] Automatic minimum sizes should never force grid items to become bigger than the tracks they span #3705
Comments
Here's the comment summarizing the principles that led to the text handling flexible tracks: #2177 (comment)
|
fantasai
added a commit
that referenced
this issue
Jun 6, 2019
…ldn't trigger overflow, elide the informative text stating that purpose from the sentence describing the clamping. Requested by Oriol. #3705
fantasai
added a commit
that referenced
this issue
Jun 6, 2019
…xed tracks, to make sure spanning items get accommodated by the intrinsic tracks they cross. #3705
Update: In #4783 we reverted this fix and made a different one (clamping the automatic minimum size to zero when it crosses flexible tracks). |
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Mar 29, 2021
This test was checking that grid items not spanning any flex track with an intrinsic min track sizing function would distribute its intrinsic contribution in $11.5.3. That was according to the resolution from w3c/csswg-drafts#3705 However, that wasn't web compatible, so it was later amended in w3c/csswg-drafts#4783 Now, the intrinsic contributions of items spanning flex tracks must be distributed in $11.5.4, even if none of the flex tracks is intrinsic. This change makes the test pass in GridNG. Bug: 1045599 Change-Id: Ibfb818dcc12a185e30d2824e9ca534069beb48ec
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Mar 29, 2021
This test was checking that grid items not spanning any flex track with an intrinsic min track sizing function would distribute its intrinsic contribution in $11.5.3. That was according to the resolution from w3c/csswg-drafts#3705 However, that wasn't web compatible, so it was later amended in w3c/csswg-drafts#4783 Now, the intrinsic contributions of items spanning flex tracks must be distributed in $11.5.4, even if none of the flex tracks is intrinsic. This change makes the test pass in GridNG. Bug: 1045599 Change-Id: Ibfb818dcc12a185e30d2824e9ca534069beb48ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2791426 Reviewed-by: Javier Fernandez <[email protected]> Commit-Queue: Oriol Brufau <[email protected]> Cr-Commit-Position: refs/heads/master@{#867283}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Mar 29, 2021
This test was checking that grid items not spanning any flex track with an intrinsic min track sizing function would distribute its intrinsic contribution in $11.5.3. That was according to the resolution from w3c/csswg-drafts#3705 However, that wasn't web compatible, so it was later amended in w3c/csswg-drafts#4783 Now, the intrinsic contributions of items spanning flex tracks must be distributed in $11.5.4, even if none of the flex tracks is intrinsic. This change makes the test pass in GridNG. Bug: 1045599 Change-Id: Ibfb818dcc12a185e30d2824e9ca534069beb48ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2791426 Reviewed-by: Javier Fernandez <[email protected]> Commit-Queue: Oriol Brufau <[email protected]> Cr-Commit-Position: refs/heads/master@{#867283}
pull bot
pushed a commit
to FreddyZeng/chromium
that referenced
this issue
Mar 30, 2021
This test was checking that grid items not spanning any flex track with an intrinsic min track sizing function would distribute its intrinsic contribution in $11.5.3. That was according to the resolution from w3c/csswg-drafts#3705 However, that wasn't web compatible, so it was later amended in w3c/csswg-drafts#4783 Now, the intrinsic contributions of items spanning flex tracks must be distributed in $11.5.4, even if none of the flex tracks is intrinsic. This change makes the test pass in GridNG. Bug: 1045599 Change-Id: Ibfb818dcc12a185e30d2824e9ca534069beb48ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2791426 Reviewed-by: Javier Fernandez <[email protected]> Commit-Queue: Oriol Brufau <[email protected]> Cr-Commit-Position: refs/heads/master@{#867283}
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this issue
Apr 2, 2021
…nsic-sizes-002.html, a=testonly Automatic update from web-platform-tests [css-grid] Fix WPT grid-flex-track-intrinsic-sizes-002.html This test was checking that grid items not spanning any flex track with an intrinsic min track sizing function would distribute its intrinsic contribution in $11.5.3. That was according to the resolution from w3c/csswg-drafts#3705 However, that wasn't web compatible, so it was later amended in w3c/csswg-drafts#4783 Now, the intrinsic contributions of items spanning flex tracks must be distributed in $11.5.4, even if none of the flex tracks is intrinsic. This change makes the test pass in GridNG. Bug: 1045599 Change-Id: Ibfb818dcc12a185e30d2824e9ca534069beb48ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2791426 Reviewed-by: Javier Fernandez <[email protected]> Commit-Queue: Oriol Brufau <[email protected]> Cr-Commit-Position: refs/heads/master@{#867283} -- wpt-commits: 4fb0b5be59092eecdb9ef0cd03180f2f9a423f1d wpt-pr: 28291
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this issue
Apr 2, 2021
…nsic-sizes-002.html, a=testonly Automatic update from web-platform-tests [css-grid] Fix WPT grid-flex-track-intrinsic-sizes-002.html This test was checking that grid items not spanning any flex track with an intrinsic min track sizing function would distribute its intrinsic contribution in $11.5.3. That was according to the resolution from w3c/csswg-drafts#3705 However, that wasn't web compatible, so it was later amended in w3c/csswg-drafts#4783 Now, the intrinsic contributions of items spanning flex tracks must be distributed in $11.5.4, even if none of the flex tracks is intrinsic. This change makes the test pass in GridNG. Bug: 1045599 Change-Id: Ibfb818dcc12a185e30d2824e9ca534069beb48ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2791426 Reviewed-by: Javier Fernandez <[email protected]> Commit-Queue: Oriol Brufau <[email protected]> Cr-Commit-Position: refs/heads/master@{#867283} -- wpt-commits: 4fb0b5be59092eecdb9ef0cd03180f2f9a423f1d wpt-pr: 28291
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this issue
Apr 7, 2021
…nsic-sizes-002.html, a=testonly Automatic update from web-platform-tests [css-grid] Fix WPT grid-flex-track-intrinsic-sizes-002.html This test was checking that grid items not spanning any flex track with an intrinsic min track sizing function would distribute its intrinsic contribution in $11.5.3. That was according to the resolution from w3c/csswg-drafts#3705 However, that wasn't web compatible, so it was later amended in w3c/csswg-drafts#4783 Now, the intrinsic contributions of items spanning flex tracks must be distributed in $11.5.4, even if none of the flex tracks is intrinsic. This change makes the test pass in GridNG. Bug: 1045599 Change-Id: Ibfb818dcc12a185e30d2824e9ca534069beb48ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2791426 Reviewed-by: Javier Fernandez <[email protected]> Commit-Queue: Oriol Brufau <[email protected]> Cr-Commit-Position: refs/heads/master@{#867283} -- wpt-commits: 4fb0b5be59092eecdb9ef0cd03180f2f9a423f1d wpt-pr: 28291
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this issue
Apr 8, 2021
…nsic-sizes-002.html, a=testonly Automatic update from web-platform-tests [css-grid] Fix WPT grid-flex-track-intrinsic-sizes-002.html This test was checking that grid items not spanning any flex track with an intrinsic min track sizing function would distribute its intrinsic contribution in $11.5.3. That was according to the resolution from w3c/csswg-drafts#3705 However, that wasn't web compatible, so it was later amended in w3c/csswg-drafts#4783 Now, the intrinsic contributions of items spanning flex tracks must be distributed in $11.5.4, even if none of the flex tracks is intrinsic. This change makes the test pass in GridNG. Bug: 1045599 Change-Id: Ibfb818dcc12a185e30d2824e9ca534069beb48ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2791426 Reviewed-by: Javier Fernandez <[email protected]> Commit-Queue: Oriol Brufau <[email protected]> Cr-Commit-Position: refs/heads/master@{#867283} -- wpt-commits: 4fb0b5be59092eecdb9ef0cd03180f2f9a423f1d wpt-pr: 28291
mjfroman
pushed a commit
to mjfroman/moz-libwebrtc-third-party
that referenced
this issue
Oct 14, 2022
This test was checking that grid items not spanning any flex track with an intrinsic min track sizing function would distribute its intrinsic contribution in $11.5.3. That was according to the resolution from w3c/csswg-drafts#3705 However, that wasn't web compatible, so it was later amended in w3c/csswg-drafts#4783 Now, the intrinsic contributions of items spanning flex tracks must be distributed in $11.5.4, even if none of the flex tracks is intrinsic. This change makes the test pass in GridNG. Bug: 1045599 Change-Id: Ibfb818dcc12a185e30d2824e9ca534069beb48ec Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2791426 Reviewed-by: Javier Fernandez <[email protected]> Commit-Queue: Oriol Brufau <[email protected]> Cr-Commit-Position: refs/heads/master@{#867283} GitOrigin-RevId: 762ea1b8feb239644f4c1073af42fc639959a6f6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://drafts.csswg.org/css-grid/#min-size-auto says
In fact this is not correct. I agree that clamping by the sum of max track sizes seems a good heuristic, but not doing so wouldn't force the item to overflow its fixed-size grid area. That's because the content-based minimum size is only used when an item spans a track with an
auto
min track size, and if all spanned tracks have a fixed max track sizes then they are not flexible. Therefore, https://drafts.csswg.org/css-grid/#algo-spanning-items ensures the sum of the spanned track sizes will at least be the minimum contribution of the item, which is greater or equal than the outer size given by the minimum size. So not clamping would just imply that both the item and the tracks it spans would be larger, but no overflow.So the paradox is that when there is clamping, it's not actually needed to prevent overflow; but when there is no clamping because some track doesn't have a fixed max size, then the automatic minimum size may force a grid item to become bigger than the tracks it spans.
Basically, this happens when
auto
minimum, thus triggering the automatic minimum size to be the content-based minimum sizeExample: https://jsfiddle.net/jLfwga63/
The automatic minimum width is 100px, but both columns are 0px wide, so the item is forced to overflow. This seems bad, in order to prevent it, consider dropping
at least in case all spanned flexible tracks have a fixed min track sizing function.
The text was updated successfully, but these errors were encountered: