Wheel scroll action fails for "deltaX" and "deltaY" properties on HiRes displays
Categories
(Remote Protocol :: Agent, defect, P1)
Tracking
(firefox118 fixed)
| Tracking | Status | |
|---|---|---|
| firefox118 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
Details
(Whiteboard: [webdriver:m8][wptsync upstream][webdriver:relnote])
Attachments
(1 external 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!
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 5•3 years ago
|
||
| bugherder | ||
Comment 9•3 years ago
|
||
| bugherder | ||
| Assignee | ||
Updated•3 years ago
|
Description
•