Skip to content

webdriver: Enable pointerMove to perform smooth transition over specified duration#42946

Merged
yezhizhen merged 5 commits intoservo:mainfrom
yezhizhen:fix-pending-moves
Mar 6, 2026
Merged

webdriver: Enable pointerMove to perform smooth transition over specified duration#42946
yezhizhen merged 5 commits intoservo:mainfrom
yezhizhen:fix-pending-moves

Conversation

@yezhizhen
Copy link
Copy Markdown
Member

@yezhizhen yezhizhen commented Mar 2, 2026

Enable pointerMove to perform a smooth transition over specified duration.

  • Sync move/scroll interval with default tick duraiton in testdriver:
    * @param {number} [defaultTickDuration] - The default duration of a
    * tick. Be default this is set ot 16ms, which is one frame time
    * based on 60Hz display.
    */
    function Actions(defaultTickDuration=16) {
  • Fully process all pending pointer moves within this tick. This is one of the conditions that is required to finish this tick. Previously, the pending move events might be processed in next Tick, if they have long duration.
before-fix.mp4
post-fix.mp4

Testing: Added a WPT test. I'm surprised it is not covered by existing tests, given the huge behaviour difference.
Fixes: #42950
Part of #41620

Signed-off-by: Euclid Ye <[email protected]>
Signed-off-by: Euclid Ye <[email protected]>
@yezhizhen yezhizhen requested a review from xiaochengh March 2, 2026 08:28
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 2, 2026
@yezhizhen yezhizhen changed the title webdriver: Process pending PointerMoves fully within this tick; Sync interval with defaultTickDuration webdriver: Process pending PointerMoves fully within this tick; Sync interval with testdriver defaultTickDuration Mar 2, 2026
@yezhizhen

This comment was marked as outdated.

@yezhizhen yezhizhen changed the title webdriver: Process pending PointerMoves fully within this tick; Sync interval with testdriver defaultTickDuration webdriver: Enable pointerMove to perform smooth transition over specified duration Mar 2, 2026
@yezhizhen
Copy link
Copy Markdown
Member Author

Adding a test. We can assert more than 10 mousemove, with changing coordinates.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#58169) with upstreamable changes.

@yezhizhen yezhizhen force-pushed the fix-pending-moves branch from 51d6993 to d0e2e19 Compare March 2, 2026 13:49
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#58169).

1 similar comment
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#58169).

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#58169) title and body.

2 similar comments
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#58169) title and body.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#58169) title and body.

@yezhizhen
Copy link
Copy Markdown
Member Author

Reported bug: SeleniumHQ/selenium#12736

Interesting. It seems chromedriver/safaridriver is not spec-compliant, and also blinks. They both only get 2 mousemove events eventually, failing the new test.
Safaridriver
Chromedriver

Copy link
Copy Markdown
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me, but I'll wait for the resolution of the issue with the test.

// asynchronously wait for an implementation defined amount of time to pass.

// Asynchronously wait means do not block browser to process event loop.
// In the context of Servo, it means block the webdriver server thread.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say:

Suggested change
// In the context of Servo, it means block the webdriver server thread.
// In the context of Servo, it means not blocking the webdriver server thread.

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. That's why we sleep the server thread right below.

// asynchronously wait for an implementation defined amount of time to pass.

// Asynchronously wait means do not block browser to process event loop.
// In the context of Servo, it means block the webdriver server thread.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// In the context of Servo, it means block the webdriver server thread.
// In the context of Servo, it means blocking the webdriver server thread.

@yezhizhen
Copy link
Copy Markdown
Member Author

yezhizhen commented Mar 3, 2026

Seems reasonable to me, but I'll wait for the resolution of the issue with the test.

I don't know who we can find to resolve this. The test seems fairly straightforward :(
The smooth move is part of spec, but only Firefox has implemented this.
And chromedriver team never responded: SeleniumHQ/selenium#12736

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Mar 4, 2026
@yezhizhen yezhizhen added this pull request to the merge queue Mar 6, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 6, 2026
Merged via the queue into servo:main with commit cab4416 Mar 6, 2026
33 checks passed
@yezhizhen yezhizhen deleted the fix-pending-moves branch March 6, 2026 02:36
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 6, 2026
github-merge-queue bot pushed a commit that referenced this pull request Mar 11, 2026
Scroll and PointerMove is quite similar. We did so for `PointeMove` in
#42289 +
#42946.

Imagine having 3 non-zero duration scroll actions with origin at
different Elements.
Previously we would wait for one to be fully dispatched before moving to
next action,
instead of interspersed.

We also consolidate `PendingPointerMove` and
newly added `PendingScroll` into `enum PendingActions`.

Testing: 
[Existing tests behaviour not
changing.](https://github.com/servo/servo/actions/runs/22887005716).
Added a wdspec test.
Previously: `['wheel', 'wheel', 'wheel', 'wheel', 'wheel', 'wheel',
'wheel', 'wheel', 'wheel', 'move']`
Now: `['wheel', 'move', 'wheel', 'move', 'wheel', 'move', 'move',
'wheel', 'wheel', 'move', 'move', 'wheel', 'wheel', 'move', 'move',
'wheel']`

---------

Signed-off-by: Euclid Ye <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PointerMove with long duration blinks to the target position if action sequence only have one tick

4 participants