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•2 years 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•2 years ago
|
||
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 3•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 4•2 years ago
|
||
Depends on D196932
| Assignee | ||
Comment 5•2 years ago
|
||
Depends on D196987
Comment 8•2 years 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
Updated•2 years 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
•