Bug 1325940 part 2 - Converted NS_STYLE_BORDER_IMAGE_REPEAT_* to an enum class. r=emilio
authorXidorn Quan <me@upsuper.org>
Thu, 21 Dec 2017 16:16:40 +1100
changeset 397131 c9fceb1a76ec9b85dd4aeb6be1ea61e04b421ec8
parent 397130 06ac73f3f76fccb670d383e2c5614eef7e40063d
child 397132 4d07f50ba637177239af481eac9202d5e15a13eb
push id33127
push useraiakab@mozilla.com
push dateThu, 21 Dec 2017 22:17:05 +0000
treeherdermozilla-central@d20967c26da5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1325940
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1325940 part 2 - Converted NS_STYLE_BORDER_IMAGE_REPEAT_* to an enum class. r=emilio MozReview-Commit-ID: Kdzm5D8Dpv
gfx/webrender_bindings/WebRenderTypes.h
layout/painting/nsCSSRendering.cpp
layout/painting/nsCSSRenderingBorders.cpp
layout/painting/nsCSSRenderingBorders.h
layout/painting/nsImageRenderer.cpp
layout/painting/nsImageRenderer.h
layout/style/ServoBindings.toml
layout/style/nsCSSDataBlock.cpp
layout/style/nsCSSParser.cpp
layout/style/nsCSSProps.cpp
layout/style/nsRuleNode.cpp
layout/style/nsStyleConsts.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
--- a/gfx/webrender_bindings/WebRenderTypes.h
+++ b/gfx/webrender_bindings/WebRenderTypes.h
@@ -485,26 +485,26 @@ static inline wr::SideOffsets2D_f32 ToSi
   SideOffsets2D_f32 offset;
   offset.top = top;
   offset.right = right;
   offset.bottom = bottom;
   offset.left = left;
   return offset;
 }
 
-static inline wr::RepeatMode ToRepeatMode(uint8_t repeatMode)
+static inline wr::RepeatMode ToRepeatMode(mozilla::StyleBorderImageRepeat repeatMode)
 {
   switch (repeatMode) {
-  case NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH:
+  case mozilla::StyleBorderImageRepeat::Stretch:
     return wr::RepeatMode::Stretch;
-  case NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT:
+  case mozilla::StyleBorderImageRepeat::Repeat:
     return wr::RepeatMode::Repeat;
-  case NS_STYLE_BORDER_IMAGE_REPEAT_ROUND:
+  case mozilla::StyleBorderImageRepeat::Round:
     return wr::RepeatMode::Round;
-  case NS_STYLE_BORDER_IMAGE_REPEAT_SPACE:
+  case mozilla::StyleBorderImageRepeat::Space:
     return wr::RepeatMode::Space;
   default:
     MOZ_ASSERT(false);
   }
 
   return wr::RepeatMode::Stretch;
 }
 
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -744,20 +744,20 @@ nsCSSRendering::CreateWebRenderCommandsF
   bool imageTypeSupported = false;
   // FIXME(1409773): fix this: image->GetType() == eStyleImageType_Image
   // FIXME(1409774): fix this: image->GetType() == eStyleImageType_Gradient;
 
   if (!imageTypeSupported) {
     return false;
   }
 
