Closed Bug 2049522 Opened 25 days ago Closed 24 days ago

test_bug1831148.html uses a fixed epsilon that fails at large scroll offsets when layout.disable-pixel-alignment is enabled

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox154 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(1 file)

When layout.disable-pixel-alignment is true (bug 2048146), test_bug1831148.html fails on macosx1500-aarch64 with errors like "scrollTop and BCR top match - got 9126261.199996948, expected 9126260 epsilon: +/- 1".

The test compares outer.scrollTop (a double) against a value derived from getBoundingClientRect(), whose coordinates are stored internally as 32-bit floats (CSSPoint). At the multi-million-pixel scroll offsets the test exercises, one float ULP already exceeds a CSS pixel, so the two values unavoidably diverge by an amount that grows with the coordinate magnitude. The fixed epsilon does not account for this, so the comparison fails once the divergence passes ~1px.

Fix: scale the epsilon with the float ULP at the compared magnitude.

Test dashboard: https://tests.firefox.dev/test.html?test=layout/generic/test/test_bug1831148.html

getBoundingClientRect() coordinates are stored internally as 32-bit floats
(CSSPoint), whereas scrollTop is reported as a double. At the multi-million-pixel
scroll offsets this test exercises, one float ULP exceeds a CSS pixel, so the two
values unavoidably diverge by an amount that grows with the coordinate magnitude.
The fixed epsilon did not account for this and failed once the divergence passed
~1px (exposed by enabling layout.disable-pixel-alignment in bug 2048146).

Scale the tolerance with the float ULP at the compared magnitude.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Pushed by hikezoe.birchill@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/88ac7f97eb06 https://hg.mozilla.org/integration/autoland/rev/404a9a858fe8 Scale test_bug1831148.html epsilon with float ULP at large scroll offsets. r=dshin,layout-reviewers
Status: ASSIGNED → RESOLVED
Closed: 24 days ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: