Firefox uses central baseline when synthesizing a baseline from border-box of (orthogonal) vertical-writing-mode grid item
Categories
(Core :: Layout: Grid, defect)
Tracking
()
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(4 files)
STR:
EXPECTED RESULTS:
Text should be aligned with the bottom border-edge of the cyan box.
ACTUAL RESULTS:
The text is aligned with the center of the cyan box.
This is the remaining part of getting us to passing on the WPT in bug 1833486. I'm spinning it off to its own bug in case there's anything remaining there, and since it's kind of unrelated to what that WPT is focused on (which is subgrid stretch behavior).
I've stepped through in gdb and it looks like the root issue here happens when we get to this snippet
https://searchfox.org/mozilla-central/rev/008ce958417fd724e02748740d669aafd49debb3/layout/generic/nsGridContainerFrame.cpp#9673,9690,9702
if (aAxis == eLogicalAxisBlock) {
...
} else {
...
baseline = ::SynthesizeBaselineFromBorderBox(aGroup, childWM, size);
When we step into SynthesizeBaselineFromBorderBox, we see that childWM
is a vertical writing mode and we interpret that to mean that we should use a central baseline. But in fact that would only make sense if we were getting a baseline in the other axis. In this case we're getting a vertical baseline (i.e. a distance from the top of the page) which is in the opposite axis from the one where the child would use a central baseline.
Assignee | ||
Comment 1•6 months ago
•
|
||
Hmm, so swapping from childWM
to aCBWM
fixes the linked testcase (attachment 9369318 [details]) but it still doesn't fix the issue in https://wpt.fyi/results/css/css-grid/subgrid/subgrid-stretch.html
In particular, it looks like we're still broken if the grid item itself has display:grid
, so that's probably triggering a different codepath that needs a similar fix.
Assignee | ||
Comment 2•6 months ago
|
||
Assignee | ||
Updated•6 months ago
|
Assignee | ||
Comment 3•6 months ago
|
||
Updated•6 months ago
|
Updated•6 months ago
|
Assignee | ||
Comment 4•6 months ago
|
||
Depends on D196932
Assignee | ||
Comment 5•6 months ago
|
||
Depends on D196987
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bafa1b145894 part 1: When synthesizing a baseline from a grid item, don't bother with central baselines if we're getting a measurement in the item's inline axis. r=TYLin https://hg.mozilla.org/integration/autoland/rev/4713b1c806dd part 2: Add a WPT to check some grid synthesized baseline behavior. r=TYLin https://hg.mozilla.org/integration/autoland/rev/8319ba83d9cb part 3: Add a few variants of the WPT for grid synthesized baselines. r=TYLin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/43764 for changes under testing/web-platform/tests
Comment 8•6 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/bafa1b145894
https://hg.mozilla.org/mozilla-central/rev/4713b1c806dd
https://hg.mozilla.org/mozilla-central/rev/8319ba83d9cb
Upstream PR merged by moz-wptsync-bot
Updated•5 months ago
|
Comment 10•4 months ago
|
||
Reproducible on a 2023-12-18 Nightly build on macOS 12.
Verified as fixed on Firefox 123.0 and Firefox Nightly 124.0a1 on Windows 10, Ubuntu 22, macOS 12.
Description
•