Bug 951793 - Add overscroll-behavior attributes to ScrollbarStyles. r=mstange
☠☠ backed out by d7a700707ddb ☠ ☠
authorBotond Ballo <botond@mozilla.com>
Wed, 18 Oct 2017 19:13:02 -0400
changeset 438164 867d8ea5355c6370c1e374554deeb24ba4ded941
parent 438163 e61ac8e48971721fe8de73b614df7c4f6d791f96
child 438165 fa82cdc01408ea0d804541f6923a6eceb8b485c9
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersmstange
bugs951793
milestone59.0a1
Bug 951793 - Add overscroll-behavior attributes to ScrollbarStyles. r=mstange MozReview-Commit-ID: 7fksMZdDSrG
layout/base/ScrollbarStyles.cpp
layout/base/ScrollbarStyles.h
--- a/layout/base/ScrollbarStyles.cpp
+++ b/layout/base/ScrollbarStyles.cpp
@@ -8,26 +8,30 @@
 #include "nsStyleStruct.h" // for nsStyleDisplay and nsStyleBackground::Position
 
 namespace mozilla {
 
   ScrollbarStyles::ScrollbarStyles(uint8_t aH, uint8_t aV,
                                    const nsStyleDisplay* aDisplay)
     : mHorizontal(aH), mVertical(aV),
       mScrollBehavior(aDisplay->mScrollBehavior),
+      mOverscrollBehaviorX(aDisplay->mOverscrollBehaviorX),
+      mOverscrollBehaviorY(aDisplay->mOverscrollBehaviorY),
       mScrollSnapTypeX(aDisplay->mScrollSnapTypeX),
       mScrollSnapTypeY(aDisplay->mScrollSnapTypeY),
       mScrollSnapPointsX(aDisplay->mScrollSnapPointsX),
       mScrollSnapPointsY(aDisplay->mScrollSnapPointsY),
       mScrollSnapDestinationX(aDisplay->mScrollSnapDestination.mXPosition),
       mScrollSnapDestinationY(aDisplay->mScrollSnapDestination.mYPosition) {}
 
   ScrollbarStyles::ScrollbarStyles(const nsStyleDisplay* aDisplay)
     : mHorizontal(aDisplay->mOverflowX), mVertical(aDisplay->mOverflowY),
       mScrollBehavior(aDisplay->mScrollBehavior),
+      mOverscrollBehaviorX(aDisplay->mOverscrollBehaviorX),
+      mOverscrollBehaviorY(aDisplay->mOverscrollBehaviorY),
       mScrollSnapTypeX(aDisplay->mScrollSnapTypeX),
       mScrollSnapTypeY(aDisplay->mScrollSnapTypeY),
       mScrollSnapPointsX(aDisplay->mScrollSnapPointsX),
       mScrollSnapPointsY(aDisplay->mScrollSnapPointsY),
       mScrollSnapDestinationX(aDisplay->mScrollSnapDestination.mXPosition),
       mScrollSnapDestinationY(aDisplay->mScrollSnapDestination.mYPosition) {}
 
 } // namespace mozilla
--- a/layout/base/ScrollbarStyles.h
+++ b/layout/base/ScrollbarStyles.h
@@ -21,28 +21,32 @@ struct ScrollbarStyles
 {
   // Always one of NS_STYLE_OVERFLOW_SCROLL, NS_STYLE_OVERFLOW_HIDDEN,
   // or NS_STYLE_OVERFLOW_AUTO.
   uint8_t mHorizontal;
   uint8_t mVertical;
   // Always one of NS_STYLE_SCROLL_BEHAVIOR_AUTO or
   // NS_STYLE_SCROLL_BEHAVIOR_SMOOTH
   uint8_t mScrollBehavior;
+  mozilla::StyleOverscrollBehavior mOverscrollBehaviorX;
+  mozilla::StyleOverscrollBehavior mOverscrollBehaviorY;
   // Always one of NS_STYLE_SCROLL_SNAP_NONE, NS_STYLE_SCROLL_SNAP_MANDATORY,
   // or NS_STYLE_SCROLL_SNAP_PROXIMITY.
   uint8_t mScrollSnapTypeX;
   uint8_t mScrollSnapTypeY;
   nsStyleCoord mScrollSnapPointsX;
   nsStyleCoord mScrollSnapPointsY;
   nsStyleCoord::CalcValue mScrollSnapDestinationX;
   nsStyleCoord::CalcValue mScrollSnapDestinationY;
 
   ScrollbarStyles(uint8_t aH, uint8_t aV)
     : mHorizontal(aH), mVertical(aV),
       mScrollBehavior(NS_STYLE_SCROLL_BEHAVIOR_AUTO),
+      mOverscrollBehaviorX(StyleOverscrollBehavior::Auto),
+      mOverscrollBehaviorY(StyleOverscrollBehavior::Auto),
       mScrollSnapTypeX(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
       mScrollSnapTypeY(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
       mScrollSnapPointsX(nsStyleCoord(eStyleUnit_None)),
       mScrollSnapPointsY(nsStyleCoord(eStyleUnit_None)) {
 
     mScrollSnapDestinationX.mPercent = 0;
     mScrollSnapDestinationX.mLength = nscoord(0.0f);
     mScrollSnapDestinationX.mHasPercent = false;
@@ -51,16 +55,18 @@ struct ScrollbarStyles
     mScrollSnapDestinationY.mHasPercent = false;
   }
 
   explicit ScrollbarStyles(const nsStyleDisplay* aDisplay);
   ScrollbarStyles(uint8_t aH, uint8_t aV, const nsStyleDisplay* aDisplay);
   bool operator==(const ScrollbarStyles& aStyles) const {
     return aStyles.mHorizontal == mHorizontal && aStyles.mVertical == mVertical &&
            aStyles.mScrollBehavior == mScrollBehavior &&
+           aStyles.mOverscrollBehaviorX == mOverscrollBehaviorX &&
+           aStyles.mOverscrollBehaviorY == mOverscrollBehaviorY &&
            aStyles.mScrollSnapTypeX == mScrollSnapTypeX &&
            aStyles.mScrollSnapTypeY == mScrollSnapTypeY &&
            aStyles.mScrollSnapPointsX == mScrollSnapPointsX &&
            aStyles.mScrollSnapPointsY == mScrollSnapPointsY &&
            aStyles.mScrollSnapDestinationX == mScrollSnapDestinationX &&
            aStyles.mScrollSnapDestinationY == mScrollSnapDestinationY;
   }
   bool operator!=(const ScrollbarStyles& aStyles) const {