Closed Bug 1849229 Opened 7 months ago Closed 7 months ago

Wheel scroll action fails for "deltaX" and "deltaY" properties on HiRes displays

Categories

(Remote Protocol :: Agent, defect, P1)

defect
Points:
1

Tracking

(firefox118 fixed)

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m8][wptsync upstream][webdriver:relnote])

Attachments

(1 file)

As noticed today our WebDriver implementation for dispatch a scroll action fails when the test is executed from a machine that uses a HiRes display like a MacBook Pro. Here the device pixel ratio is set to 2 and as such 1 CSS pixel correlates to 2 device pixels.

This can easily be reproduced by Marionette once the patch on bug 1849227 will be available. For now here the log output of the test failure that I can see:

1692277067552	Marionette	DEBUG	3 -> [0,5,"WebDriver:PerformActions",{"actions":[{"type":"wheel","id":"id","actions":[{"type":"scroll","x":0,"y":0,"deltaX":5,"deltaY":10,"duration":0,"origin":{"element-6066-11e4-a52e-4f735466cecf":"792a2ba9-896b-4a33-86ac-8b6eb678c6a9"}}]}]}]
1692277067560	Marionette	TRACE	Dispatching tick 1/1
1692277067560	Marionette	TRACE	Dispatch WheelScrollAction with id: id deltaX: 5 deltaY: 10
1692277067561	Marionette	TRACE	moveOverTime start: 0,0 target: 5,10 duration: 0
1692277067570	Marionette	DEBUG	3 <- [1,5,null,{"value":null}]
1692277067571	Marionette	DEBUG	3 -> [0,6,"WebDriver:ExecuteScript",{"script":"return allEvents.events;","args":[],"newSandbox":true,"sandbox":null,"line":138,"filename":"_a/test_minimized.py"}]
1692277067573	Marionette	DEBUG	3 <- [1,6,null,{"value":[{"type":"wheel","button":0,"buttons":0,"deltaX":2.5,"deltaY":5,"deltaZ":0,"deltaMode":0,"target":"outer"}]}]

The caught scroll event has only a delta of 2.5/5 instead of 5/10.

A test like that works fine with wpt because the harness sets layout.css.devPixelsPerPx to 1.

Emilio, as it looks like we will have to convert the CSS pixels that WebDriver expects to device pixels. I assume the best option here is to use the window.devicePixelRatio value? Or should we use something else? Thanks!

Component: Marionette → Agent
Assignee: nobody → hskupin
Severity: -- → S3
Status: NEW → ASSIGNED
Points: --- → 1
Priority: -- → P1
Whiteboard: [webdriver:m8]
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4ade93d36333
[remote] Convert delta values for wheel scroll actions from CSS to device pixels. r=webdriver-reviewers,jdescottes
Failed to create upstream wpt PR due to merge conflicts. This requires fixup from a wpt sync admin.
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Whiteboard: [webdriver:m8] → [webdriver:m8], [wptsync upstream error]
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41563 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m8], [wptsync upstream error] → [webdriver:m8], [wptsync upstream]
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Upstream PR was closed without merging
Upstream PR merged by sideshowbarker
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7f21aa1284eb
[wpt PR 41563] - [Gecko Bug 1849229] [remote] Convert delta values for wheel scroll actions from CSS to device pixels., a=testonly
Whiteboard: [webdriver:m8], [wptsync upstream] → [webdriver:m8][wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.