[css-flex] Don't allow items' heights to affect intrinsic block sizes #27183
Conversation
The review process for this patch is being conducted in the Chromium project. |
Blink currently makes this flex item 200px tall. Firefox gives it the correct height of 100px. <div style="display: flex; flex-direction: column"> <div style="flex-basis: 100px; height: 200px"> <div style="height: 100%"> Blink was letting the inner div's height resolve against the flex item's 200px, giving the flex item an automatic minimum size of 200px, even though the min-content size is supposed to be calculated with the item having an 'auto' size. Meaning we should ignore the item's 200px height. To keep the 200px from having an effect, this patch broadens the definition of ConstraintSpace().IsFixedBlockSizeDefinite. It no longer has to accompany a FixedBlockSize. It now means that the element is to be laid out as if it has an auto height. Flexbox now sets this constraint on items when the flexbox needs the item's intrinsic block size. Bug: 1033476 Change-Id: I74feb5a0dc0c4ae6e4a5eb2e01496992b23cc552
7637334
to
4f35551
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Blink currently makes this flex item 200px tall. Firefox gives it the
correct height of 100px.
<div style="display: flex; flex-direction: column">
<div style="flex-basis: 100px; height: 200px">
<div style="height: 100%">
Blink was letting the inner div's height resolve against the flex item's
200px, giving the flex item an automatic minimum size of 200px, even
though the min-content size is supposed to be calculated with the item
having an 'auto' size. Meaning we should ignore the item's 200px height.
To keep the 200px from having an effect, this patch broadens the
definition of ConstraintSpace().IsFixedBlockSizeDefinite. It no longer
has to accompany a FixedBlockSize. It now means that the element is to
be laid out as if it has an auto height.
Flexbox now sets this constraint on items when the flexbox needs the
item's intrinsic block size.
Bug: 1033476
Change-Id: I74feb5a0dc0c4ae6e4a5eb2e01496992b23cc552
Reviewed-on: https://chromium-review.googlesource.com/2613485
WPT-Export-Revision: 74f225f0fdeb3a6a3d599806ca7d341bf690bd29