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:
Martin Robinson 2025-06-20 15:59:01 +02:00 committed by GitHub
parent ce4da2bf97
commit 80a7de8c9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 26 additions and 55 deletions

View file

@ -28,7 +28,7 @@ use crossbeam_channel::{Receiver, Sender};
use dpi::PhysicalSize;
use embedder_traits::{
CompositorHitTestResult, Cursor, InputEvent, MouseButtonEvent, MouseMoveEvent, ShutdownState,
TouchEventType, UntrustedNodeAddress, ViewportDetails, WheelDelta, WheelEvent, WheelMode,
UntrustedNodeAddress, ViewportDetails, WheelDelta, WheelEvent, WheelMode,
};
use euclid::{Point2D, Rect, Scale, Size2D, Transform3D, Vector2D};
use ipc_channel::ipc::{self, IpcSharedMemory};
@ -1833,10 +1833,9 @@ impl IOCompositor {
webview_id: WebViewId,
scroll_location: ScrollLocation,
cursor: DeviceIntPoint,
event_type: TouchEventType,
) {
if let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) {
webview_renderer.notify_scroll_event(scroll_location, cursor, event_type);
webview_renderer.notify_scroll_event(scroll_location, cursor);
}
}

View file

@ -802,21 +802,11 @@ impl WebViewRenderer {
&mut self,
scroll_location: ScrollLocation,
cursor: DeviceIntPoint,
event_type: TouchEventType,
) {
if self.global.borrow().shutdown_state() != ShutdownState::NotShuttingDown {
return;
}
match event_type {
TouchEventType::Move => self.on_scroll_window_event(scroll_location, cursor),
TouchEventType::Up | TouchEventType::Cancel => {
self.on_scroll_window_event(scroll_location, cursor);
},
TouchEventType::Down => {
self.on_scroll_window_event(scroll_location, cursor);
},
}
self.on_scroll_window_event(scroll_location, cursor);
}
fn on_scroll_window_event(&mut self, scroll_location: ScrollLocation, cursor: DeviceIntPoint) {

View file

@ -165,7 +165,6 @@ impl ApplicationHandler<WakerEvent> for App {
webview.notify_scroll_event(
ScrollLocation::Delta(moved_by),
DeviceIntPoint::new(10, 10),
TouchEventType::Down,
);
}
}

View file

@ -14,7 +14,7 @@ use constellation_traits::{EmbedderToConstellationMessage, TraversalDirection};
use dpi::PhysicalSize;
use embedder_traits::{
Cursor, InputEvent, JSValue, JavaScriptEvaluationError, LoadStatus, MediaSessionActionType,
ScreenGeometry, Theme, TouchEventType, ViewportDetails,
ScreenGeometry, Theme, ViewportDetails,
};
use euclid::{Point2D, Scale, Size2D};
use servo_geometry::DeviceIndependentPixel;
@ -434,18 +434,11 @@ impl WebView {
))
}
pub fn notify_scroll_event(
&self,
location: ScrollLocation,
point: DeviceIntPoint,
touch_event_action: TouchEventType,
) {
self.inner().compositor.borrow_mut().notify_scroll_event(
self.id(),
location,
point,
touch_event_action,
);
pub fn notify_scroll_event(&self, location: ScrollLocation, point: DeviceIntPoint) {
self.inner()
.compositor
.borrow_mut()
.notify_scroll_event(self.id(), location, point);
}
pub fn notify_input_event(&self, event: InputEvent) {