mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
script: Minimize layout queries for window scroll offsets. (#38018)
These changes reduce the number of times we need to query layout for the same information when creating mouse/pointer events. Testing: No new tests required for maintaining existing behaviour. Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
6dbd64e72d
commit
d0a93a8b02
5 changed files with 32 additions and 21 deletions
|
@ -95,6 +95,7 @@ impl WheelEvent {
|
|||
delta_y,
|
||||
delta_z,
|
||||
delta_mode,
|
||||
can_gc,
|
||||
);
|
||||
|
||||
ev
|
||||
|
@ -160,6 +161,7 @@ impl WheelEventMethods<crate::DomTypeHolder> for WheelEvent {
|
|||
delta_y_arg: Finite<f64>,
|
||||
delta_z_arg: Finite<f64>,
|
||||
delta_mode_arg: u32,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
if self.upcast::<Event>().dispatching() {
|
||||
return;
|
||||
|
@ -181,6 +183,7 @@ impl WheelEventMethods<crate::DomTypeHolder> for WheelEvent {
|
|||
self.mouseevent.MetaKey(),
|
||||
self.mouseevent.Button(),
|
||||
self.mouseevent.GetRelatedTarget().as_deref(),
|
||||
can_gc,
|
||||
);
|
||||
self.delta_x.set(delta_x_arg);
|
||||
self.delta_y.set(delta_y_arg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue