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
--- 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