-  if (styleBorder->mBorderImageRepeatH == NS_STYLE_BORDER_IMAGE_REPEAT_ROUND ||
-      styleBorder->mBorderImageRepeatH == NS_STYLE_BORDER_IMAGE_REPEAT_SPACE ||
-      styleBorder->mBorderImageRepeatV == NS_STYLE_BORDER_IMAGE_REPEAT_ROUND ||
-      styleBorder->mBorderImageRepeatV == NS_STYLE_BORDER_IMAGE_REPEAT_SPACE) {
+  if (styleBorder->mBorderImageRepeatH == StyleBorderImageRepeat::Round ||
+      styleBorder->mBorderImageRepeatH == StyleBorderImageRepeat::Space ||
+      styleBorder->mBorderImageRepeatV == StyleBorderImageRepeat::Round ||
+      styleBorder->mBorderImageRepeatV == StyleBorderImageRepeat::Space) {
     return false;
   }
 
 
   uint32_t flags = 0;
   if (aDisplayListBuilder->ShouldSyncDecodeImages()) {
     flags |= nsImageRenderer::FLAG_SYNC_DECODE_IMAGES;
   }
--- a/layout/painting/nsCSSRenderingBorders.cpp
+++ b/layout/painting/nsCSSRenderingBorders.cpp
@@ -3749,17 +3749,17 @@ nsCSSBorderImageRenderer::DrawBorderImag
     std::max(mImageSize.height - mSlice.top - mSlice.bottom, 0),
     mSlice.bottom,
   };
 
   ImgDrawResult result = ImgDrawResult::SUCCESS;
 
   for (int i = LEFT; i <= RIGHT; i++) {
     for (int j = TOP; j <= BOTTOM; j++) {
-      uint8_t fillStyleH, fillStyleV;
+      StyleBorderImageRepeat fillStyleH, fillStyleV;
       nsSize unitSize;
 
       if (i == MIDDLE && j == MIDDLE) {
         // Discard the middle portion unless set to fill.
         if (NS_STYLE_BORDER_IMAGE_SLICE_NOFILL == mFill) {
           continue;
         }
 
@@ -3803,36 +3803,36 @@ nsCSSBorderImageRenderer::DrawBorderImag
         if (0 < borderHeight[j] && 0 < sliceHeight[j])
           factor = gfxFloat(borderHeight[j]) / sliceHeight[j];
         else
           factor = 1;
 
         unitSize.width = sliceWidth[i] * factor;
         unitSize.height = borderHeight[j];
         fillStyleH = mRepeatModeHorizontal;
-        fillStyleV = NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH;
+        fillStyleV = StyleBorderImageRepeat::Stretch;
 
       } else if (j == MIDDLE) { // left, right
         gfxFloat factor;
         if (0 < borderWidth[i] && 0 < sliceWidth[i])
           factor = gfxFloat(borderWidth[i]) / sliceWidth[i];
         else
           factor = 1;
 
         unitSize.width = borderWidth[i];
         unitSize.height = sliceHeight[j] * factor;
-        fillStyleH = NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH;
+        fillStyleH = StyleBorderImageRepeat::Stretch;
         fillStyleV = mRepeatModeVertical;
 
       } else {
         // Corners are always stretched to fit the corner.
         unitSize.width = borderWidth[i];
         unitSize.height = borderHeight[j];
-        fillStyleH = NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH;
-        fillStyleV = NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH;
+        fillStyleH = StyleBorderImageRepeat::Stretch;
+        fillStyleV = StyleBorderImageRepeat::Stretch;
       }
 
       nsRect destArea(borderX[i], borderY[j], borderWidth[i], borderHeight[j]);
       nsRect subArea(sliceX[i], sliceY[j], sliceWidth[i], sliceHeight[j]);
       if (subArea.IsEmpty())
         continue;
 
       nsIntRect intSubArea = subArea.ToOutsidePixels(nsPresContext::AppUnitsPerCSSPixel());
--- a/layout/painting/nsCSSRenderingBorders.h
+++ b/layout/painting/nsCSSRenderingBorders.h
@@ -331,18 +331,18 @@ private:
 
   nsImageRenderer mImageRenderer;
   nsSize mImageSize;
   nsMargin mSlice;
   nsMargin mWidths;
   nsMargin mImageOutset;
   nsRect mArea;
   nsRect mClip;
-  uint8_t mRepeatModeHorizontal;
-  uint8_t mRepeatModeVertical;
+  mozilla::StyleBorderImageRepeat mRepeatModeHorizontal;
+  mozilla::StyleBorderImageRepeat mRepeatModeVertical;
   uint8_t mFill;
 
   friend class nsDisplayBorder;
   friend struct nsCSSRendering;
 };
 
 namespace mozilla {
 #ifdef DEBUG_NEW_BORDERS
--- a/layout/painting/nsImageRenderer.cpp
+++ b/layout/painting/nsImageRenderer.cpp
@@ -740,78 +740,78 @@ nsImageRenderer::BuildWebRenderDisplayIt
                                     aOpacity);
 }
 
 /**
  * Compute the size and position of the master copy of the image. I.e., a single
  * tile used to fill the dest rect.
  * aFill The destination rect to be filled
  * aHFill and aVFill are the repeat patterns for the component -
- * NS_STYLE_BORDER_IMAGE_REPEAT_* - i.e., how a tiling unit is used to fill aFill
+ * StyleBorderImageRepeat - i.e., how a tiling unit is used to fill aFill
  * aUnitSize The size of the source rect in dest coords.
  */
 static nsRect
 ComputeTile(nsRect&              aFill,
-            uint8_t              aHFill,
-            uint8_t              aVFill,
+            StyleBorderImageRepeat aHFill,
+            StyleBorderImageRepeat aVFill,
             const nsSize&        aUnitSize,
             nsSize&              aRepeatSize)
 {
   nsRect tile;
   switch (aHFill) {
-  case NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH:
+  case StyleBorderImageRepeat::Stretch:
     tile.x = aFill.x;
     tile.width = aFill.width;
     aRepeatSize.width = tile.width;
     break;
-  case NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT:
+  case StyleBorderImageRepeat::Repeat:
     tile.x = aFill.x + aFill.width/2 - aUnitSize.width/2;
     tile.width = aUnitSize.width;
     aRepeatSize.width = tile.width;
     break;
-  case NS_STYLE_BORDER_IMAGE_REPEAT_ROUND:
+  case StyleBorderImageRepeat::Round:
     tile.x = aFill.x;
     tile.width = nsCSSRendering::ComputeRoundedSize(aUnitSize.width,
                                                     aFill.width);
     aRepeatSize.width = tile.width;
     break;
-  case NS_STYLE_BORDER_IMAGE_REPEAT_SPACE:
+  case StyleBorderImageRepeat::Space:
     {
       nscoord space;
       aRepeatSize.width =
         nsCSSRendering::ComputeBorderSpacedRepeatSize(aUnitSize.width,
                                                       aFill.width, space);
       tile.x = aFill.x + space;
       tile.width = aUnitSize.width;
       aFill.x = tile.x;
       aFill.width = aFill.width - space * 2;
     }
     break;
   default:
     NS_NOTREACHED("unrecognized border-image fill style");
   }
 
   switch (aVFill) {
-  case NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH:
+  case StyleBorderImageRepeat::Stretch:
     tile.y = aFill.y;
     tile.height = aFill.height;
     aRepeatSize.height = tile.height;
     break;
-  case NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT:
+  case StyleBorderImageRepeat::Repeat:
     tile.y = aFill.y + aFill.height/2 - aUnitSize.height/2;
     tile.height = aUnitSize.height;
     aRepeatSize.height = tile.height;
     break;
-  case NS_STYLE_BORDER_IMAGE_REPEAT_ROUND:
+  case StyleBorderImageRepeat::Round:
     tile.y = aFill.y;
     tile.height = nsCSSRendering::ComputeRoundedSize(aUnitSize.height,
                                                      aFill.height);
     aRepeatSize.height = tile.height;
     break;
-  case NS_STYLE_BORDER_IMAGE_REPEAT_SPACE:
+  case StyleBorderImageRepeat::Space:
     {
       nscoord space;
       aRepeatSize.height =
         nsCSSRendering::ComputeBorderSpacedRepeatSize(aUnitSize.height,
                                                       aFill.height, space);
       tile.y = aFill.y + space;
       tile.height = aUnitSize.height;
       aFill.y = tile.y;
@@ -827,36 +827,36 @@ ComputeTile(nsRect&              aFill,
 
 /**
  * Returns true if the given set of arguments will require the tiles which fill
  * the dest rect to be scaled from the source tile. See comment on ComputeTile
  * for argument descriptions.
  */
 static bool
 RequiresScaling(const nsRect&        aFill,
-                uint8_t              aHFill,
-                uint8_t              aVFill,
+                StyleBorderImageRepeat aHFill,
+                StyleBorderImageRepeat aVFill,
                 const nsSize&        aUnitSize)
 {
   // If we have no tiling in either direction, we can skip the intermediate
   // scaling step.
-  return (aHFill != NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH ||
-          aVFill != NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH) &&
+  return (aHFill != StyleBorderImageRepeat::Stretch ||
+          aVFill != StyleBorderImageRepeat::Stretch) &&
          (aUnitSize.width != aFill.width ||
           aUnitSize.height != aFill.height);
 }
 
 ImgDrawResult
 nsImageRenderer::DrawBorderImageComponent(nsPresContext*       aPresContext,
                                           gfxContext&          aRenderingContext,
                                           const nsRect&        aDirtyRect,
                                           const nsRect&        aFill,
                                           const CSSIntRect&    aSrc,
-                                          uint8_t              aHFill,
-                                          uint8_t              aVFill,
+                                          StyleBorderImageRepeat aHFill,
+                                          StyleBorderImageRepeat aVFill,
                                           const nsSize&        aUnitSize,
                                           uint8_t              aIndex,
                                           const Maybe<nsSize>& aSVGViewportSize,
                                           const bool           aHasIntrinsicRatio)
 {
   if (!IsReady()) {
     NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
     return ImgDrawResult::BAD_ARGS;
--- a/layout/painting/nsImageRenderer.h
+++ b/layout/painting/nsImageRenderer.h
@@ -242,18 +242,18 @@ public:
    * intrinsic ratio.
    */
   ImgDrawResult
   DrawBorderImageComponent(nsPresContext*       aPresContext,
                            gfxContext&          aRenderingContext,
                            const nsRect&        aDirtyRect,
                            const nsRect&        aFill,
                            const mozilla::CSSIntRect& aSrc,
-                           uint8_t              aHFill,
-                           uint8_t              aVFill,
+                           mozilla::StyleBorderImageRepeat aHFill,
+                           mozilla::StyleBorderImageRepeat aVFill,
                            const nsSize&        aUnitSize,
                            uint8_t              aIndex,
                            const mozilla::Maybe<nsSize>& aSVGViewportSize,
                            const bool           aHasIntrinsicRatio);
 
   bool IsRasterImage();
   bool IsAnimatedImage();
 
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -163,16 +163,17 @@ rusty-enums = [
     "StyleTextJustify",
     "StyleHyphens",
     "StyleGeometryBox",
     "StyleFillRule",
     "StyleShapeSourceType",
     "StyleBasicShapeType",
     "nsStyleImageLayers_Size_DimensionType",
     "StyleStackSizing",
+    "StyleBorderImageRepeat",
     "StyleBoxPack",
     "StyleBoxOrient",
     "StyleBoxAlign",
     "StyleUserFocus",
     "StyleUserSelect",
     "StyleImageLayerRepeat",
     "StyleBoxDecorationBreak",
     "StyleRuleInclusion",
--- a/layout/style/nsCSSDataBlock.cpp
+++ b/layout/style/nsCSSDataBlock.cpp
@@ -449,18 +449,17 @@ nsCSSCompressedDataBlock::HasDefaultBord
   return outset.AllSidesEqualTo(nsCSSValue(0.0f, eCSSUnit_Number));
 }
 
 bool
 nsCSSCompressedDataBlock::HasDefaultBorderImageRepeat() const
 {
   const nsCSSValuePair &repeat =
     ValueFor(eCSSProperty_border_image_repeat)->GetPairValue();
-  return repeat.BothValuesEqualTo(
-    nsCSSValue(NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH, eCSSUnit_Enumerated));
+  return repeat.BothValuesEqualTo(nsCSSValue(StyleBorderImageRepeat::Stretch));
 }
 
 /*****************************************************************************/
 
 nsCSSExpandedDataBlock::nsCSSExpandedDataBlock()
 {
   AssertInitialState();
 }
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -13153,18 +13153,17 @@ CSSParserImpl::SetBorderImageInitialValu
   nsCSSValue outset;
   nsCSSRect& outsetBox = outset.SetRectValue();
   outsetBox.SetAllSidesTo(nsCSSValue(0.0f, eCSSUnit_Number));
   AppendValue(eCSSProperty_border_image_outset, outset);
 
   // border-image-repeat: repeat
   nsCSSValue repeat;
   nsCSSValuePair repeatPair;
-  repeatPair.SetBothValuesTo(nsCSSValue(NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH,
-                                        eCSSUnit_Enumerated));
+  repeatPair.SetBothValuesTo(nsCSSValue(StyleBorderImageRepeat::Stretch));
   repeat.SetPairValue(&repeatPair);
   AppendValue(eCSSProperty_border_image_repeat, repeat);
 }
 
 bool
 CSSParserImpl::ParseBorderImageSlice(bool aAcceptsInherit,
                                      bool* aConsumedTokens)
 {
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -999,20 +999,20 @@ const KTableEntry nsCSSProps::kBlendMode
 
 const KTableEntry nsCSSProps::kBorderCollapseKTable[] = {
   { eCSSKeyword_collapse,  NS_STYLE_BORDER_COLLAPSE },
   { eCSSKeyword_separate,  NS_STYLE_BORDER_SEPARATE },
   { eCSSKeyword_UNKNOWN,   -1 }
 };
 
 const KTableEntry nsCSSProps::kBorderImageRepeatKTable[] = {
-  { eCSSKeyword_stretch, NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH },
-  { eCSSKeyword_repeat, NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT },
-  { eCSSKeyword_round, NS_STYLE_BORDER_IMAGE_REPEAT_ROUND },
-  { eCSSKeyword_space, NS_STYLE_BORDER_IMAGE_REPEAT_SPACE },
+  { eCSSKeyword_stretch, StyleBorderImageRepeat::Stretch },
+  { eCSSKeyword_repeat, StyleBorderImageRepeat::Repeat },
+  { eCSSKeyword_round, StyleBorderImageRepeat::Round },
+  { eCSSKeyword_space, StyleBorderImageRepeat::Space },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kBorderImageSliceKTable[] = {
   { eCSSKeyword_fill, NS_STYLE_BORDER_IMAGE_SLICE_FILL },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -1420,16 +1420,17 @@ struct SetEnumValueHelper
   { \
     auto value = aValue.GetIntValue(); \
     MOZ_ASSERT(value >= static_cast<decltype(value)>(type_::min_) && \
                value <= static_cast<decltype(value)>(type_::max_), \
                "inappropriate value"); \
     aField = static_cast<type_>(value); \
   }
 
+  DEFINE_ENUM_CLASS_SETTER(StyleBorderImageRepeat, Stretch, Space)
   DEFINE_ENUM_CLASS_SETTER(StyleBoxAlign, Stretch, End)
   DEFINE_ENUM_CLASS_SETTER(StyleBoxDecorationBreak, Slice, Clone)
   DEFINE_ENUM_CLASS_SETTER(StyleBoxDirection, Normal, Reverse)
   DEFINE_ENUM_CLASS_SETTER(StyleBoxOrient, Horizontal, Vertical)
   DEFINE_ENUM_CLASS_SETTER(StyleBoxPack, Start, Justify)
   DEFINE_ENUM_CLASS_SETTER(StyleBoxSizing, Content, Border)
   DEFINE_ENUM_CLASS_SETTER(StyleClear, None, Both)
   DEFINE_ENUM_CLASS_SETTER(StyleContent, OpenQuote, AltContent)
@@ -7597,24 +7598,24 @@ nsRuleNode::ComputeBorderData(void* aSta
   SetBorderImagePair(*aRuleData->ValueForBorderImageRepeat(),
                      borderImageRepeat);
 
   SetValue(borderImageRepeat.mXValue,
            border->mBorderImageRepeatH,
            conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentBorder->mBorderImageRepeatH,
-           NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH);
+           StyleBorderImageRepeat::Stretch);
 
   SetValue(borderImageRepeat.mYValue,
            border->mBorderImageRepeatV,
            conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentBorder->mBorderImageRepeatV,
-           NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH);
+           StyleBorderImageRepeat::Stretch);
 
   COMPUTE_END_RESET(Border, border)
 }
 
 const void*
 nsRuleNode::ComputePaddingData(void* aStartStruct,
                                const nsRuleData* aRuleData,
                                GeckoStyleContext* aContext,
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -332,21 +332,23 @@ enum class StyleImageLayerRepeat : uint8
 #define NS_STYLE_BORDER_STYLE_DASHED            4
 #define NS_STYLE_BORDER_STYLE_SOLID             5
 #define NS_STYLE_BORDER_STYLE_DOUBLE            6
 #define NS_STYLE_BORDER_STYLE_INSET             7
 #define NS_STYLE_BORDER_STYLE_OUTSET            8
 #define NS_STYLE_BORDER_STYLE_HIDDEN            9
 #define NS_STYLE_BORDER_STYLE_AUTO              10 // for outline-style only
 
-// See nsStyleBorder mBorderImage
-#define NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH    0
-#define NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT     1
-#define NS_STYLE_BORDER_IMAGE_REPEAT_ROUND      2
-#define NS_STYLE_BORDER_IMAGE_REPEAT_SPACE      3
+// border-image-repeat
+enum class StyleBorderImageRepeat : uint8_t {
+  Stretch,
+  Repeat,
+  Round,
+  Space
+};
 
 #define NS_STYLE_BORDER_IMAGE_SLICE_NOFILL      0
 #define NS_STYLE_BORDER_IMAGE_SLICE_FILL        1
 
 // See nsStyleContent
 enum class StyleContent : uint8_t {
   OpenQuote,
   CloseQuote,
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -332,18 +332,18 @@ nsStylePadding::CalcDifference(const nsS
   // force reflow of all descendants, but the hint would need to force
   // reflow of the frame's children (see how
   // ReflowInput::InitResizeFlags initializes the inline-resize flag).
   return NS_STYLE_HINT_REFLOW & ~nsChangeHint_ClearDescendantIntrinsics;
 }
 
 nsStyleBorder::nsStyleBorder(const nsPresContext* aContext)
   : mBorderImageFill(NS_STYLE_BORDER_IMAGE_SLICE_NOFILL)
-  , mBorderImageRepeatH(NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH)
-  , mBorderImageRepeatV(NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH)
+  , mBorderImageRepeatH(StyleBorderImageRepeat::Stretch)
+  , mBorderImageRepeatV(StyleBorderImageRepeat::Stretch)
   , mFloatEdge(StyleFloatEdge::ContentBox)
   , mBoxDecorationBreak(StyleBoxDecorationBreak::Slice)
   , mComputedBorder(0, 0, 0, 0)
 {
   MOZ_COUNT_CTOR(nsStyleBorder);
 
   NS_FOR_CSS_HALF_CORNERS (corner) {
     mBorderRadius.Set(corner, nsStyleCoord(0, nsStyleCoord::CoordConstructor));
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1248,18 +1248,18 @@ public:
   mozilla::UniquePtr<nsBorderColors> mBorderColors;
   nsStyleCorners mBorderRadius;       // [reset] coord, percent
   nsStyleImage   mBorderImageSource;  // [reset]
   nsStyleSides   mBorderImageSlice;   // [reset] factor, percent
   nsStyleSides   mBorderImageWidth;   // [reset] length, factor, percent, auto
   nsStyleSides   mBorderImageOutset;  // [reset] length, factor
 
   uint8_t        mBorderImageFill;    // [reset]
-  uint8_t        mBorderImageRepeatH; // [reset] see nsStyleConsts.h
-  uint8_t        mBorderImageRepeatV; // [reset]
+  mozilla::StyleBorderImageRepeat mBorderImageRepeatH; // [reset]
+  mozilla::StyleBorderImageRepeat mBorderImageRepeatV; // [reset]
   mozilla::StyleFloatEdge mFloatEdge; // [reset]
   mozilla::StyleBoxDecorationBreak mBoxDecorationBreak; // [reset]
 
 protected:
   uint8_t       mBorderStyle[4];  // [reset] See nsStyleConsts.h
 
 public:
   // [reset] the colors to use for a simple border.