Bug 1749352 - Don't interrupt scroll snapping animations when we receive a momentum pan event. r=botond

Scroll snapping uses an MSD smooth scroll to animate to the target position.
During the scroll snap animation, any synthesized momentum events
from the OS should be ignored; the scroll snap animation has taken over.

It is possible that this patch has unfortunate consequences when mixing
keyboard and touchpad scrolling. For example, pressing space to scroll down
by a page and then doing a fling with the touchpad might now have different
results.

Differential Revision: https://phabricator.services.mozilla.com/D135920
This commit is contained in:
Markus Stange 2022-02-27 23:19:48 +00:00
Родитель 4b0db9788b
Коммит 51877e08a5
1 изменённых файлов: 1 добавлений и 6 удалений

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

@ -2766,12 +2766,7 @@ nsEventStatus AsyncPanZoomController::OnPanMomentumStart(
const PanGestureInput& aEvent) {
APZC_LOG("%p got a pan-momentumstart in state %d\n", this, mState);
if (mState == SMOOTHMSD_SCROLL) {
// SMOOTHMSD_SCROLL scrolls are cancelled by pan gestures.
CancelAnimation();
}
if (mState == OVERSCROLL_ANIMATION) {
if (mState == SMOOTHMSD_SCROLL || mState == OVERSCROLL_ANIMATION) {
return nsEventStatus_eConsumeNoDefault;
}