Bug 1453425 - Remove mScrollPosAtLastPaint from nsGfxScrollFrame. r=botond
authorRyan Hunt <rhunt@eqrion.net>
Mon, 24 Sep 2018 14:12:04 -0500
changeset 491200 42961627bc9a1bfd12acb11c62bdbc327ffd7303
parent 491199 5ef21255897e9c49c234be77b32b07ac3db7dc6c
child 491201 d73aa682bf9a50db1252dc9c7e7874078073ebfd
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersbotond
bugs1453425
milestone65.0a1
Bug 1453425 - Remove mScrollPosAtLastPaint from nsGfxScrollFrame. r=botond This field appears to be only ever used as a local variable, and can be removed. Differential Revision: https://phabricator.services.mozilla.com/D7126
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGfxScrollFrame.h
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2115,17 +2115,16 @@ ScrollFrameHelper::ScrollFrameHelper(nsC
   , mReferenceFrameDuringPainting(nullptr)
   , mAsyncScroll(nullptr)
   , mAsyncSmoothMSDScroll(nullptr)
   , mLastScrollOrigin(nsGkAtoms::other)
   , mAllowScrollOriginDowngrade(false)
   , mLastSmoothScrollOrigin(nullptr)
   , mScrollGeneration(++sScrollGenerationCounter)
   , mDestination(0, 0)
-  , mScrollPosAtLastPaint(0, 0)
   , mRestorePos(-1, -1)
   , mLastPos(-1, -1)
   , mScrollPosForLayerPixelAlignment(-1, -1)
   , mLastUpdateFramesPos(-1, -1)
   , mHadDisplayPortAtLastFrameUpdate(false)
   , mDisplayPortAtLastFrameUpdate()
   , mScrollParentID(mozilla::layers::FrameMetrics::NULL_SCROLL_ID)
   , mNeverHasVerticalScrollbar(false)
@@ -3390,20 +3389,19 @@ ScrollFrameHelper::BuildDisplayList(nsDi
   SetAndNullOnExit<const nsIFrame> tmpBuilder(mReferenceFrameDuringPainting, aBuilder->GetCurrentReferenceFrame());
   if (aBuilder->IsForFrameVisibility()) {
     NotifyApproximateFrameVisibilityUpdate(false);
   }
 
   mOuter->DisplayBorderBackgroundOutline(aBuilder, aLists);
 
   if (aBuilder->IsPaintingToWindow()) {
-    mScrollPosAtLastPaint = GetScrollPosition();
     if (IsMaybeScrollingActive()) {
       if (mScrollPosForLayerPixelAlignment == nsPoint(-1,-1)) {
-        mScrollPosForLayerPixelAlignment = mScrollPosAtLastPaint;
+        mScrollPosForLayerPixelAlignment = GetScrollPosition();
       }
     } else {
       mScrollPosForLayerPixelAlignment = nsPoint(-1,-1);
     }
   }
 
   // It's safe to get this value before the DecideScrollableLayer call below
   // because that call cannot create a displayport for root scroll frames,
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -531,17 +531,16 @@ public:
   Maybe<nsPoint> mApzSmoothScrollDestination;
   uint32_t mScrollGeneration;
   nsRect mScrollPort;
   // Where we're currently scrolling to, if we're scrolling asynchronously.
   // If we're not in the middle of an asynchronous scroll then this is
   // just the current scroll position. ScrollBy will choose its
   // destination based on this value.
   nsPoint mDestination;
-  nsPoint mScrollPosAtLastPaint;
 
   // A goal position to try to scroll to as content loads. As long as mLastPos
   // matches the current logical scroll position, we try to scroll to mRestorePos
   // after every reflow --- because after each time content is loaded/added to the
   // scrollable element, there will be a reflow.
   nsPoint mRestorePos;
   // The last logical position we scrolled to while trying to restore mRestorePos, or
   // 0,0 when this is a new frame. Set to -1,-1 once we've scrolled for any reason