-
Notifications
You must be signed in to change notification settings - Fork 715
[css-flexbox-1] Intrinsic size of single line flexbox. #12123
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
Comments
I'm not entirely sure this should be considered a bug. According to 10.7. Minimum and maximum heights: min-height and max-height:
In your initial example, it seems that the |
https://drafts.csswg.org/css-flexbox-1/#intrinsic-cross-sizes
But that's not the minimum that Blink is using, since here the container gets an inner height of 80px, not 50px: <!DOCTYPE html>
<div style="display: flex; min-height: min-content; height: 10px; border: solid 3px; place-items: baseline; line-height: 20px">
<div style="background: lime; min-height: 50px">hi there</div>
<div style="background: magenta; min-height: 50px; align-content: end">hi there</div>
</div> CSS Grid adds a shim, but I'm not seeing that in the flexbox spec. So apparently Blink is using the height of the line, instead of just taking the largest contribution among the items. |
Blink has this behavior which seems weird to me: <!DOCTYPE html>
<div style="display: flex; min-height: min-content; height: 10px; border: solid 3px;">
<div style="background: lime; height: 50px;">hi there</div>
</div>
<div style="display: flex; min-height: min-content; height: 10px; border: solid 3px;">
<div style="background: lime;">hi there</div>
</div> |
Intrinsic sizing keywords weren't working correctly on the min and max block sizes of a flex container, because we weren't setting the `CacheableLayoutResult::content_block_size` to the right value. This also ensures that `align-content` aligns within the final size of the container. Note it's not very clear what to do for single-line containers, they are being discussed in w3c/csswg-drafts#12123 Testing: Adding new WPT tests. There are still some failures, but most subtests would fail without this change. Fixes: #36981 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Yeah that falls out of the fact that the available-block-size etc. is definite when measuring (which isn't true for multi-line flexboxes for example). I'm not sure we can change that given how compat constrained we are with flexbox these days. |
Take the following example:
https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=13717
The initial block-size of the flexbox is
10px
. Because this is a single line, the flex-line size becomes 10px, and hence thats the intrinsic-size.As per:
https://drafts.csswg.org/css-flexbox-1/#algo-cross-line
In Blink we had a unintentional bug where we'd re-compute the block-size with the intrinsic size of the line. (Resulting in 50px in the line above).
However this bug does provide a better behaviour.
Note we have compat on a very simlar case wrt. aspect-ratio:
E.g. the min-height is intrinsic, and we all recompute the initial block-size based on this.
The text was updated successfully, but these errors were encountered: