diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /remote/shared/webdriver/Actions.sys.mjs | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'remote/shared/webdriver/Actions.sys.mjs')
-rw-r--r-- | remote/shared/webdriver/Actions.sys.mjs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/remote/shared/webdriver/Actions.sys.mjs b/remote/shared/webdriver/Actions.sys.mjs index 2639c4dc9f..2c21e989dd 100644 --- a/remote/shared/webdriver/Actions.sys.mjs +++ b/remote/shared/webdriver/Actions.sys.mjs @@ -1318,6 +1318,7 @@ class WheelScrollAction extends WheelAction { this.duration ?? tickDuration, deltaTarget => this.performOneWheelScroll( + state, scrollCoordinates, deltaPosition, deltaTarget, @@ -1329,12 +1330,19 @@ class WheelScrollAction extends WheelAction { /** * Perform one part of a wheel scroll corresponding to a specific emitted event. * + * @param {State} state - Actions state. * @param {Array<number>} scrollCoordinates - [x, y] viewport coordinates of the scroll. * @param {Array<number>} deltaPosition - [deltaX, deltaY] coordinates of the scroll before this event. * @param {Array<Array<number>>} deltaTargets - Array of [deltaX, deltaY] coordinates to scroll to. * @param {WindowProxy} win - Current window global. */ - performOneWheelScroll(scrollCoordinates, deltaPosition, deltaTargets, win) { + performOneWheelScroll( + state, + scrollCoordinates, + deltaPosition, + deltaTargets, + win + ) { if (deltaTargets.length !== 1) { throw new Error("Can only scroll one wheel at a time"); } @@ -1350,6 +1358,7 @@ class WheelScrollAction extends WheelAction { deltaY, deltaZ: 0, }); + eventData.update(state); lazy.event.synthesizeWheelAtPoint( scrollCoordinates[0], @@ -2237,6 +2246,22 @@ class WheelEventData extends InputEventData { this.deltaY = deltaY; this.deltaZ = deltaZ; this.deltaMode = deltaMode; + + this.altKey = false; + this.ctrlKey = false; + this.metaKey = false; + this.shiftKey = false; + } + + update(state) { + // set modifier properties based on whether any corresponding keys are + // pressed on any key input source + for (const [, otherInputSource] of state.inputSourcesByType("key")) { + this.altKey = otherInputSource.alt || this.altKey; + this.ctrlKey = otherInputSource.ctrl || this.ctrlKey; + this.metaKey = otherInputSource.meta || this.metaKey; + this.shiftKey = otherInputSource.shift || this.shiftKey; + } } } |