Closed Bug 2095252 Opened 15 days ago Closed 13 days ago

[wpt-sync] Sync PR 65065 - layout: Round scroll area requests correctly so fractional offset does not result in incorrect result

Categories

(Core :: DOM: CSS Object Model, task, P4)

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 65065 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/65065
Details from upstream follow.

Jacob MacKenzie <jacobmacweb@proton.me> wrote:

layout: Round scroll area requests correctly so fractional offset does not result in incorrect result

Currently, scrollHeight on the JS side is retrieved (through a chain of calls) from a Rect that is rounded incorrectly. This causes inconsistencies with other engines - and unexpected values (only off by one px, though). This means scrollHeight and clientHeight can differ just due to the position of the measured node.

This changes that, to round origin and size independently so a fractional offset of the node does not result in inconsistent rounding of the scroll area.

Old behaviour:
<img width="2545" height="606" alt="image" src="https://github.com/user-attachments/assets/1e395735-9d73-44c2-95e9-297d9a2375ad" />

New behaviour:
<img width="1477" height="236" alt="image" src="https://github.com/user-attachments/assets/14801a06-f41f-491b-9225-d5a72f3c3d0e" />

Testing: WPT run locally, passing where expected. New scrollWidthHeight-subpixel-position.tentative.html to test this case specifically, and its linked to https://github.com/w3c/csswg-drafts/issues/9866 which covers a similar discussion. I can confirm the test fails on main (20/36 fail) and passes on my branch.
Fixes: #<!-- nolink -->49802

Related Zulip: #general > Need opinions on issue posted on scrollHeight (issue linked)

Reviewed in servo/servo#49839

Component: web-platform-tests → DOM: CSS Object Model
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 36 subtests

Status Summary

Firefox

OK : 1
PASS: 36

Chrome

OK : 1
PASS: 36

Safari

OK : 1
PASS: 36

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e07bf39d2504 https://hg.mozilla.org/integration/autoland/rev/498983655af1 [wpt PR 65065] - layout: Round scroll area requests correctly so fractional offset does not result in incorrect result, a=testonly
Status: NEW → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.