Closed Bug 1578586 Opened 5 years ago Closed 5 years ago

Don't apply percent-height ancestor-resolution quirk to percentages inside of a flex item or grid item

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(2 files)

Attached file testcase 1

For flex items with indefinite heights and percent-height children, we currently can trigger a quirks-mode-only behavior where the percent height children will walk up the tree until they find a frame to resolve their percentage against[1] (which in this case will probably be the flex container frame since it's their first non-block ancestor, and CalcQuirkContainingBlockHeight stops when it hits a frame whose type it doesn't recognize).[2]

This behavior is "for compatibility with IE", but IE doesn't properly support modern flexbox and is not a relevant compat target these days. The more relevant compat target is Chrome, which does not have this quirky behavior on percentages inside of an indefinite-height flex or grid item (the second and third cases in the attached testcase).

We should avoid applying this quirk for flex and grid items. Right now we end up resolving the percent for other reasons (which is bug 1092007 at least in flexbox), but we should fix this here as well to avoid the percent continuing to have some quirks-mode-specific resolution behavior.

[1] https://searchfox.org/mozilla-central/rev/9bb55ae4d808fc48afcf93f99da6a685265b86c6/layout/generic/ReflowInput.cpp#2132-2144
[2] https://searchfox.org/mozilla-central/rev/9bb55ae4d808fc48afcf93f99da6a685265b86c6/layout/generic/ReflowInput.cpp#1981-1983
[3] https://searchfox.org/mozilla-central/rev/9bb55ae4d808fc48afcf93f99da6a685265b86c6/layout/generic/ReflowInput.cpp#1983-1984

See Also: → 1429654
Attachment #9090246 - Attachment description: Bug 1578586: Don't let the "percentages-can-resolve-against-ancestor" quirk apply to percentages in flex/grid items. → Bug 1578586: Don't let the "percentages-can-resolve-against-ancestor" quirk apply to percentages in flex/grid items. r?mats

Sorry for the wait on addressing this suggested followup. (This was filed as an opportunistic fixup for a note that came up during bug 1092007's review, basically -- intended to fix it sooner but didn't consider it high-priority, and didn't end up getting to it as soon as I'd wanted.)

Patch posted for review, with a testcase based on the attached testcase (just asserting that the scenarios with grid/flex should look the same regardless of whether we're in quirks or standards mode).

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a4f6e5d0f330 Don't let the "percentages-can-resolve-against-ancestor" quirk apply to percentages in flex/grid items. r=mats
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/20354 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Upstream PR merged by moz-wptsync-bot
Blocks: 1616702
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: