Dispatch WebDriver scroll actions as PanGestureInput
Categories
(Core :: Panning and Zooming, defect, P3)
Tracking
()
People
(Reporter: ajakobi, Unassigned)
Details
Attachments
(1 file)
| Reporter | ||
Comment 1•3 months ago
|
||
Updated•3 months ago
|
Comment 2•3 months ago
|
||
Note for future references: A big difference whether to use pan gestures or wheel is in the case of using pan gestures, every scroll action triggered by WebDriver ends with a pan-end event which immediately trigger scroll-snap. Whereas in the case of using wheel, there's no immediate scroll snap trigger. This difference is observable on some scroll snap wpts.
IIRC, each wheel action triggered by WebDriver will end the wheel transaction, so it may be possible that if we do scroll-snap on the end of the wheel transaction, it may also fix unrelated-gesture-scroll-during-snap.html failure and wheel event will never trigger overscroll so that we can avoid bug 2039210. I think it's worth a shot.
Updated•3 months ago
|
Comment 3•3 months ago
|
||
Changing the scrolling behavior for wheel actions of WebDriver by eg. adding new logic would as well require specification work. So we cannot easily use the pan gestures. As I saw the test this bug was going to fix will now be fixed separately, so this proposed change is not immediately necessary, right?
Would you propose to get it added in the future to customize the scroll? I actually wonder if a better way would be to have a scroll action for pointer input sources (mouse, touch) and can be differentiated that way given that pan gestures sounds like related to touch devices.
Comment 4•3 months ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #3)
Changing the scrolling behavior for wheel actions of WebDriver by eg. adding new logic would as well require specification work. So we cannot easily use the pan gestures. As I saw the test this bug was going to fix will now be fixed separately, so this proposed change is not immediately necessary, right?
That's right.
Would you propose to get it added in the future to customize the scroll? I actually wonder if a better way would be to have a
scrollaction for pointer input sources (mouse, touch) and can be differentiated that way given that pan gestures sounds like related to touch devices.
Though the spec doesn't yet clear mention it, both Safari and Chrome use pan gestures, not wheel. So we will end up aligning our behavior to theirs.
Comment 5•2 months ago
|
||
Hm, so I've used the following wdspec test locally which passed for me in Chrome, so it emits wheel events and no touch events:
@parametrize_deltas
def test_scroll_dispatches_wheel_not_touch_events(
session, test_actions_scroll_page, wheel_chain, delta_x, delta_y
):
target = session.find.css("#scrollable", all=False)
session.execute_script("""
const el = arguments[0];
for (const type of ["touchstart", "touchmove", "touchend"]) {
el.addEventListener(type, event => {
allEvents.events.push({
type: event.type,
target: event.target.id || event.target.localName,
});
});
}
""", args=(target,))
wheel_chain.scroll(0, 0, delta_x, delta_y, origin=target).perform()
events = wait_for_events(session, 2)
for event in events:
assert event["type"] != "touchstart"
assert event["type"] != "touchmove"
assert event["type"] != "touchend"
assert events[0]["type"] == "wheel"
Hiro, did I miss something specific to test or how could I actually verify the broken behavior in Chrome with a wdspec test?
Comment 6•2 months ago
|
||
Pan means here is two fingers scrolling on touchpad, it's not related to touch screen inputs at all.
Comment 7•2 months ago
|
||
But how to check that? The before-mentioned pan-end event seems to be something Gecko internal that I cannot use for a wdspec test.
| Reporter | ||
Updated•2 months ago
|
Comment 8•2 months ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #7)
But how to check that? The before-mentioned
pan-endevent seems to be something Gecko internal that I cannot use for a wdspec test.
Hiro, can you please help with identifying the difference in a webdriver test? What exactly would we have to check? I would like to report it on the Chrome side but would need a validation test for it first. Thanks.
Comment 9•2 months ago
|
||
So basically a big difference between pan gestures and mouse wheels is that pan gestures causes overscrolling, but mouse wheel don't.
That's being said, historically in Gecko WebDriver's scroll action causes overscrolling regardless whether the input is wheel or pan.
Moreover as of now none of the major browser engines doesn't handle pan gestures as relative scrolling, thus right now we can differentiate pan gestures and mouse wheels in some kind of wpts, but it will not work since all browsers implemented issues/12840.
So I'd say we can differentiate them by checking overscroll state, but we can't do it right now.
Comment 10•2 months ago
|
||
Removing bug 2015367 from the blockers since bug 2015367 has been already resolved.
Description
•