From e4f370549410a2ebc5bc4a3044a222981764411c Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Wed, 24 Sep 2025 19:06:32 +0200 Subject: [PATCH] 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 --- ports/servoshell/desktop/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/servoshell/desktop/app.rs b/ports/servoshell/desktop/app.rs index 3a22daa15a3..1cbd6cb8289 100644 --- a/ports/servoshell/desktop/app.rs +++ b/ports/servoshell/desktop/app.rs @@ -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), );