aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/embedder
diff options
context:
space:
mode:
Diffstat (limited to 'components/shared/embedder')
-rw-r--r--components/shared/embedder/input_events.rs7
-rw-r--r--components/shared/embedder/webdriver.rs2
2 files changed, 6 insertions, 3 deletions
diff --git a/components/shared/embedder/input_events.rs b/components/shared/embedder/input_events.rs
index 0268be6dd9c..acaa9afb3ff 100644
--- a/components/shared/embedder/input_events.rs
+++ b/components/shared/embedder/input_events.rs
@@ -61,15 +61,16 @@ pub enum MouseButton {
Other(u16),
}
-impl From<u16> for MouseButton {
- fn from(value: u16) -> Self {
+impl<T: Into<u64>> From<T> for MouseButton {
+ fn from(value: T) -> Self {
+ let value = value.into();
match value {
0 => MouseButton::Left,
1 => MouseButton::Middle,
2 => MouseButton::Right,
3 => MouseButton::Back,
4 => MouseButton::Forward,
- _ => MouseButton::Other(value),
+ _ => MouseButton::Other(value as u16),
}
}
}
diff --git a/components/shared/embedder/webdriver.rs b/components/shared/embedder/webdriver.rs
index 9577163411e..3716a29951a 100644
--- a/components/shared/embedder/webdriver.rs
+++ b/components/shared/embedder/webdriver.rs
@@ -44,6 +44,8 @@ pub enum WebDriverCommandMsg {
MouseButtonAction(WebViewId, MouseButtonAction, MouseButton, f32, f32),
/// Act as if the mouse was moved in the browsing context with the given ID.
MouseMoveAction(WebViewId, f32, f32),
+ /// Act as if the mouse wheel is scrolled in the browsing context given the given ID.
+ WheelScrollAction(WebViewId, f32, f32, f64, f64),
/// Set the window size.
SetWindowSize(WebViewId, DeviceIntSize, IpcSender<Size2D<f32, CSSPixel>>),
/// Take a screenshot of the window.