diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 62783af48a0e..5b4294fe4155 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2357,15 +2357,12 @@ void ScrollFrameHelper::ScrollTo(nsPoint aScrollPosition, ScrollMode aMode, ScrollToWithOrigin(aScrollPosition, aMode, aOrigin, aRange, aSnap); } -void ScrollFrameHelper::ScrollToCSSPixels( - const CSSIntPoint& aScrollPosition, ScrollMode aMode, - nsIScrollbarMediator::ScrollSnapMode aSnap, ScrollOrigin aOrigin) { +void ScrollFrameHelper::ScrollToCSSPixels(const CSSIntPoint& aScrollPosition, + ScrollMode aMode, + ScrollOrigin aOrigin) { nsPoint current = GetScrollPosition(); CSSIntPoint currentCSSPixels = GetScrollPositionCSSPixels(); nsPoint pt = CSSPoint::ToAppUnits(aScrollPosition); - if (aSnap == nsIScrollableFrame::DEFAULT) { - aSnap = nsIScrollableFrame::ENABLE_SNAP; - } if (aOrigin == ScrollOrigin::NotSpecified) { aOrigin = ScrollOrigin::Other; @@ -2387,7 +2384,7 @@ void ScrollFrameHelper::ScrollToCSSPixels( range.y = pt.y; range.height = 0; } - ScrollTo(pt, aMode, aOrigin, &range, aSnap); + ScrollTo(pt, aMode, aOrigin, &range, nsIScrollableFrame::ENABLE_SNAP); // 'this' might be destroyed here } @@ -4810,9 +4807,9 @@ void ScrollFrameHelper::ScrollBy(nsIntPoint aDelta, ScrollUnit aUnit, } } -void ScrollFrameHelper::ScrollByCSSPixels( - const CSSIntPoint& aDelta, ScrollMode aMode, ScrollOrigin aOrigin, - nsIScrollbarMediator::ScrollSnapMode aSnap) { +void ScrollFrameHelper::ScrollByCSSPixels(const CSSIntPoint& aDelta, + ScrollMode aMode, + ScrollOrigin aOrigin) { nsPoint current = GetScrollPosition(); // `current` value above might be a value which was aligned to in // layer-pixels, so starting from such points will make the difference between @@ -4826,10 +4823,6 @@ void ScrollFrameHelper::ScrollByCSSPixels( CSSIntPoint currentCSSPixels = GetScrollPositionCSSPixels(); nsPoint pt = CSSPoint::ToAppUnits(currentCSSPixels + aDelta); - if (aSnap == nsIScrollableFrame::DEFAULT) { - aSnap = nsIScrollableFrame::ENABLE_SNAP; - } - if (aOrigin == ScrollOrigin::NotSpecified) { aOrigin = ScrollOrigin::Other; } @@ -4850,7 +4843,8 @@ void ScrollFrameHelper::ScrollByCSSPixels( range.y = pt.y; range.height = 0; } - ScrollToWithOrigin(pt, aMode, aOrigin, &range, aSnap); + ScrollToWithOrigin(pt, aMode, aOrigin, &range, + nsIScrollableFrame::ENABLE_SNAP); // 'this' might be destroyed here } diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index 1e4933c8ec56..0d623e25f33a 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -255,8 +255,6 @@ class ScrollFrameHelper : public nsIReflowCallback { */ void ScrollToCSSPixels(const CSSIntPoint& aScrollPosition, ScrollMode aMode = ScrollMode::Instant, - nsIScrollbarMediator::ScrollSnapMode aSnap = - nsIScrollbarMediator::DEFAULT, ScrollOrigin aOrigin = ScrollOrigin::NotSpecified); /** * @note This method might destroy the frame, pres shell and other objects. @@ -284,9 +282,7 @@ class ScrollFrameHelper : public nsIReflowCallback { nsIScrollbarMediator::DISABLE_SNAP); void ScrollByCSSPixels(const CSSIntPoint& aDelta, ScrollMode aMode = ScrollMode::Instant, - ScrollOrigin aOrigin = ScrollOrigin::NotSpecified, - nsIScrollbarMediator::ScrollSnapMode aSnap = - nsIScrollbarMediator::DEFAULT); + ScrollOrigin aOrigin = ScrollOrigin::NotSpecified); /** * @note This method might destroy the frame, pres shell and other objects. */ @@ -995,10 +991,8 @@ class nsHTMLScrollFrame : public nsContainerFrame, void ScrollToCSSPixels( const CSSIntPoint& aScrollPosition, ScrollMode aMode = ScrollMode::Instant, - nsIScrollbarMediator::ScrollSnapMode aSnap = - nsIScrollbarMediator::DEFAULT, ScrollOrigin aOrigin = ScrollOrigin::NotSpecified) final { - mHelper.ScrollToCSSPixels(aScrollPosition, aMode, aSnap, aOrigin); + mHelper.ScrollToCSSPixels(aScrollPosition, aMode, aOrigin); } void ScrollToCSSPixelsApproximate( const mozilla::CSSPoint& aScrollPosition, @@ -1024,12 +1018,10 @@ class nsHTMLScrollFrame : public nsContainerFrame, mHelper.ScrollBy(aDelta, aUnit, aMode, aOverflow, aOrigin, aMomentum, aSnap); } - void ScrollByCSSPixels(const CSSIntPoint& aDelta, - ScrollMode aMode = ScrollMode::Instant, - ScrollOrigin aOrigin = ScrollOrigin::NotSpecified, - nsIScrollbarMediator::ScrollSnapMode aSnap = - nsIScrollbarMediator::DEFAULT) final { - mHelper.ScrollByCSSPixels(aDelta, aMode, aOrigin, aSnap); + void ScrollByCSSPixels( + const CSSIntPoint& aDelta, ScrollMode aMode = ScrollMode::Instant, + ScrollOrigin aOrigin = ScrollOrigin::NotSpecified) final { + mHelper.ScrollByCSSPixels(aDelta, aMode, aOrigin); } void ScrollSnap() final { mHelper.ScrollSnap(); } /** @@ -1478,10 +1470,8 @@ class nsXULScrollFrame final : public nsBoxFrame, void ScrollToCSSPixels( const CSSIntPoint& aScrollPosition, ScrollMode aMode = ScrollMode::Instant, - nsIScrollbarMediator::ScrollSnapMode aSnap = - nsIScrollbarMediator::DISABLE_SNAP, ScrollOrigin aOrigin = ScrollOrigin::NotSpecified) final { - mHelper.ScrollToCSSPixels(aScrollPosition, aMode, aSnap, aOrigin); + mHelper.ScrollToCSSPixels(aScrollPosition, aMode, aOrigin); } void ScrollToCSSPixelsApproximate( const mozilla::CSSPoint& aScrollPosition, @@ -1504,12 +1494,10 @@ class nsXULScrollFrame final : public nsBoxFrame, mHelper.ScrollBy(aDelta, aUnit, aMode, aOverflow, aOrigin, aMomentum, aSnap); } - void ScrollByCSSPixels(const CSSIntPoint& aDelta, - ScrollMode aMode = ScrollMode::Instant, - ScrollOrigin aOrigin = ScrollOrigin::NotSpecified, - nsIScrollbarMediator::ScrollSnapMode aSnap = - nsIScrollbarMediator::DEFAULT) final { - mHelper.ScrollByCSSPixels(aDelta, aMode, aOrigin, aSnap); + void ScrollByCSSPixels( + const CSSIntPoint& aDelta, ScrollMode aMode = ScrollMode::Instant, + ScrollOrigin aOrigin = ScrollOrigin::NotSpecified) final { + mHelper.ScrollByCSSPixels(aDelta, aMode, aOrigin); } void ScrollSnap() final { mHelper.ScrollSnap(); } /** diff --git a/layout/generic/nsIScrollableFrame.h b/layout/generic/nsIScrollableFrame.h index 5f08f1a4e562..7ba671b9e5b0 100644 --- a/layout/generic/nsIScrollableFrame.h +++ b/layout/generic/nsIScrollableFrame.h @@ -282,15 +282,10 @@ class nsIScrollableFrame : public nsIScrollbarMediator { * range and / or moving in any direction; GetScrollPositionCSSPixels will be * exactly aScrollPosition at the end of the scroll animation unless the * SMOOTH_MSD animation is interrupted. - * - * FIXME: Drop |aSnap| argument once after we finished the migration to the - * Scroll Snap Module v1. We should alway use ENABLE_SNAP. */ virtual void ScrollToCSSPixels( const CSSIntPoint& aScrollPosition, ScrollMode aMode = ScrollMode::Instant, - nsIScrollbarMediator::ScrollSnapMode aSnap = - nsIScrollbarMediator::DEFAULT, ScrollOrigin aOrigin = ScrollOrigin::NotSpecified) = 0; /** * @note This method might destroy the frame, pres shell and other objects. @@ -326,15 +321,9 @@ class nsIScrollableFrame : public nsIScrollbarMediator { nsIScrollbarMediator::ScrollSnapMode aSnap = nsIScrollbarMediator::DISABLE_SNAP) = 0; - /** - * FIXME: Drop |aSnap| argument once after we finished the migration to the - * Scroll Snap Module v1. We should alway use ENABLE_SNAP. - */ virtual void ScrollByCSSPixels( const CSSIntPoint& aDelta, ScrollMode aMode = ScrollMode::Instant, - ScrollOrigin aOrigin = ScrollOrigin::NotSpecified, - nsIScrollbarMediator::ScrollSnapMode aSnap = - nsIScrollbarMediator::DEFAULT) = 0; + ScrollOrigin aOrigin = ScrollOrigin::NotSpecified) = 0; /** * Perform scroll snapping, possibly resulting in a smooth scroll to