diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 5536bf548539..07456623942b 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -3176,19 +3176,6 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, if (pluginFrame) { MOZ_ASSERT(pluginFrame->WantsToHandleWheelEventAsDefaultAction()); action = WheelPrefs::ACTION_SEND_TO_PLUGIN; - } else if (!wheelEvent->mMayHaveMomentum && - nsLayoutUtils::IsScrollFrameWithSnapping(frameToScroll)) { - // If the target has scroll-snapping points then we want to handle - // the wheel event on the main thread even if we have APZ enabled. Do - // so and let the APZ know that it should ignore this event. However, - // if the wheel event is synthesized from a Mac trackpad or other device - // that can generate additional momentum events, then we should allow - // APZ to handle it, because it will track the velocity and predicted - // destination from the momentum. - if (wheelEvent->mFlags.mHandledByAPZ) { - wheelEvent->PreventDefault(); - } - action = WheelPrefs::GetInstance()->ComputeActionFor(wheelEvent); } else if (wheelEvent->mFlags.mHandledByAPZ) { action = WheelPrefs::ACTION_NONE; } else { diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 5e13ba3504b6..6f6f9425724d 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -3530,12 +3530,6 @@ nsDisplayLayerEventRegions::AddFrame(nsDisplayListBuilder* aBuilder, if (pluginFrame && pluginFrame->WantsToHandleWheelEventAsDefaultAction()) { mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, borderBox); } - } else if (gfxPlatform::GetPlatform()->SupportsApzWheelInput() && - nsLayoutUtils::IsScrollFrameWithSnapping(aFrame->GetParent())) { - // If the frame is the inner content of a scrollable frame with snap-points - // then we want to handle wheel events for it on the main thread. Add it to - // the d-t-c region so that APZ waits for the main thread. - mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, borderBox); } // Touch action region diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 9b2445bcac96..48938dfcc970 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -8968,16 +8968,6 @@ nsLayoutUtils::GetSelectionBoundingRect(Selection* aSel) return res; } -/* static */ bool -nsLayoutUtils::IsScrollFrameWithSnapping(nsIFrame* aFrame) -{ - nsIScrollableFrame* sf = do_QueryFrame(aFrame); - if (!sf) { - return false; - } - return sf->IsScrollFrameWithSnapping(); -} - /* static */ nsBlockFrame* nsLayoutUtils::GetFloatContainingBlock(nsIFrame* aFrame) { diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 6b52199e55e4..90a4b4a06abd 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -2792,10 +2792,6 @@ public: */ static nsRect GetSelectionBoundingRect(mozilla::dom::Selection* aSel); - /** - * Returns true if the given frame is a scrollframe and it has snap points. - */ - static bool IsScrollFrameWithSnapping(nsIFrame* aFrame); /** * Calculate the bounding rect of |aContent|, relative to the origin * of the scrolled content of |aRootScrollFrame|. diff --git a/layout/forms/nsListControlFrame.h b/layout/forms/nsListControlFrame.h index ef29b160e53a..bfd6a8d915ce 100644 --- a/layout/forms/nsListControlFrame.h +++ b/layout/forms/nsListControlFrame.h @@ -108,9 +108,6 @@ public: virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue) override; virtual void SetFocus(bool aOn = true, bool aRepaint = false) override; - virtual bool IsScrollFrameWithSnapping() const override { - return false; - } virtual mozilla::ScrollbarStyles GetScrollbarStyles() const override; virtual bool ShouldPropagateComputedBSizeToScrolledContent() const override; diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 14711df2dc4b..ea53c8cfffd0 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3632,26 +3632,6 @@ static void HandleScrollPref(nsIScrollable *aScrollable, int32_t aOrientation, } } -bool -ScrollFrameHelper::IsScrollFrameWithSnapping() const -{ - nsPresContext* presContext = mOuter->PresContext(); - if (!presContext->IsDynamic() && - !(mIsRoot && presContext->HasPaginatedScrolling())) { - return false; - } - - if (!mIsRoot) { - const nsStyleDisplay& display = *mOuter->StyleDisplay(); - return display.mScrollSnapTypeY != NS_STYLE_SCROLL_SNAP_TYPE_NONE || - display.mScrollSnapTypeX != NS_STYLE_SCROLL_SNAP_TYPE_NONE; - } else { - const ScrollbarStyles& display = presContext->GetViewportScrollbarStylesOverride(); - return display.mScrollSnapTypeY != NS_STYLE_SCROLL_SNAP_TYPE_NONE || - display.mScrollSnapTypeX != NS_STYLE_SCROLL_SNAP_TYPE_NONE; - } -} - ScrollbarStyles ScrollFrameHelper::GetScrollbarStylesFromFrame() const { diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index 1d217bba1978..bab06272152b 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -58,7 +58,6 @@ public: ScrollFrameHelper(nsContainerFrame* aOuter, bool aIsRoot); ~ScrollFrameHelper(); - bool IsScrollFrameWithSnapping() const; mozilla::ScrollbarStyles GetScrollbarStylesFromFrame() const; // If a child frame was added or removed on the scrollframe, @@ -752,9 +751,6 @@ public: virtual nsIFrame* GetScrolledFrame() const override { return mHelper.GetScrolledFrame(); } - virtual bool IsScrollFrameWithSnapping() const override { - return mHelper.IsScrollFrameWithSnapping(); - } virtual mozilla::ScrollbarStyles GetScrollbarStyles() const override { return mHelper.GetScrollbarStylesFromFrame(); } @@ -1168,9 +1164,6 @@ public: virtual nsIFrame* GetScrolledFrame() const override { return mHelper.GetScrolledFrame(); } - virtual bool IsScrollFrameWithSnapping() const override { - return mHelper.IsScrollFrameWithSnapping(); - } virtual mozilla::ScrollbarStyles GetScrollbarStyles() const override { return mHelper.GetScrollbarStylesFromFrame(); } diff --git a/layout/generic/nsIScrollableFrame.h b/layout/generic/nsIScrollableFrame.h index e45a67640afc..d58d72b91e4c 100644 --- a/layout/generic/nsIScrollableFrame.h +++ b/layout/generic/nsIScrollableFrame.h @@ -65,8 +65,6 @@ public: */ virtual mozilla::ScrollbarStyles GetScrollbarStyles() const = 0; - virtual bool IsScrollFrameWithSnapping() const = 0; - enum { HORIZONTAL = 0x01, VERTICAL = 0x02 }; /** * Return the scrollbars which are visible. It's OK to call this during reflow