-
Notifications
You must be signed in to change notification settings - Fork 669
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-flexbox] Should fully inflexible item have definite height even with min-height: auto? #4305
Comments
Yes, because of https://www.w3.org/TR/css-flexbox-1/#min-size-auto
Although maybe “by definition” isn't quite correct phrasing for the note anymore... |
Test case demonstrating the behavior: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/9405 <!DOCTYPE html>
<div style="display: flex; flex-flow: column; border: thick dotted; height: 150px;">
<span style="border: thick solid; flex: 0 0 1em;">
<div style="float: right; height: 50%; background: orange;">foo</div>
foo<br>foo<br>foo<br>foo<br>foo<br>foo
</span>
</div> The % on the float does resolve against the height of the flex item, despite that height being boosted by the min-height:auto specifically. |
@cbiesinger Does this answer your question, or do you think we need to dig into this more? |
Not cbiesinger, but still confused :)
<!DOCTYPE html>
<div style="display: flex; flex-flow: column; border: thick dotted;">
<div style="display: flex; flex: 0 0 10px; border: 2px dotted blue;" id=should-my-children-stretch-to-my-definite-height>
<...some flex items...>
</div>
</div> |
Closing since #4311 was closed, and is a dupe of this issue. |
Not technically a dupe but that resolution does resolve this one, thanks |
Another flex-specific definiteness exception was recently added[1]. Now the item's child's %height can resolve in this case. <div style="display: flex; flex-direction: column;"> <div style="flex: 1 1 100px;"> <div style="height: 100%"></div> </div> </div> The %height used to not be allowed to resolve because the item's min-height:auto required a layout to determine the height of the item. Normally if you need a layout to find a size, you consider the size to be indefinite. But we're making an exception for layouts done just for min-height:auto when the item has a definite flex-basis. This CL makes more cases definite. A follow-up CL will change other cases from definite to indefinite. See https://crbug.com/1255340 [1] w3c/csswg-drafts#4305 Fixed: 961902 Change-Id: I3fadb99a3cba7174a87e5e9a165526d2c5a369d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3200406 Commit-Queue: David Grogan <dgrogan@chromium.org> Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/main@{#929607}
Another flex-specific definiteness exception was recently added[1]. Now the item's child's %height can resolve in this case. <div style="display: flex; flex-direction: column;"> <div style="flex: 1 1 100px;"> <div style="height: 100%"></div> </div> </div> The %height used to not be allowed to resolve because the item's min-height:auto required a layout to determine the height of the item. Normally if you need a layout to find a size, you consider the size to be indefinite. But we're making an exception for layouts done just for min-height:auto when the item has a definite flex-basis. This CL makes more cases definite. A follow-up CL will change other cases from definite to indefinite. See https://crbug.com/1255340 [1] w3c/csswg-drafts#4305 Fixed: 961902 Change-Id: I3fadb99a3cba7174a87e5e9a165526d2c5a369d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3200406 Commit-Queue: David Grogan <dgrogan@chromium.org> Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/main@{#929607} NOKEYCHECK=True GitOrigin-RevId: 38061e3cf018dc77d8798516ec389aabf636b882
https://drafts.csswg.org/css-flexbox/#definite-sizes says:
However, with min-height: auto, such an item may well require layout to determine its size (in a column flexbox where the item has
height: auto; flex: 0 0 100px;
). Should its size still be considered definite?cc @dholbert @fantasai @tabatkins
The text was updated successfully, but these errors were encountered: