Closed Bug 1654044 Opened 4 years ago Closed 3 years ago

Firefox incorrectly treats flex items' heights as definite if they have `overflow: {scroll, hidden,auto}`, in vertical indefinite-height flex container

Categories

(Core :: Layout: Flexbox, defect, P3)

defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: dholbert, Assigned: TYLin)

References

Details

Attachments

(2 files)

Attached file testcase 1

STR:

  1. Load attached testcase.

EXPECTED RESULTS:
No orange in any of the subtests (aside from the scrollbar tracks in the middle two subtests, which might show orange)

ACTUAL RESULTS:
The first three subtests are orange on their bottom half.

This indicates that we're treating the flex item's resolved main-size (height) as "definite" in these overflow:{hidden,auto,scroll} cases (but not in the fourth case, where the flex item has overflow:visible).

It seems we're misapplying "point 2" from https://drafts.csswg.org/css-flexbox-1/#definite-sizes here (inadvertently); the flex container has an indefinite height, so we shouldn't be promoting the flex items' main size to be definite.

Chrome gives EXPECTED RESULTS.

I suspect the issue here is that we're failing to propagate mTreatBSizeAsIndefinite through to the scrolled frame, or something like that.

(CC'ing TYLin in case he's interested in taking a look.)

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

This bug affects YouTube reported in bug 1723448.

(In reply to Ting-Yu Lin [:TYLin] (UTC-7) from comment #5)

This bug affects YouTube reported in bug 1723448.

Given this^, it might be worth nominating this for uplift to beta during the "early beta" period, after it's landed and baked on Nightly for a few days.

(In the pretty-unlikely scenario that it causes some unforeseen layout breakage, and we have to rethink this somehow, then of course it'd be extremely easy & safe to back out from beta at that point, since it's just a single line of code. So: relatively high reward & low risk.)

Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/341b95ccba1f Carry mTreatBSizeAsIndefinite flag from scroll frame to scrolled inner frame (-moz-scrolled-content). r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/29975 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
Upstream PR merged by moz-wptsync-bot

(In reply to Daniel Holbert [:dholbert] from comment #7)

(In reply to Ting-Yu Lin [:TYLin] (UTC-7) from comment #5)

This bug affects YouTube reported in bug 1723448.

Given this^, it might be worth nominating this for uplift to beta during the "early beta" period, after it's landed and baked on Nightly for a few days.

Per bug 1723448 comment 7, Youtube seems changed to workaround this bug, so we don't have the pressure to uplift my patch unless we get another webcompat report.

Regressions: 1739048
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: