Bug 1340044 - Part 2. Rename value in StyleGeometryBox. draft
authorcku <cku@mozilla.com>
Thu, 16 Mar 2017 15:18:10 +0800
changeset 500399 8fe31c5cbe428b42a02c7d46450173f034b88c4f
parent 500398 fbf98148c1a5ca9b453eb41a4d9e56ab9dda5549
child 549633 287aeb9a1a04525bbd600ff197d01f0c9ec9be21
push id49718
push userbmo:cku@mozilla.com
push dateFri, 17 Mar 2017 05:30:24 +0000
bugs1340044
milestone55.0a1
Bug 1340044 - Part 2. Rename value in StyleGeometryBox. This change is to use gecko_enum_prefix in helpers.mako.rs, so that we do not need to manually write code for nsStyleDisplay::mTransformBox. MozReview-Commit-ID: 7UAL0iUcSIO
layout/base/nsLayoutUtils.cpp
layout/generic/nsFloatManager.cpp
layout/generic/nsFrame.cpp
layout/painting/nsCSSRendering.cpp
layout/painting/nsDisplayList.cpp
layout/style/Declaration.cpp
layout/style/nsCSSParser.cpp
layout/style/nsCSSProps.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsRuleNode.cpp
layout/style/nsStyleConsts.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleTransformMatrix.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -6969,17 +6969,17 @@ nsLayoutUtils::GetFrameTransparency(nsIF
 
   nsStyleContext* bgSC;
   if (!nsCSSRendering::FindBackground(aBackgroundFrame, &bgSC)) {
     return eTransparencyTransparent;
   }
   const nsStyleBackground* bg = bgSC->StyleBackground();
   if (NS_GET_A(bg->BackgroundColor(bgSC)) < 255 ||
       // bottom layer's clip is used for the color
-      bg->BottomLayer().mClip != StyleGeometryBox::Border)
+      bg->BottomLayer().mClip != StyleGeometryBox::BorderBox)
     return eTransparencyTransparent;
   return eTransparencyOpaque;
 }
 
 static bool IsPopupFrame(nsIFrame* aFrame)
 {
   // aFrame is a popup it's the list control frame dropdown for a combobox.
   nsIAtom* frameType = aFrame->GetType();
@@ -9335,27 +9335,27 @@ ComputeSVGReferenceRect(nsIFrame* aFrame
                         StyleGeometryBox aGeometryBox)
 {
   MOZ_ASSERT(aFrame->GetContent()->IsSVGElement());
   nsRect r;
 
   // For SVG elements without associated CSS layout box, the used value for
   // content-box, padding-box, border-box and margin-box is fill-box.
   switch (aGeometryBox) {
-    case StyleGeometryBox::Stroke: {
+    case StyleGeometryBox::StrokeBox: {
       // XXX Bug 1299876
       // The size of srtoke-box is not correct if this graphic element has
       // specific stroke-linejoin or stroke-linecap.
       gfxRect bbox = nsSVGUtils::GetBBox(aFrame,
                 nsSVGUtils::eBBoxIncludeFill | nsSVGUtils::eBBoxIncludeStroke);
       r = nsLayoutUtils::RoundGfxRectToAppRect(bbox,
                                          nsPresContext::AppUnitsPerCSSPixel());
       break;
     }
-    case StyleGeometryBox::View: {
+    case StyleGeometryBox::ViewBox: {
       nsIContent* content = aFrame->GetContent();
       nsSVGElement* element = static_cast<nsSVGElement*>(content);
       SVGSVGElement* svgElement = element->GetCtx();
       MOZ_ASSERT(svgElement);
 
       if (svgElement && svgElement->HasViewBoxRect()) {
         // If a ‘viewBox‘ attribute is specified for the SVG viewport creating
         // element:
@@ -9376,21 +9376,21 @@ ComputeSVGReferenceRect(nsIFrame* aFrame
         r = nsRect(0, 0,
                    nsPresContext::CSSPixelsToAppUnits(viewportSize.width),
                    nsPresContext::CSSPixelsToAppUnits(viewportSize.height));
       }
 
       break;
     }
     case StyleGeometryBox::NoBox:
-    case StyleGeometryBox::Border:
-    case StyleGeometryBox::Content:
-    case StyleGeometryBox::Padding:
-    case StyleGeometryBox::Margin:
-    case StyleGeometryBox::Fill: {
+    case StyleGeometryBox::BorderBox:
+    case StyleGeometryBox::ContentBox:
+    case StyleGeometryBox::PaddingBox:
+    case StyleGeometryBox::MarginBox:
+    case StyleGeometryBox::FillBox: {
       gfxRect bbox = nsSVGUtils::GetBBox(aFrame,
                                          nsSVGUtils::eBBoxIncludeFill);
       r = nsLayoutUtils::RoundGfxRectToAppRect(bbox,
                                          nsPresContext::AppUnitsPerCSSPixel());
       break;
     }
     default:{
       MOZ_ASSERT_UNREACHABLE("unknown StyleGeometryBox type");
@@ -9409,30 +9409,30 @@ static nsRect
 ComputeHTMLReferenceRect(nsIFrame* aFrame,
                          StyleGeometryBox aGeometryBox)
 {
   nsRect r;
 
   // For elements with associated CSS layout box, the used value for fill-box,
   // stroke-box and view-box is border-box.
   switch (aGeometryBox) {
-    case StyleGeometryBox::Content:
+    case StyleGeometryBox::ContentBox:
       r = aFrame->GetContentRectRelativeToSelf();
       break;
-    case StyleGeometryBox::Padding:
+    case StyleGeometryBox::PaddingBox:
       r = aFrame->GetPaddingRectRelativeToSelf();
       break;
-    case StyleGeometryBox::Margin:
+    case StyleGeometryBox::MarginBox:
       r = aFrame->GetMarginRectRelativeToSelf();
       break;
     case StyleGeometryBox::NoBox:
-    case StyleGeometryBox::Border:
-    case StyleGeometryBox::Fill:
-    case StyleGeometryBox::Stroke:
-    case StyleGeometryBox::View:
+    case StyleGeometryBox::BorderBox:
+    case StyleGeometryBox::FillBox:
+    case StyleGeometryBox::StrokeBox:
+    case StyleGeometryBox::ViewBox:
       r = aFrame->GetRectRelativeToSelf();
       break;
     default:
       MOZ_ASSERT_UNREACHABLE("unknown StyleGeometryBox type");
       r = aFrame->GetRectRelativeToSelf();
       break;
   }
 
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -927,26 +927,26 @@ nsFloatManager::ShapeInfo::ComputeShapeB
   const StyleShapeSource& aShapeOutside,
   nsIFrame* const aFrame,
   const mozilla::LogicalRect& aMarginRect,
   mozilla::WritingMode aWM)
 {
   LogicalRect rect = aMarginRect;
 
   switch (aShapeOutside.GetReferenceBox()) {
-    case StyleGeometryBox::Content:
+    case StyleGeometryBox::ContentBox:
       rect.Deflate(aWM, aFrame->GetLogicalUsedPadding(aWM));
       MOZ_FALLTHROUGH;
-    case StyleGeometryBox::Padding:
+    case StyleGeometryBox::PaddingBox:
       rect.Deflate(aWM, aFrame->GetLogicalUsedBorder(aWM));
       MOZ_FALLTHROUGH;
-    case StyleGeometryBox::Border:
+    case StyleGeometryBox::BorderBox:
       rect.Deflate(aWM, aFrame->GetLogicalUsedMargin(aWM));
       break;
-    case StyleGeometryBox::Margin:
+    case StyleGeometryBox::MarginBox:
       // Do nothing. rect is already a margin rect.
       break;
     case StyleGeometryBox::NoBox:
     default:
       MOZ_ASSERT(aShapeOutside.GetType() != StyleShapeSourceType::Box,
                  "Box source type must have <shape-box> specified!");
       break;
   }
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1494,23 +1494,23 @@ nsIFrame::GetContentBoxBorderRadii(nscoo
 }
 
 bool
 nsIFrame::GetShapeBoxBorderRadii(nscoord aRadii[8]) const
 {
   switch (StyleDisplay()->mShapeOutside.GetReferenceBox()) {
     case StyleGeometryBox::NoBox:
       return false;
-    case StyleGeometryBox::Content:
+    case StyleGeometryBox::ContentBox:
       return GetContentBoxBorderRadii(aRadii);
-    case StyleGeometryBox::Padding:
+    case StyleGeometryBox::PaddingBox:
       return GetPaddingBoxBorderRadii(aRadii);
-    case StyleGeometryBox::Border:
+    case StyleGeometryBox::BorderBox:
       return GetBorderRadii(aRadii);
-    case StyleGeometryBox::Margin:
+    case StyleGeometryBox::MarginBox:
       return GetMarginBoxBorderRadii(aRadii);
     default:
       MOZ_ASSERT_UNREACHABLE("Unexpected box value");
       return false;
   }
   return false;
 }
 
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -2013,43 +2013,44 @@ SetupDirtyRects(const nsRect& aBGClipAre
                        "converted dirty rect should not be empty");
   MOZ_ASSERT(!aDirtyRect->IsEmpty() || aDirtyRectGfx->IsEmpty(),
              "second should be empty if first is");
 }
 
 static bool
 IsSVGStyleGeometryBox(StyleGeometryBox aBox)
 {
-  return (aBox == StyleGeometryBox::Fill || aBox == StyleGeometryBox::Stroke ||
-          aBox == StyleGeometryBox::View);
+  return (aBox == StyleGeometryBox::FillBox ||
+          aBox == StyleGeometryBox::StrokeBox ||
+          aBox == StyleGeometryBox::ViewBox);
 }
 
 static bool
 IsHTMLStyleGeometryBox(StyleGeometryBox aBox)
 {
-  return (aBox == StyleGeometryBox::Content ||
-          aBox == StyleGeometryBox::Padding ||
-          aBox == StyleGeometryBox::Border ||
-          aBox == StyleGeometryBox::Margin);
+  return (aBox == StyleGeometryBox::ContentBox ||
+          aBox == StyleGeometryBox::PaddingBox ||
+          aBox == StyleGeometryBox::BorderBox ||
+          aBox == StyleGeometryBox::MarginBox);
 }
 
 static StyleGeometryBox
 ComputeBoxValue(nsIFrame* aForFrame, StyleGeometryBox aBox)
 {
   if (!(aForFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT)) {
     // For elements with associated CSS layout box, the values fill-box,
     // stroke-box and view-box compute to the initial value of mask-clip.
     if (IsSVGStyleGeometryBox(aBox)) {
-      return StyleGeometryBox::Border;
+      return StyleGeometryBox::BorderBox;
     }
   } else {
     // For SVG elements without associated CSS layout box, the values
     // content-box, padding-box, border-box and margin-box compute to fill-box.
     if (IsHTMLStyleGeometryBox(aBox)) {
-      return StyleGeometryBox::Fill;
+      return StyleGeometryBox::FillBox;
     }
   }
 
   return aBox;
 }
 
 bool
 nsCSSRendering::ImageLayerClipState::IsValid() const
@@ -2083,19 +2084,19 @@ nsCSSRendering::GetImageLayerClip(const 
   if (IsSVGStyleGeometryBox(layerClip)) {
     MOZ_ASSERT(aForFrame->IsFrameOfType(nsIFrame::eSVG) &&
                (aForFrame->GetType() != nsGkAtoms::svgOuterSVGFrame));
 
     // The coordinate space of clipArea is svg user space.
     nsRect clipArea =
       nsLayoutUtils::ComputeGeometryBox(aForFrame, layerClip);
 
-    nsRect strokeBox = (layerClip == StyleGeometryBox::Stroke)
+    nsRect strokeBox = (layerClip == StyleGeometryBox::StrokeBox)
       ? clipArea
-      : nsLayoutUtils::ComputeGeometryBox(aForFrame, StyleGeometryBox::Stroke);
+      : nsLayoutUtils::ComputeGeometryBox(aForFrame, StyleGeometryBox::StrokeBox);
     nsRect clipAreaRelativeToStrokeBox = clipArea - strokeBox.TopLeft();
 
     // aBorderArea is the stroke-box area in a coordinate space defined by
     // the caller. This coordinate space can be svg user space of aForFrame,
     // the space of aForFrame's reference-frame, or anything else.
     //
     // Which coordinate space chosen for aBorderArea is not matter. What
     // matter is to ensure returning aClipState->mBGClipArea in the consistent
@@ -2130,37 +2131,37 @@ nsCSSRendering::GetImageLayerClip(const 
   nsRect clipBorderArea =
     ::BoxDecorationRectForBorder(aForFrame, aBorderArea, skipSides, &aBorder);
 
   bool haveRoundedCorners = GetRadii(aForFrame, aBorder, aBorderArea,
                                      clipBorderArea, aClipState->mRadii);
 
   bool isSolidBorder =
       aWillPaintBorder && IsOpaqueBorder(aBorder);
-  if (isSolidBorder && layerClip == StyleGeometryBox::Border) {
+  if (isSolidBorder && layerClip == StyleGeometryBox::BorderBox) {
     // If we have rounded corners, we need to inflate the background
     // drawing area a bit to avoid seams between the border and
     // background.
     layerClip = haveRoundedCorners
                      ? StyleGeometryBox::MozAlmostPadding
-                     : StyleGeometryBox::Padding;
+                     : StyleGeometryBox::PaddingBox;
   }
 
   aClipState->mBGClipArea = clipBorderArea;
 
   if (aForFrame->GetType() == nsGkAtoms::scrollFrame &&
       NS_STYLE_IMAGELAYER_ATTACHMENT_LOCAL == aLayer.mAttachment) {
     // As of this writing, this is still in discussion in the CSS Working Group
     // http://lists.w3.org/Archives/Public/www-style/2013Jul/0250.html
 
     // The rectangle for 'background-clip' scrolls with the content,
     // but the background is also clipped at a non-scrolling 'padding-box'
     // like the content. (See below.)
     // Therefore, only 'content-box' makes a difference here.
-    if (layerClip == StyleGeometryBox::Content) {
+    if (layerClip == StyleGeometryBox::ContentBox) {
       nsIScrollableFrame* scrollableFrame = do_QueryFrame(aForFrame);
       // Clip at a rectangle attached to the scrolled content.
       aClipState->mHasAdditionalBGClipArea = true;
       aClipState->mAdditionalBGClipArea = nsRect(
         aClipState->mBGClipArea.TopLeft()
           + scrollableFrame->GetScrolledFrame()->GetPosition()
           // For the dir=rtl case:
           + scrollableFrame->GetScrollRange().TopLeft(),
@@ -2170,40 +2171,40 @@ nsCSSRendering::GetImageLayerClip(const 
       // https://bugzilla.mozilla.org/show_bug.cgi?id=748518
       padding.bottom = 0;
       padding.ApplySkipSides(skipSides);
       aClipState->mAdditionalBGClipArea.Deflate(padding);
     }
 
     // Also clip at a non-scrolling, rounded-corner 'padding-box',
     // same as the scrolled content because of the 'overflow' property.
-    layerClip = StyleGeometryBox::Padding;
+    layerClip = StyleGeometryBox::PaddingBox;
   }
 
   // See the comment of StyleGeometryBox::Margin.
   // Hitting this assertion means we decide to turn on margin-box support for
   // positioned mask from CSS parser and style system. In this case, you
   // should *inflate* mBGClipArea by the margin returning from
   // aForFrame->GetUsedMargin() in the code chunk bellow.
-  MOZ_ASSERT(layerClip != StyleGeometryBox::Margin,
-             "StyleGeometryBox::Margin rendering is not supported yet.\n");
-
-  if (layerClip != StyleGeometryBox::Border &&
+  MOZ_ASSERT(layerClip != StyleGeometryBox::MarginBox,
+             "StyleGeometryBox::MarginBox rendering is not supported yet.\n");
+
+  if (layerClip != StyleGeometryBox::BorderBox &&
       layerClip != StyleGeometryBox::Text) {
     nsMargin border = aForFrame->GetUsedBorder();
     if (layerClip == StyleGeometryBox::MozAlmostPadding) {
       // Reduce |border| by 1px (device pixels) on all sides, if
       // possible, so that we don't get antialiasing seams between the
       // {background|mask} and border.
       border.top = std::max(0, border.top - aAppUnitsPerPixel);
       border.right = std::max(0, border.right - aAppUnitsPerPixel);
       border.bottom = std::max(0, border.bottom - aAppUnitsPerPixel);
       border.left = std::max(0, border.left - aAppUnitsPerPixel);
-    } else if (layerClip != StyleGeometryBox::Padding) {
-      NS_ASSERTION(layerClip == StyleGeometryBox::Content,
+    } else if (layerClip != StyleGeometryBox::PaddingBox) {
+      NS_ASSERTION(layerClip == StyleGeometryBox::ContentBox,
                    "unexpected background-clip");
       border += aForFrame->GetUsedPadding();
     }
     border.ApplySkipSides(skipSides);
     aClipState->mBGClipArea.Deflate(border);
 
     if (haveRoundedCorners) {
       nsIFrame::InsetBorderRadii(aClipState->mRadii, border);
@@ -3523,17 +3524,17 @@ nsCSSRendering::PaintStyleImageLayerWith
   nsRect paintBorderArea =
     ::BoxDecorationRectForBackground(aParams.frame, aParams.borderArea,
                                      skipSides, &aBorder);
   nsRect clipBorderArea =
     ::BoxDecorationRectForBorder(aParams.frame, aParams.borderArea,
                                  skipSides, &aBorder);
 
   DrawResult result = DrawResult::SUCCESS;
-  StyleGeometryBox currentBackgroundClip = StyleGeometryBox::Border;
+  StyleGeometryBox currentBackgroundClip = StyleGeometryBox::BorderBox;
   uint32_t count = drawAllLayers
     ? layers.mImageCount                  // iterate all image layers.
     : layers.mImageCount - aParams.layer; // iterate from the bottom layer to
                                           // the 'aParams.layer-th' layer.
   NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT_WITH_RANGE(i, layers,
                                                        layers.mImageCount - 1,
                                                        count) {
     // NOTE: no Save() yet, we do that later by calling autoSR.EnsureSaved(ctx)
@@ -3625,20 +3626,20 @@ nsCSSRendering::ComputeImageLayerPositio
     MOZ_ASSERT(aForFrame->IsFrameOfType(nsIFrame::eSVG) &&
                (aForFrame->GetType() != nsGkAtoms::svgOuterSVGFrame));
     *aAttachedToFrame = aForFrame;
 
     positionArea =
       nsLayoutUtils::ComputeGeometryBox(aForFrame, layerOrigin);
 
     nsPoint toStrokeBoxOffset = nsPoint(0, 0);
-    if (layerOrigin != StyleGeometryBox::Stroke) {
+    if (layerOrigin != StyleGeometryBox::StrokeBox) {
       nsRect strokeBox =
         nsLayoutUtils::ComputeGeometryBox(aForFrame,
-                                          StyleGeometryBox::Stroke);
+                                          StyleGeometryBox::StrokeBox);
       toStrokeBoxOffset = positionArea.TopLeft() - strokeBox.TopLeft();
     }
 
     // For SVG frames, the return value is relative to the stroke box
     return nsRect(toStrokeBoxOffset, positionArea.Size());
   }
 
   MOZ_ASSERT(!aForFrame->IsFrameOfType(nsIFrame::eSVG) ||
@@ -3652,26 +3653,26 @@ nsCSSRendering::ComputeImageLayerPositio
     positionArea = nsRect(
       scrollableFrame->GetScrolledFrame()->GetPosition()
         // For the dir=rtl case:
         + scrollableFrame->GetScrollRange().TopLeft(),
       scrollableFrame->GetScrolledRect().Size());
     // The ScrolledRect’s size does not include the borders or scrollbars,
     // reverse the handling of background-origin
     // compared to the common case below.
-    if (layerOrigin == StyleGeometryBox::Border) {
+    if (layerOrigin == StyleGeometryBox::BorderBox) {
       nsMargin border = geometryFrame->GetUsedBorder();
       border.ApplySkipSides(geometryFrame->GetSkipSides());
       positionArea.Inflate(border);
       positionArea.Inflate(scrollableFrame->GetActualScrollbarSizes());
-    } else if (layerOrigin != StyleGeometryBox::Padding) {
+    } else if (layerOrigin != StyleGeometryBox::PaddingBox) {
       nsMargin padding = geometryFrame->GetUsedPadding();
       padding.ApplySkipSides(geometryFrame->GetSkipSides());
       positionArea.Deflate(padding);
-      NS_ASSERTION(layerOrigin == StyleGeometryBox::Content,
+      NS_ASSERTION(layerOrigin == StyleGeometryBox::ContentBox,
                    "unknown background-origin value");
     }
     *aAttachedToFrame = aForFrame;
     return positionArea;
   }
 
   if (MOZ_UNLIKELY(frameType == nsGkAtoms::canvasFrame)) {
     geometryFrame = aForFrame->PrincipalChildList().FirstChild();
@@ -3681,32 +3682,32 @@ nsCSSRendering::ComputeImageLayerPositio
     // absolutely positioned content).
     if (geometryFrame) {
       positionArea = geometryFrame->GetRect();
     }
   } else {
     positionArea = nsRect(nsPoint(0,0), aBorderArea.Size());
   }
 
-  // See the comment of StyleGeometryBox::Margin.
+  // See the comment of StyleGeometryBox::MarginBox.
   // Hitting this assertion means we decide to turn on margin-box support for
   // positioned mask from CSS parser and style system. In this case, you
   // should *inflate* positionArea by the margin returning from
   // geometryFrame->GetUsedMargin() in the code chunk bellow.
-  MOZ_ASSERT(aLayer.mOrigin != StyleGeometryBox::Margin,
-             "StyleGeometryBox::Margin rendering is not supported yet.\n");
+  MOZ_ASSERT(aLayer.mOrigin != StyleGeometryBox::MarginBox,
+             "StyleGeometryBox::MarginBox rendering is not supported yet.\n");
 
   // {background|mask} images are tiled over the '{background|mask}-clip' area
   // but the origin of the tiling is based on the '{background|mask}-origin'
   // area.
-  if (layerOrigin != StyleGeometryBox::Border && geometryFrame) {
+  if (layerOrigin != StyleGeometryBox::BorderBox && geometryFrame) {
     nsMargin border = geometryFrame->GetUsedBorder();
-    if (layerOrigin != StyleGeometryBox::Padding) {
+    if (layerOrigin != StyleGeometryBox::PaddingBox) {
       border += geometryFrame->GetUsedPadding();
-      NS_ASSERTION(layerOrigin == StyleGeometryBox::Content,
+      NS_ASSERTION(layerOrigin == StyleGeometryBox::ContentBox,
                    "unknown background-origin value");
     }
     positionArea.Deflate(border);
   }
 
   nsIFrame* attachedToFrame = aForFrame;
   if (NS_STYLE_IMAGELAYER_ATTACHMENT_FIXED == aLayer.mAttachment) {
     // If it's a fixed background attachment, then the image is placed
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -3388,20 +3388,20 @@ nsDisplayBackgroundImage::GetInsideClipR
     return result;
 
   nsIFrame *frame = aItem->Frame();
 
   nsRect clipRect = aBackgroundRect;
   if (frame->GetType() == nsGkAtoms::canvasFrame) {
     nsCanvasFrame* canvasFrame = static_cast<nsCanvasFrame*>(frame);
     clipRect = canvasFrame->CanvasArea() + aItem->ToReferenceFrame();
-  } else if (aClip == StyleGeometryBox::Padding ||
-             aClip == StyleGeometryBox::Content) {
+  } else if (aClip == StyleGeometryBox::PaddingBox ||
+             aClip == StyleGeometryBox::ContentBox) {
     nsMargin border = frame->GetUsedBorder();
-    if (aClip == StyleGeometryBox::Content) {
+    if (aClip == StyleGeometryBox::ContentBox) {
       border += frame->GetUsedPadding();
     }
     border.ApplySkipSides(frame->GetSkipSides());
     clipRect.Deflate(border);
   }
 
   return clipRect.Intersect(aRect);
 }
--- a/layout/style/Declaration.cpp
+++ b/layout/style/Declaration.cpp
@@ -399,19 +399,19 @@ Declaration::GetImageLayerValue(
     }
 
     MOZ_ASSERT(clip->mValue.GetUnit() == eCSSUnit_Enumerated &&
                origin->mValue.GetUnit() == eCSSUnit_Enumerated,
                "should not have inherit/initial within list");
 
     StyleGeometryBox originDefaultValue =
       (aTable == nsStyleImageLayers::kBackgroundLayerTable)
-      ? StyleGeometryBox::Padding : StyleGeometryBox::Border;
+      ? StyleGeometryBox::PaddingBox : StyleGeometryBox::BorderBox;
     if (static_cast<StyleGeometryBox>(clip->mValue.GetIntValue()) !=
-        StyleGeometryBox::Border ||
+        StyleGeometryBox::BorderBox ||
         static_cast<StyleGeometryBox>(origin->mValue.GetIntValue()) !=
         originDefaultValue) {
 #ifdef DEBUG
       const nsCSSProps::KTableEntry* originTable = nsCSSProps::kKeywordTableTable[aTable[nsStyleImageLayers::origin]];
       const nsCSSProps::KTableEntry* clipTable = nsCSSProps::kKeywordTableTable[aTable[nsStyleImageLayers::clip]];
       for (size_t i = 0; originTable[i].mValue != -1; i++) {
         // For each keyword & value in kOriginKTable, ensure that
         // kBackgroundKTable has a matching entry at the same position.
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -12215,31 +12215,31 @@ CSSParserImpl::ParseImageLayersItem(
   CSSParserImpl::ImageLayersShorthandParseState& aState,
   const nsCSSPropertyID aTable[])
 {
   // Fill in the values that the shorthand will set if we don't find
   // other values.
   aState.mImage->mValue.SetNoneValue();
   aState.mAttachment->mValue.SetIntValue(NS_STYLE_IMAGELAYER_ATTACHMENT_SCROLL,
                                          eCSSUnit_Enumerated);
-  aState.mClip->mValue.SetEnumValue(StyleGeometryBox::Border);
+  aState.mClip->mValue.SetEnumValue(StyleGeometryBox::BorderBox);
 
   aState.mRepeat->mXValue.SetIntValue(NS_STYLE_IMAGELAYER_REPEAT_REPEAT,
                                       eCSSUnit_Enumerated);
   aState.mRepeat->mYValue.Reset();
 
   RefPtr<nsCSSValue::Array> positionXArr = nsCSSValue::Array::Create(2);
   RefPtr<nsCSSValue::Array> positionYArr = nsCSSValue::Array::Create(2);
   aState.mPositionX->mValue.SetArrayValue(positionXArr, eCSSUnit_Array);
   aState.mPositionY->mValue.SetArrayValue(positionYArr, eCSSUnit_Array);
 
   if (eCSSProperty_mask == aTable[nsStyleImageLayers::shorthand]) {
-    aState.mOrigin->mValue.SetEnumValue(StyleGeometryBox::Border);
+    aState.mOrigin->mValue.SetEnumValue(StyleGeometryBox::BorderBox);
   } else {
-    aState.mOrigin->mValue.SetEnumValue(StyleGeometryBox::Padding);
+    aState.mOrigin->mValue.SetEnumValue(StyleGeometryBox::PaddingBox);
   }
   positionXArr->Item(1).SetPercentValue(0.0f);
   positionYArr->Item(1).SetPercentValue(0.0f);
 
   aState.mSize->mXValue.SetAutoValue();
   aState.mSize->mYValue.SetAutoValue();
   aState.mComposite->mValue.SetIntValue(NS_STYLE_MASK_COMPOSITE_ADD,
                                         eCSSUnit_Enumerated);
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -885,49 +885,49 @@ const KTableEntry nsCSSProps::kTransform
 const KTableEntry nsCSSProps::kImageLayerAttachmentKTable[] = {
   { eCSSKeyword_fixed, NS_STYLE_IMAGELAYER_ATTACHMENT_FIXED },
   { eCSSKeyword_scroll, NS_STYLE_IMAGELAYER_ATTACHMENT_SCROLL },
   { eCSSKeyword_local, NS_STYLE_IMAGELAYER_ATTACHMENT_LOCAL },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kBackgroundOriginKTable[] = {
-  { eCSSKeyword_border_box, StyleGeometryBox::Border },
-  { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
-  { eCSSKeyword_content_box, StyleGeometryBox::Content },
+  { eCSSKeyword_border_box, StyleGeometryBox::BorderBox },
+  { eCSSKeyword_padding_box, StyleGeometryBox::PaddingBox },
+  { eCSSKeyword_content_box, StyleGeometryBox::ContentBox },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 KTableEntry nsCSSProps::kBackgroundClipKTable[] = {
-  { eCSSKeyword_border_box, StyleGeometryBox::Border },
-  { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
-  { eCSSKeyword_content_box, StyleGeometryBox::Content },
+  { eCSSKeyword_border_box, StyleGeometryBox::BorderBox },
+  { eCSSKeyword_padding_box, StyleGeometryBox::PaddingBox },
+  { eCSSKeyword_content_box, StyleGeometryBox::ContentBox },
   // The next entry is controlled by the layout.css.background-clip-text.enabled
   // pref.
   { eCSSKeyword_text, StyleGeometryBox::Text },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kMaskOriginKTable[] = {
-  { eCSSKeyword_border_box, StyleGeometryBox::Border },
-  { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
-  { eCSSKeyword_content_box, StyleGeometryBox::Content },
-  { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
-  { eCSSKeyword_stroke_box, StyleGeometryBox::Stroke },
-  { eCSSKeyword_view_box, StyleGeometryBox::View },
+  { eCSSKeyword_border_box, StyleGeometryBox::BorderBox },
+  { eCSSKeyword_padding_box, StyleGeometryBox::PaddingBox },
+  { eCSSKeyword_content_box, StyleGeometryBox::ContentBox },
+  { eCSSKeyword_fill_box, StyleGeometryBox::FillBox },
+  { eCSSKeyword_stroke_box, StyleGeometryBox::StrokeBox },
+  { eCSSKeyword_view_box, StyleGeometryBox::ViewBox },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kMaskClipKTable[] = {
-  { eCSSKeyword_border_box, StyleGeometryBox::Border },
-  { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
-  { eCSSKeyword_content_box, StyleGeometryBox::Content },
-  { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
-  { eCSSKeyword_stroke_box, StyleGeometryBox::Stroke },
-  { eCSSKeyword_view_box, StyleGeometryBox::View },
+  { eCSSKeyword_border_box, StyleGeometryBox::BorderBox },
+  { eCSSKeyword_padding_box, StyleGeometryBox::PaddingBox },
+  { eCSSKeyword_content_box, StyleGeometryBox::ContentBox },
+  { eCSSKeyword_fill_box, StyleGeometryBox::FillBox },
+  { eCSSKeyword_stroke_box, StyleGeometryBox::StrokeBox },
+  { eCSSKeyword_view_box, StyleGeometryBox::ViewBox },
   { eCSSKeyword_no_clip, StyleGeometryBox::NoClip },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 // Note: Don't change this table unless you update
 // ParseImageLayerPosition!
 
 const KTableEntry nsCSSProps::kImageLayerPositionKTable[] = {
@@ -2101,19 +2101,19 @@ const KTableEntry nsCSSProps::kTouchActi
 
 const KTableEntry nsCSSProps::kTopLayerKTable[] = {
   { eCSSKeyword_none,     NS_STYLE_TOP_LAYER_NONE },
   { eCSSKeyword_top,      NS_STYLE_TOP_LAYER_TOP },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kTransformBoxKTable[] = {
-  { eCSSKeyword_border_box, StyleGeometryBox::Border },
-  { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
-  { eCSSKeyword_view_box, StyleGeometryBox::View },
+  { eCSSKeyword_border_box, StyleGeometryBox::BorderBox },
+  { eCSSKeyword_fill_box, StyleGeometryBox::FillBox },
+  { eCSSKeyword_view_box, StyleGeometryBox::ViewBox },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kTransitionTimingFunctionKTable[] = {
   { eCSSKeyword_ease, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE },
   { eCSSKeyword_linear, NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR },
   { eCSSKeyword_ease_in, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN },
   { eCSSKeyword_ease_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_OUT },
@@ -2309,23 +2309,23 @@ const KTableEntry nsCSSProps::kDominantB
 
 const KTableEntry nsCSSProps::kFillRuleKTable[] = {
   { eCSSKeyword_nonzero, StyleFillRule::Nonzero },
   { eCSSKeyword_evenodd, StyleFillRule::Evenodd },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kClipPathGeometryBoxKTable[] = {
-  { eCSSKeyword_content_box, StyleGeometryBox::Content },
-  { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
-  { eCSSKeyword_border_box, StyleGeometryBox::Border },
-  { eCSSKeyword_margin_box, StyleGeometryBox::Margin },
-  { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
-  { eCSSKeyword_stroke_box, StyleGeometryBox::Stroke },
-  { eCSSKeyword_view_box, StyleGeometryBox::View },
+  { eCSSKeyword_content_box, StyleGeometryBox::ContentBox },
+  { eCSSKeyword_padding_box, StyleGeometryBox::PaddingBox },
+  { eCSSKeyword_border_box, StyleGeometryBox::BorderBox },
+  { eCSSKeyword_margin_box, StyleGeometryBox::MarginBox },
+  { eCSSKeyword_fill_box, StyleGeometryBox::FillBox },
+  { eCSSKeyword_stroke_box, StyleGeometryBox::StrokeBox },
+  { eCSSKeyword_view_box, StyleGeometryBox::ViewBox },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kShapeRadiusKTable[] = {
   { eCSSKeyword_closest_side, StyleShapeRadius::ClosestSide },
   { eCSSKeyword_farthest_side, StyleShapeRadius::FarthestSide },
   { eCSSKeyword_UNKNOWN, -1 }
 };
@@ -2354,20 +2354,20 @@ const KTableEntry nsCSSProps::kImageRend
 
 const KTableEntry nsCSSProps::kMaskTypeKTable[] = {
   { eCSSKeyword_luminance, NS_STYLE_MASK_TYPE_LUMINANCE },
   { eCSSKeyword_alpha, NS_STYLE_MASK_TYPE_ALPHA },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kShapeOutsideShapeBoxKTable[] = {
-  { eCSSKeyword_content_box, StyleGeometryBox::Content },
-  { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
-  { eCSSKeyword_border_box, StyleGeometryBox::Border },
-  { eCSSKeyword_margin_box, StyleGeometryBox::Margin },
+  { eCSSKeyword_content_box, StyleGeometryBox::ContentBox },
+  { eCSSKeyword_padding_box, StyleGeometryBox::PaddingBox },
+  { eCSSKeyword_border_box, StyleGeometryBox::BorderBox },
+  { eCSSKeyword_margin_box, StyleGeometryBox::MarginBox },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kShapeRenderingKTable[] = {
   { eCSSKeyword_auto, NS_STYLE_SHAPE_RENDERING_AUTO },
   { eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED },
   { eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES },
   { eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION },
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -6333,18 +6333,18 @@ nsComputedDOMStyle::DoGetMask()
 {
   const nsStyleSVGReset* svg = StyleSVGReset();
   const nsStyleImageLayers::Layer& firstLayer = svg->mMask.mLayers[0];
 
   // Mask is now a shorthand, but it used to be a longhand, so that we
   // need to support computed style for the cases where it used to be
   // a longhand.
   if (svg->mMask.mImageCount > 1 ||
-      firstLayer.mClip != StyleGeometryBox::Border ||
-      firstLayer.mOrigin != StyleGeometryBox::Border ||
+      firstLayer.mClip != StyleGeometryBox::BorderBox ||
+      firstLayer.mOrigin != StyleGeometryBox::BorderBox ||
       firstLayer.mComposite != NS_STYLE_MASK_COMPOSITE_ADD ||
       firstLayer.mMaskMode != NS_STYLE_MASK_MODE_MATCH_SOURCE ||
       !nsStyleImageLayers::IsInitialPositionForLayerType(
         firstLayer.mPosition, nsStyleImageLayers::LayerType::Mask) ||
       !firstLayer.mRepeat.IsInitialValue() ||
       !firstLayer.mSize.IsInitialValue() ||
       !(firstLayer.mImage.GetType() == eStyleImageType_Null ||
         firstLayer.mImage.GetType() == eStyleImageType_Image)) {
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -1451,17 +1451,17 @@ struct SetEnumValueHelper
   DEFINE_ENUM_CLASS_SETTER(StyleHyphens, None, Auto)
   DEFINE_ENUM_CLASS_SETTER(StyleTextJustify, None, InterCharacter)
   DEFINE_ENUM_CLASS_SETTER(StyleUserFocus, None, SelectMenu)
   DEFINE_ENUM_CLASS_SETTER(StyleUserSelect, None, MozText)
   DEFINE_ENUM_CLASS_SETTER(StyleUserInput, None, Auto)
   DEFINE_ENUM_CLASS_SETTER(StyleUserModify, ReadOnly, WriteOnly)
   DEFINE_ENUM_CLASS_SETTER(StyleWindowDragging, Default, NoDrag)
   DEFINE_ENUM_CLASS_SETTER(StyleOrient, Inline, Vertical)
-  DEFINE_ENUM_CLASS_SETTER(StyleGeometryBox, Border, View)
+  DEFINE_ENUM_CLASS_SETTER(StyleGeometryBox, BorderBox, ViewBox)
 #ifdef MOZ_XUL
   DEFINE_ENUM_CLASS_SETTER(StyleDisplay, None, MozPopup)
 #else
   DEFINE_ENUM_CLASS_SETTER(StyleDisplay, None, InlineBox)
 #endif
 
 #undef DEF_SET_ENUMERATED_VALUE
 };
@@ -6610,17 +6610,17 @@ nsRuleNode::ComputeDisplayData(void* aSt
            parentDisplay->mTransformStyle,
            NS_STYLE_TRANSFORM_STYLE_FLAT);
 
   // transform-box: enum, inherit, initial
   SetValue(*aRuleData->ValueForTransformBox(),
            display->mTransformBox, conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentDisplay->mTransformBox,
-           StyleGeometryBox::Border);
+           StyleGeometryBox::BorderBox);
 
   // orient: enum, inherit, initial
   SetValue(*aRuleData->ValueForOrient(),
            display->mOrient, conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentDisplay->mOrient,
            StyleOrient::Inline);
 
@@ -7458,17 +7458,17 @@ nsRuleNode::ComputeBackgroundData(void* 
                     bg->mImage.mAttachmentCount, maxItemCount, rebuild,
                     conditions);
 
   // background-clip: enum, inherit, initial [list]
   SetImageLayerList(aContext, *aRuleData->ValueForBackgroundClip(),
                     bg->mImage.mLayers,
                     parentBG->mImage.mLayers,
                     &nsStyleImageLayers::Layer::mClip,
-                    StyleGeometryBox::Border,
+                    StyleGeometryBox::BorderBox,
                     parentBG->mImage.mClipCount,
                     bg->mImage.mClipCount, maxItemCount, rebuild, conditions);
 
   // background-blend-mode: enum, inherit, initial [list]
   SetImageLayerList(aContext, *aRuleData->ValueForBackgroundBlendMode(),
                     bg->mImage.mLayers,
                     parentBG->mImage.mLayers,
                     &nsStyleImageLayers::Layer::mBlendMode,
@@ -7477,17 +7477,17 @@ nsRuleNode::ComputeBackgroundData(void* 
                     bg->mImage.mBlendModeCount, maxItemCount, rebuild,
                     conditions);
 
   // background-origin: enum, inherit, initial [list]
   SetImageLayerList(aContext, *aRuleData->ValueForBackgroundOrigin(),
                     bg->mImage.mLayers,
                     parentBG->mImage.mLayers,
                     &nsStyleImageLayers::Layer::mOrigin,
-                    StyleGeometryBox::Padding,
+                    StyleGeometryBox::PaddingBox,
                     parentBG->mImage.mOriginCount,
                     bg->mImage.mOriginCount, maxItemCount, rebuild,
                     conditions);
 
   // background-position-x/y: enum, length, percent (flags), inherit [list]
   Position::Coord initialPositionCoord;
   initialPositionCoord.mPercent = 0.0f;
   initialPositionCoord.mLength = 0;
@@ -10098,27 +10098,27 @@ nsRuleNode::ComputeSVGResetData(void* aS
                         svgReset->mMask.mRepeatCount, maxItemCount, rebuild,
                         conditions);
 
   // mask-clip: enum, inherit, initial [list]
   SetImageLayerList(aContext, *aRuleData->ValueForMaskClip(),
                     svgReset->mMask.mLayers,
                     parentSVGReset->mMask.mLayers,
                     &nsStyleImageLayers::Layer::mClip,
-                    StyleGeometryBox::Border,
+                    StyleGeometryBox::BorderBox,
                     parentSVGReset->mMask.mClipCount,
                     svgReset->mMask.mClipCount, maxItemCount, rebuild,
                     conditions);
 
   // mask-origin: enum, inherit, initial [list]
   SetImageLayerList(aContext, *aRuleData->ValueForMaskOrigin(),
                     svgReset->mMask.mLayers,
                     parentSVGReset->mMask.mLayers,
                     &nsStyleImageLayers::Layer::mOrigin,
-                    StyleGeometryBox::Border,
+                    StyleGeometryBox::BorderBox,
                     parentSVGReset->mMask.mOriginCount,
                     svgReset->mMask.mOriginCount, maxItemCount, rebuild,
                     conditions);
 
   // mask-position-x/y: enum, length, percent (flags), inherit [list]
   Position::Coord initialPositionCoord;
   initialPositionCoord.mPercent = 0.0f;
   initialPositionCoord.mLength = 0;
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -82,26 +82,26 @@ enum class StyleClear : uint8_t {
   // so it needs to use a bit value that none of the other values can have.
   Line = 8,
   Max = 13  // Max = (Both | Line)
 };
 
 // Define geometry box for clip-path's reference-box, background-clip,
 // background-origin, mask-clip, mask-origin, shape-box and transform-box.
 enum class StyleGeometryBox : uint8_t {
-  Content, // Used by everything, except transform-box.
-  Padding, // Used by everything, except transform-box.
-  Border,
-  Margin,  // XXX Bug 1260094 comment 9.
-           // Although margin-box is required by mask-origin and mask-clip, we
-           // do not implement that due to lack of support in other browsers.
-           // clip-path reference-box only.
-  Fill,    // Used by everything, except shape-box.
-  Stroke,  // mask-clip, mask-origin and clip-path reference-box only.
-  View,    // Used by everything, except shape-box.
+  ContentBox, // Used by everything, except transform-box.
+  PaddingBox, // Used by everything, except transform-box.
+  BorderBox,
+  MarginBox,  // XXX Bug 1260094 comment 9.
+              // Although margin-box is required by mask-origin and mask-clip,
+              // we do not implement that due to lack of support in other
+              // browsers. clip-path reference-box only.
+  FillBox,    // Used by everything, except shape-box.
+  StrokeBox,  // mask-clip, mask-origin and clip-path reference-box only.
+  ViewBox,    // Used by everything, except shape-box.
   NoClip,  // mask-clip only.
   Text,    // background-clip only.
   NoBox,   // Depending on which kind of element this style value applied on,
            // the default value of a reference-box can be different.
            // For an HTML element, the default value of reference-box is
            // border-box; for an SVG element, the default value is fill-box.
            // Since we can not determine the default value at parsing time,
            // set it as NoBox so that we make a decision later.
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2896,17 +2896,17 @@ nsStyleImageLayers::Size::operator==(con
 
   return mWidthType == aOther.mWidthType &&
          mHeightType == aOther.mHeightType &&
          (mWidthType != eLengthPercentage || mWidth == aOther.mWidth) &&
          (mHeightType != eLengthPercentage || mHeight == aOther.mHeight);
 }
 
 nsStyleImageLayers::Layer::Layer()
-  : mClip(StyleGeometryBox::Border)
+  : mClip(StyleGeometryBox::BorderBox)
   , mAttachment(NS_STYLE_IMAGELAYER_ATTACHMENT_SCROLL)
   , mBlendMode(NS_STYLE_BLEND_NORMAL)
   , mComposite(NS_STYLE_MASK_COMPOSITE_ADD)
   , mMaskMode(NS_STYLE_MASK_MODE_MATCH_SOURCE)
 {
   mImage.SetNull();
   mSize.SetInitialValues();
 }
@@ -2918,20 +2918,20 @@ nsStyleImageLayers::Layer::~Layer()
 void
 nsStyleImageLayers::Layer::Initialize(nsStyleImageLayers::LayerType aType)
 {
   mRepeat.SetInitialValues();
 
   mPosition.SetInitialPercentValues(0.0f);
 
   if (aType == LayerType::Background) {
-    mOrigin = StyleGeometryBox::Padding;
+    mOrigin = StyleGeometryBox::PaddingBox;
   } else {
     MOZ_ASSERT(aType == LayerType::Mask, "unsupported layer type.");
-    mOrigin = StyleGeometryBox::Border;
+    mOrigin = StyleGeometryBox::BorderBox;
   }
 }
 
 bool
 nsStyleImageLayers::Layer::RenderingMightDependOnPositioningAreaSizeChange() const
 {
   // Do we even have an image?
   if (mImage.IsEmpty()) {
@@ -3264,17 +3264,17 @@ nsStyleDisplay::nsStyleDisplay(const nsP
   , mTouchAction(NS_STYLE_TOUCH_ACTION_AUTO)
   , mScrollBehavior(NS_STYLE_SCROLL_BEHAVIOR_AUTO)
   , mScrollSnapTypeX(NS_STYLE_SCROLL_SNAP_TYPE_NONE)
   , mScrollSnapTypeY(NS_STYLE_SCROLL_SNAP_TYPE_NONE)
   , mScrollSnapPointsX(eStyleUnit_None)
   , mScrollSnapPointsY(eStyleUnit_None)
   , mBackfaceVisibility(NS_STYLE_BACKFACE_VISIBILITY_VISIBLE)
   , mTransformStyle(NS_STYLE_TRANSFORM_STYLE_FLAT)
-  , mTransformBox(StyleGeometryBox::Border)
+  , mTransformBox(StyleGeometryBox::BorderBox)
   , mSpecifiedTransform(nullptr)
   , mTransformOrigin{ {0.5f, eStyleUnit_Percent}, // Transform is centered on origin
                       {0.5f, eStyleUnit_Percent},
                       {0, nsStyleCoord::CoordConstructor} }
   , mChildPerspective(eStyleUnit_None)
   , mPerspectiveOrigin{ {0.5f, eStyleUnit_Percent},
                         {0.5f, eStyleUnit_Percent} }
   , mVerticalAlign(NS_STYLE_VERTICAL_ALIGN_BASELINE, eStyleUnit_Enumerated)
--- a/layout/style/nsStyleTransformMatrix.cpp
+++ b/layout/style/nsStyleTransformMatrix.cpp
@@ -53,36 +53,36 @@ TransformReferenceBox::EnsureDimensionsA
   if (mFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) {
     if (!nsLayoutUtils::SVGTransformBoxEnabled()) {
       mX = -mFrame->GetPosition().x;
       mY = -mFrame->GetPosition().y;
       Size contextSize = nsSVGUtils::GetContextSize(mFrame);
       mWidth = nsPresContext::CSSPixelsToAppUnits(contextSize.width);
       mHeight = nsPresContext::CSSPixelsToAppUnits(contextSize.height);
     } else
-    if (mFrame->StyleDisplay()->mTransformBox == StyleGeometryBox::Fill) {
+    if (mFrame->StyleDisplay()->mTransformBox == StyleGeometryBox::FillBox) {
       // Percentages in transforms resolve against the SVG bbox, and the
       // transform is relative to the top-left of the SVG bbox.
       nsRect bboxInAppUnits =
         nsLayoutUtils::ComputeGeometryBox(const_cast<nsIFrame*>(mFrame),
-                                          StyleGeometryBox::Fill);
+                                          StyleGeometryBox::FillBox);
       // The mRect of an SVG nsIFrame is its user space bounds *including*
       // stroke and markers, whereas bboxInAppUnits is its user space bounds
       // including fill only.  We need to note the offset of the reference box
       // from the frame's mRect in mX/mY.
       mX = bboxInAppUnits.x - mFrame->GetPosition().x;
       mY = bboxInAppUnits.y - mFrame->GetPosition().y;
       mWidth = bboxInAppUnits.width;
       mHeight = bboxInAppUnits.height;
     } else {
       // The value 'border-box' is treated as 'view-box' for SVG content.
       MOZ_ASSERT(mFrame->StyleDisplay()->mTransformBox ==
-                   StyleGeometryBox::View ||
+                   StyleGeometryBox::ViewBox ||
                  mFrame->StyleDisplay()->mTransformBox ==
-                   StyleGeometryBox::Border,
+                   StyleGeometryBox::BorderBox,
                  "Unexpected value for 'transform-box'");
       // Percentages in transforms resolve against the width/height of the
       // nearest viewport (or its viewBox if one is applied), and the
       // transform is relative to {0,0} in current user space.
       mX = -mFrame->GetPosition().x;
       mY = -mFrame->GetPosition().y;
       Size contextSize = nsSVGUtils::GetContextSize(mFrame);
       mWidth = nsPresContext::CSSPixelsToAppUnits(contextSize.width);