mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
libservo: Remove TouchEventType
argument from WebView::notify_scroll_event
(#37588)
The compositor always does the same thing with these events regardless of the phase, so I think it is completely unecessary. Testing: This shouldn't change behavior at all, so is covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
ce4da2bf97
commit
80a7de8c9c
7 changed files with 26 additions and 55 deletions
|
@ -19,7 +19,7 @@ use servo::webrender_api::units::{DeviceIntPoint, DeviceIntSize};
|
|||
use servo::{
|
||||
AllowOrDenyRequest, AuthenticationRequest, FilterPattern, FormControl, GamepadHapticEffectType,
|
||||
KeyboardEvent, LoadStatus, PermissionRequest, Servo, ServoDelegate, ServoError, SimpleDialog,
|
||||
TouchEventType, WebDriverCommandMsg, WebView, WebViewBuilder, WebViewDelegate,
|
||||
WebDriverCommandMsg, WebView, WebViewBuilder, WebViewDelegate,
|
||||
};
|
||||
use url::Url;
|
||||
|
||||
|
@ -350,36 +350,36 @@ impl RunningAppState {
|
|||
0.0,
|
||||
-self.inner().window.page_height() + 2.0 * LINE_HEIGHT,
|
||||
));
|
||||
webview.notify_scroll_event(scroll_location, origin, TouchEventType::Move);
|
||||
webview.notify_scroll_event(scroll_location, origin);
|
||||
})
|
||||
.shortcut(Modifiers::empty(), Key::PageUp, || {
|
||||
let scroll_location = ScrollLocation::Delta(Vector2D::new(
|
||||
0.0,
|
||||
self.inner().window.page_height() - 2.0 * LINE_HEIGHT,
|
||||
));
|
||||
webview.notify_scroll_event(scroll_location, origin, TouchEventType::Move);
|
||||
webview.notify_scroll_event(scroll_location, origin);
|
||||
})
|
||||
.shortcut(Modifiers::empty(), Key::Home, || {
|
||||
webview.notify_scroll_event(ScrollLocation::Start, origin, TouchEventType::Move);
|
||||
webview.notify_scroll_event(ScrollLocation::Start, origin);
|
||||
})
|
||||
.shortcut(Modifiers::empty(), Key::End, || {
|
||||
webview.notify_scroll_event(ScrollLocation::End, origin, TouchEventType::Move);
|
||||
webview.notify_scroll_event(ScrollLocation::End, origin);
|
||||
})
|
||||
.shortcut(Modifiers::empty(), Key::ArrowUp, || {
|
||||
let location = ScrollLocation::Delta(Vector2D::new(0.0, 3.0 * LINE_HEIGHT));
|
||||
webview.notify_scroll_event(location, origin, TouchEventType::Move);
|
||||
webview.notify_scroll_event(location, origin);
|
||||
})
|
||||
.shortcut(Modifiers::empty(), Key::ArrowDown, || {
|
||||
let location = ScrollLocation::Delta(Vector2D::new(0.0, -3.0 * LINE_HEIGHT));
|
||||
webview.notify_scroll_event(location, origin, TouchEventType::Move);
|
||||
webview.notify_scroll_event(location, origin);
|
||||
})
|
||||
.shortcut(Modifiers::empty(), Key::ArrowLeft, || {
|
||||
let location = ScrollLocation::Delta(Vector2D::new(LINE_HEIGHT, 0.0));
|
||||
webview.notify_scroll_event(location, origin, TouchEventType::Move);
|
||||
webview.notify_scroll_event(location, origin);
|
||||
})
|
||||
.shortcut(Modifiers::empty(), Key::ArrowRight, || {
|
||||
let location = ScrollLocation::Delta(Vector2D::new(-LINE_HEIGHT, 0.0));
|
||||
webview.notify_scroll_event(location, origin, TouchEventType::Move);
|
||||
webview.notify_scroll_event(location, origin);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue