Closed Bug 1696560 Opened 4 years ago Closed 3 years ago

Flex item's min size doesn't transfer to the opposite axis though aspect-ratio

Categories

(Core :: Layout, defect)

defect

Tracking

()

VERIFIED FIXED
101 Branch
Tracking Status
firefox101 --- verified

People

(Reporter: TYLin, Assigned: boris)

References

(Blocks 1 open bug, )

Details

Attachments

(2 files, 2 obsolete files)

Load the attached testcase.

Google Chrome has the flex item of size 100x100, where we have 0x100.

I suppose the flex item's min-height:100px should be transferred to the inline axis through aspect-ratio per https://drafts.csswg.org/css-sizing-4/#aspect-ratio-size-transfers

Assignee: nobody → boris.chiou

So we can reuse this function in the next patch.

nsIFrame::ComputeSize() skip this case for flex items if the main axis
is the inline axis. Basically, flex items ignore their min & max sizing
properties in nsIFrame::ComputeSize() and we apply them later in the
flex reflow algorithm. Therefore, we also have to apply the transferred
min/max sizes together with its min & max sizing properties.

Basically, the transferred min & max sizes shouldn't override the min &
max sizing properties, so applying it earilier than these properties
should be identical. This just makes the flex base size ane main size be
more correct at the beginning (and so other adjustments of min/max sizes
in flex algorithm should override the transferred min/max sizes).

Based on https://github.com/w3c/csswg-drafts/issues/6071#issuecomment-801338121:

So after discussing with fantasai, the css-sizing-4 transferred min/max size text should not apply in flexbox/grid. Instead, only the sizing inside those specs should apply.

Chrome and Safari still apply the transferred min/max size, but looks like we may not have to do this based on the spec issue comment.

Attachment #9273524 - Attachment description: Bug 1696560 - Apply transferred min/max sizes for flex item at the beginning even if the main axis is the inline axis. → Bug 1696560 - Apply transferred min & max sizes for flex base size if the main axis is the inline axis.
Attachment #9273516 - Attachment is obsolete: true
Attachment #9273517 - Attachment is obsolete: true
Attachment #9273524 - Attachment description: Bug 1696560 - Apply transferred min & max sizes for flex base size if the main axis is the inline axis. → Bug 1696560 - Apply transferred min & max sizes for flex base size if main is the inline axis.
Pushed by bchiou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/aa9e91285699 Apply transferred min & max sizes for flex base size if main is the inline axis. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/33799 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-101b-p2]

Reproducible on Firefox 100.0(20220428192727) on Windows 10 64-bits. Verified as fixed on Firefox 101.0b8(20220517185920) and Nightly 102.0a1(20220518214245) on Windown 10 64-bits, macOS 11 and Ubuntu 20.04

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-101b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: