webdriver: improve perform pointermove & wheel actions with more accurate coordinates (#38095)

1. Create `get_origin_relative_coordinates` according to
[spec](https://w3c.github.io/webdriver/#dfn-get-coordinates-relative-to-an-origin)
to be reused
2. Add previously missing offset for PointerOrigin::Element
3. Refactor code for perform pointermove/wheel to be closer to spec.
4. Handle some issues with spec:
https://github.com/w3c/webdriver/issues/1758

Testing: Several new passing cases as we are more precise with
coordinates now.
Fixes: Part of #38042.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
Euclid Ye 2025-07-16 10:03:34 +08:00 committed by GitHub
parent 189e649222
commit 2e3c280f46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 128 additions and 79 deletions

View file

@ -560,7 +560,7 @@ impl App {
ScrollLocation::Delta(Vector2D::new(dx as f32, dy as f32));
webview.notify_input_event(
InputEvent::Wheel(WheelEvent::new(delta, point))
InputEvent::Wheel(WheelEvent::new(delta, point.to_f32()))
.with_webdriver_message_id(webdriver_message_id),
);