servoshell: Scale WebDriver mouse button coordinates by HiDPI scale factor (#39472)

Mouse button events are sent in CSSPixel coordinates, but these need to
so they need to converted into device coordinates when creating an input
event for them. This isn't an issue for automated test because they
always use a scale factor of 1. This is a problem when running
interactively and not in headless mode.

Testing: This isn't really testable in an automated way, but is very
obviously
causes tests to pass when run with WebDriver and without headless mode.
Fixes: Part of #38087.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-09-24 19:06:32 +02:00 committed by GitHub
parent c15495b3e7
commit e4f3705494
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -522,7 +522,7 @@ impl App {
InputEvent::MouseButton(MouseButtonEvent::new(
mouse_event_type,
mouse_button,
Point2D::new(x, y),
Point2D::new(x, y) * webview.hidpi_scale_factor(),
))
.with_webdriver_message_id(webdriver_message_id),
);