From 41900951e943bd367404c06d1423877b7417cc91 Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Tue, 8 Sep 2020 08:08:32 +0000 Subject: [PATCH] Bug 1663535. Handle scroll snapping with desktop zooming scrollbars. r=kats If we need to snap we just don't use the desktop zooming scrollbar path. A quick look into the scroll snapping code looks like it uses layout only aware things. This should be good enough for now, we can look into supporting scroll snap + pinch zoom later if we need to. Differential Revision: https://phabricator.services.mozilla.com/D89400 --- layout/generic/nsGfxScrollFrame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index ddfb547dfbb4..ace6d12015de 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -4563,8 +4563,8 @@ void ScrollFrameHelper::ScrollBy(nsIntPoint aDelta, ScrollUnit aUnit, return; } - // xxx need to handle scroll snapping - if (gfxPlatform::UseDesktopZoomingScrollbars() && + if ((aSnap != nsIScrollableFrame::ENABLE_SNAP || !NeedsScrollSnap()) && + gfxPlatform::UseDesktopZoomingScrollbars() && nsLayoutUtils::AsyncPanZoomEnabled(mOuter) && !nsLayoutUtils::ShouldDisableApzForElement(mOuter->GetContent()) && (WantAsyncScroll() || mZoomableByAPZ)) {