Bug 951793 - Do not reconstruct the frame when overscroll-behavior has changed. r=mstange
☠☠ backed out by d7a700707ddb ☠ ☠
authorBotond Ballo <botond@mozilla.com>
Wed, 22 Nov 2017 19:06:43 -0500
changeset 438176 6eef6403fa715d41734f4ed740a6a6a0cad33eb0
parent 438175 a5e529f52fb19b1545e0d6c36dc04dba75a747bd
child 438177 ca8c86e229df948fe7d06590b7435ddb9e13a1a6
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