Bug 1745649 - Consistently ignore wheel deltas on MayBegin and Cancelled events. r=mac-reviewers,spohl,bradwerth

We're already ignoring them during APZ scroll handling.
Zeroing out the deltas means that we will also ignore them for DOM wheel events.
This is more consistent and works around a bug in macOS 12.1.

Differential Revision: https://phabricator.services.mozilla.com/D133766
This commit is contained in:
Markus Stange 2021-12-14 17:52:56 +00:00
Родитель bf3e47d93b
Коммит f6d6922fd6
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -3397,8 +3397,17 @@ static gfx::IntPoint GetIntegerDeltaForEvent(NSEvent* aEvent) {
if (usePreciseDeltas && hasPhaseInformation) {
PanGestureInput panEvent(PanGestureTypeForEvent(theEvent), eventIntervalTime, eventTimeStamp,
position, preciseDelta, modifiers);
panEvent.SetLineOrPageDeltas(lineOrPageDelta.x, lineOrPageDelta.y);
position, ScreenPoint(), modifiers);
// Always force zero deltas on event types that shouldn't cause any scrolling,
// so that we don't dispatch DOM wheel events for them.
bool shouldIgnoreDeltas = panEvent.mType == PanGestureInput::PANGESTURE_MAYSTART ||
panEvent.mType == PanGestureInput::PANGESTURE_CANCELLED;
if (!shouldIgnoreDeltas) {
panEvent.mPanDisplacement = preciseDelta;
panEvent.SetLineOrPageDeltas(lineOrPageDelta.x, lineOrPageDelta.y);
}
if (panEvent.mType == PanGestureInput::PANGESTURE_END) {
// Check if there's a momentum start event in the event queue, so that we