Closed Bug 1815936 Opened 2 years ago Closed 2 years ago

Flexbox with `align-items: last baseline` has nonsensical results

Categories

(Core :: Layout: Flexbox, defect)

defect

Tracking

()

VERIFIED FIXED
112 Branch
Tracking Status
firefox112 --- verified
firefox113 --- verified

People

(Reporter: dshin, Assigned: dshin)

References

Details

Attachments

(2 files)

STR: Load attached test case
Expected: left side's black border box aligns with the flex container's bottom box
Actual: left side's box protrudes over the top of the flex container

We're calling GetNaturalBaselineBOffset which returns the baseline from the block end as origin, which is incompatible with the rest of the code which takes block start as the origin.

Assignee: nobody → dshin
Severity: -- → S3
Status: NEW → ASSIGNED

GetNaturalBaselineBOffset returns the offset originating from border-end for
last baselines.

Looks like the problematic code-snippet came from me in bug 1672640, btw. Adding a dependency.

(This isn't exactly a regression from that bug, because our layout was wrong before, too -- when I view this testcase in builds before bug 1672640's fix, we place the left box a little too far down, below the bottom of the right boxes. Hence, just using dependency flags.)

Depends on: 1672640
Pushed by dshin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3f46184524f1 In flexbox baseline calculation, ensure that the offset originates from border-start. r=dholbert

Backed out for causing wpt failures on flex-align-baseline-flex-001.html.

[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - TEST-PASS | /css/css-flexbox/alignment/flex-align-baseline-flex-001.html | .target > * 4 
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - TEST-FAIL | /css/css-flexbox/alignment/flex-align-baseline-flex-001.html | .target > * 5 - assert_equals: 
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - <div data-offset-y="35"><span></span></div>
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - offsetTop expected 35 but got 15
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - assert_tolerance@http://web-platform.test:8000/resources/check-layout-th.js:24:22
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - checkExpectedValues@http://web-platform.test:8000/resources/check-layout-th.js:87:25
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - checkSubtreeExpectedValues@http://web-platform.test:8000/resources/check-layout-th.js:7:44
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - window.checkLayout/</<@http://web-platform.test:8000/resources/check-layout-th.js:228:34
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2591:25
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - test@http://web-platform.test:8000/resources/testharness.js:628:30
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - window.checkLayout/<@http://web-platform.test:8000/resources/check-layout-th.js:221:13
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - window.checkLayout@http://web-platform.test:8000/resources/check-layout-th.js:220:29
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - onload@http://web-platform.test:8000/css/css-flexbox/alignment/flex-align-baseline-flex-001.html:1:12
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - TEST-PASS | /css/css-flexbox/alignment/flex-align-baseline-flex-001.html | .target > * 6 
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - TEST-UNEXPECTED-PASS | /css/css-flexbox/alignment/flex-align-baseline-flex-001.html | .target > * 7 - expected FAIL
[task 2023-02-17T19:26:17.125Z] 19:26:17     INFO - TEST-INFO | expected FAIL
[task 2023-02-17T19:26:17.129Z] 19:26:17     INFO - 
[task 2023-02-17T19:26:17.129Z] 19:26:17     INFO - TEST-PASS | /css/css-flexbox/alignment/flex-align-baseline-flex-001.html | .target > * 8 
Flags: needinfo?(dshin)
Flags: needinfo?(dshin)
Pushed by dshin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2a4e00d6502a In flexbox baseline calculation, ensure that the offset originates from border-start. r=dholbert
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
QA Whiteboard: [qa-112b-p2]

Reproducible on a 2023-02-20 Nightly build on Windows 10.
Verified as fixed on Firefox 112.0b7(build ID: 20230326180212) and Nightly 113.0a1(build ID: 20230327093043) on Windows 10, macOS 12, Ubuntu 22.

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

Attachment

General

Created:
Updated:
Size: