Bug 1526749 - Drop |aScrollPortSize| argument from ScrollSnapUtils::GetSnapPointForDestination. r=botond
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 11 Feb 2019 23:44:53 +0000
changeset 516478 dea533265a6c88aba8ad3e6f83d315b3a62076df
parent 516477 b2680b23136b978a8c7e2ec9d8e43419e50f491e
child 516479 13d65407d068092274183015f18e27f003205fb2
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1526749
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1526749 - Drop |aScrollPortSize| argument from ScrollSnapUtils::GetSnapPointForDestination. r=botond It's no longer used since https://hg.mozilla.org/mozilla-central/rev/c55ab6afe5ad . Depends on D19289 Differential Revision: https://phabricator.services.mozilla.com/D19290
gfx/layers/apz/src/AsyncPanZoomController.cpp
layout/generic/ScrollSnap.cpp
layout/generic/ScrollSnap.h
layout/generic/nsGfxScrollFrame.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -5054,17 +5054,16 @@ void AsyncPanZoomController::SetTestAsyn
 Maybe<CSSPoint> AsyncPanZoomController::FindSnapPointNear(
     const CSSPoint& aDestination, nsIScrollableFrame::ScrollUnit aUnit) {
   mRecursiveMutex.AssertCurrentThreadIn();
   APZC_LOG("%p scroll snapping near %s\n", this,
            Stringify(aDestination).c_str());
   CSSRect scrollRange = Metrics().CalculateScrollRange();
   if (Maybe<nsPoint> snapPoint = ScrollSnapUtils::GetSnapPointForDestination(
           mScrollMetadata.GetSnapInfo(), aUnit,
-          CSSSize::ToAppUnits(Metrics().CalculateCompositedSizeInCssPixels()),
           CSSRect::ToAppUnits(scrollRange),
           CSSPoint::ToAppUnits(Metrics().GetScrollOffset()),
           CSSPoint::ToAppUnits(aDestination))) {
     CSSPoint cssSnapPoint = CSSPoint::FromAppUnits(snapPoint.ref());
     // GetSnapPointForDestination() can produce a destination that's outside
     // of the scroll frame's scroll range. Clamp it here (this matches the
     // behaviour of the main-thread code path, which clamps it in
     // nsGfxScrollFrame::ScrollTo()).
--- a/layout/generic/ScrollSnap.cpp
+++ b/layout/generic/ScrollSnap.cpp
@@ -245,18 +245,18 @@ static void ProcessScrollSnapCoordinates
 
     aCallback.AddVerticalEdge(snapCoords.x);
     aCallback.AddHorizontalEdge(snapCoords.y);
   }
 }
 
 Maybe<nsPoint> ScrollSnapUtils::GetSnapPointForDestination(
     const ScrollSnapInfo& aSnapInfo, nsIScrollableFrame::ScrollUnit aUnit,
-    const nsSize& aScrollPortSize, const nsRect& aScrollRange,
-    const nsPoint& aStartPos, const nsPoint& aDestination) {
+    const nsRect& aScrollRange, const nsPoint& aStartPos,
+    const nsPoint& aDestination) {
   if (aSnapInfo.mScrollSnapTypeY == StyleScrollSnapType::None &&
       aSnapInfo.mScrollSnapTypeX == StyleScrollSnapType::None) {
     return Nothing();
   }
 
   nsPoint destPos = aSnapInfo.mScrollSnapDestination;
 
   CalcSnapPoints calcSnapPoints(aUnit, aDestination, aStartPos);
--- a/layout/generic/ScrollSnap.h
+++ b/layout/generic/ScrollSnap.h
@@ -17,27 +17,26 @@ struct ScrollSnapInfo;
 }
 
 struct ScrollSnapUtils {
   /**
    * GetSnapPointForDestination determines which point to snap to after
    * scrolling. |aStartPos| gives the position before scrolling and
    * |aDestination| gives the position after scrolling, with no snapping.
    * Behaviour is dependent on the value of |aUnit|.
-   * |aSnapInfo|, |aScrollPortSize|, and |aScrollRange| are characteristics
-   * of the scroll frame for which snapping is being performed.
+   * |aSnapInfo| and |aScrollRange| are characteristics of the scroll frame for
+   * which snapping is being performed.
    * If a suitable snap point could be found, it is returned. Otherwise, an
    * empty Maybe is returned.
    * IMPORTANT NOTE: This function is designed to be called both on and off
    *                 the main thread. If modifying its implementation, be sure
    *                 not to touch main-thread-only data structures without
    *                 appropriate locking.
    */
   static mozilla::Maybe<nsPoint> GetSnapPointForDestination(
       const layers::ScrollSnapInfo& aSnapInfo,
-      nsIScrollableFrame::ScrollUnit aUnit, const nsSize& aScrollPortSize,
-      const nsRect& aScrollRange, const nsPoint& aStartPos,
-      const nsPoint& aDestination);
+      nsIScrollableFrame::ScrollUnit aUnit, const nsRect& aScrollRange,
+      const nsPoint& aStartPos, const nsPoint& aDestination);
 };
 
 }  // namespace mozilla
 
 #endif  // mozilla_layout_ScrollSnap_h_
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -6460,18 +6460,18 @@ layers::ScrollSnapInfo ScrollFrameHelper
   // TODO(botond): Should we cache it?
   return ComputeScrollSnapInfo(*this);
 }
 
 bool ScrollFrameHelper::GetSnapPointForDestination(
     nsIScrollableFrame::ScrollUnit aUnit, nsPoint aStartPos,
     nsPoint& aDestination) {
   Maybe<nsPoint> snapPoint = ScrollSnapUtils::GetSnapPointForDestination(
-      GetScrollSnapInfo(), aUnit, mScrollPort.Size(),
-      GetScrollRangeForClamping(), aStartPos, aDestination);
+      GetScrollSnapInfo(), aUnit, GetScrollRangeForClamping(), aStartPos,
+      aDestination);
   if (snapPoint) {
     aDestination = snapPoint.ref();
     return true;
   }
   return false;
 }
 
 bool ScrollFrameHelper::UsesContainerScrolling() const {