[webkit-changes] [WebKit/WebKit] 086f6c: [WebDriver] pointerevents/mouse-pointer-boundary-e...

Abrar Rahman Protyasha noreply at github.com
Wed Sep 4 20:16:16 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 086f6c0f2d059ee5c649f79a4c8d1ccf5c3e02cf
      https://github.com/WebKit/WebKit/commit/086f6c0f2d059ee5c649f79a4c8d1ccf5c3e02cf
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2024-09-04 (Wed, 04 Sep 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp

  Log Message:
  -----------
  [WebDriver] pointerevents/mouse-pointer-boundary-events-for-shadowdom.html WPT is failing through WebDriver, but not through WKTR
https://bugs.webkit.org/show_bug.cgi?id=274639
rdar://128668986

Reviewed by Wenson Hsieh.

The test in question fails because it dispatches a couple of pointer
move actions through the testdriver.js Actions() interface. The failure
mode indicates that the mouse cursor jumps back and forth to the origin
between subsequent pointer moves, which causes unexpected event dispatch
on the body.

Our automation state management interleaves the "Pause" state with the
"PointerMove" state in the simulated input source states we transition
our input source across. The pause is required as part of a pointer move
action, as specified in the WebDriver spec.

A "Pause" state has an (invalid) {0,0} location value associated with it,
so whenever we transition between pointer move actions, we transition
first to an intermediate "Pause" state, and the state location resolution
logic in SimulatedInputDispatcher::transitionInputSourceToState() treats
the “origin” location of a “Pause” state relative to the viewport. This
has the effect of our cursor jumping back and forth - during a pointer
move sequence - between the last pointer move location and the origin,
which is where the extra pointer events emitted on the body come from.

This patch addresses the issue by instead defaulting to a pointer origin
(not viewport origin) for state location resolution. For states where the
location matters, WebDriver _should_ be plumbing us the appropriate origin
to resolve against. When this origin is not provided, we can safely assume
that the location is not meaningful either, and resolve against a pointer
origin. This gets rid of the unexpected displacements for states with
meaningless locations.

* Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):

Canonical link: https://commits.webkit.org/283186@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list