diff options
author | Delan Azabani <dazabani@igalia.com> | 2025-03-06 02:47:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-05 18:47:13 +0000 |
commit | 69e749947910480e97ffaf22031316ebe7f67b9c (patch) | |
tree | 27e3a28bf12adbae06221e9219b60aaa356e94db /components/webdriver_server/actions.rs | |
parent | 16aeeaec85ec1eef985224fae8f38aa31f0eb22b (diff) | |
download | servo-69e749947910480e97ffaf22031316ebe7f67b9c.tar.gz servo-69e749947910480e97ffaf22031316ebe7f67b9c.zip |
compositor: Make input event handling per-WebView (#35716)
This is another step in the move to having a per-WebView renderer. In
this step event handling is made per-WebView. Most events sent to Servo
are sent via the WebView API already, so this just moves more event
handling code to the per-WebView render portion of the compositor.
- ServoRenderer is given shared ownership and interior mutability as
it is now shared among all WebView(Renderers).
- Some messages coming from other parts of Servo must now carry a
WebViewId as well so that they can be associated with a particular
WebView.
- There needs to be some reorganization of `ServoRenderer` in order to
avoid issues with double borrow of `RefCells`.
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/webdriver_server/actions.rs')
-rw-r--r-- | components/webdriver_server/actions.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/webdriver_server/actions.rs b/components/webdriver_server/actions.rs index 8e3f6751101..0c5f24cac85 100644 --- a/components/webdriver_server/actions.rs +++ b/components/webdriver_server/actions.rs @@ -279,6 +279,7 @@ impl Handler { let button = (action.button as u16).into(); let cmd_msg = WebDriverCommandMsg::MouseButtonAction( + session.top_level_browsing_context_id, MouseButtonAction::Down, button, pointer_input_state.x as f32, @@ -325,6 +326,7 @@ impl Handler { let button = (action.button as u16).into(); let cmd_msg = WebDriverCommandMsg::MouseButtonAction( + session.top_level_browsing_context_id, MouseButtonAction::Up, button, pointer_input_state.x as f32, @@ -469,7 +471,11 @@ impl Handler { // Step 7 if x != current_x || y != current_y { // Step 7.2 - let cmd_msg = WebDriverCommandMsg::MouseMoveAction(x as f32, y as f32); + let cmd_msg = WebDriverCommandMsg::MouseMoveAction( + session.top_level_browsing_context_id, + x as f32, + y as f32, + ); self.constellation_chan .send(ConstellationMsg::WebDriverCommand(cmd_msg)) .unwrap(); |