diff options
Diffstat (limited to 'components/compositing/webview_renderer.rs')
-rw-r--r-- | components/compositing/webview_renderer.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/components/compositing/webview_renderer.rs b/components/compositing/webview_renderer.rs index 614ef0ff4c3..f76dc68013d 100644 --- a/components/compositing/webview_renderer.rs +++ b/components/compositing/webview_renderer.rs @@ -726,6 +726,22 @@ impl WebViewRenderer { })); } + /// Push scroll pending event when receiving wheel action from webdriver + pub(crate) fn on_webdriver_wheel_action( + &mut self, + scroll_delta: Vector2D<f32, DevicePixel>, + point: Point2D<f32, DevicePixel>, + ) { + if self.global.borrow().shutdown_state() != ShutdownState::NotShuttingDown { + return; + } + + let scroll_location = + ScrollLocation::Delta(LayoutVector2D::from_untyped(scroll_delta.to_untyped())); + let cursor = DeviceIntPoint::new(point.x as i32, point.y as i32); + self.on_scroll_window_event(scroll_location, cursor) + } + pub(crate) fn process_pending_scroll_events(&mut self, compositor: &mut IOCompositor) { if self.pending_scroll_zoom_events.is_empty() { return; |