diff --git a/gfx/layers/apz/public/GeckoContentController.h b/gfx/layers/apz/public/GeckoContentController.h index 650b9ce059cc..6d8023fe9fff 100644 --- a/gfx/layers/apz/public/GeckoContentController.h +++ b/gfx/layers/apz/public/GeckoContentController.h @@ -36,14 +36,6 @@ public: */ virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) = 0; - /** - * Requests handling of a scroll snapping at the end of a fling gesture for - * the scrollable frame with the given scroll id. aDestination specifies the - * expected landing position of the fling if no snapping were to be performed. - */ - virtual void RequestFlingSnap(const FrameMetrics::ViewID& aScrollId, - const mozilla::CSSPoint& aDestination) = 0; - /** * Acknowledges the recipt of a scroll offset update for the scrollable * frame with the given scroll id. This is used to maintain consistency diff --git a/gfx/layers/apz/util/APZCCallbackHelper.cpp b/gfx/layers/apz/util/APZCCallbackHelper.cpp index d6ed4a53b9d8..87b82b31b065 100644 --- a/gfx/layers/apz/util/APZCCallbackHelper.cpp +++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp @@ -331,46 +331,6 @@ APZCCallbackHelper::InitializeRootDisplayport(nsIPresShell* aPresShell) } } -class FlingSnapEvent : public nsRunnable -{ - typedef mozilla::layers::FrameMetrics::ViewID ViewID; - -public: - FlingSnapEvent(const ViewID& aScrollId, - const mozilla::CSSPoint& aDestination) - : mScrollId(aScrollId) - , mDestination(aDestination) - { - } - - NS_IMETHOD Run() { - MOZ_ASSERT(NS_IsMainThread()); - - nsIScrollableFrame* sf = nsLayoutUtils::FindScrollableFrameFor(mScrollId); - if (sf) { - sf->FlingSnap(mDestination); - } - - return NS_OK; - } - -protected: - ViewID mScrollId; - mozilla::CSSPoint mDestination; -}; - -void -APZCCallbackHelper::RequestFlingSnap(const FrameMetrics::ViewID& aScrollId, - const mozilla::CSSPoint& aDestination) -{ - nsCOMPtr r1 = new FlingSnapEvent(aScrollId, aDestination); - if (!NS_IsMainThread()) { - NS_DispatchToMainThread(r1); - } else { - r1->Run(); - } -} - class AcknowledgeScrollUpdateEvent : public nsRunnable { typedef mozilla::layers::FrameMetrics::ViewID ViewID; diff --git a/gfx/layers/apz/util/APZCCallbackHelper.h b/gfx/layers/apz/util/APZCCallbackHelper.h index fd3782cc4307..46dd93ac84be 100644 --- a/gfx/layers/apz/util/APZCCallbackHelper.h +++ b/gfx/layers/apz/util/APZCCallbackHelper.h @@ -66,14 +66,6 @@ public: given presShell. */ static void InitializeRootDisplayport(nsIPresShell* aPresShell); - /* Tell layout to perform scroll snapping for the scrollable frame with the - * given scroll id. aDestination specifies the expected landing position of - * a current fling or scrolling animation that should be used to select - * the scroll snap point. - */ - static void RequestFlingSnap(const FrameMetrics::ViewID& aScrollId, - const mozilla::CSSPoint& aDestination); - /* Tell layout that we received the scroll offset update for the given view ID, so that it accepts future scroll offset updates from APZ. */ static void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, diff --git a/gfx/layers/apz/util/ChromeProcessController.cpp b/gfx/layers/apz/util/ChromeProcessController.cpp index 14f0faa48004..281f37c8535a 100644 --- a/gfx/layers/apz/util/ChromeProcessController.cpp +++ b/gfx/layers/apz/util/ChromeProcessController.cpp @@ -68,13 +68,6 @@ ChromeProcessController::PostDelayedTask(Task* aTask, int aDelayMs) MessageLoop::current()->PostDelayedTask(FROM_HERE, aTask, aDelayMs); } -void -ChromeProcessController::RequestFlingSnap(const FrameMetrics::ViewID& aScrollId, - const mozilla::CSSPoint& aDestination) -{ - APZCCallbackHelper::RequestFlingSnap(aScrollId, aDestination); -} - void ChromeProcessController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration) diff --git a/gfx/layers/apz/util/ChromeProcessController.h b/gfx/layers/apz/util/ChromeProcessController.h index e6f64130d67f..47b3d3535b8b 100644 --- a/gfx/layers/apz/util/ChromeProcessController.h +++ b/gfx/layers/apz/util/ChromeProcessController.h @@ -40,8 +40,6 @@ public: // GeckoContentController interface virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) override; virtual void PostDelayedTask(Task* aTask, int aDelayMs) override; - virtual void RequestFlingSnap(const FrameMetrics::ViewID& aScrollId, - const mozilla::CSSPoint& aDestination) override; virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration) override; diff --git a/gfx/layers/ipc/APZChild.cpp b/gfx/layers/ipc/APZChild.cpp index f7e00448f846..a8ca20940dad 100644 --- a/gfx/layers/ipc/APZChild.cpp +++ b/gfx/layers/ipc/APZChild.cpp @@ -94,14 +94,6 @@ APZChild::RecvUpdateFrame(const FrameMetrics& aFrameMetrics) return mBrowser->UpdateFrame(aFrameMetrics); } -bool -APZChild::RecvRequestFlingSnap(const FrameMetrics::ViewID& aScrollId, - const mozilla::CSSPoint& aDestination) -{ - APZCCallbackHelper::RequestFlingSnap(aScrollId, aDestination); - return true; -} - bool APZChild::RecvAcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration) diff --git a/gfx/layers/ipc/APZChild.h b/gfx/layers/ipc/APZChild.h index 1c01c0370232..38c0e48a4f3c 100644 --- a/gfx/layers/ipc/APZChild.h +++ b/gfx/layers/ipc/APZChild.h @@ -28,9 +28,6 @@ public: virtual bool RecvUpdateFrame(const FrameMetrics& frame) override; - virtual bool RecvRequestFlingSnap(const ViewID& aScrollID, - const CSSPoint& aDestination) override; - virtual bool RecvAcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration) override; diff --git a/gfx/layers/ipc/PAPZ.ipdl b/gfx/layers/ipc/PAPZ.ipdl index 35de6602a8c2..541d27748ba0 100644 --- a/gfx/layers/ipc/PAPZ.ipdl +++ b/gfx/layers/ipc/PAPZ.ipdl @@ -89,7 +89,6 @@ child: // The following methods correspond to functions on the GeckoContentController // interface in gfx/layers/apz/public/GeckoContentController.h. Refer to documentation // in that file for these functions. - async RequestFlingSnap(ViewID aScrollID, CSSPoint aDestination); async AcknowledgeScrollUpdate(ViewID aScrollId, uint32_t aScrollGeneration); async HandleDoubleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid); async HandleSingleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid, bool aCallTakeFocusForClickFromTap); diff --git a/gfx/layers/ipc/RemoteContentController.cpp b/gfx/layers/ipc/RemoteContentController.cpp index 1710d3c4ecaa..191e5de58e4e 100644 --- a/gfx/layers/ipc/RemoteContentController.cpp +++ b/gfx/layers/ipc/RemoteContentController.cpp @@ -51,24 +51,6 @@ RemoteContentController::RequestContentRepaint(const FrameMetrics& aFrameMetrics } } -void -RemoteContentController::RequestFlingSnap(const FrameMetrics::ViewID& aScrollId, - const mozilla::CSSPoint& aDestination) -{ - if (MessageLoop::current() != mUILoop) { - // We have to send this message from the "UI thread" (main - // thread). - mUILoop->PostTask( - FROM_HERE, - NewRunnableMethod(this, &RemoteContentController::RequestFlingSnap, - aScrollId, aDestination)); - return; - } - if (CanSend()) { - Unused << SendRequestFlingSnap(aScrollId, aDestination); - } -} - void RemoteContentController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration) diff --git a/gfx/layers/ipc/RemoteContentController.h b/gfx/layers/ipc/RemoteContentController.h index 471104d505f5..56000da0eb02 100644 --- a/gfx/layers/ipc/RemoteContentController.h +++ b/gfx/layers/ipc/RemoteContentController.h @@ -42,9 +42,6 @@ public: // Needs to be called on the main thread. virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) override; - virtual void RequestFlingSnap(const FrameMetrics::ViewID& aScrollId, - const mozilla::CSSPoint& aDestination) override; - virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration) override; diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 32fff2655576..da250cf87aad 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3915,12 +3915,6 @@ ScrollFrameHelper::ScrollSnap(nsIScrollableFrame::ScrollMode aMode) ScrollSnap(destinationPos, aMode); } -void -ScrollFrameHelper::FlingSnap(const mozilla::CSSPoint& aDestination) -{ - ScrollSnap(CSSPoint::ToAppUnits(aDestination)); -} - void ScrollFrameHelper::ScrollSnap(const nsPoint &aDestination, nsIScrollableFrame::ScrollMode aMode) diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index a1452af3c3ab..1d217bba1978 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -204,7 +204,6 @@ public: // Get the scroll range assuming the scrollport has size (aWidth, aHeight). nsRect GetScrollRange(nscoord aWidth, nscoord aHeight) const; nsSize GetScrollPositionClampingScrollPortSize() const; - void FlingSnap(const mozilla::CSSPoint& aDestination); void ScrollSnap(nsIScrollableFrame::ScrollMode aMode = nsIScrollableFrame::SMOOTH_MSD); void ScrollSnap(const nsPoint &aDestination, nsIScrollableFrame::ScrollMode aMode = nsIScrollableFrame::SMOOTH_MSD); @@ -841,9 +840,6 @@ public: override { mHelper.ScrollBy(aDelta, aUnit, aMode, aOverflow, aOrigin, aMomentum, aSnap); } - virtual void FlingSnap(const mozilla::CSSPoint& aDestination) override { - mHelper.FlingSnap(aDestination); - } virtual void ScrollSnap() override { mHelper.ScrollSnap(); } @@ -1256,9 +1252,6 @@ public: override { mHelper.ScrollBy(aDelta, aUnit, aMode, aOverflow, aOrigin, aMomentum, aSnap); } - virtual void FlingSnap(const mozilla::CSSPoint& aDestination) override { - mHelper.FlingSnap(aDestination); - } virtual void ScrollSnap() override { mHelper.ScrollSnap(); } diff --git a/layout/generic/nsIScrollableFrame.h b/layout/generic/nsIScrollableFrame.h index efc575170257..e45a67640afc 100644 --- a/layout/generic/nsIScrollableFrame.h +++ b/layout/generic/nsIScrollableFrame.h @@ -270,16 +270,6 @@ public: nsIScrollbarMediator::ScrollSnapMode aSnap = nsIScrollbarMediator::DISABLE_SNAP) = 0; - /** - * Perform scroll snapping, possibly resulting in a smooth scroll to - * maintain the scroll snap position constraints. A predicted landing - * position determined by the APZC is used to select the best matching - * snap point, allowing touchscreen fling gestures to navigate between - * snap points. - * @param aDestination The desired landing position of the fling, which - * is used to select the best matching snap point. - */ - virtual void FlingSnap(const mozilla::CSSPoint& aDestination) = 0; /** * Perform scroll snapping, possibly resulting in a smooth scroll to * maintain the scroll snap position constraints. Velocity sampled from