mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement wheel action in webdriver (#36744)
https://w3c.github.io/webdriver/#wheel-actions Test: `tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::{test_null_response_value,test_params_actions_origin_outside_viewport[element],test_params_actions_origin_outside_viewport[viewport]}, tests/wpt/tests/webdriver/tests/classic/perform_actions/perform.py` Fixes: https://github.com/servo/servo/issues/36720 cc: @xiaochengh @longvatrong111 @yezhizhen Signed-off-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com> Co-authored-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
This commit is contained in:
parent
f47e69c112
commit
eaf9224799
9 changed files with 255 additions and 51 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue