Bug 951793 - Do not reconstruct the frame when overscroll-behavior has changed. r=mstange
authorBotond Ballo <botond@mozilla.com>
Wed, 22 Nov 2017 19:06:43 -0500
changeset 438194 6121a94e63b93ce1ad8c736bf0b16ac88e8558f6
parent 438193 7607f740e87bfbde05a50371ab6681946c571bda
child 438195 826766a15d6acdedb61209157f9febcfd142b75e
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersmstange
bugs951793
milestone59.0a1
Bug 951793 - Do not reconstruct the frame when overscroll-behavior has changed. r=mstange A repaint is sufficient to pick up the new property value. MozReview-Commit-ID: oKFgGfquyl
layout/style/nsStyleStruct.cpp
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -3704,18 +3704,16 @@ nsStyleDisplay::CalcDifference(const nsS
   nsChangeHint hint = nsChangeHint(0);
 
   if (!DefinitelyEqualURIsAndPrincipal(mBinding.ForceGet(), aNewData.mBinding.ForceGet())
       || mPosition != aNewData.mPosition
       || mDisplay != aNewData.mDisplay
       || mContain != aNewData.mContain
       || (mFloat == StyleFloat::None) != (aNewData.mFloat == StyleFloat::None)
       || mScrollBehavior != aNewData.mScrollBehavior
-      || mOverscrollBehaviorX != aNewData.mOverscrollBehaviorX
-      || mOverscrollBehaviorY != aNewData.mOverscrollBehaviorY
       || mScrollSnapTypeX != aNewData.mScrollSnapTypeX
       || mScrollSnapTypeY != aNewData.mScrollSnapTypeY
       || mScrollSnapPointsX != aNewData.mScrollSnapPointsX
       || mScrollSnapPointsY != aNewData.mScrollSnapPointsY
       || mScrollSnapDestination != aNewData.mScrollSnapDestination
       || mTopLayer != aNewData.mTopLayer
       || mResize != aNewData.mResize) {
     return nsChangeHint_ReconstructFrame;
@@ -3896,16 +3894,23 @@ nsStyleDisplay::CalcDifference(const nsS
   }
 
   // If touch-action is changed, we need to regenerate the event regions on
   // the layers and send it over to the compositor for APZ to handle.
   if (mTouchAction != aNewData.mTouchAction) {
     hint |= nsChangeHint_RepaintFrame;
   }
 
+  // If overscroll-behavior has changed, the changes are picked up
+  // during a repaint.
+  if (mOverscrollBehaviorX != aNewData.mOverscrollBehaviorX ||
+      mOverscrollBehaviorY != aNewData.mOverscrollBehaviorY) {
+    hint |= nsChangeHint_SchedulePaint;
+  }
+
   // Note:  Our current behavior for handling changes to the
   // transition-duration, transition-delay, and transition-timing-function
   // properties is to do nothing.  In other words, the transition
   // property that matters is what it is when the transition begins, and
   // we don't stop a transition later because the transition property
   // changed.
   // We do handle changes to transition-property, but we don't need to
   // bother with anything here, since the transition manager is notified