Bug 1299066: Rename NS_STYLE_DISPLAY_* to use the new enum class. r?heycam draft
authorEmilio Cobos Álvarez <ecoal95@gmail.com>
Sat, 27 Aug 2016 23:15:13 -0700
changeset 407274 044c2f520be1ac25e3efd94f4c4bc9839b787a88
parent 407273 2ddc65f19516c0bedaa3fc4b6d40ddd5c01f0795
child 407275 10ee4b1cbe82227141a1a2223829ddda4ed63bbf
push id27917
push userbmo:ecoal95@gmail.com
push dateTue, 30 Aug 2016 06:52:07 +0000
reviewersheycam
bugs1299066
milestone51.0a1
Bug 1299066: Rename NS_STYLE_DISPLAY_* to use the new enum class. r?heycam This was generated with the following python script: ``` import sys import re CAMEL_CASE_REGEX = re.compile(r"(^|_|-)([A-Z])([A-Z]+)") DISPLAY_REGEX = re.compile(r"\bNS_STYLE_DISPLAY_([^M][A-Z_]+)\b") def to_camel_case(ident): return re.sub(CAMEL_CASE_REGEX, lambda m: m.group(2) + m.group(3).lower(), ident) def constant_to_enum(constant): return "StyleDisplay::" + to_camel_case(constant) + ("_" if constant == "NONE" else "") def process_line(line): return re.sub(DISPLAY_REGEX, lambda m: constant_to_enum(m.group(1)), line) lines = [] with open(sys.argv[1], "r") as f: for line in f: lines.append(process_line(line)) with open(sys.argv[1], "w") as f: for line in lines: f.write(line) ``` And the following shell commands: ``` find . -name '*.cpp' -exec python display.py {} \; find . -name '*.h' -exec python display.py {} \; ``` Still doesn't build because some files don't use the mozilla namespace, but this should make it better for review. MozReview-Commit-ID: 7wMCQDFO59Z
accessible/base/nsTextEquivUtils.cpp
dom/base/Element.cpp
dom/base/nsRange.cpp
dom/events/EventStateManager.cpp
dom/html/nsGenericHTMLElement.cpp
editor/libeditor/EditorBase.cpp
extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
gfx/layers/apz/util/DoubleTapToZoom.cpp
layout/base/RestyleManager.cpp
layout/base/ServoRestyleManager.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsFrameTraversal.cpp
layout/base/nsLayoutUtils.cpp
layout/generic/BlockReflowInput.cpp
layout/generic/ReflowInput.cpp
layout/generic/nsBackdropFrame.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsIFrameInlines.h
layout/generic/nsLineLayout.cpp
layout/generic/nsTextFrame.cpp
layout/style/ServoStyleSet.cpp
layout/style/nsCSSProps.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsRuleNode.cpp
layout/style/nsStyleContext.cpp
layout/style/nsStyleSet.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/style/nsStyleStructInlines.h
layout/tables/nsCellMap.cpp
layout/tables/nsTableColGroupFrame.cpp
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowGroupFrame.cpp
layout/xul/nsBoxFrame.cpp
--- a/accessible/base/nsTextEquivUtils.cpp
+++ b/accessible/base/nsTextEquivUtils.cpp
@@ -122,17 +122,17 @@ nsTextEquivUtils::AppendTextEquivFromTex
     if (parentContent) {
       nsIFrame *frame = parentContent->GetPrimaryFrame();
       if (frame) {
         // If this text is inside a block level frame (as opposed to span
         // level), we need to add spaces around that block's text, so we don't
         // get words jammed together in final name.
         const nsStyleDisplay* display = frame->StyleDisplay();
         if (display->IsBlockOutsideStyle() ||
-            display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
+            display->mDisplay == StyleDisplay::TableCell) {
           isHTMLBlock = true;
           if (!aString->IsEmpty()) {
             aString->Append(char16_t(' '));
           }
         }
       }
     }
     
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -952,17 +952,17 @@ Element::GetClientAreaRect()
   nsIFrame* styledFrame;
   nsIScrollableFrame* sf = GetScrollFrame(&styledFrame);
 
   if (sf) {
     return sf->GetScrollPortRect();
   }
 
   if (styledFrame &&
-      (styledFrame->StyleDisplay()->mDisplay != NS_STYLE_DISPLAY_INLINE ||
+      (styledFrame->StyleDisplay()->mDisplay != StyleDisplay::Inline ||
        styledFrame->IsFrameOfType(nsIFrame::eReplaced))) {
     // Special case code to make client area work even when there isn't
     // a scroll view, see bug 180552, bug 227567.
     return styledFrame->GetPaddingRect() - styledFrame->GetPositionIgnoringScrolling();
   }
 
   // SVG nodes reach here and just return 0
   return nsRect(0, 0, 0, 0);
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -3367,17 +3367,17 @@ enum TreeTraversalState {
 static int8_t
 GetRequiredInnerTextLineBreakCount(nsIFrame* aFrame)
 {
   if (aFrame->GetContent()->IsHTMLElement(nsGkAtoms::p)) {
     return 2;
   }
   const nsStyleDisplay* styleDisplay = aFrame->StyleDisplay();
   if (styleDisplay->IsBlockOutside(aFrame) ||
-      styleDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_CAPTION) {
+      styleDisplay->mDisplay == StyleDisplay::TableCaption) {
     return 1;
   }
   return 0;
 }
 
 static bool
 IsLastCellOfRow(nsIFrame* aFrame)
 {
@@ -3484,22 +3484,22 @@ nsRange::GetInnerTextNoFlush(DOMString& 
     if (currentNode == endNode && currentState == endState) {
       break;
     }
     if (isVisibleAndNotReplaced) {
       if (currentNode->IsHTMLElement(nsGkAtoms::br)) {
         result.Append('\n');
       }
       switch (f->StyleDisplay()->mDisplay) {
-      case NS_STYLE_DISPLAY_TABLE_CELL:
+      case StyleDisplay::TableCell:
         if (!IsLastCellOfRow(f)) {
           result.Append('\t');
         }
         break;
-      case NS_STYLE_DISPLAY_TABLE_ROW:
+      case StyleDisplay::TableRow:
         if (!IsLastRowOfRowGroup(f) ||
             !IsLastNonemptyRowGroupOfTable(f->GetParent())) {
           result.Append('\n');
         }
         break;
       }
       result.AddRequiredLineBreakCount(GetRequiredInnerTextLineBreakCount(f));
     }
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -3008,17 +3008,17 @@ EventStateManager::PostHandleEvent(nsPre
         }
 
         // When the mouse is pressed, the default action is to focus the
         // target. Look for the nearest enclosing focusable frame.
         while (currFrame) {
           // If the mousedown happened inside a popup, don't
           // try to set focus on one of its containing elements
           const nsStyleDisplay* display = currFrame->StyleDisplay();
-          if (display->mDisplay == NS_STYLE_DISPLAY_POPUP) {
+          if (display->mDisplay == StyleDisplay::Popup) {
             newFocus = nullptr;
             break;
           }
 
           int32_t tabIndexUnused;
           if (currFrame->IsFocusable(&tabIndexUnused, true)) {
             newFocus = currFrame->GetContent();
             nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(newFocus));
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -1285,17 +1285,17 @@ nsGenericHTMLElement::MapCommonAttribute
                                               nsRuleData* aData)
 {
   MapCommonAttributesIntoExceptHidden(aAttributes, aData);
 
   if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Display)) {
     nsCSSValue* display = aData->ValueForDisplay();
     if (display->GetUnit() == eCSSUnit_Null) {
       if (aAttributes->IndexOfAttr(nsGkAtoms::hidden) >= 0) {
-        display->SetIntValue(NS_STYLE_DISPLAY_NONE, eCSSUnit_Enumerated);
+        display->SetIntValue(StyleDisplay::None_, eCSSUnit_Enumerated);
       }
     }
   }
 }
 
 /* static */ const nsGenericHTMLElement::MappedAttributeEntry
 nsGenericHTMLElement::sCommonAttributeMap[] = {
   { &nsGkAtoms::contenteditable },
@@ -3092,17 +3092,17 @@ IsOrHasAncestorWithDisplayNone(Element* 
   RefPtr<nsStyleContext> sc;
   for (int32_t i = elementsToCheck.Length() - 1; i >= 0; --i) {
     if (sc) {
       sc = styleSet->ResolveStyleFor(elementsToCheck[i], sc);
     } else {
       sc = nsComputedDOMStyle::GetStyleContextForElementNoFlush(elementsToCheck[i],
                                                                 nullptr, aPresShell);
     }
-    if (sc->StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_NONE) {
+    if (sc->StyleDisplay()->mDisplay == StyleDisplay::None_) {
       return true;
     }
   }
 
   return false;
 }
 
 void
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -3432,17 +3432,17 @@ IsElementVisible(Element* aElement)
   // Now it might be that we have no frame because we're in a
   // display:none subtree, or it might be that we're just dealing with
   // lazy frame construction and it hasn't happened yet.  Check which
   // one it is.
   RefPtr<nsStyleContext> styleContext =
     nsComputedDOMStyle::GetStyleContextForElementNoFlush(aElement,
                                                          nullptr, nullptr);
   if (styleContext) {
-    return styleContext->StyleDisplay()->mDisplay != NS_STYLE_DISPLAY_NONE;
+    return styleContext->StyleDisplay()->mDisplay != StyleDisplay::None_;
   }
   return false;
 }
 
 bool
 EditorBase::IsEditable(nsIDOMNode* aNode)
 {
   nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
@@ -459,17 +459,17 @@ IsBreakElement(nsINode* aNode)
   // If we don't have a frame, we don't consider ourselves a break
   // element.  In particular, words can span us.
   if (!element->GetPrimaryFrame())
     return false;
 
   // Anything that's not an inline element is a break element.
   // XXXbz should replaced inlines be break elements, though?
   return element->GetPrimaryFrame()->StyleDisplay()->mDisplay !=
-    NS_STYLE_DISPLAY_INLINE;
+    StyleDisplay::Inline;
 }
 
 struct CheckLeavingBreakElementClosure {
   bool          mLeftBreakElement;
 };
 
 static void
 CheckLeavingBreakElement(nsINode* aNode, void* aClosure)
--- a/gfx/layers/apz/util/DoubleTapToZoom.cpp
+++ b/gfx/layers/apz/util/DoubleTapToZoom.cpp
@@ -55,17 +55,17 @@ ElementFromPoint(const nsCOMPtr<nsIPresS
     }
   }
   return nullptr;
 }
 
 static bool
 ShouldZoomToElement(const nsCOMPtr<dom::Element>& aElement) {
   if (nsIFrame* frame = aElement->GetPrimaryFrame()) {
-    if (frame->GetDisplay() == NS_STYLE_DISPLAY_INLINE) {
+    if (frame->GetDisplay() == StyleDisplay::Inline) {
       return false;
     }
   }
   if (aElement->IsAnyOfHTMLElements(nsGkAtoms::li, nsGkAtoms::q)) {
     return false;
   }
   return true;
 }
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -158,17 +158,17 @@ RestyleManager::RestyleElement(Element* 
     // for example, an animation-only style flush doesn't flush other
     // buffered style changes), we only do this if the restyle hint says
     // we have *some* restyling for this frame.  This means we'll
     // potentially get ahead of ourselves in that case, but not as much
     // as we would if we didn't check the restyle hint.
     nsStyleContext* newContext =
       FrameConstructor()->MaybeRecreateFramesForElement(aElement);
     if (newContext &&
-        newContext->StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_CONTENTS) {
+        newContext->StyleDisplay()->mDisplay == StyleDisplay::Contents) {
       // Style change for a display:contents node that did not recreate frames.
       ComputeAndProcessStyleChange(newContext, aElement, aMinHint,
                                    aRestyleTracker, aRestyleHint,
                                    aRestyleHintData);
     }
   }
 }
 
@@ -1780,33 +1780,33 @@ ElementRestyler::ConditionallyRestyleUnd
 void
 ElementRestyler::DoConditionallyRestyleUndisplayedDescendants(
     nsIContent* aParent,
     Element* aRestyleRoot)
 {
   nsCSSFrameConstructor* fc = mPresContext->FrameConstructor();
   UndisplayedNode* nodes = fc->GetAllUndisplayedContentIn(aParent);
   ConditionallyRestyleUndisplayedNodes(nodes, aParent,
-                                       NS_STYLE_DISPLAY_NONE, aRestyleRoot);
+                                       StyleDisplay::None_, aRestyleRoot);
   nodes = fc->GetAllDisplayContentsIn(aParent);
   ConditionallyRestyleUndisplayedNodes(nodes, aParent,
-                                       NS_STYLE_DISPLAY_CONTENTS, aRestyleRoot);
+                                       StyleDisplay::Contents, aRestyleRoot);
 }
 
 // The structure of this method parallels RestyleUndisplayedNodes.
 // If you update this method, you probably want to update that one too.
 void
 ElementRestyler::ConditionallyRestyleUndisplayedNodes(
     UndisplayedNode* aUndisplayed,
     nsIContent* aUndisplayedParent,
     const uint8_t aDisplay,
     Element* aRestyleRoot)
 {
-  MOZ_ASSERT(aDisplay == NS_STYLE_DISPLAY_NONE ||
-             aDisplay == NS_STYLE_DISPLAY_CONTENTS);
+  MOZ_ASSERT(aDisplay == StyleDisplay::None_ ||
+             aDisplay == StyleDisplay::Contents);
   if (!aUndisplayed) {
     return;
   }
 
   if (aUndisplayedParent &&
       aUndisplayedParent->IsElement() &&
       aUndisplayedParent->HasFlag(mRestyleTracker.RootBit())) {
     MOZ_ASSERT(!aUndisplayedParent->IsStyledByServo());
@@ -1818,19 +1818,19 @@ ElementRestyler::ConditionallyRestyleUnd
 
     if (!undisplayed->mContent->IsElement()) {
       continue;
     }
 
     Element* element = undisplayed->mContent->AsElement();
 
     if (!ConditionallyRestyle(element, aRestyleRoot)) {
-      if (aDisplay == NS_STYLE_DISPLAY_NONE) {
+      if (aDisplay == StyleDisplay::None_) {
         ConditionallyRestyleContentDescendants(element, aRestyleRoot);
-      } else {  // NS_STYLE_DISPLAY_CONTENTS
+      } else {  // StyleDisplay::Contents
         DoConditionallyRestyleUndisplayedDescendants(element, aRestyleRoot);
       }
     }
   }
 }
 
 void
 ElementRestyler::ConditionallyRestyleContentDescendants(Element* aElement,
@@ -3418,20 +3418,20 @@ ElementRestyler::RestyleUndisplayedDesce
 void
 ElementRestyler::DoRestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint,
                                                  nsIContent* aParent,
                                                  nsStyleContext* aParentContext)
 {
   nsCSSFrameConstructor* fc = mPresContext->FrameConstructor();
   UndisplayedNode* nodes = fc->GetAllUndisplayedContentIn(aParent);
   RestyleUndisplayedNodes(aChildRestyleHint, nodes, aParent,
-                          aParentContext, NS_STYLE_DISPLAY_NONE);
+                          aParentContext, StyleDisplay::None_);
   nodes = fc->GetAllDisplayContentsIn(aParent);
   RestyleUndisplayedNodes(aChildRestyleHint, nodes, aParent,
-                          aParentContext, NS_STYLE_DISPLAY_CONTENTS);
+                          aParentContext, StyleDisplay::Contents);
 }
 
 // The structure of this method parallels ConditionallyRestyleUndisplayedNodes.
 // If you update this method, you probably want to update that one too.
 void
 ElementRestyler::RestyleUndisplayedNodes(nsRestyleHint    aChildRestyleHint,
                                          UndisplayedNode* aUndisplayed,
                                          nsIContent*      aUndisplayedParent,
@@ -3502,17 +3502,17 @@ ElementRestyler::RestyleUndisplayedNodes
       mChangeList->AppendChange(nullptr, element,
                                 nsChangeHint_ReconstructFrame);
       // The node should be removed from the undisplayed map when
       // we reframe it.
     } else {
       // update the undisplayed node with the new context
       undisplayed->mStyle = undisplayedContext;
 
-      if (aDisplay == NS_STYLE_DISPLAY_CONTENTS) {
+      if (aDisplay == StyleDisplay::Contents) {
         DoRestyleUndisplayedDescendants(aChildRestyleHint, element,
                                         undisplayed->mStyle);
       }
     }
   }
 }
 
 void
@@ -3809,17 +3809,17 @@ void
 RestyleManager::ComputeAndProcessStyleChange(nsStyleContext*        aNewContext,
                                              Element*               aElement,
                                              nsChangeHint           aMinChange,
                                              RestyleTracker&        aRestyleTracker,
                                              nsRestyleHint          aRestyleHint,
                                              const RestyleHintData& aRestyleHintData)
 {
   MOZ_ASSERT(mReframingStyleContexts, "should have rsc");
-  MOZ_ASSERT(aNewContext->StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_CONTENTS);
+  MOZ_ASSERT(aNewContext->StyleDisplay()->mDisplay == StyleDisplay::Contents);
   nsIFrame* frame = GetNearestAncestorFrame(aElement);
   MOZ_ASSERT(frame, "display:contents node in map although it's a "
                     "display:none descendant?");
   TreeMatchContext treeMatchContext(true,
                                     nsRuleWalker::eRelevantLinkUnvisited,
                                     frame->PresContext()->Document());
   nsIContent* parent = aElement->GetParent();
   Element* parentElement =
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -99,17 +99,17 @@ ServoRestyleManager::RecreateStyleContex
       // generate a ReconstructFrame change hint if the new display value
       // (which we can get from the ComputedValues stored on the node) is not
       // none.
       if (primaryFrame) {
         changeHint |= primaryFrame->StyleContext()->ConsumeStoredChangeHint();
       } else {
         const nsStyleDisplay* currentDisplay =
           Servo_GetStyleDisplay(computedValues);
-        if (currentDisplay->mDisplay != NS_STYLE_DISPLAY_NONE) {
+        if (currentDisplay->mDisplay != StyleDisplay::None_) {
           changeHint |= nsChangeHint_ReconstructFrame;
         }
       }
 
       // Add the new change hint to the list of elements to process if
       // we need to do any work.
       if (changeHint) {
         aChangeListToProcess.AppendChange(primaryFrame, element, changeHint);
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -340,18 +340,18 @@ IsFlexOrGridContainer(const nsIFrame* aF
          t == nsGkAtoms::gridContainerFrame;
 }
 
 // Returns true if aFrame has "display: -webkit-{inline-}box"
 static inline bool
 IsWebkitBox(const nsIFrame* aFrame)
 {
   auto containerDisplay = aFrame->StyleDisplay()->mDisplay;
-  return containerDisplay == NS_STYLE_DISPLAY_WEBKIT_BOX ||
-    containerDisplay == NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX;
+  return containerDisplay == StyleDisplay::WebkitBox ||
+    containerDisplay == StyleDisplay::WebkitInlineBox;
 }
 
 #if DEBUG
 static void
 AssertAnonymousFlexOrGridItemParent(const nsIFrame* aChild,
                                     const nsIFrame* aParent)
 {
   MOZ_ASSERT(IsAnonymousFlexOrGridItem(aChild),
@@ -2022,17 +2022,17 @@ nsCSSFrameConstructor::AdjustParentFrame
                                          nsStyleContext*              aStyleContext)
 {
   NS_PRECONDITION(aStyleContext, "Must have child's style context");
   NS_PRECONDITION(aFCData, "Must have frame construction data");
 
   bool tablePart = ((aFCData->mBits & FCDATA_IS_TABLE_PART) != 0);
 
   if (tablePart && aStyleContext->StyleDisplay()->mDisplay ==
-      NS_STYLE_DISPLAY_TABLE_CAPTION) {
+      StyleDisplay::TableCaption) {
     *aParentFrame = ::AdjustCaptionParentFrame(*aParentFrame);
   }
 }
 
 // Pull all the captions present in aItems out  into aCaptions
 static void
 PullOutCaptionFrames(nsFrameItems& aItems, nsFrameItems& aCaptions)
 {
@@ -2054,18 +2054,18 @@ PullOutCaptionFrames(nsFrameItems& aItem
 // of having frames handle page-break-before/after will solve the problem.
 nsIFrame*
 nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState,
                                       FrameConstructionItem&   aItem,
                                       nsContainerFrame*        aParentFrame,
                                       const nsStyleDisplay*    aDisplay,
                                       nsFrameItems&            aFrameItems)
 {
-  NS_PRECONDITION(aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE ||
-                  aDisplay->mDisplay == NS_STYLE_DISPLAY_INLINE_TABLE,
+  NS_PRECONDITION(aDisplay->mDisplay == StyleDisplay::Table ||
+                  aDisplay->mDisplay == StyleDisplay::InlineTable,
                   "Unexpected call");
 
   nsIContent* const content = aItem.mContent;
   nsStyleContext* const styleContext = aItem.mStyleContext;
   const uint32_t nameSpaceID = aItem.mNameSpaceID;
 
   // create the pseudo SC for the table wrapper as a child of the inner SC
   RefPtr<nsStyleContext> outerStyleContext;
@@ -2166,29 +2166,29 @@ MakeTablePartAbsoluteContainingBlockIfNe
 
 nsIFrame*
 nsCSSFrameConstructor::ConstructTableRowOrRowGroup(nsFrameConstructorState& aState,
                                                    FrameConstructionItem&   aItem,
                                                    nsContainerFrame*        aParentFrame,
                                                    const nsStyleDisplay*    aDisplay,
                                                    nsFrameItems&            aFrameItems)
 {
-  NS_PRECONDITION(aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW ||
-                  aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW_GROUP ||
-                  aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP ||
-                  aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
+  NS_PRECONDITION(aDisplay->mDisplay == StyleDisplay::TableRow ||
+                  aDisplay->mDisplay == StyleDisplay::TableRowGroup ||
+                  aDisplay->mDisplay == StyleDisplay::TableFooterGroup ||
+                  aDisplay->mDisplay == StyleDisplay::TableHeaderGroup,
                   "Unexpected call");
   MOZ_ASSERT(aItem.mStyleContext->StyleDisplay() == aDisplay,
              "Display style doesn't match style context");
   nsIContent* const content = aItem.mContent;
   nsStyleContext* const styleContext = aItem.mStyleContext;
   const uint32_t nameSpaceID = aItem.mNameSpaceID;
 
   nsContainerFrame* newFrame;
-  if (aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW) {
+  if (aDisplay->mDisplay == StyleDisplay::TableRow) {
     if (kNameSpaceID_MathML == nameSpaceID)
       newFrame = NS_NewMathMLmtrFrame(mPresShell, styleContext);
     else
       newFrame = NS_NewTableRowFrame(mPresShell, styleContext);
   } else {
     newFrame = NS_NewTableRowGroupFrame(mPresShell, styleContext);
   }
 
@@ -2251,17 +2251,17 @@ nsCSSFrameConstructor::ConstructTableCol
 
 nsIFrame*
 nsCSSFrameConstructor::ConstructTableCell(nsFrameConstructorState& aState,
                                           FrameConstructionItem&   aItem,
                                           nsContainerFrame*        aParentFrame,
                                           const nsStyleDisplay*    aDisplay,
                                           nsFrameItems&            aFrameItems)
 {
-  NS_PRECONDITION(aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL,
+  NS_PRECONDITION(aDisplay->mDisplay == StyleDisplay::TableCell,
                   "Unexpected call");
 
   nsIContent* const content = aItem.mContent;
   nsStyleContext* const styleContext = aItem.mStyleContext;
   const uint32_t nameSpaceID = aItem.mNameSpaceID;
 
   nsTableFrame* tableFrame =
     static_cast<nsTableRowFrame*>(aParentFrame)->GetTableFrame();
@@ -2478,17 +2478,17 @@ nsCSSFrameConstructor::ConstructDocEleme
 
   // --------- IF SCROLLABLE WRAP IN SCROLLFRAME --------
 
   NS_ASSERTION(!display->IsScrollableOverflow() ||
                state.mPresContext->IsPaginated() ||
                propagatedScrollFrom == aDocElement,
                "Scrollbars should have been propagated to the viewport");
 
-  if (MOZ_UNLIKELY(display->mDisplay == NS_STYLE_DISPLAY_NONE)) {
+  if (MOZ_UNLIKELY(display->mDisplay == StyleDisplay::None_)) {
     SetUndisplayedContent(aDocElement, styleContext);
     return nullptr;
   }
 
   TreeMatchContext::AutoAncestorPusher ancestorPusher(state.mTreeMatchContext);
   ancestorPusher.PushAncestorAndStyleScope(aDocElement);
 
   // Make sure to start any background image loads for the root element now.
@@ -2553,44 +2553,44 @@ nsCSSFrameConstructor::ConstructDocEleme
 
     nsFrameItems frameItems;
     contentFrame = static_cast<nsContainerFrame*>(
       ConstructOuterSVG(state, item, mDocElementContainingBlock,
                         styleContext->StyleDisplay(),
                         frameItems));
     newFrame = frameItems.FirstChild();
     NS_ASSERTION(frameItems.OnlyChild(), "multiple root element frames");
-  } else if (display->mDisplay == NS_STYLE_DISPLAY_FLEX ||
-             display->mDisplay == NS_STYLE_DISPLAY_WEBKIT_BOX) {
+  } else if (display->mDisplay == StyleDisplay::Flex ||
+             display->mDisplay == StyleDisplay::WebkitBox) {
     contentFrame = NS_NewFlexContainerFrame(mPresShell, styleContext);
     InitAndRestoreFrame(state, aDocElement, mDocElementContainingBlock,
                         contentFrame);
     newFrame = contentFrame;
     processChildren = true;
 
     newFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
     if (display->IsAbsPosContainingBlock(newFrame)) {
       state.PushAbsoluteContainingBlock(contentFrame, newFrame,
                                         absoluteSaveState);
     }
 
-  } else if (display->mDisplay == NS_STYLE_DISPLAY_GRID) {
+  } else if (display->mDisplay == StyleDisplay::Grid) {
     contentFrame = NS_NewGridContainerFrame(mPresShell, styleContext);
     InitAndRestoreFrame(state, aDocElement, mDocElementContainingBlock,
                         contentFrame);
     newFrame = contentFrame;
     processChildren = true;
 
     newFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
     if (display->IsAbsPosContainingBlock(newFrame)) {
       state.PushAbsoluteContainingBlock(contentFrame, newFrame,
                                         absoluteSaveState);
     }
 
-  } else if (display->mDisplay == NS_STYLE_DISPLAY_TABLE) {
+  } else if (display->mDisplay == StyleDisplay::Table) {
     // We're going to call the right function ourselves, so no need to give a
     // function to this FrameConstructionData.
 
     // XXXbz on the other hand, if we converted this whole function to
     // FrameConstructionData/Item, then we'd need the right function
     // here... but would probably be able to get away with less code in this
     // function in general.
     // Use a null PendingBinding, since our binding is not in fact pending.
@@ -2606,17 +2606,17 @@ nsCSSFrameConstructor::ConstructDocEleme
     // if the document is a table then just populate it.
     contentFrame = static_cast<nsContainerFrame*>(
       ConstructTable(state, item, mDocElementContainingBlock,
                      styleContext->StyleDisplay(),
                      frameItems));
     newFrame = frameItems.FirstChild();
     NS_ASSERTION(frameItems.OnlyChild(), "multiple root element frames");
   } else {
-    MOZ_ASSERT(display->mDisplay == NS_STYLE_DISPLAY_BLOCK,
+    MOZ_ASSERT(display->mDisplay == StyleDisplay::Block,
                "Unhandled display type for root element");
     contentFrame = NS_NewBlockFormattingContext(mPresShell, styleContext);
     nsFrameItems frameItems;
     // Use a null PendingBinding, since our binding is not in fact pending.
     ConstructBlock(state, aDocElement,
                    state.GetGeometricParent(display,
                                             mDocElementContainingBlock),
                    mDocElementContainingBlock, styleContext,
@@ -3255,28 +3255,28 @@ nsCSSFrameConstructor::ConstructFieldSet
     absPosContainer = fieldsetFrame;
   }
 
   // Create the inner ::-moz-fieldset-content frame.
   nsContainerFrame* contentFrameTop;
   nsContainerFrame* contentFrame;
   auto parent = scrollFrame ? scrollFrame : fieldsetFrame;
   switch (fieldsetContentDisplay->mDisplay) {
-    case NS_STYLE_DISPLAY_FLEX:
+    case StyleDisplay::Flex:
       contentFrame = NS_NewFlexContainerFrame(mPresShell, fieldsetContentStyle);
       InitAndRestoreFrame(aState, content, parent, contentFrame);
       contentFrameTop = contentFrame;
       break;
-    case NS_STYLE_DISPLAY_GRID:
+    case StyleDisplay::Grid:
       contentFrame = NS_NewGridContainerFrame(mPresShell, fieldsetContentStyle);
       InitAndRestoreFrame(aState, content, parent, contentFrame);
       contentFrameTop = contentFrame;
       break;
     default: {
-      MOZ_ASSERT(fieldsetContentDisplay->mDisplay == NS_STYLE_DISPLAY_BLOCK,
+      MOZ_ASSERT(fieldsetContentDisplay->mDisplay == StyleDisplay::Block,
                  "bug in nsRuleNode::ComputeDisplayData?");
 
       nsContainerFrame* columnSetFrame = nullptr;
       RefPtr<nsStyleContext> innerSC = fieldsetContentStyle;
       const nsStyleColumn* columns = fieldsetContentStyle->StyleColumn();
       if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO ||
           columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) {
         columnSetFrame =
@@ -4271,30 +4271,30 @@ nsCSSFrameConstructor::GetAnonymousConte
   }
 
   return NS_OK;
 }
 
 static
 bool IsXULDisplayType(const nsStyleDisplay* aDisplay)
 {
-  return (aDisplay->mDisplay == NS_STYLE_DISPLAY_INLINE_BOX ||
+  return (aDisplay->mDisplay == StyleDisplay::InlineBox ||
 #ifdef MOZ_XUL
-          aDisplay->mDisplay == NS_STYLE_DISPLAY_INLINE_XUL_GRID ||
-          aDisplay->mDisplay == NS_STYLE_DISPLAY_INLINE_STACK ||
+          aDisplay->mDisplay == StyleDisplay::InlineXulGrid ||
+          aDisplay->mDisplay == StyleDisplay::InlineStack ||
 #endif
-          aDisplay->mDisplay == NS_STYLE_DISPLAY_BOX
+          aDisplay->mDisplay == StyleDisplay::Box
 #ifdef MOZ_XUL
-          || aDisplay->mDisplay == NS_STYLE_DISPLAY_XUL_GRID ||
-          aDisplay->mDisplay == NS_STYLE_DISPLAY_STACK ||
-          aDisplay->mDisplay == NS_STYLE_DISPLAY_XUL_GRID_GROUP ||
-          aDisplay->mDisplay == NS_STYLE_DISPLAY_XUL_GRID_LINE ||
-          aDisplay->mDisplay == NS_STYLE_DISPLAY_DECK ||
-          aDisplay->mDisplay == NS_STYLE_DISPLAY_POPUP ||
-          aDisplay->mDisplay == NS_STYLE_DISPLAY_GROUPBOX
+          || aDisplay->mDisplay == StyleDisplay::XulGrid ||
+          aDisplay->mDisplay == StyleDisplay::Stack ||
+          aDisplay->mDisplay == StyleDisplay::XulGridGroup ||
+          aDisplay->mDisplay == StyleDisplay::XulGridLine ||
+          aDisplay->mDisplay == StyleDisplay::Deck ||
+          aDisplay->mDisplay == StyleDisplay::Popup ||
+          aDisplay->mDisplay == StyleDisplay::Groupbox
 #endif
           );
 }
 
 
 // XUL frames are not allowed to be out of flow.
 #define SIMPLE_XUL_FCDATA(_func)                                        \
   FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_SKIP_ABSPOS_PUSH,    \
@@ -4464,32 +4464,32 @@ nsCSSFrameConstructor::FindXULMenubarDat
 #endif /* XP_MACOSX */
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULListBoxBodyData(Element* aElement,
                                               nsStyleContext* aStyleContext)
 {
   if (aStyleContext->StyleDisplay()->mDisplay !=
-        NS_STYLE_DISPLAY_XUL_GRID_GROUP) {
+        StyleDisplay::XulGridGroup) {
     return nullptr;
   }
 
   static const FrameConstructionData sListBoxBodyData =
     SCROLLABLE_XUL_FCDATA(NS_NewListBoxBodyFrame);
   return &sListBoxBodyData;
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULListItemData(Element* aElement,
                                            nsStyleContext* aStyleContext)
 {
   if (aStyleContext->StyleDisplay()->mDisplay !=
-        NS_STYLE_DISPLAY_XUL_GRID_LINE) {
+        StyleDisplay::XulGridLine) {
     return nullptr;
   }
 
   static const FrameConstructionData sListItemData =
     SCROLLABLE_XUL_FCDATA(NS_NewListItemFrame);
   return &sListItemData;
 }
 
@@ -4497,32 +4497,32 @@ nsCSSFrameConstructor::FindXULListItemDa
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULDisplayData(const nsStyleDisplay* aDisplay,
                                           Element* aElement,
                                           nsStyleContext* aStyleContext)
 {
   static const FrameConstructionDataByInt sXULDisplayData[] = {
-    SCROLLABLE_ABSPOS_CONTAINER_XUL_INT_CREATE(NS_STYLE_DISPLAY_INLINE_BOX,
+    SCROLLABLE_ABSPOS_CONTAINER_XUL_INT_CREATE(StyleDisplay::InlineBox,
                                                NS_NewBoxFrame),
-    SCROLLABLE_ABSPOS_CONTAINER_XUL_INT_CREATE(NS_STYLE_DISPLAY_BOX,
+    SCROLLABLE_ABSPOS_CONTAINER_XUL_INT_CREATE(StyleDisplay::Box,
                                                NS_NewBoxFrame),
 #ifdef MOZ_XUL
-    SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_INLINE_XUL_GRID, NS_NewGridBoxFrame),
-    SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_XUL_GRID, NS_NewGridBoxFrame),
-    SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_XUL_GRID_GROUP,
+    SCROLLABLE_XUL_INT_CREATE(StyleDisplay::InlineXulGrid, NS_NewGridBoxFrame),
+    SCROLLABLE_XUL_INT_CREATE(StyleDisplay::XulGrid, NS_NewGridBoxFrame),
+    SCROLLABLE_XUL_INT_CREATE(StyleDisplay::XulGridGroup,
                               NS_NewGridRowGroupFrame),
-    SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_XUL_GRID_LINE,
+    SCROLLABLE_XUL_INT_CREATE(StyleDisplay::XulGridLine,
                               NS_NewGridRowLeafFrame),
-    SIMPLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_DECK, NS_NewDeckFrame),
-    SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_GROUPBOX, NS_NewGroupBoxFrame),
-    SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_INLINE_STACK, NS_NewStackFrame),
-    SCROLLABLE_XUL_INT_CREATE(NS_STYLE_DISPLAY_STACK, NS_NewStackFrame),
-    { NS_STYLE_DISPLAY_POPUP,
+    SIMPLE_XUL_INT_CREATE(StyleDisplay::Deck, NS_NewDeckFrame),
+    SCROLLABLE_XUL_INT_CREATE(StyleDisplay::Groupbox, NS_NewGroupBoxFrame),
+    SCROLLABLE_XUL_INT_CREATE(StyleDisplay::InlineStack, NS_NewStackFrame),
+    SCROLLABLE_XUL_INT_CREATE(StyleDisplay::Stack, NS_NewStackFrame),
+    { StyleDisplay::Popup,
       FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_IS_POPUP |
                   FCDATA_SKIP_ABSPOS_PUSH, NS_NewMenuPopupFrame) }
 #endif /* MOZ_XUL */
   };
 
   // Processing by display here:
   return FindDataByInt(aDisplay->mDisplay, aElement, aStyleContext,
                        sXULDisplayData, ArrayLength(sXULDisplayData));
@@ -4546,18 +4546,18 @@ nsCSSFrameConstructor::BeginBuildingScro
   if (!gfxScrollFrame) {
     // Build a XULScrollFrame when the child is a box, otherwise an
     // HTMLScrollFrame
     // XXXbz this is the lone remaining consumer of IsXULDisplayType.
     // I wonder whether we can eliminate that somehow.
     const nsStyleDisplay* displayStyle = aContentStyle->StyleDisplay();
     if (IsXULDisplayType(displayStyle)) {
       gfxScrollFrame = NS_NewXULScrollFrame(mPresShell, contentStyle, aIsRoot,
-          displayStyle->mDisplay == NS_STYLE_DISPLAY_STACK ||
-          displayStyle->mDisplay == NS_STYLE_DISPLAY_INLINE_STACK);
+          displayStyle->mDisplay == StyleDisplay::Stack ||
+          displayStyle->mDisplay == StyleDisplay::InlineStack);
     } else {
       gfxScrollFrame = NS_NewHTMLScrollFrame(mPresShell, contentStyle, aIsRoot);
     }
 
     InitAndRestoreFrame(aState, aContent, aParentFrame, gfxScrollFrame);
   }
 
   // if there are any anonymous children for the scroll frame, create
@@ -4648,17 +4648,17 @@ nsCSSFrameConstructor::FindDisplayData(c
   static_assert(eParentTypeCount < (1 << (32 - FCDATA_PARENT_TYPE_OFFSET)),
                 "Check eParentTypeCount should not overflow");
 
   // The style system ensures that floated and positioned frames are
   // block-level.
   NS_ASSERTION(!(aDisplay->IsFloatingStyle() ||
                  aDisplay->IsAbsolutelyPositionedStyle()) ||
                aDisplay->IsBlockOutsideStyle() ||
-               aDisplay->mDisplay == NS_STYLE_DISPLAY_CONTENTS,
+               aDisplay->mDisplay == StyleDisplay::Contents,
                "Style system did not apply CSS2.1 section 9.7 fixups");
 
   // If this is "body", try propagating its scroll style to the viewport
   // Note that we need to do this even if the body is NOT scrollable;
   // it might have dynamically changed from scrollable to not scrollable,
   // and that might need to be propagated.
   // XXXbz is this the right place to do this?  If this code moves,
   // make this function static.
@@ -4676,17 +4676,17 @@ nsCSSFrameConstructor::FindDisplayData(c
 
   if (aDisplay->IsBlockInsideStyle()) {
     // If the frame is a block-level frame and is scrollable, then wrap it in a
     // scroll frame.  Except we don't want to do that for paginated contexts for
     // frames that are block-outside and aren't frames for native anonymous stuff.
     // XXX Ignore tables for the time being (except caption)
     const uint32_t kCaptionCtorFlags =
       FCDATA_IS_TABLE_PART | FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable);
-    bool caption = aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_CAPTION;
+    bool caption = aDisplay->mDisplay == StyleDisplay::TableCaption;
     bool suppressScrollFrame = false;
     bool needScrollFrame = aDisplay->IsScrollableOverflow() &&
                            !propagatedScrollToViewport;
     if (needScrollFrame) {
       suppressScrollFrame = mPresShell->GetPresContext()->IsPaginated() &&
                             aDisplay->IsBlockOutsideStyle() &&
                             !aElement->IsInNativeAnonymousSubtree();
       if (!suppressScrollFrame) {
@@ -4711,109 +4711,109 @@ nsCSSFrameConstructor::FindDisplayData(c
     };
     return &sNonScrollableBlockData[suppressScrollFrame][caption];
   }
 
   // If this is for a <body> node and we've propagated the scroll-frame to the
   // viewport, we need to make sure not to add another layer of scrollbars, so
   // we use a different FCData struct without FCDATA_MAY_NEED_SCROLLFRAME.
   if (propagatedScrollToViewport && aDisplay->IsScrollableOverflow()) {
-    if (aDisplay->mDisplay == NS_STYLE_DISPLAY_FLEX ||
-        aDisplay->mDisplay == NS_STYLE_DISPLAY_WEBKIT_BOX) {
+    if (aDisplay->mDisplay == StyleDisplay::Flex ||
+        aDisplay->mDisplay == StyleDisplay::WebkitBox) {
       static const FrameConstructionData sNonScrollableFlexData =
         FCDATA_DECL(0, NS_NewFlexContainerFrame);
       return &sNonScrollableFlexData;
     }
-    if (aDisplay->mDisplay == NS_STYLE_DISPLAY_GRID) {
+    if (aDisplay->mDisplay == StyleDisplay::Grid) {
       static const FrameConstructionData sNonScrollableGridData =
         FCDATA_DECL(0, NS_NewGridContainerFrame);
       return &sNonScrollableGridData;
     }
   }
 
   static const FrameConstructionDataByInt sDisplayData[] = {
     // To keep the hash table small don't add inline frames (they're
     // typically things like FONT and B), because we can quickly
     // find them if we need to.
     // XXXbz the "quickly" part is a bald-faced lie!
-    { NS_STYLE_DISPLAY_INLINE,
+    { StyleDisplay::Inline,
       FULL_CTOR_FCDATA(FCDATA_IS_INLINE | FCDATA_IS_LINE_PARTICIPANT,
                        &nsCSSFrameConstructor::ConstructInline) },
-    { NS_STYLE_DISPLAY_FLEX,
+    { StyleDisplay::Flex,
       FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewFlexContainerFrame) },
-    { NS_STYLE_DISPLAY_INLINE_FLEX,
+    { StyleDisplay::InlineFlex,
       FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewFlexContainerFrame) },
-    { NS_STYLE_DISPLAY_WEBKIT_BOX,
+    { StyleDisplay::WebkitBox,
       FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewFlexContainerFrame) },
-    { NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX,
+    { StyleDisplay::WebkitInlineBox,
       FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewFlexContainerFrame) },
-    { NS_STYLE_DISPLAY_GRID,
+    { StyleDisplay::Grid,
       FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewGridContainerFrame) },
-    { NS_STYLE_DISPLAY_INLINE_GRID,
+    { StyleDisplay::InlineGrid,
       FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewGridContainerFrame) },
-    { NS_STYLE_DISPLAY_RUBY,
+    { StyleDisplay::Ruby,
       FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT,
                   NS_NewRubyFrame) },
-    { NS_STYLE_DISPLAY_RUBY_BASE,
+    { StyleDisplay::RubyBase,
       FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT |
                   FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyBaseContainer),
                   NS_NewRubyBaseFrame) },
-    { NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER,
+    { StyleDisplay::RubyBaseContainer,
       FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT |
                   FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby),
                   NS_NewRubyBaseContainerFrame) },
-    { NS_STYLE_DISPLAY_RUBY_TEXT,
+    { StyleDisplay::RubyText,
       FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT |
                   FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyTextContainer),
                   NS_NewRubyTextFrame) },
-    { NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER,
+    { StyleDisplay::RubyTextContainer,
       FCDATA_DECL(FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby),
                   NS_NewRubyTextContainerFrame) },
-    { NS_STYLE_DISPLAY_TABLE,
+    { StyleDisplay::Table,
       FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructTable) },
-    { NS_STYLE_DISPLAY_INLINE_TABLE,
+    { StyleDisplay::InlineTable,
       FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructTable) },
     // NOTE: In the unlikely event that we add another table-part here that has
     // a desired-parent-type (& hence triggers table fixup), we'll need to also
     // update the flexbox chunk in nsStyleContext::ApplyStyleFixups().
-    { NS_STYLE_DISPLAY_TABLE_ROW_GROUP,
+    { StyleDisplay::TableRowGroup,
       FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
                        &nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
-    { NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
+    { StyleDisplay::TableHeaderGroup,
       FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
                        &nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
-    { NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP,
+    { StyleDisplay::TableFooterGroup,
       FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
                        &nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
-    { NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP,
+    { StyleDisplay::TableColumnGroup,
       FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
                   FCDATA_SKIP_ABSPOS_PUSH |
                   FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
                   NS_NewTableColGroupFrame) },
-    { NS_STYLE_DISPLAY_TABLE_COLUMN,
+    { StyleDisplay::TableColumn,
       FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeColGroup),
                        &nsCSSFrameConstructor::ConstructTableCol) },
-    { NS_STYLE_DISPLAY_TABLE_ROW,
+    { StyleDisplay::TableRow,
       FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRowGroup),
                        &nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
-    { NS_STYLE_DISPLAY_TABLE_CELL,
+    { StyleDisplay::TableCell,
       FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRow),
                        &nsCSSFrameConstructor::ConstructTableCell) },
-    { NS_STYLE_DISPLAY_CONTENTS,
+    { StyleDisplay::Contents,
       FULL_CTOR_FCDATA(FCDATA_IS_CONTENTS, nullptr/*never called*/) }
   };
 
   // See the mDisplay fixup code in nsRuleNode::ComputeDisplayData.
-  MOZ_ASSERT(aDisplay->mDisplay != NS_STYLE_DISPLAY_CONTENTS ||
+  MOZ_ASSERT(aDisplay->mDisplay != StyleDisplay::Contents ||
              !aElement->IsRootOfNativeAnonymousSubtree(),
              "display:contents on anonymous content is unsupported");
 
   return FindDataByInt(aDisplay->mDisplay,
                        aElement, aStyleContext, sDisplayData,
                        ArrayLength(sDisplayData));
 }
 
@@ -4869,17 +4869,17 @@ nsCSSFrameConstructor::ConstructNonScrol
   // every block that would be scrollable in a non-paginated context.
   // We mark our blocks with a bit here if this condition is true, so
   // we can check it later in nsFrame::ApplyPaginatedOverflowClipping.
   bool clipPaginatedOverflow =
     (aItem.mFCData->mBits & FCDATA_FORCED_NON_SCROLLABLE_BLOCK) != 0;
   nsContainerFrame* newFrame;
   if ((aDisplay->IsAbsolutelyPositionedStyle() ||
        aDisplay->IsFloatingStyle() ||
-       NS_STYLE_DISPLAY_INLINE_BLOCK == aDisplay->mDisplay ||
+       StyleDisplay::InlineBlock == aDisplay->mDisplay ||
        clipPaginatedOverflow) &&
       !aParentFrame->IsSVGText()) {
     newFrame = NS_NewBlockFormattingContext(mPresShell, styleContext);
     if (clipPaginatedOverflow) {
       newFrame->AddStateBits(NS_BLOCK_CLIP_PAGINATED_OVERFLOW);
     }
   } else {
     newFrame = NS_NewBlockFrame(mPresShell, styleContext);
@@ -5495,17 +5495,17 @@ nsCSSFrameConstructor::AddPageBreakItem(
   // (Getting different parents can result in framechange hints, e.g.,
   // for user-modify.)
   RefPtr<nsStyleContext> pseudoStyle =
     mPresShell->StyleSet()->
       ResolveAnonymousBoxStyle(nsCSSAnonBoxes::pageBreak,
                                aMainStyleContext->GetParent());
 
   NS_ASSERTION(pseudoStyle->StyleDisplay()->mDisplay ==
-                 NS_STYLE_DISPLAY_BLOCK, "Unexpected display");
+                 StyleDisplay::Block, "Unexpected display");
 
   static const FrameConstructionData sPageBreakData =
     FCDATA_DECL(FCDATA_SKIP_FRAMESET, NS_NewPageBreakFrame);
 
   // Lie about the tag and namespace so we don't trigger anything
   // interesting during frame construction.
   aItems.AppendItem(&sPageBreakData, aContent, nsCSSAnonBoxes::pageBreak,
                     kNameSpaceID_None, nullptr, pseudoStyle.forget(),
@@ -5681,17 +5681,17 @@ nsCSSFrameConstructor::AddFrameConstruct
 
     aTag = mDocument->BindingManager()->ResolveTag(aContent, &aNameSpaceID);
   }
 
   bool isGeneratedContent = ((aFlags & ITEM_IS_GENERATED_CONTENT) != 0);
 
   // Pre-check for display "none" - if we find that, don't create
   // any frame at all
-  if (NS_STYLE_DISPLAY_NONE == display->mDisplay) {
+  if (StyleDisplay::None_ == display->mDisplay) {
     SetAsUndisplayedContent(aState, aItems, aContent, styleContext, isGeneratedContent);
     return;
   }
 
   bool isText = !aContent->IsElement();
 
   // never create frames for non-option/optgroup kids of <select> and
   // non-option kids of <optgroup> inside a <select>.
@@ -5806,17 +5806,17 @@ nsCSSFrameConstructor::AddFrameConstruct
   }
 
   uint32_t bits = data->mBits;
 
   // Inside colgroups, suppress everything except columns.
   if (aParentFrame &&
       aParentFrame->GetType() == nsGkAtoms::tableColGroupFrame &&
       (!(bits & FCDATA_IS_TABLE_PART) ||
-       display->mDisplay != NS_STYLE_DISPLAY_TABLE_COLUMN)) {
+       display->mDisplay != StyleDisplay::TableColumn)) {
     SetAsUndisplayedContent(aState, aItems, aContent, styleContext, isGeneratedContent);
     return;
   }
 
   bool canHavePageBreak =
     (aFlags & ITEM_ALLOW_PAGE_BREAK) &&
     aState.mPresContext->IsPaginated() &&
     !display->IsAbsolutelyPositionedStyle() &&
@@ -5926,17 +5926,17 @@ nsCSSFrameConstructor::AddFrameConstruct
     // Compute a boolean isInline which is guaranteed to be false for blocks
     // (but may also be false for some inlines).
     bool isInline =
       // Table-internal things are inline-outside if and only if they're kids of
       // inlines, since they'll trigger construction of inline-table
       // pseudos.
       ((bits & FCDATA_IS_TABLE_PART) &&
        (!aParentFrame || // No aParentFrame means inline
-        aParentFrame->StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_INLINE)) ||
+        aParentFrame->StyleDisplay()->mDisplay == StyleDisplay::Inline)) ||
       // Things that are inline-outside but aren't inline frames are inline
       display->IsInlineOutsideStyle() ||
       // Popups that are certainly out of flow.
       isPopup;
 
     // Set mIsAllInline conservatively.  It just might be that even an inline
     // that has mIsAllInline false doesn't need an {ib} split.  So this is just
     // an optimization to keep from doing too much work in cases when we can
@@ -6490,22 +6490,22 @@ nsCSSFrameConstructor::IsValidSibling(ns
 {
   nsIFrame* parentFrame = aSibling->GetParent();
   nsIAtom* parentType = nullptr;
   if (parentFrame) {
     parentType = parentFrame->GetType();
   }
 
   uint8_t siblingDisplay = aSibling->GetDisplay();
-  if ((NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == siblingDisplay) ||
-      (NS_STYLE_DISPLAY_TABLE_COLUMN       == siblingDisplay) ||
-      (NS_STYLE_DISPLAY_TABLE_CAPTION      == siblingDisplay) ||
-      (NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == siblingDisplay) ||
-      (NS_STYLE_DISPLAY_TABLE_ROW_GROUP    == siblingDisplay) ||
-      (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == siblingDisplay) ||
+  if ((StyleDisplay::TableColumnGroup == siblingDisplay) ||
+      (StyleDisplay::TableColumn       == siblingDisplay) ||
+      (StyleDisplay::TableCaption      == siblingDisplay) ||
+      (StyleDisplay::TableHeaderGroup == siblingDisplay) ||
+      (StyleDisplay::TableRowGroup    == siblingDisplay) ||
+      (StyleDisplay::TableFooterGroup == siblingDisplay) ||
       nsGkAtoms::menuFrame == parentType) {
     // if we haven't already, construct a style context to find the display type of aContent
     if (UNSET_DISPLAY == aDisplay) {
       nsIFrame* styleParent;
       aSibling->GetParentStyleContext(&styleParent);
       if (!styleParent) {
         styleParent = aSibling->GetParent();
       }
@@ -6517,41 +6517,41 @@ nsCSSFrameConstructor::IsValidSibling(ns
       // ResolveStyleContext can be made non-optional.
       RefPtr<nsStyleContext> styleContext =
         ResolveStyleContext(styleParent, aContent, nullptr);
       const nsStyleDisplay* display = styleContext->StyleDisplay();
       aDisplay = display->mDisplay;
     }
     if (nsGkAtoms::menuFrame == parentType) {
       return
-        (NS_STYLE_DISPLAY_POPUP == aDisplay) ==
-        (NS_STYLE_DISPLAY_POPUP == siblingDisplay);
+        (StyleDisplay::Popup == aDisplay) ==
+        (StyleDisplay::Popup == siblingDisplay);
     }
     // To have decent performance we want to return false in cases in which
     // reordering the two siblings has no effect on display.  To ensure
     // correctness, we MUST return false in cases where the two siblings have
     // the same desired parent type and live on different display lists.
     // Specificaly, columns and column groups should only consider columns and
     // column groups as valid siblings.  Captions should only consider other
     // captions.  All other things should consider each other as valid
     // siblings.  The restriction in the |if| above on siblingDisplay is ok,
     // because for correctness the only part that really needs to happen is to
     // not consider captions, column groups, and row/header/footer groups
     // siblings of each other.  Treating a column or colgroup as a valid
     // sibling of a non-table-related frame will just mean we end up reframing.
-    if ((siblingDisplay == NS_STYLE_DISPLAY_TABLE_CAPTION) !=
-        (aDisplay == NS_STYLE_DISPLAY_TABLE_CAPTION)) {
+    if ((siblingDisplay == StyleDisplay::TableCaption) !=
+        (aDisplay == StyleDisplay::TableCaption)) {
       // One's a caption and the other is not.  Not valid siblings.
       return false;
     }
 
-    if ((siblingDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP ||
-         siblingDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN) !=
-        (aDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP ||
-         aDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN)) {
+    if ((siblingDisplay == StyleDisplay::TableColumnGroup ||
+         siblingDisplay == StyleDisplay::TableColumn) !=
+        (aDisplay == StyleDisplay::TableColumnGroup ||
+         aDisplay == StyleDisplay::TableColumn)) {
       // One's a column or column group and the other is not.  Not valid
       // siblings.
       return false;
     }
     // Fall through; it's possible that the display type was overridden and
     // a different sort of frame was constructed, so we may need to return false
     // below.
   }
@@ -7849,20 +7849,20 @@ nsCSSFrameConstructor::ContentRangeInser
   // containing block haveFirst* flags if the parent frame where
   // the insertion/append is occurring is an inline or block
   // container. For other types of containers this isn't relevant.
   uint8_t parentDisplay = insertion.mParentFrame->GetDisplay();
 
   // Examine the insertion.mParentFrame where the insertion is taking
   // place. If it's a certain kind of container then some special
   // processing is done.
-  if ((NS_STYLE_DISPLAY_BLOCK == parentDisplay) ||
-      (NS_STYLE_DISPLAY_LIST_ITEM == parentDisplay) ||
-      (NS_STYLE_DISPLAY_INLINE == parentDisplay) ||
-      (NS_STYLE_DISPLAY_INLINE_BLOCK == parentDisplay)) {
+  if ((StyleDisplay::Block == parentDisplay) ||
+      (StyleDisplay::ListItem == parentDisplay) ||
+      (StyleDisplay::Inline == parentDisplay) ||
+      (StyleDisplay::InlineBlock == parentDisplay)) {
     // Recover the special style flags for the containing block
     if (containingBlock) {
       haveFirstLetterStyle = HasFirstLetterStyle(containingBlock);
       haveFirstLineStyle =
         ShouldHaveFirstLineStyle(containingBlock->GetContent(),
                                  containingBlock->StyleContext());
     }
 
@@ -9181,30 +9181,30 @@ static bool EqualURIs(mozilla::css::URLV
   return aURI1 == aURI2 ||    // handle null==null, and optimize
          (aURI1 && aURI2 && aURI1->URIEquals(*aURI2));
 }
 
 nsStyleContext*
 nsCSSFrameConstructor::MaybeRecreateFramesForElement(Element* aElement)
 {
   RefPtr<nsStyleContext> oldContext = GetUndisplayedContent(aElement);
-  uint8_t oldDisplay = NS_STYLE_DISPLAY_NONE;
+  uint8_t oldDisplay = StyleDisplay::None_;
   if (!oldContext) {
     oldContext = GetDisplayContentsStyleFor(aElement);
     if (!oldContext) {
       return nullptr;
     }
-    oldDisplay = NS_STYLE_DISPLAY_CONTENTS;
+    oldDisplay = StyleDisplay::Contents;
   }
 
   // The parent has a frame, so try resolving a new context.
   RefPtr<nsStyleContext> newContext = mPresShell->StyleSet()->
     ResolveStyleFor(aElement, oldContext->GetParent());
 
-  if (oldDisplay == NS_STYLE_DISPLAY_NONE) {
+  if (oldDisplay == StyleDisplay::None_) {
     ChangeUndisplayedContent(aElement, newContext);
   } else {
     ChangeDisplayContents(aElement, newContext);
   }
 
   const nsStyleDisplay* disp = newContext->StyleDisplay();
   if (oldDisplay == disp->mDisplay) {
     // We can skip trying to recreate frames here, but only if our style
@@ -9927,22 +9927,22 @@ nsCSSFrameConstructor::CreateNeededAnonF
 
 /* static */ nsCSSFrameConstructor::RubyWhitespaceType
 nsCSSFrameConstructor::ComputeRubyWhitespaceType(uint_fast8_t aPrevDisplay,
                                                  uint_fast8_t aNextDisplay)
 {
   MOZ_ASSERT(nsStyleDisplay::IsRubyDisplayType(aPrevDisplay) &&
              nsStyleDisplay::IsRubyDisplayType(aNextDisplay));
   if (aPrevDisplay == aNextDisplay &&
-      (aPrevDisplay == NS_STYLE_DISPLAY_RUBY_BASE ||
-       aPrevDisplay == NS_STYLE_DISPLAY_RUBY_TEXT)) {
+      (aPrevDisplay == StyleDisplay::RubyBase ||
+       aPrevDisplay == StyleDisplay::RubyText)) {
     return eRubyInterLeafWhitespace;
   }
-  if (aNextDisplay == NS_STYLE_DISPLAY_RUBY_TEXT ||
-      aNextDisplay == NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER) {
+  if (aNextDisplay == StyleDisplay::RubyText ||
+      aNextDisplay == StyleDisplay::RubyTextContainer) {
     return eRubyInterLevelWhitespace;
   }
   return eRubyInterSegmentWhitespace;
 }
 
 /**
  * This function checks the content from |aStartIter| to |aEndIter|,
  * determines whether it contains only whitespace, and if yes,
@@ -9983,21 +9983,21 @@ nsCSSFrameConstructor::InterpretRubyWhit
  */
 void
 nsCSSFrameConstructor::WrapItemsInPseudoRubyLeafBox(
   FCItemIterator& aIter,
   nsStyleContext* aParentStyle, nsIContent* aParentContent)
 {
   uint_fast8_t parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
   ParentType parentType, wrapperType;
-  if (parentDisplay == NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER) {
+  if (parentDisplay == StyleDisplay::RubyTextContainer) {
     parentType = eTypeRubyTextContainer;
     wrapperType = eTypeRubyText;
   } else {
-    MOZ_ASSERT(parentDisplay == NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER);
+    MOZ_ASSERT(parentDisplay == StyleDisplay::RubyBaseContainer);
     parentType = eTypeRubyBaseContainer;
     wrapperType = eTypeRubyBase;
   }
 
   MOZ_ASSERT(aIter.item().DesiredParentType() != parentType,
              "Should point to something needs to be wrapped.");
 
   FCItemIterator endIter(aIter);
@@ -10371,19 +10371,19 @@ nsCSSFrameConstructor::WrapItemsInPseudo
                                                FCItemIterator& aIter,
                                                const FCItemIterator& aEndIter)
 {
   const PseudoParentData& pseudoData = sPseudoParentData[aWrapperType];
   nsIAtom* pseudoType = *pseudoData.mPseudoType;
   uint8_t parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
 
   if (pseudoType == nsCSSAnonBoxes::table &&
-      (parentDisplay == NS_STYLE_DISPLAY_INLINE ||
-       parentDisplay == NS_STYLE_DISPLAY_RUBY_BASE ||
-       parentDisplay == NS_STYLE_DISPLAY_RUBY_TEXT)) {
+      (parentDisplay == StyleDisplay::Inline ||
+       parentDisplay == StyleDisplay::RubyBase ||
+       parentDisplay == StyleDisplay::RubyText)) {
     pseudoType = nsCSSAnonBoxes::inlineTable;
   }
 
   already_AddRefed<nsStyleContext> wrapperStyle =
     mPresShell->StyleSet()->ResolveAnonymousBoxStyle(pseudoType, aParentStyle);
   FrameConstructionItem* newItem =
     new FrameConstructionItem(&pseudoData.mFCData,
                               // Use the content of our parent frame
@@ -10438,20 +10438,20 @@ void nsCSSFrameConstructor::CreateNeeded
 {
   if (aItems.IsEmpty() ||
       GetParentType(aParentFrame) != eTypeRuby) {
     return;
   }
 
   FCItemIterator iter(aItems);
   int firstDisplay = iter.item().mStyleContext->StyleDisplay()->mDisplay;
-  if (firstDisplay == NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER) {
+  if (firstDisplay == StyleDisplay::RubyBaseContainer) {
     return;
   }
-  NS_ASSERTION(firstDisplay == NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER,
+  NS_ASSERTION(firstDisplay == StyleDisplay::RubyTextContainer,
                "Child of ruby frame should either a rbc or a rtc");
 
   const PseudoParentData& pseudoData =
     sPseudoParentData[eTypeRubyBaseContainer];
   already_AddRefed<nsStyleContext> pseudoStyle = mPresShell->StyleSet()->
     ResolveAnonymousBoxStyle(*pseudoData.mPseudoType,
                              aParentFrame->StyleContext());
   FrameConstructionItem* newItem =
@@ -10772,17 +10772,17 @@ nsCSSFrameConstructor::ProcessChildren(n
     if (!aFrame->IsGeneratedContentFrame() &&
         mPresShell->GetPresContext()->IsChrome()) {
       nsIContent *badKid = AnyKidsNeedBlockParent(aFrameItems.FirstChild());
       nsDependentAtomString parentTag(aContent->NodeInfo()->NameAtom()),
                             kidTag(badKid->NodeInfo()->NameAtom());
       const char16_t* params[] = { parentTag.get(), kidTag.get() };
       const nsStyleDisplay *display = frameStyleContext->StyleDisplay();
       const char *message =
-        (display->mDisplay == NS_STYLE_DISPLAY_INLINE_BOX)
+        (display->mDisplay == StyleDisplay::InlineBox)
           ? "NeededToWrapXULInlineBox" : "NeededToWrapXUL";
       nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                       NS_LITERAL_CSTRING("Layout: FrameConstructor"),
                                       mDocument,
                                       nsContentUtils::eXUL_PROPERTIES,
                                       message,
                                       params, ArrayLength(params));
     }
@@ -11633,17 +11633,17 @@ nsCSSFrameConstructor::CreateListBoxCont
 
     RefPtr<nsStyleContext> styleContext;
     styleContext = ResolveStyleContext(aParentFrame, aChild, &state);
 
     // Pre-check for display "none" - only if we find that, do we create
     // any frame at all
     const nsStyleDisplay* display = styleContext->StyleDisplay();
 
-    if (NS_STYLE_DISPLAY_NONE == display->mDisplay) {
+    if (StyleDisplay::None_ == display->mDisplay) {
       *aNewFrame = nullptr;
       return NS_OK;
     }
 
     BeginUpdate();
 
     FrameConstructionItemList items;
     AddFrameConstructionItemsInternal(state, aChild, aParentFrame,
@@ -11820,17 +11820,17 @@ nsCSSFrameConstructor::ConstructInline(n
   //     Text("e")
   // Inline (outer span)
   //   Text("f")
 
   nsIContent* const content = aItem.mContent;
   nsStyleContext* const styleContext = aItem.mStyleContext;
 
   bool positioned =
-    NS_STYLE_DISPLAY_INLINE == aDisplay->mDisplay &&
+    StyleDisplay::Inline == aDisplay->mDisplay &&
     aDisplay->IsRelativelyPositionedStyle() &&
     !aParentFrame->IsSVGText();
 
   nsInlineFrame* newFrame = NS_NewInlineFrame(mPresShell, styleContext);
 
   // Initialize the frame
   InitAndRestoreFrame(aState, content, aParentFrame, newFrame);
 
--- a/layout/base/nsFrameTraversal.cpp
+++ b/layout/base/nsFrameTraversal.cpp
@@ -506,17 +506,17 @@ bool
 nsFrameIterator::IsPopupFrame(nsIFrame* aFrame)
 {
   // If skipping popup checks, pretend this isn't one.
   if (mSkipPopupChecks) {
     return false;
   }
 
   return (aFrame &&
-          aFrame->StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_POPUP);
+          aFrame->StyleDisplay()->mDisplay == StyleDisplay::Popup);
 }
 
 // nsVisualIterator implementation
 
 nsIFrame*
 nsVisualIterator::GetFirstChildInner(nsIFrame* aFrame) {
   return aFrame->PrincipalChildList().GetNextVisualFor(nullptr);
 }
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1399,17 +1399,17 @@ nsLayoutUtils::GetChildListNameFor(nsIFr
       id = nsIFrame::kAbsoluteList;
     } else if (NS_STYLE_POSITION_FIXED == disp->mPosition) {
       if (nsLayoutUtils::IsReallyFixedPos(aChildFrame)) {
         id = nsIFrame::kFixedList;
       } else {
         id = nsIFrame::kAbsoluteList;
       }
 #ifdef MOZ_XUL
-    } else if (NS_STYLE_DISPLAY_POPUP == disp->mDisplay) {
+    } else if (StyleDisplay::Popup == disp->mDisplay) {
       // Out-of-flows that are DISPLAY_POPUP must be kids of the root popup set
 #ifdef DEBUG
       nsIFrame* parent = aChildFrame->GetParent();
       NS_ASSERTION(parent && parent->GetType() == nsGkAtoms::popupSetFrame,
                    "Unexpected parent");
 #endif // DEBUG
 
       id = nsIFrame::kPopupList;
@@ -9063,18 +9063,18 @@ nsLayoutUtils::GetTouchActionFromFrame(n
   // non-replaced inline elements, table rows, row groups, table columns, and column groups
   bool isNonReplacedInlineElement = aFrame->IsFrameOfType(nsIFrame::eLineParticipant);
   if (isNonReplacedInlineElement) {
     return NS_STYLE_TOUCH_ACTION_AUTO;
   }
 
   const nsStyleDisplay* disp = aFrame->StyleDisplay();
   bool isTableElement = disp->IsInnerTableStyle() &&
-    disp->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL &&
-    disp->mDisplay != NS_STYLE_DISPLAY_TABLE_CAPTION;
+    disp->mDisplay != StyleDisplay::TableCell &&
+    disp->mDisplay != StyleDisplay::TableCaption;
   if (isTableElement) {
     return NS_STYLE_TOUCH_ACTION_AUTO;
   }
 
   return disp->mTouchAction;
 }
 
 /* static */  void
--- a/layout/generic/BlockReflowInput.cpp
+++ b/layout/generic/BlockReflowInput.cpp
@@ -801,17 +801,17 @@ BlockReflowInput::FlowAndPlaceFloat(nsIF
     }
 
     if (CanPlaceFloat(floatMarginISize, floatAvailableSpace)) {
       // We found an appropriate place.
       break;
     }
 
     // Nope. try to advance to the next band.
-    if (NS_STYLE_DISPLAY_TABLE != floatDisplay->mDisplay ||
+    if (StyleDisplay::Table != floatDisplay->mDisplay ||
           eCompatibility_NavQuirks != mPresContext->CompatibilityMode() ) {
 
       mBCoord += floatAvailableSpace.mRect.BSize(wm);
       if (adjustedAvailableSpace.BSize(wm) != NS_UNCONSTRAINEDSIZE) {
         adjustedAvailableSpace.BSize(wm) -= floatAvailableSpace.mRect.BSize(wm);
       }
       floatAvailableSpace = GetFloatAvailableSpace(mBCoord);
     } else {
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -795,61 +795,61 @@ ReflowInput::InitFrameType(nsIAtom* aFra
       //XXXfr hack for making frames behave properly when in overflow container lists
       //      see bug 154892; need to revisit later
       if (mFrame->GetPrevInFlow())
         frameType = NS_CSS_FRAME_TYPE_BLOCK;
     }
     else if (disp->IsFloating(mFrame)) {
       frameType = NS_CSS_FRAME_TYPE_FLOATING;
     } else {
-      NS_ASSERTION(disp->mDisplay == NS_STYLE_DISPLAY_POPUP,
+      NS_ASSERTION(disp->mDisplay == StyleDisplay::Popup,
                    "unknown out of flow frame type");
       frameType = NS_CSS_FRAME_TYPE_UNKNOWN;
     }
   }
   else {
     switch (GetDisplay()) {
-    case NS_STYLE_DISPLAY_BLOCK:
-    case NS_STYLE_DISPLAY_LIST_ITEM:
-    case NS_STYLE_DISPLAY_TABLE:
-    case NS_STYLE_DISPLAY_TABLE_CAPTION:
-    case NS_STYLE_DISPLAY_FLEX:
-    case NS_STYLE_DISPLAY_WEBKIT_BOX:
-    case NS_STYLE_DISPLAY_GRID:
-    case NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER:
+    case StyleDisplay::Block:
+    case StyleDisplay::ListItem:
+    case StyleDisplay::Table:
+    case StyleDisplay::TableCaption:
+    case StyleDisplay::Flex:
+    case StyleDisplay::WebkitBox:
+    case StyleDisplay::Grid:
+    case StyleDisplay::RubyTextContainer:
       frameType = NS_CSS_FRAME_TYPE_BLOCK;
       break;
 
-    case NS_STYLE_DISPLAY_INLINE:
-    case NS_STYLE_DISPLAY_INLINE_BLOCK:
-    case NS_STYLE_DISPLAY_INLINE_TABLE:
-    case NS_STYLE_DISPLAY_INLINE_BOX:
-    case NS_STYLE_DISPLAY_INLINE_XUL_GRID:
-    case NS_STYLE_DISPLAY_INLINE_STACK:
-    case NS_STYLE_DISPLAY_INLINE_FLEX:
-    case NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX:
-    case NS_STYLE_DISPLAY_INLINE_GRID:
-    case NS_STYLE_DISPLAY_RUBY:
-    case NS_STYLE_DISPLAY_RUBY_BASE:
-    case NS_STYLE_DISPLAY_RUBY_TEXT:
-    case NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER:
+    case StyleDisplay::Inline:
+    case StyleDisplay::InlineBlock:
+    case StyleDisplay::InlineTable:
+    case StyleDisplay::InlineBox:
+    case StyleDisplay::InlineXulGrid:
+    case StyleDisplay::InlineStack:
+    case StyleDisplay::InlineFlex:
+    case StyleDisplay::WebkitInlineBox:
+    case StyleDisplay::InlineGrid:
+    case StyleDisplay::Ruby:
+    case StyleDisplay::RubyBase:
+    case StyleDisplay::RubyText:
+    case StyleDisplay::RubyBaseContainer:
       frameType = NS_CSS_FRAME_TYPE_INLINE;
       break;
 
-    case NS_STYLE_DISPLAY_TABLE_CELL:
-    case NS_STYLE_DISPLAY_TABLE_ROW_GROUP:
-    case NS_STYLE_DISPLAY_TABLE_COLUMN:
-    case NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP:
-    case NS_STYLE_DISPLAY_TABLE_HEADER_GROUP:
-    case NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP:
-    case NS_STYLE_DISPLAY_TABLE_ROW:
+    case StyleDisplay::TableCell:
+    case StyleDisplay::TableRowGroup:
+    case StyleDisplay::TableColumn:
+    case StyleDisplay::TableColumnGroup:
+    case StyleDisplay::TableHeaderGroup:
+    case StyleDisplay::TableFooterGroup:
+    case StyleDisplay::TableRow:
       frameType = NS_CSS_FRAME_TYPE_INTERNAL_TABLE;
       break;
 
-    case NS_STYLE_DISPLAY_NONE:
+    case StyleDisplay::None_:
     default:
       frameType = NS_CSS_FRAME_TYPE_UNKNOWN;
       break;
     }
   }
 
   // See if the frame is replaced
   if (mFrame->IsFrameOfType(nsIFrame::eReplacedContainsBlock)) {
@@ -1208,17 +1208,17 @@ static bool AreAllEarlierInFlowFramesEmp
 void
 ReflowInput::CalculateHypotheticalPosition
                      (nsPresContext*           aPresContext,
                       nsIFrame*                aPlaceholderFrame,
                       const ReflowInput* cbrs,
                       nsHypotheticalPosition&  aHypotheticalPos,
                       nsIAtom*                 aFrameType) const
 {
-  NS_ASSERTION(mStyleDisplay->mOriginalDisplay != NS_STYLE_DISPLAY_NONE,
+  NS_ASSERTION(mStyleDisplay->mOriginalDisplay != StyleDisplay::None_,
                "mOriginalDisplay has not been properly initialized");
 
   // Find the nearest containing block frame to the placeholder frame,
   // and its inline-start edge and width.
   nscoord blockIStartContentEdge;
   // Dummy writing mode for blockContentSize, will be changed as needed by
   // GetHypotheticalBoxContainer.
   WritingMode cbwm = cbrs->GetWritingMode();
@@ -1241,17 +1241,17 @@ ReflowInput::CalculateHypotheticalPositi
     // See if we can get the intrinsic size of the element
     knowIntrinsicSize = GetIntrinsicSizeFor(mFrame, intrinsicSize, aFrameType);
   }
 
   // See if we can calculate what the box inline size would have been if
   // the element had been in the flow
   nscoord boxISize;
   bool    knowBoxISize = false;
-  if ((NS_STYLE_DISPLAY_INLINE == mStyleDisplay->mOriginalDisplay) &&
+  if ((StyleDisplay::Inline == mStyleDisplay->mOriginalDisplay) &&
       !NS_FRAME_IS_REPLACED(mFrameType)) {
     // For non-replaced inline-level elements the 'inline size' property
     // doesn't apply, so we don't know what the inline size would have
     // been without reflowing it
 
   } else {
     // It's either a replaced inline-level element or a block-level element
 
@@ -2047,17 +2047,17 @@ static eNormalLineHeightControl GetNorma
   }
   return sNormalLineHeightControl;
 }
 
 static inline bool
 IsSideCaption(nsIFrame* aFrame, const nsStyleDisplay* aStyleDisplay,
               WritingMode aWM)
 {
-  if (aStyleDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CAPTION) {
+  if (aStyleDisplay->mDisplay != StyleDisplay::TableCaption) {
     return false;
   }
   uint8_t captionSide = aFrame->StyleTableBorder()->mCaptionSide;
   return captionSide == NS_STYLE_CAPTION_SIDE_LEFT ||
          captionSide == NS_STYLE_CAPTION_SIDE_RIGHT;
 }
 
 // Flex/grid items resolve block-axis percentage margin & padding against the
@@ -2237,18 +2237,18 @@ ReflowInput::InitConstraints(nsPresConte
     // This varies by frame type.
 
     if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == mFrameType) {
       // Internal table elements. The rules vary depending on the type.
       // Calculate the computed isize
       bool rowOrRowGroup = false;
       const nsStyleCoord &inlineSize = mStylePosition->ISize(wm);
       nsStyleUnit inlineSizeUnit = inlineSize.GetUnit();
-      if ((NS_STYLE_DISPLAY_TABLE_ROW == mStyleDisplay->mDisplay) ||
-          (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == mStyleDisplay->mDisplay)) {
+      if ((StyleDisplay::TableRow == mStyleDisplay->mDisplay) ||
+          (StyleDisplay::TableRowGroup == mStyleDisplay->mDisplay)) {
         // 'inlineSize' property doesn't apply to table rows and row groups
         inlineSizeUnit = eStyleUnit_Auto;
         rowOrRowGroup = true;
       }
 
       // calc() with percentages acts like auto on internal table elements
       if (eStyleUnit_Auto == inlineSizeUnit ||
           (inlineSize.IsCalcUnit() && inlineSize.CalcHasPercent())) {
@@ -2267,18 +2267,18 @@ ReflowInput::InitConstraints(nsPresConte
         NS_ASSERTION(inlineSizeUnit == inlineSize.GetUnit(),
                      "unexpected inline size unit change");
         ComputedISize() = ComputeISizeValue(cbSize.ISize(wm),
                                             mStylePosition->mBoxSizing,
                                             inlineSize);
       }
 
       // Calculate the computed block size
-      if ((NS_STYLE_DISPLAY_TABLE_COLUMN == mStyleDisplay->mDisplay) ||
-          (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == mStyleDisplay->mDisplay)) {
+      if ((StyleDisplay::TableColumn == mStyleDisplay->mDisplay) ||
+          (StyleDisplay::TableColumnGroup == mStyleDisplay->mDisplay)) {
         // 'blockSize' property doesn't apply to table columns and column groups
         blockSizeUnit = eStyleUnit_Auto;
       }
       // calc() with percentages acts like 'auto' on internal table elements
       if (eStyleUnit_Auto == blockSizeUnit ||
           (blockSize.IsCalcUnit() && blockSize.CalcHasPercent())) {
         ComputedBSize() = NS_AUTOHEIGHT;
       } else {
@@ -2378,17 +2378,17 @@ ReflowInput::InitConstraints(nsPresConte
       NS_ASSERTION(ComputedISize() >= 0, "Bogus inline-size");
       NS_ASSERTION(ComputedBSize() == NS_UNCONSTRAINEDSIZE ||
                    ComputedBSize() >= 0, "Bogus block-size");
 
       // Exclude inline tables, side captions, flex and grid items from block
       // margin calculations.
       if (isBlock &&
           !IsSideCaption(mFrame, mStyleDisplay, cbwm) &&
-          mStyleDisplay->mDisplay != NS_STYLE_DISPLAY_INLINE_TABLE &&
+          mStyleDisplay->mDisplay != StyleDisplay::InlineTable &&
           parentFrameType != nsGkAtoms::flexContainerFrame &&
           parentFrameType != nsGkAtoms::gridContainerFrame) {
         CalculateBlockSideMargins(aFrameType);
       }
     }
   }
 }
 
--- a/layout/generic/nsBackdropFrame.cpp
+++ b/layout/generic/nsBackdropFrame.cpp
@@ -40,18 +40,18 @@ nsBackdropFrame::BuildDisplayList(nsDisp
                                   const nsRect& aDirtyRect,
                                   const nsDisplayListSet& aLists)
 {
   DO_GLOBAL_REFLOW_COUNT_DSP("nsBackdropFrame");
   // We want this frame to always be there even if its display value is
   // none or contents so that we can respond to style change on it. To
   // support those values, we skip painting ourselves in those cases.
   auto display = StyleDisplay()->mDisplay;
-  if (display == NS_STYLE_DISPLAY_NONE ||
-      display == NS_STYLE_DISPLAY_CONTENTS) {
+  if (display == StyleDisplay::None_ ||
+      display == StyleDisplay::Contents) {
     return;
   }
 
   DisplayBorderBackgroundOutline(aBuilder, aLists);
 }
 
 /* virtual */ LogicalSize
 nsBackdropFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -2942,17 +2942,17 @@ nsBlockFrame::AttributeChanged(int32_t  
     if (RenumberLists(presContext)) {
       presContext->PresShell()->
         FrameNeedsReflow(this, nsIPresShell::eStyleChange,
                          NS_FRAME_HAS_DIRTY_CHILDREN);
     }
   }
   else if (nsGkAtoms::value == aAttribute) {
     const nsStyleDisplay* styleDisplay = StyleDisplay();
-    if (NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) {
+    if (StyleDisplay::ListItem == styleDisplay->mDisplay) {
       // Search for the closest ancestor that's a block frame. We
       // make the assumption that all related list items share a
       // common block parent.
       // XXXldb I think that's a bad assumption.
       nsBlockFrame* blockParent = nsLayoutUtils::FindNearestBlockAncestor(this);
 
       // Tell the enclosing block frame to renumber list items within
       // itself
@@ -6050,17 +6050,17 @@ nsBlockFrame::AdjustFloatAvailableSpace(
                                         nsIFrame* aFloatFrame)
 {
   // Compute the available inline size. By default, assume the inline
   // size of the containing block.
   nscoord availISize;
   const nsStyleDisplay* floatDisplay = aFloatFrame->StyleDisplay();
   WritingMode wm = aState.mReflowInput.GetWritingMode();
 
-  if (NS_STYLE_DISPLAY_TABLE != floatDisplay->mDisplay ||
+  if (StyleDisplay::Table != floatDisplay->mDisplay ||
       eCompatibility_NavQuirks != aState.mPresContext->CompatibilityMode() ) {
     availISize = aState.ContentISize();
   }
   else {
     // This quirk matches the one in BlockReflowInput::FlowAndPlaceFloat
     // give tables only the available space
     // if they can shrink we may not be constrained to place
     // them in the next line
@@ -6875,26 +6875,26 @@ nsBlockFrame::SetInitialChildList(ChildL
     // to store the bullet numbers).  Also note that due to various
     // wrapper frames (scrollframes, columns) we want to use the
     // outermost (primary, ideally, but it's not set yet when we get
     // here) frame of our content for the display check.  On the other
     // hand, we look at ourselves for the GetPrevInFlow() check, since
     // for a columnset we don't want a bullet per column.  Note that
     // the outermost frame for the content is the primary frame in
     // most cases; the ones when it's not (like tables) can't be
-    // NS_STYLE_DISPLAY_LIST_ITEM).
+    // StyleDisplay::ListItem).
     nsIFrame* possibleListItem = this;
     while (1) {
       nsIFrame* parent = possibleListItem->GetParent();
       if (parent->GetContent() != GetContent()) {
         break;
       }
       possibleListItem = parent;
     }
-    if (NS_STYLE_DISPLAY_LIST_ITEM ==
+    if (StyleDisplay::ListItem ==
           possibleListItem->StyleDisplay()->mDisplay &&
         !GetPrevInFlow()) {
       // Resolve style for the bullet frame
       const nsStyleList* styleList = StyleList();
       CounterStyle* style = styleList->GetCounterStyle();
 
       CreateBulletFrameForListItem(
         style->IsBullet(),
@@ -6941,17 +6941,17 @@ nsBlockFrame::CreateBulletFrameForListIt
     AddStateBits(NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET);
   }
 }
 
 bool
 nsBlockFrame::BulletIsEmpty() const
 {
   NS_ASSERTION(mContent->GetPrimaryFrame()->StyleDisplay()->mDisplay ==
-                 NS_STYLE_DISPLAY_LIST_ITEM && HasOutsideBullet(),
+                 StyleDisplay::ListItem && HasOutsideBullet(),
                "should only care when we have an outside bullet");
   const nsStyleList* list = StyleList();
   return list->GetCounterStyle()->IsNone() &&
          !list->GetListStyleImage();
 }
 
 void
 nsBlockFrame::GetSpokenBulletText(nsAString& aText) const
@@ -7107,17 +7107,17 @@ nsBlockFrame::RenumberListsFor(nsPresCon
     }
   }
 
   bool kidRenumberedABullet = false;
 
   // If the frame is a list-item and the frame implements our
   // block frame API then get its bullet and set the list item
   // ordinal.
-  if (NS_STYLE_DISPLAY_LIST_ITEM == display->mDisplay) {
+  if (StyleDisplay::ListItem == display->mDisplay) {
     // Make certain that the frame is a block frame in case
     // something foreign has crept in.
     nsBlockFrame* listItem = nsLayoutUtils::GetAsBlock(kid);
     if (listItem) {
       nsBulletFrame* bullet = listItem->GetBullet();
       if (bullet) {
         if (!aForCounting) {
           bool changed;
@@ -7153,17 +7153,17 @@ nsBlockFrame::RenumberListsFor(nsPresCon
       bool meToo = RenumberListsInBlock(aPresContext, listItem, aOrdinal,
                                         aDepth + 1, aIncrement,
                                         aForCounting);
       if (meToo) {
         kidRenumberedABullet = true;
       }
     }
   }
-  else if (NS_STYLE_DISPLAY_BLOCK == display->mDisplay) {
+  else if (StyleDisplay::Block == display->mDisplay) {
     if (FrameStartsCounterScope(kid)) {
       // Don't bother recursing into a block frame that is a new
       // counter scope. Any list-items in there will be handled by
       // it.
     }
     else {
       // If the display=block element is a block frame then go ahead
       // and recurse into it, as it might have child list-items.
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -78,18 +78,18 @@ kAxisOrientationToSidesMap[eNumAxisOrien
 };
 
 // Helper structs / classes / methods
 // ==================================
 // Returns true iff the given nsStyleDisplay has display:-webkit-{inline-}-box.
 static inline bool
 IsDisplayValueLegacyBox(const nsStyleDisplay* aStyleDisp)
 {
-  return aStyleDisp->mDisplay == NS_STYLE_DISPLAY_WEBKIT_BOX ||
-    aStyleDisp->mDisplay == NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX;
+  return aStyleDisp->mDisplay == StyleDisplay::WebkitBox ||
+    aStyleDisp->mDisplay == StyleDisplay::WebkitInlineBox;
 }
 
 // Helper to check whether our nsFlexContainerFrame is emulating a legacy
 // -webkit-{inline-}box, in which case we should use legacy CSS properties
 // instead of the modern ones. The params are are the nsStyleDisplay and the
 // nsStyleContext associated with the nsFlexContainerFrame itself.
 static inline bool
 IsLegacyBox(const nsStyleDisplay* aStyleDisp,
@@ -98,17 +98,17 @@ IsLegacyBox(const nsStyleDisplay* aStyle
   // Trivial case: just check "display" directly.
   if (IsDisplayValueLegacyBox(aStyleDisp)) {
     return true;
   }
 
   // If this frame is for a scrollable element, then it will actually have
   // "display:block", and its *parent* will have the real flex-flavored display
   // value. So in that case, check the parent to find out if we're legacy.
-  if (aStyleDisp->mDisplay == NS_STYLE_DISPLAY_BLOCK) {
+  if (aStyleDisp->mDisplay == StyleDisplay::Block) {
     nsStyleContext* parentStyleContext = aStyleContext->GetParent();
     NS_ASSERTION(parentStyleContext &&
                  aStyleContext->GetPseudo() == nsCSSAnonBoxes::scrolledContent,
                  "The only way a nsFlexContainerFrame can have 'display:block' "
                  "should be if it's the inner part of a scrollable element");
     if (IsDisplayValueLegacyBox(parentStyleContext->StyleDisplay())) {
       return true;
     }
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -476,17 +476,17 @@ IsFontSizeInflationContainer(nsIFrame* a
 
   // The root frame should always be an inflation container.
   if (!aFrame->GetParent()) {
     return true;
   }
 
   nsIContent *content = aFrame->GetContent();
   nsIAtom* frameType = aFrame->GetType();
-  bool isInline = (aFrame->GetDisplay() == NS_STYLE_DISPLAY_INLINE ||
+  bool isInline = (aFrame->GetDisplay() == StyleDisplay::Inline ||
                    RubyUtils::IsRubyBox(frameType) ||
                    (aFrame->IsFloating() &&
                     frameType == nsGkAtoms::letterFrame) ||
                    // Given multiple frames for the same node, only the
                    // outer one should be considered a container.
                    // (Important, e.g., for nsSelectsAreaFrame.)
                    (aFrame->GetParent()->GetContent() == content) ||
                    (content && (content->IsAnyOfHTMLElements(nsGkAtoms::option,
@@ -4173,17 +4173,17 @@ nsIFrame::ContentOffsets OffsetsForSingl
     offsets.secondaryOffset = range.end;
     offsets.associate = CARET_ASSOCIATE_AFTER;
     return offsets;
   }
 
   // Figure out whether the offsets should be over, after, or before the frame
   nsRect rect(nsPoint(0, 0), aFrame->GetSize());
 
-  bool isBlock = aFrame->GetDisplay() != NS_STYLE_DISPLAY_INLINE;
+  bool isBlock = aFrame->GetDisplay() != StyleDisplay::Inline;
   bool isRtl = (aFrame->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL);
   if ((isBlock && rect.y < aPoint.y) ||
       (!isBlock && ((isRtl  && rect.x + rect.width / 2 > aPoint.x) || 
                     (!isRtl && rect.x + rect.width / 2 < aPoint.x)))) {
     offsets.offset = range.end;
     if (rect.Contains(aPoint))
       offsets.secondaryOffset = range.start;
     else
--- a/layout/generic/nsIFrameInlines.h
+++ b/layout/generic/nsIFrameInlines.h
@@ -33,17 +33,17 @@ nsIFrame::IsFlexOrGridItem() const
   return !(GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
          GetParent() &&
          GetParent()->IsFlexOrGridContainer();
 }
 
 bool
 nsIFrame::IsTableCaption() const
 {
-  return StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_TABLE_CAPTION &&
+  return StyleDisplay()->mDisplay == StyleDisplay::TableCaption &&
     GetParent()->StyleContext()->GetPseudo() == nsCSSAnonBoxes::tableWrapper;
 }
 
 bool
 nsIFrame::IsFloating() const
 {
   return StyleDisplay()->IsFloating(this);
 }
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -766,18 +766,18 @@ IsPercentageAware(const nsIFrame* aFrame
       pos->OffsetHasPercent(NS_SIDE_LEFT)) {
     return true;
   }
 
   if (eStyleUnit_Auto == pos->mWidth.GetUnit()) {
     // We need to check for frames that shrink-wrap when they're auto
     // width.
     const nsStyleDisplay* disp = aFrame->StyleDisplay();
-    if (disp->mDisplay == NS_STYLE_DISPLAY_INLINE_BLOCK ||
-        disp->mDisplay == NS_STYLE_DISPLAY_INLINE_TABLE ||
+    if (disp->mDisplay == StyleDisplay::InlineBlock ||
+        disp->mDisplay == StyleDisplay::InlineTable ||
         fType == nsGkAtoms::HTMLButtonControlFrame ||
         fType == nsGkAtoms::gfxButtonControlFrame ||
         fType == nsGkAtoms::fieldSetFrame ||
         fType == nsGkAtoms::comboboxDisplayFrame) {
       return true;
     }
 
     // Per CSS 2.1, section 10.3.2:
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5215,19 +5215,19 @@ nsTextFrame::GetTextDecorations(
       }
     }
 
     // In all modes, if we're on an inline-block or inline-table (or
     // inline-stack, inline-box, inline-grid), we're done.
     // If we're on a ruby frame other than ruby text container, we
     // should continue.
     uint8_t display = f->GetDisplay();
-    if (display != NS_STYLE_DISPLAY_INLINE &&
+    if (display != StyleDisplay::Inline &&
         (!nsStyleDisplay::IsRubyDisplayType(display) ||
-         display == NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER) &&
+         display == StyleDisplay::RubyTextContainer) &&
         nsStyleDisplay::IsDisplayTypeInlineOutside(display)) {
       break;
     }
 
     // In quirks mode, if we're on an HTML table element, we're done.
     if (compatMode == eCompatibility_NavQuirks &&
         f->GetContent()->IsHTMLElement(nsGkAtoms::table)) {
       break;
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -414,17 +414,17 @@ ServoStyleSet::ProbePseudoElementStyle(E
   // 'content' property is equivalent to not having the pseudo-element
   // at all.
   if (computedValues &&
       (pseudoTag == nsCSSPseudoElements::before ||
        pseudoTag == nsCSSPseudoElements::after)) {
     const nsStyleDisplay *display = Servo_GetStyleDisplay(computedValues);
     const nsStyleContent *content = Servo_GetStyleContent(computedValues);
     // XXXldb What is contentCount for |content: ""|?
-    if (display->mDisplay == NS_STYLE_DISPLAY_NONE ||
+    if (display->mDisplay == StyleDisplay::None_ ||
         content->ContentCount() == 0) {
       return nullptr;
     }
   }
 
   return GetContext(computedValues.forget(), aParentContext, pseudoTag, aType);
 }
 
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1239,64 +1239,64 @@ const KTableEntry nsCSSProps::kCursorKTa
 
 const KTableEntry nsCSSProps::kDirectionKTable[] = {
   { eCSSKeyword_ltr,      NS_STYLE_DIRECTION_LTR },
   { eCSSKeyword_rtl,      NS_STYLE_DIRECTION_RTL },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 KTableEntry nsCSSProps::kDisplayKTable[] = {
-  { eCSSKeyword_none,                NS_STYLE_DISPLAY_NONE },
-  { eCSSKeyword_inline,              NS_STYLE_DISPLAY_INLINE },
-  { eCSSKeyword_block,               NS_STYLE_DISPLAY_BLOCK },
-  { eCSSKeyword_inline_block,        NS_STYLE_DISPLAY_INLINE_BLOCK },
-  { eCSSKeyword_list_item,           NS_STYLE_DISPLAY_LIST_ITEM },
-  { eCSSKeyword_table,               NS_STYLE_DISPLAY_TABLE },
-  { eCSSKeyword_inline_table,        NS_STYLE_DISPLAY_INLINE_TABLE },
-  { eCSSKeyword_table_row_group,     NS_STYLE_DISPLAY_TABLE_ROW_GROUP },
-  { eCSSKeyword_table_header_group,  NS_STYLE_DISPLAY_TABLE_HEADER_GROUP },
-  { eCSSKeyword_table_footer_group,  NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP },
-  { eCSSKeyword_table_row,           NS_STYLE_DISPLAY_TABLE_ROW },
-  { eCSSKeyword_table_column_group,  NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP },
-  { eCSSKeyword_table_column,        NS_STYLE_DISPLAY_TABLE_COLUMN },
-  { eCSSKeyword_table_cell,          NS_STYLE_DISPLAY_TABLE_CELL },
-  { eCSSKeyword_table_caption,       NS_STYLE_DISPLAY_TABLE_CAPTION },
+  { eCSSKeyword_none,                StyleDisplay::None_ },
+  { eCSSKeyword_inline,              StyleDisplay::Inline },
+  { eCSSKeyword_block,               StyleDisplay::Block },
+  { eCSSKeyword_inline_block,        StyleDisplay::InlineBlock },
+  { eCSSKeyword_list_item,           StyleDisplay::ListItem },
+  { eCSSKeyword_table,               StyleDisplay::Table },
+  { eCSSKeyword_inline_table,        StyleDisplay::InlineTable },
+  { eCSSKeyword_table_row_group,     StyleDisplay::TableRowGroup },
+  { eCSSKeyword_table_header_group,  StyleDisplay::TableHeaderGroup },
+  { eCSSKeyword_table_footer_group,  StyleDisplay::TableFooterGroup },
+  { eCSSKeyword_table_row,           StyleDisplay::TableRow },
+  { eCSSKeyword_table_column_group,  StyleDisplay::TableColumnGroup },
+  { eCSSKeyword_table_column,        StyleDisplay::TableColumn },
+  { eCSSKeyword_table_cell,          StyleDisplay::TableCell },
+  { eCSSKeyword_table_caption,       StyleDisplay::TableCaption },
   // Make sure this is kept in sync with the code in
   // nsCSSFrameConstructor::ConstructXULFrame
-  { eCSSKeyword__moz_box,            NS_STYLE_DISPLAY_BOX },
-  { eCSSKeyword__moz_inline_box,     NS_STYLE_DISPLAY_INLINE_BOX },
+  { eCSSKeyword__moz_box,            StyleDisplay::Box },
+  { eCSSKeyword__moz_inline_box,     StyleDisplay::InlineBox },
 #ifdef MOZ_XUL
-  { eCSSKeyword__moz_grid,           NS_STYLE_DISPLAY_XUL_GRID },
-  { eCSSKeyword__moz_inline_grid,    NS_STYLE_DISPLAY_INLINE_XUL_GRID },
-  { eCSSKeyword__moz_grid_group,     NS_STYLE_DISPLAY_XUL_GRID_GROUP },
-  { eCSSKeyword__moz_grid_line,      NS_STYLE_DISPLAY_XUL_GRID_LINE },
-  { eCSSKeyword__moz_stack,          NS_STYLE_DISPLAY_STACK },
-  { eCSSKeyword__moz_inline_stack,   NS_STYLE_DISPLAY_INLINE_STACK },
-  { eCSSKeyword__moz_deck,           NS_STYLE_DISPLAY_DECK },
-  { eCSSKeyword__moz_popup,          NS_STYLE_DISPLAY_POPUP },
-  { eCSSKeyword__moz_groupbox,       NS_STYLE_DISPLAY_GROUPBOX },
+  { eCSSKeyword__moz_grid,           StyleDisplay::XulGrid },
+  { eCSSKeyword__moz_inline_grid,    StyleDisplay::InlineXulGrid },
+  { eCSSKeyword__moz_grid_group,     StyleDisplay::XulGridGroup },
+  { eCSSKeyword__moz_grid_line,      StyleDisplay::XulGridLine },
+  { eCSSKeyword__moz_stack,          StyleDisplay::Stack },
+  { eCSSKeyword__moz_inline_stack,   StyleDisplay::InlineStack },
+  { eCSSKeyword__moz_deck,           StyleDisplay::Deck },
+  { eCSSKeyword__moz_popup,          StyleDisplay::Popup },
+  { eCSSKeyword__moz_groupbox,       StyleDisplay::Groupbox },
 #endif
-  { eCSSKeyword_flex,                NS_STYLE_DISPLAY_FLEX },
-  { eCSSKeyword_inline_flex,         NS_STYLE_DISPLAY_INLINE_FLEX },
-  { eCSSKeyword_ruby,                NS_STYLE_DISPLAY_RUBY },
-  { eCSSKeyword_ruby_base,           NS_STYLE_DISPLAY_RUBY_BASE },
-  { eCSSKeyword_ruby_base_container, NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER },
-  { eCSSKeyword_ruby_text,           NS_STYLE_DISPLAY_RUBY_TEXT },
-  { eCSSKeyword_ruby_text_container, NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER },
+  { eCSSKeyword_flex,                StyleDisplay::Flex },
+  { eCSSKeyword_inline_flex,         StyleDisplay::InlineFlex },
+  { eCSSKeyword_ruby,                StyleDisplay::Ruby },
+  { eCSSKeyword_ruby_base,           StyleDisplay::RubyBase },
+  { eCSSKeyword_ruby_base_container, StyleDisplay::RubyBaseContainer },
+  { eCSSKeyword_ruby_text,           StyleDisplay::RubyText },
+  { eCSSKeyword_ruby_text_container, StyleDisplay::RubyTextContainer },
   // The next two entries are controlled by the layout.css.grid.enabled pref.
-  { eCSSKeyword_grid,                NS_STYLE_DISPLAY_GRID },
-  { eCSSKeyword_inline_grid,         NS_STYLE_DISPLAY_INLINE_GRID },
+  { eCSSKeyword_grid,                StyleDisplay::Grid },
+  { eCSSKeyword_inline_grid,         StyleDisplay::InlineGrid },
   // The next 4 entries are controlled by the layout.css.prefixes.webkit pref.
-  { eCSSKeyword__webkit_box,         NS_STYLE_DISPLAY_WEBKIT_BOX },
-  { eCSSKeyword__webkit_inline_box,  NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX },
-  { eCSSKeyword__webkit_flex,        NS_STYLE_DISPLAY_FLEX },
-  { eCSSKeyword__webkit_inline_flex, NS_STYLE_DISPLAY_INLINE_FLEX },
+  { eCSSKeyword__webkit_box,         StyleDisplay::WebkitBox },
+  { eCSSKeyword__webkit_inline_box,  StyleDisplay::WebkitInlineBox },
+  { eCSSKeyword__webkit_flex,        StyleDisplay::Flex },
+  { eCSSKeyword__webkit_inline_flex, StyleDisplay::InlineFlex },
   // The next entry is controlled by the layout.css.display-contents.enabled
   // pref.
-  { eCSSKeyword_contents,            NS_STYLE_DISPLAY_CONTENTS },
+  { eCSSKeyword_contents,            StyleDisplay::Contents },
   { eCSSKeyword_UNKNOWN,             -1 }
 };
 
 const KTableEntry nsCSSProps::kEmptyCellsKTable[] = {
   { eCSSKeyword_show,                 NS_STYLE_TABLE_EMPTY_CELLS_SHOW },
   { eCSSKeyword_hide,                 NS_STYLE_TABLE_EMPTY_CELLS_HIDE },
   { eCSSKeyword_UNKNOWN,              -1 }
 };
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -4775,17 +4775,17 @@ nsComputedDOMStyle::DoGetHeight()
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
 
   bool calcHeight = false;
 
   if (mInnerFrame) {
     calcHeight = true;
 
     const nsStyleDisplay* displayData = StyleDisplay();
-    if (displayData->mDisplay == NS_STYLE_DISPLAY_INLINE &&
+    if (displayData->mDisplay == StyleDisplay::Inline &&
         !(mInnerFrame->IsFrameOfType(nsIFrame::eReplaced)) &&
         // An outer SVG frame should behave the same as eReplaced in this case
         mInnerFrame->GetType() != nsGkAtoms::svgOuterSVGFrame) {
 
       calcHeight = false;
     }
   }
 
@@ -4819,17 +4819,17 @@ nsComputedDOMStyle::DoGetWidth()
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
 
   bool calcWidth = false;
 
   if (mInnerFrame) {
     calcWidth = true;
 
     const nsStyleDisplay *displayData = StyleDisplay();
-    if (displayData->mDisplay == NS_STYLE_DISPLAY_INLINE &&
+    if (displayData->mDisplay == StyleDisplay::Inline &&
         !(mInnerFrame->IsFrameOfType(nsIFrame::eReplaced)) &&
         // An outer SVG frame should behave the same as eReplaced in this case
         mInnerFrame->GetType() != nsGkAtoms::svgOuterSVGFrame) {
 
       calcWidth = false;
     }
   }
 
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -194,92 +194,92 @@ nsRuleNode::ChildrenHashOps = {
 //    Reference: http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo
 /* static */
 void
 nsRuleNode::EnsureBlockDisplay(uint8_t& display,
                                bool aConvertListItem /* = false */)
 {
   // see if the display value is already a block
   switch (display) {
-  case NS_STYLE_DISPLAY_LIST_ITEM :
+  case StyleDisplay::ListItem :
     if (aConvertListItem) {
-      display = NS_STYLE_DISPLAY_BLOCK;
+      display = StyleDisplay::Block;
       break;
     } // else, fall through to share the 'break' for non-changing display vals
     MOZ_FALLTHROUGH;
-  case NS_STYLE_DISPLAY_NONE :
-  case NS_STYLE_DISPLAY_CONTENTS :
+  case StyleDisplay::None_ :
+  case StyleDisplay::Contents :
     // never change display:none or display:contents *ever*
-  case NS_STYLE_DISPLAY_TABLE :
-  case NS_STYLE_DISPLAY_BLOCK :
-  case NS_STYLE_DISPLAY_FLEX :
-  case NS_STYLE_DISPLAY_WEBKIT_BOX :
-  case NS_STYLE_DISPLAY_GRID :
+  case StyleDisplay::Table :
+  case StyleDisplay::Block :
+  case StyleDisplay::Flex :
+  case StyleDisplay::WebkitBox :
+  case StyleDisplay::Grid :
     // do not muck with these at all - already blocks
     // This is equivalent to nsStyleDisplay::IsBlockOutside.  (XXX Maybe we
     // should just call that?)
     // This needs to match the check done in
     // nsCSSFrameConstructor::FindMathMLData for <math>.
     break;
 
-  case NS_STYLE_DISPLAY_INLINE_TABLE :
+  case StyleDisplay::InlineTable :
     // make inline tables into tables
-    display = NS_STYLE_DISPLAY_TABLE;
-    break;
-
-  case NS_STYLE_DISPLAY_INLINE_FLEX:
+    display = StyleDisplay::Table;
+    break;
+
+  case StyleDisplay::InlineFlex:
     // make inline flex containers into flex containers
-    display = NS_STYLE_DISPLAY_FLEX;
-    break;
-
-  case NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX:
+    display = StyleDisplay::Flex;
+    break;
+
+  case StyleDisplay::WebkitInlineBox:
     // make -webkit-inline-box containers into -webkit-box containers
-    display = NS_STYLE_DISPLAY_WEBKIT_BOX;
-    break;
-
-  case NS_STYLE_DISPLAY_INLINE_GRID:
+    display = StyleDisplay::WebkitBox;
+    break;
+
+  case StyleDisplay::InlineGrid:
     // make inline grid containers into grid containers
-    display = NS_STYLE_DISPLAY_GRID;
+    display = StyleDisplay::Grid;
     break;
 
   default :
     // make it a block
-    display = NS_STYLE_DISPLAY_BLOCK;
+    display = StyleDisplay::Block;
   }
 }
 
 // EnsureInlineDisplay:
 //  - if the display value (argument) is not an inline type
 //    then we set it to a valid inline display value
 /* static */
 void
 nsRuleNode::EnsureInlineDisplay(uint8_t& display)
 {
   // see if the display value is already inline
   switch (display) {
-    case NS_STYLE_DISPLAY_BLOCK :
-      display = NS_STYLE_DISPLAY_INLINE_BLOCK;
+    case StyleDisplay::Block :
+      display = StyleDisplay::InlineBlock;
       break;
-    case NS_STYLE_DISPLAY_TABLE :
-      display = NS_STYLE_DISPLAY_INLINE_TABLE;
+    case StyleDisplay::Table :
+      display = StyleDisplay::InlineTable;
       break;
-    case NS_STYLE_DISPLAY_FLEX :
-      display = NS_STYLE_DISPLAY_INLINE_FLEX;
+    case StyleDisplay::Flex :
+      display = StyleDisplay::InlineFlex;
       break;
-    case NS_STYLE_DISPLAY_WEBKIT_BOX :
-      display = NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX;
+    case StyleDisplay::WebkitBox :
+      display = StyleDisplay::WebkitInlineBox;
       break;
-    case NS_STYLE_DISPLAY_GRID :
-      display = NS_STYLE_DISPLAY_INLINE_GRID;
+    case StyleDisplay::Grid :
+      display = StyleDisplay::InlineGrid;
       break;
-    case NS_STYLE_DISPLAY_BOX:
-      display = NS_STYLE_DISPLAY_INLINE_BOX;
+    case StyleDisplay::Box:
+      display = StyleDisplay::InlineBox;
       break;
-    case NS_STYLE_DISPLAY_STACK:
-      display = NS_STYLE_DISPLAY_INLINE_STACK;
+    case StyleDisplay::Stack:
+      display = StyleDisplay::InlineStack;
       break;
   }
 }
 
 static nscoord CalcLengthWith(const nsCSSValue& aValue,
                               nscoord aFontSize,
                               const nsStyleFont* aStyleFont,
                               nsStyleContext* aStyleContext,
@@ -5816,17 +5816,17 @@ nsRuleNode::ComputeDisplayData(void* aSt
       }
     }
   }
 
   // display: enum, inherit, initial
   SetValue(*aRuleData->ValueForDisplay(), display->mDisplay, conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentDisplay->mDisplay,
-           NS_STYLE_DISPLAY_INLINE);
+           StyleDisplay::Inline);
 
   // contain: none, enum, inherit, initial
   SetValue(*aRuleData->ValueForContain(), display->mContain, conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentDisplay->mContain,
            NS_STYLE_CONTAIN_NONE, Unused,
            NS_STYLE_CONTAIN_NONE, Unused, Unused);
 
@@ -6162,59 +6162,59 @@ nsRuleNode::ComputeDisplayData(void* aSt
            parentDisplay->mOverflowClipBox,
            NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX);
 
   SetValue(*aRuleData->ValueForResize(), display->mResize, conditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
            parentDisplay->mResize,
            NS_STYLE_RESIZE_NONE);
 
-  if (display->mDisplay != NS_STYLE_DISPLAY_NONE) {
+  if (display->mDisplay != StyleDisplay::None_) {
     // CSS2 9.7 specifies display type corrections dealing with 'float'
     // and 'position'.  Since generated content can't be floated or
     // positioned, we can deal with it here.
 
     nsIAtom* pseudo = aContext->GetPseudo();
-    if (pseudo && display->mDisplay == NS_STYLE_DISPLAY_CONTENTS) {
+    if (pseudo && display->mDisplay == StyleDisplay::Contents) {
       // We don't want to create frames for anonymous content using a parent
       // frame that is for content above the root of the anon tree.
       // (XXX what we really should check here is not GetPseudo() but if there's
       //  a 'content' property value that implies anon content but we can't
       //  check that here since that's a different struct(?))
       // We might get display:contents to work for CSS_PSEUDO_ELEMENT_CONTAINS_ELEMENTS
       // pseudos (:first-letter etc) in the future, but those have a lot of
       // special handling in frame construction so they are also unsupported
       // for now.
-      display->mOriginalDisplay = display->mDisplay = NS_STYLE_DISPLAY_INLINE;
+      display->mOriginalDisplay = display->mDisplay = StyleDisplay::Inline;
       conditions.SetUncacheable();
     }
 
     // Inherit a <fieldset> grid/flex display type into its anon content frame.
     if (pseudo == nsCSSAnonBoxes::fieldsetContent) {
-      MOZ_ASSERT(display->mDisplay == NS_STYLE_DISPLAY_BLOCK,
+      MOZ_ASSERT(display->mDisplay == StyleDisplay::Block,
                  "forms.css should have set 'display:block'");
       switch (parentDisplay->mDisplay) {
-        case NS_STYLE_DISPLAY_GRID:
-        case NS_STYLE_DISPLAY_INLINE_GRID:
-          display->mDisplay = NS_STYLE_DISPLAY_GRID;
+        case StyleDisplay::Grid:
+        case StyleDisplay::InlineGrid:
+          display->mDisplay = StyleDisplay::Grid;
           conditions.SetUncacheable();
           break;
-        case NS_STYLE_DISPLAY_FLEX:
-        case NS_STYLE_DISPLAY_INLINE_FLEX:
-          display->mDisplay = NS_STYLE_DISPLAY_FLEX;
+        case StyleDisplay::Flex:
+        case StyleDisplay::InlineFlex:
+          display->mDisplay = StyleDisplay::Flex;
           conditions.SetUncacheable();
           break;
       }
     }
 
     if (nsCSSPseudoElements::firstLetter == pseudo) {
       // a non-floating first-letter must be inline
       // XXX this fix can go away once bug 103189 is fixed correctly
       // Note that we reset mOriginalDisplay to enforce the invariant that it equals mDisplay if we're not positioned or floating.
-      display->mOriginalDisplay = display->mDisplay = NS_STYLE_DISPLAY_INLINE;
+      display->mOriginalDisplay = display->mDisplay = StyleDisplay::Inline;
 
       // We can't cache the data in the rule tree since if a more specific
       // rule has 'float: left' we'll end up with the wrong 'display'
       // property.
       conditions.SetUncacheable();
     }
 
     if (display->IsAbsolutelyPositionedStyle()) {
@@ -6244,18 +6244,18 @@ nsRuleNode::ComputeDisplayData(void* aSt
     if (display->IsContainPaint()) {
       // An element with contain:paint or contain:layout needs to "be a
       // formatting context". For the purposes of the "display" property, that
       // just means we need to promote "display:inline" to "inline-block".
       // XXX We may also need to promote ruby display vals; see bug 1179349.
 
       // It's okay to cache this change in the rule tree for the same
       // reasons as floats in the previous condition.
-      if (display->mDisplay == NS_STYLE_DISPLAY_INLINE) {
-          display->mDisplay = NS_STYLE_DISPLAY_INLINE_BLOCK;
+      if (display->mDisplay == StyleDisplay::Inline) {
+          display->mDisplay = StyleDisplay::InlineBlock;
       }
     }
   }
 
   /* Convert the nsCSSValueList into an nsTArray<nsTransformFunction *>. */
   const nsCSSValue* transformValue = aRuleData->ValueForTransform();
   switch (transformValue->GetUnit()) {
   case eCSSUnit_Null:
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -609,20 +609,20 @@ ShouldSuppressLineBreak(const nsStyleCon
       !nsCSSAnonBoxes::IsNonElement(aContext->GetPseudo()) &&
       !RubyUtils::IsRubyPseudo(aContext->GetPseudo())) {
     return false;
   }
   if (aParentContext->ShouldSuppressLineBreak()) {
     // Line break suppressing bit is propagated to any children of
     // line participants, which include inline, contents, and inline
     // ruby boxes.
-    if (aParentDisplay->mDisplay == NS_STYLE_DISPLAY_INLINE ||
-        aParentDisplay->mDisplay == NS_STYLE_DISPLAY_CONTENTS ||
-        aParentDisplay->mDisplay == NS_STYLE_DISPLAY_RUBY ||
-        aParentDisplay->mDisplay == NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER) {
+    if (aParentDisplay->mDisplay == StyleDisplay::Inline ||
+        aParentDisplay->mDisplay == StyleDisplay::Contents ||
+        aParentDisplay->mDisplay == StyleDisplay::Ruby ||
+        aParentDisplay->mDisplay == StyleDisplay::RubyBaseContainer) {
       return true;
     }
   }
   // Any descendant of ruby level containers is non-breakable, but
   // the level containers themselves are breakable. We have to check
   // the container display type against all ruby display type here
   // because any of the ruby boxes could be anonymous.
   // Note that, when certain HTML tags, e.g. form controls, have ruby
@@ -636,40 +636,40 @@ ShouldSuppressLineBreak(const nsStyleCon
   //    any, won't be able to break the line its ruby ancestor lays; and
   // 3. their parent frame is always a ruby content frame (due to
   //    anonymous ruby box generation), which makes line layout suppress
   //    any optional line break around this frame.
   // However, there is one special case which is BR tag, because it
   // directly affects the line layout. This case is handled by the BR
   // frame which checks the flag of its parent frame instead of itself.
   if ((aParentDisplay->IsRubyDisplayType() &&
-       aDisplay->mDisplay != NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER &&
-       aDisplay->mDisplay != NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER) ||
+       aDisplay->mDisplay != StyleDisplay::RubyBaseContainer &&
+       aDisplay->mDisplay != StyleDisplay::RubyTextContainer) ||
       // Since ruby base and ruby text may exist themselves without any
       // non-anonymous frame outside, we should also check them.
-      aDisplay->mDisplay == NS_STYLE_DISPLAY_RUBY_BASE ||
-      aDisplay->mDisplay == NS_STYLE_DISPLAY_RUBY_TEXT) {
+      aDisplay->mDisplay == StyleDisplay::RubyBase ||
+      aDisplay->mDisplay == StyleDisplay::RubyText) {
     return true;
   }
   return false;
 }
 
 // Flex & grid containers blockify their children.
 //  "The display value of a flex item is blockified"
 //    https://drafts.csswg.org/css-flexbox-1/#flex-items
 //  "The display value of a grid item is blockified"
 //    https://drafts.csswg.org/css-grid/#grid-items
 static bool
 ShouldBlockifyChildren(const nsStyleDisplay* aStyleDisp)
 {
   auto displayVal = aStyleDisp->mDisplay;
-  return NS_STYLE_DISPLAY_FLEX == displayVal ||
-    NS_STYLE_DISPLAY_INLINE_FLEX == displayVal ||
-    NS_STYLE_DISPLAY_GRID == displayVal ||
-    NS_STYLE_DISPLAY_INLINE_GRID == displayVal;
+  return StyleDisplay::Flex == displayVal ||
+    StyleDisplay::InlineFlex == displayVal ||
+    StyleDisplay::Grid == displayVal ||
+    StyleDisplay::InlineGrid == displayVal;
 }
 
 void
 nsStyleContext::SetStyleBits()
 {
   // XXXbholley: We should get this information directly from the
   // ServoComputedValues rather than computing it here. This setup for
   // ServoComputedValues-backed nsStyleContexts is probably not something
@@ -691,17 +691,17 @@ nsStyleContext::SetStyleBits()
 
   if ((mParent && mParent->HasPseudoElementData()) || IsPseudoElement()) {
     mBits |= NS_STYLE_HAS_PSEUDO_ELEMENT_DATA;
   }
 
   // Set the NS_STYLE_IN_DISPLAY_NONE_SUBTREE bit
   const nsStyleDisplay* disp = StyleDisplay();
   if ((mParent && mParent->IsInDisplayNoneSubtree()) ||
-      disp->mDisplay == NS_STYLE_DISPLAY_NONE) {
+      disp->mDisplay == StyleDisplay::None_) {
     mBits |= NS_STYLE_IN_DISPLAY_NONE_SUBTREE;
   }
 }
 
 void
 nsStyleContext::ApplyStyleFixups(bool aSkipParentDisplayBasedStyleFixup)
 {
   MOZ_ASSERT(!mSource.IsServoComputedValues(),
@@ -714,17 +714,17 @@ nsStyleContext::ApplyStyleFixups(bool aS
   // For an N-line drop initial in a Western script, the cap-height of the
   // letter needs to be (N – 1) times the line-height, plus the cap-height
   // of the surrounding text.
   if (mPseudoTag == nsCSSPseudoElements::firstLetter) {
     const nsStyleTextReset* textReset = StyleTextReset();
     if (textReset->mInitialLetterSize != 0.0f) {
       nsStyleContext* containerSC = mParent;
       const nsStyleDisplay* containerDisp = containerSC->StyleDisplay();
-      while (containerDisp->mDisplay == NS_STYLE_DISPLAY_CONTENTS) {
+      while (containerDisp->mDisplay == StyleDisplay::Contents) {
         if (!containerSC->GetParent()) {
           break;
         }
         containerSC = containerSC->GetParent();
         containerDisp = containerSC->StyleDisplay();
       }
       nscoord containerLH =
         ReflowInput::CalcLineHeight(nullptr, containerSC, NS_AUTOHEIGHT, 1.0f);
@@ -777,17 +777,17 @@ nsStyleContext::ApplyStyleFixups(bool aS
         nsStyleVisibility* uniqueVisibility = GET_UNIQUE_STYLE_DATA(Visibility);
         uniqueVisibility->mDirection = dir;
       }
     }
   }
 
   // Correct tables.
   const nsStyleDisplay* disp = StyleDisplay();
-  if (disp->mDisplay == NS_STYLE_DISPLAY_TABLE) {
+  if (disp->mDisplay == StyleDisplay::Table) {
     // -moz-center and -moz-right are used for HTML's alignment
     // This is covering the <div align="right"><table>...</table></div> case.
     // In this case, we don't want to inherit the text alignment into the table.
     const nsStyleText* text = StyleText();
 
     if (text->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_LEFT ||
         text->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER ||
         text->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_RIGHT)
@@ -801,23 +801,23 @@ nsStyleContext::ApplyStyleFixups(bool aS
   // the root element.  We can't implement them in nsRuleNode because we
   // don't want to store all display structs that aren't 'block',
   // 'inline', or 'table' in the style context tree on the off chance
   // that the root element has its style reresolved later.  So do them
   // here if needed, by changing the style data, so that other code
   // doesn't get confused by looking at the style data.
   if (!mParent) {
     uint8_t displayVal = disp->mDisplay;
-    if (displayVal != NS_STYLE_DISPLAY_CONTENTS) {
+    if (displayVal != StyleDisplay::Contents) {
       nsRuleNode::EnsureBlockDisplay(displayVal, true);
     } else {
       // http://dev.w3.org/csswg/css-display/#transformations
       // "... a display-outside of 'contents' computes to block-level
       //  on the root element."
-      displayVal = NS_STYLE_DISPLAY_BLOCK;
+      displayVal = StyleDisplay::Block;
     }
     if (displayVal != disp->mDisplay) {
       nsStyleDisplay* mutable_display = GET_UNIQUE_STYLE_DATA(Display);
       disp = mutable_display;
 
       // If we're in this code, then mOriginalDisplay doesn't matter
       // for purposes of the cascade (because this nsStyleDisplay
       // isn't living in the ruletree anyway), and for determining
@@ -838,17 +838,17 @@ nsStyleContext::ApplyStyleFixups(bool aS
   if (!aSkipParentDisplayBasedStyleFixup && mParent) {
     // Skip display:contents ancestors to reach the potential container.
     // (If there are only display:contents ancestors between this node and
     // a flex/grid container ancestor, then this node is a flex/grid item, since
     // its parent *in the frame tree* will be the flex/grid container. So we treat
     // it like a flex/grid item here.)
     nsStyleContext* containerContext = mParent;
     const nsStyleDisplay* containerDisp = containerContext->StyleDisplay();
-    while (containerDisp->mDisplay == NS_STYLE_DISPLAY_CONTENTS) {
+    while (containerDisp->mDisplay == StyleDisplay::Contents) {
       if (!containerContext->GetParent()) {
         break;
       }
       containerContext = containerContext->GetParent();
       containerDisp = containerContext->StyleDisplay();
     }
     if (ShouldBlockifyChildren(containerDisp) &&
         !nsCSSAnonBoxes::IsNonElement(GetPseudo())) {
@@ -881,18 +881,18 @@ nsStyleContext::ApplyStyleFixups(bool aS
     nsRuleNode::EnsureInlineDisplay(displayVal);
     if (displayVal != disp->mDisplay) {
       nsStyleDisplay* mutable_display = GET_UNIQUE_STYLE_DATA(Display);
       disp = mutable_display;
       mutable_display->mDisplay = displayVal;
     }
   }
   // Suppress border/padding of ruby level containers
-  if (disp->mDisplay == NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER ||
-      disp->mDisplay == NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER) {
+  if (disp->mDisplay == StyleDisplay::RubyBaseContainer ||
+      disp->mDisplay == StyleDisplay::RubyTextContainer) {
     CreateEmptyStyleData(eStyleStruct_Border);
     CreateEmptyStyleData(eStyleStruct_Padding);
   }
   if (disp->IsRubyDisplayType()) {
     // Per CSS Ruby spec section Bidi Reordering, for all ruby boxes,
     // the 'normal' and 'embed' values of 'unicode-bidi' should compute to
     // 'isolate', and 'bidi-override' should compute to 'isolate-override'.
     const nsStyleTextReset* textReset = StyleTextReset();
@@ -912,32 +912,32 @@ nsStyleContext::ApplyStyleFixups(bool aS
   /*
    * According to https://drafts.csswg.org/css-writing-modes-3/#block-flow:
    *
    * If a box has a different block flow direction than its containing block:
    *   * If the box has a specified display of inline, its display computes
    *     to inline-block. [CSS21]
    *   ...etc.
    */
-  if (disp->mDisplay == NS_STYLE_DISPLAY_INLINE &&
+  if (disp->mDisplay == StyleDisplay::Inline &&
       !nsCSSAnonBoxes::IsNonElement(mPseudoTag) &&
       mParent) {
     auto cbContext = mParent;
-    while (cbContext->StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_CONTENTS) {
+    while (cbContext->StyleDisplay()->mDisplay == StyleDisplay::Contents) {
       cbContext = cbContext->mParent;
     }
     MOZ_ASSERT(cbContext, "the root context can't have display:contents");
     // We don't need the full mozilla::WritingMode value (incorporating dir
     // and text-orientation) here; just the writing-mode property is enough.
     if (StyleVisibility()->mWritingMode !=
           cbContext->StyleVisibility()->mWritingMode) {
       nsStyleDisplay* mutable_display = GET_UNIQUE_STYLE_DATA(Display);
       disp = mutable_display;
       mutable_display->mOriginalDisplay = mutable_display->mDisplay =
-        NS_STYLE_DISPLAY_INLINE_BLOCK;
+        StyleDisplay::InlineBlock;
     }
   }
 
   // Compute User Interface style, to trigger loads of cursors
   StyleUserInterface();
 #undef GET_UNIQUE_STYLE_DATA
 }
 
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -1947,17 +1947,17 @@ nsStyleSet::ProbePseudoElementStyle(Elem
   // 'content' property is equivalent to not having the pseudo-element
   // at all.
   if (result &&
       (pseudoTag == nsCSSPseudoElements::before ||
        pseudoTag == nsCSSPseudoElements::after)) {
     const nsStyleDisplay *display = result->StyleDisplay();
     const nsStyleContent *content = result->StyleContent();
     // XXXldb What is contentCount for |content: ""|?
-    if (display->mDisplay == NS_STYLE_DISPLAY_NONE ||
+    if (display->mDisplay == StyleDisplay::None_ ||
         content->ContentCount() == 0) {
       result = nullptr;
     }
   }
 
   return result.forget();
 }
 
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2976,18 +2976,18 @@ StyleAnimation::operator==(const StyleAn
          mPlayState == aOther.mPlayState &&
          mIterationCount == aOther.mIterationCount;
 }
 
 // --------------------
 // nsStyleDisplay
 //
 nsStyleDisplay::nsStyleDisplay(StyleStructContext aContext)
-  : mDisplay(NS_STYLE_DISPLAY_INLINE)
-  , mOriginalDisplay(NS_STYLE_DISPLAY_INLINE)
+  : mDisplay(StyleDisplay::Inline)
+  , mOriginalDisplay(StyleDisplay::Inline)
   , mContain(NS_STYLE_CONTAIN_NONE)
   , mAppearance(NS_THEME_NONE)
   , mPosition(NS_STYLE_POSITION_STATIC)
   , mFloat(StyleFloat::None_)
   , mOriginalFloat(StyleFloat::None_)
   , mBreakType(NS_STYLE_CLEAR_NONE)
   , mBreakInside(NS_STYLE_PAGE_BREAK_AUTO)
   , mBreakBefore(false)
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2900,69 +2900,69 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
            mAnimationDirectionCount,
            mAnimationFillModeCount,
            mAnimationPlayStateCount,
            mAnimationIterationCountCount;
 
   mozilla::StyleShapeOutside mShapeOutside; // [reset]
 
   bool IsBlockInsideStyle() const {
-    return NS_STYLE_DISPLAY_BLOCK == mDisplay ||
-           NS_STYLE_DISPLAY_LIST_ITEM == mDisplay ||
-           NS_STYLE_DISPLAY_INLINE_BLOCK == mDisplay ||
-           NS_STYLE_DISPLAY_TABLE_CAPTION == mDisplay;
+    return StyleDisplay::Block == mDisplay ||
+           StyleDisplay::ListItem == mDisplay ||
+           StyleDisplay::InlineBlock == mDisplay ||
+           StyleDisplay::TableCaption == mDisplay;
     // Should TABLE_CELL be included here?  They have
     // block frames nested inside of them.
     // (But please audit all callers before changing.)
   }
 
   bool IsBlockOutsideStyle() const {
-    return NS_STYLE_DISPLAY_BLOCK == mDisplay ||
-           NS_STYLE_DISPLAY_FLEX == mDisplay ||
-           NS_STYLE_DISPLAY_WEBKIT_BOX == mDisplay ||
-           NS_STYLE_DISPLAY_GRID == mDisplay ||
-           NS_STYLE_DISPLAY_LIST_ITEM == mDisplay ||
-           NS_STYLE_DISPLAY_TABLE == mDisplay;
+    return StyleDisplay::Block == mDisplay ||
+           StyleDisplay::Flex == mDisplay ||
+           StyleDisplay::WebkitBox == mDisplay ||
+           StyleDisplay::Grid == mDisplay ||
+           StyleDisplay::ListItem == mDisplay ||
+           StyleDisplay::Table == mDisplay;
   }
 
   static bool IsDisplayTypeInlineOutside(uint8_t aDisplay) {
-    return NS_STYLE_DISPLAY_INLINE == aDisplay ||
-           NS_STYLE_DISPLAY_INLINE_BLOCK == aDisplay ||
-           NS_STYLE_DISPLAY_INLINE_TABLE == aDisplay ||
-           NS_STYLE_DISPLAY_INLINE_BOX == aDisplay ||
-           NS_STYLE_DISPLAY_INLINE_FLEX == aDisplay ||
-           NS_STYLE_DISPLAY_WEBKIT_INLINE_BOX == aDisplay ||
-           NS_STYLE_DISPLAY_INLINE_GRID == aDisplay ||
-           NS_STYLE_DISPLAY_INLINE_XUL_GRID == aDisplay ||
-           NS_STYLE_DISPLAY_INLINE_STACK == aDisplay ||
-           NS_STYLE_DISPLAY_RUBY == aDisplay ||
-           NS_STYLE_DISPLAY_RUBY_BASE == aDisplay ||
-           NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER == aDisplay ||
-           NS_STYLE_DISPLAY_RUBY_TEXT == aDisplay ||
-           NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER == aDisplay ||
-           NS_STYLE_DISPLAY_CONTENTS == aDisplay;
+    return StyleDisplay::Inline == aDisplay ||
+           StyleDisplay::InlineBlock == aDisplay ||
+           StyleDisplay::InlineTable == aDisplay ||
+           StyleDisplay::InlineBox == aDisplay ||
+           StyleDisplay::InlineFlex == aDisplay ||
+           StyleDisplay::WebkitInlineBox == aDisplay ||
+           StyleDisplay::InlineGrid == aDisplay ||
+           StyleDisplay::InlineXulGrid == aDisplay ||
+           StyleDisplay::InlineStack == aDisplay ||
+           StyleDisplay::Ruby == aDisplay ||
+           StyleDisplay::RubyBase == aDisplay ||
+           StyleDisplay::RubyBaseContainer == aDisplay ||
+           StyleDisplay::RubyText == aDisplay ||
+           StyleDisplay::RubyTextContainer == aDisplay ||
+           StyleDisplay::Contents == aDisplay;
   }
 
   bool IsInlineOutsideStyle() const {
     return IsDisplayTypeInlineOutside(mDisplay);
   }
 
   bool IsOriginalDisplayInlineOutsideStyle() const {
     return IsDisplayTypeInlineOutside(mOriginalDisplay);
   }
 
   bool IsInnerTableStyle() const {
-    return NS_STYLE_DISPLAY_TABLE_CAPTION == mDisplay ||
-           NS_STYLE_DISPLAY_TABLE_CELL == mDisplay ||
-           NS_STYLE_DISPLAY_TABLE_ROW == mDisplay ||
-           NS_STYLE_DISPLAY_TABLE_ROW_GROUP == mDisplay ||
-           NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == mDisplay ||
-           NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == mDisplay ||
-           NS_STYLE_DISPLAY_TABLE_COLUMN == mDisplay ||
-           NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == mDisplay;
+    return StyleDisplay::TableCaption == mDisplay ||
+           StyleDisplay::TableCell == mDisplay ||
+           StyleDisplay::TableRow == mDisplay ||
+           StyleDisplay::TableRowGroup == mDisplay ||
+           StyleDisplay::TableHeaderGroup == mDisplay ||
+           StyleDisplay::TableFooterGroup == mDisplay ||
+           StyleDisplay::TableColumn == mDisplay ||
+           StyleDisplay::TableColumnGroup == mDisplay;
   }
 
   bool IsFloatingStyle() const {
     return mozilla::StyleFloat::None_ != mFloat;
   }
 
   bool IsAbsolutelyPositionedStyle() const {
     return NS_STYLE_POSITION_ABSOLUTE == mPosition ||
@@ -2974,21 +2974,21 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
            NS_STYLE_POSITION_STICKY == mPosition;
   }
   bool IsPositionForcingStackingContext() const {
     return NS_STYLE_POSITION_STICKY == mPosition ||
            NS_STYLE_POSITION_FIXED == mPosition;
   }
 
   static bool IsRubyDisplayType(uint8_t aDisplay) {
-    return NS_STYLE_DISPLAY_RUBY == aDisplay ||
-           NS_STYLE_DISPLAY_RUBY_BASE == aDisplay ||
-           NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER == aDisplay ||
-           NS_STYLE_DISPLAY_RUBY_TEXT == aDisplay ||
-           NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER == aDisplay;
+    return StyleDisplay::Ruby == aDisplay ||
+           StyleDisplay::RubyBase == aDisplay ||
+           StyleDisplay::RubyBaseContainer == aDisplay ||
+           StyleDisplay::RubyText == aDisplay ||
+           StyleDisplay::RubyTextContainer == aDisplay;
   }
 
   bool IsRubyDisplayType() const {
     return IsRubyDisplayType(mDisplay);
   }
 
   bool IsOutOfFlowStyle() const {
     return (IsAbsolutelyPositionedStyle() || IsFloatingStyle());
--- a/layout/style/nsStyleStructInlines.h
+++ b/layout/style/nsStyleStructInlines.h
@@ -114,20 +114,20 @@ nsStyleDisplay::IsOriginalDisplayInlineO
   return IsOriginalDisplayInlineOutsideStyle();
 }
 
 uint8_t
 nsStyleDisplay::GetDisplay(const nsIFrame* aContextFrame) const
 {
   NS_ASSERTION(aContextFrame->StyleDisplay() == this, "unexpected aContextFrame");
   if (aContextFrame->IsSVGText() &&
-      mDisplay != NS_STYLE_DISPLAY_NONE) {
+      mDisplay != StyleDisplay::None_) {
     return aContextFrame->GetType() == nsGkAtoms::blockFrame ?
-             NS_STYLE_DISPLAY_BLOCK :
-             NS_STYLE_DISPLAY_INLINE;
+             StyleDisplay::Block :
+             StyleDisplay::Inline;
   }
   return mDisplay;
 }
 
 bool
 nsStyleDisplay::IsFloating(const nsIFrame* aContextFrame) const
 {
   NS_ASSERTION(aContextFrame->StyleDisplay() == this, "unexpected aContextFrame");
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -237,17 +237,17 @@ nsTableCellMap::GetMapFor(const nsTableR
   }
 
   // if aRowGroup is a repeated header or footer find the header or footer it was repeated from
   if (aRowGroup->IsRepeatable()) {
     nsTableFrame* fifTable = static_cast<nsTableFrame*>(mTableFrame.FirstInFlow());
 
     const nsStyleDisplay* display = aRowGroup->StyleDisplay();
     nsTableRowGroupFrame* rgOrig =
-      (NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == display->mDisplay) ?
+      (StyleDisplay::TableHeaderGroup == display->mDisplay) ?
       fifTable->GetTHead() : fifTable->GetTFoot();
     // find the row group cell map using the original header/footer
     if (rgOrig && rgOrig != aRowGroup) {
       return GetMapFor(rgOrig, aStartHint);
     }
   }
 
   return nullptr;
@@ -2343,23 +2343,23 @@ void nsCellMap::RemoveCell(nsTableCellMa
 
 #ifdef DEBUG
 void nsCellMap::Dump(bool aIsBorderCollapse) const
 {
   printf("\n  ***** START GROUP CELL MAP DUMP ***** %p\n", (void*)this);
   nsTableRowGroupFrame* rg = GetRowGroup();
   const nsStyleDisplay* display = rg->StyleDisplay();
   switch (display->mDisplay) {
-  case NS_STYLE_DISPLAY_TABLE_HEADER_GROUP:
+  case StyleDisplay::TableHeaderGroup:
     printf("  thead ");
     break;
-  case NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP:
+  case StyleDisplay::TableFooterGroup:
     printf("  tfoot ");
     break;
-  case NS_STYLE_DISPLAY_TABLE_ROW_GROUP:
+  case StyleDisplay::TableRowGroup:
     printf("  tbody ");
     break;
   default:
     printf("HUH? wrong display type on rowgroup");
   }
   uint32_t mapRowCount = mRows.Length();
   printf("mapRowCount=%u tableRowCount=%d\n", mapRowCount, mContentRowCount);
 
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -395,17 +395,17 @@ nsTableColFrame * nsTableColGroupFrame::
   if (!childFrame) {
     childFrame = mFrames.FirstChild();
   }
   else {
     childFrame = childFrame->GetNextSibling();
   }
   while (childFrame)
   {
-    if (NS_STYLE_DISPLAY_TABLE_COLUMN ==
+    if (StyleDisplay::TableColumn ==
         childFrame->StyleDisplay()->mDisplay)
     {
       result = (nsTableColFrame *)childFrame;
       break;
     }
     childFrame = childFrame->GetNextSibling();
   }
   return result;
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -330,17 +330,17 @@ nsTableFrame::SetInitialChildList(ChildL
   // XXXbz the below code is an icky cesspit that's only needed in its current
   // form for two reasons:
   // 1) Both rowgroups and column groups come in on the principal child list.
   while (aChildList.NotEmpty()) {
     nsIFrame* childFrame = aChildList.FirstChild();
     aChildList.RemoveFirstChild();
     const nsStyleDisplay* childDisplay = childFrame->StyleDisplay();
 
-    if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay) {
+    if (StyleDisplay::TableColumnGroup == childDisplay->mDisplay) {
       NS_ASSERTION(nsGkAtoms::tableColGroupFrame == childFrame->GetType(),
                    "This is not a colgroup");
       mColGroups.AppendFrame(nullptr, childFrame);
     }
     else { // row groups and unknown frames go on the main list for now
       mFrames.AppendFrame(nullptr, childFrame);
     }
   }
@@ -525,17 +525,17 @@ nsTableFrame::ResetRowIndices(const nsFr
     excludeRowGroupsEnumerator.Next();
   }
 
   for (uint32_t rgIdx = 0; rgIdx < rowGroups.Length(); rgIdx++) {
     nsTableRowGroupFrame* rgFrame = rowGroups[rgIdx];
     if (!excludeRowGroups.GetEntry(rgFrame)) {
       const nsFrameList& rowFrames = rgFrame->PrincipalChildList();
       for (nsFrameList::Enumerator rows(rowFrames); !rows.AtEnd(); rows.Next()) {
-        if (NS_STYLE_DISPLAY_TABLE_ROW==rows.get()->StyleDisplay()->mDisplay) {
+        if (StyleDisplay::TableRow==rows.get()->StyleDisplay()->mDisplay) {
           ((nsTableRowFrame *)rows.get())->SetRowIndex(rowIndex);
           rowIndex++;
         }
       }
     }
   }
 }
 void
@@ -1449,17 +1449,17 @@ nsTableFrame::SetColumnDimensions(nscoor
   for (nsIFrame* colGroupFrame : mColGroups) {
     MOZ_ASSERT(colGroupFrame->GetType() == nsGkAtoms::tableColGroupFrame);
     // first we need to figure out the size of the colgroup
     int32_t groupFirstCol = colIdx;
     nscoord colGroupISize = 0;
     nscoord cellSpacingI = 0;
     const nsFrameList& columnList = colGroupFrame->PrincipalChildList();
     for (nsIFrame* colFrame : columnList) {
-      if (NS_STYLE_DISPLAY_TABLE_COLUMN ==
+      if (StyleDisplay::TableColumn ==
           colFrame->StyleDisplay()->mDisplay) {
         NS_ASSERTION(colIdx < GetColCount(), "invalid number of columns");
         cellSpacingI = GetColSpacing(colIdx);
         colGroupISize += fif->GetColumnISizeFromFirstInFlow(colIdx) +
                          cellSpacingI;
         ++colIdx;
       }
     }
@@ -1471,17 +1471,17 @@ nsTableFrame::SetColumnDimensions(nscoor
                              colGroupISize, colBSize);
     colGroupFrame->SetRect(aWM, colGroupRect, aContainerSize);
     nsSize colGroupSize = colGroupFrame->GetSize();
 
     // then we can place the columns correctly within the group
     colIdx = groupFirstCol;
     LogicalPoint colOrigin(aWM);
     for (nsIFrame* colFrame : columnList) {
-      if (NS_STYLE_DISPLAY_TABLE_COLUMN ==
+      if (StyleDisplay::TableColumn ==
           colFrame->StyleDisplay()->mDisplay) {
         nscoord colISize = fif->GetColumnISizeFromFirstInFlow(colIdx);
         LogicalRect colRect(aWM, colOrigin.I(aWM), colOrigin.B(aWM),
                             colISize, colBSize);
         colFrame->SetRect(aWM, colRect, colGroupSize);
         cellSpacingI = GetColSpacing(colIdx);
         colOrigin.I(aWM) += colISize + cellSpacingI;
         ++colIdx;
@@ -2101,33 +2101,33 @@ nsTableFrame::GetFirstBodyRowGroupFrame(
   nsIFrame* headerFrame = nullptr;
   nsIFrame* footerFrame = nullptr;
 
   for (nsIFrame* kidFrame : mFrames) {
     const nsStyleDisplay* childDisplay = kidFrame->StyleDisplay();
 
     // We expect the header and footer row group frames to be first, and we only
     // allow one header and one footer
-    if (NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == childDisplay->mDisplay) {
+    if (StyleDisplay::TableHeaderGroup == childDisplay->mDisplay) {
       if (headerFrame) {
         // We already have a header frame and so this header frame is treated
         // like an ordinary body row group frame
         return kidFrame;
       }
       headerFrame = kidFrame;
 
-    } else if (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay) {
+    } else if (StyleDisplay::TableFooterGroup == childDisplay->mDisplay) {
       if (footerFrame) {
         // We already have a footer frame and so this footer frame is treated
         // like an ordinary body row group frame
         return kidFrame;
       }
       footerFrame = kidFrame;
 
-    } else if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == childDisplay->mDisplay) {
+    } else if (StyleDisplay::TableRowGroup == childDisplay->mDisplay) {
       return kidFrame;
     }
   }
 
   return nullptr;
 }
 
 // Table specific version that takes into account repeated header and footer
@@ -2224,17 +2224,17 @@ nsTableFrame::GetCollapsedISize(const Wr
   for (nsIFrame* groupFrame : mColGroups) {
     const nsStyleVisibility* groupVis = groupFrame->StyleVisibility();
     bool collapseGroup = (NS_STYLE_VISIBILITY_COLLAPSE == groupVis->mVisible);
     nsTableColGroupFrame* cgFrame = (nsTableColGroupFrame*)groupFrame;
     for (nsTableColFrame* colFrame = cgFrame->GetFirstColumn(); colFrame;
          colFrame = colFrame->GetNextCol()) {
       const nsStyleDisplay* colDisplay = colFrame->StyleDisplay();
       nscoord colIdx = colFrame->GetColIndex();
-      if (NS_STYLE_DISPLAY_TABLE_COLUMN == colDisplay->mDisplay) {
+      if (StyleDisplay::TableColumn == colDisplay->mDisplay) {
         const nsStyleVisibility* colVis = colFrame->StyleVisibility();
         bool collapseCol = (NS_STYLE_VISIBILITY_COLLAPSE == colVis->mVisible);
         nscoord colISize = fif->GetColumnISizeFromFirstInFlow(colIdx);
         if (!collapseGroup && !collapseCol) {
           iSize += colISize;
           if (ColumnHasCellSpacingBefore(colIdx)) {
             iSize += GetColSpacing(colIdx - 1);
           }
@@ -2295,17 +2295,17 @@ nsTableFrame::AppendFrames(ChildListID  
   // based on the type, bug 343048.
   while (!aFrameList.IsEmpty()) {
     nsIFrame* f = aFrameList.FirstChild();
     aFrameList.RemoveFrame(f);
 
     // See what kind of frame we have
     const nsStyleDisplay* display = f->StyleDisplay();
 
-    if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay) {
+    if (StyleDisplay::TableColumnGroup == display->mDisplay) {
       if (MOZ_UNLIKELY(GetPrevInFlow())) {
         nsFrameList colgroupFrame(f, f);
         auto firstInFlow = static_cast<nsTableFrame*>(FirstInFlow());
         firstInFlow->AppendFrames(aListID, colgroupFrame);
         continue;
       }
       nsTableColGroupFrame* lastColGroup =
         nsTableColGroupFrame::GetLastRealColGroup(this);
@@ -2369,17 +2369,17 @@ nsTableFrame::InsertFrames(ChildListID  
   // from the other frames (bug 759249).
   ChildListInsertions insertions[2]; // ColGroup, other
   const nsStyleDisplay* display = aFrameList.FirstChild()->StyleDisplay();
   nsFrameList::FrameLinkEnumerator e(aFrameList);
   for (; !aFrameList.IsEmpty(); e.Next()) {
     nsIFrame* next = e.NextFrame();
     if (!next || next->StyleDisplay()->mDisplay != display->mDisplay) {
       nsFrameList head = aFrameList.ExtractHead(e);
-      if (display->mDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP) {
+      if (display->mDisplay == StyleDisplay::TableColumnGroup) {
         insertions[0].mID = kColGroupList;
         insertions[0].mList.AppendFrames(nullptr, head);
       } else {
         insertions[1].mID = kPrincipalList;
         insertions[1].mList.AppendFrames(nullptr, head);
       }
       if (!next) {
         break;
@@ -2400,37 +2400,37 @@ nsTableFrame::InsertFrames(ChildListID  
 
 void
 nsTableFrame::HomogenousInsertFrames(ChildListID     aListID,
                                      nsIFrame*       aPrevFrame,
                                      nsFrameList&    aFrameList)
 {
   // See what kind of frame we have
   const nsStyleDisplay* display = aFrameList.FirstChild()->StyleDisplay();
-  bool isColGroup = NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay;
+  bool isColGroup = StyleDisplay::TableColumnGroup == display->mDisplay;
 #ifdef DEBUG
   // Verify that either all siblings have display:table-column-group, or they
   // all have display values different from table-column-group.
   for (nsIFrame* frame : aFrameList) {
     auto nextDisplay = frame->StyleDisplay()->mDisplay;
     MOZ_ASSERT(isColGroup ==
-               (nextDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP),
+               (nextDisplay == StyleDisplay::TableColumnGroup),
                "heterogenous childlist");
   }
 #endif
   if (MOZ_UNLIKELY(isColGroup && GetPrevInFlow())) {
     auto firstInFlow = static_cast<nsTableFrame*>(FirstInFlow());
     firstInFlow->AppendFrames(aListID, aFrameList);
     return;
   }
   if (aPrevFrame) {
     const nsStyleDisplay* prevDisplay = aPrevFrame->StyleDisplay();
     // Make sure they belong on the same frame list
-    if ((display->mDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP) !=
-        (prevDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP)) {
+    if ((display->mDisplay == StyleDisplay::TableColumnGroup) !=
+        (prevDisplay->mDisplay == StyleDisplay::TableColumnGroup)) {
       // the previous frame is not valid, see comment at ::AppendFrames
       // XXXbz Using content indices here means XBL will get screwed
       // over...  Oh, well.
       nsIFrame* pseudoFrame = aFrameList.FirstChild();
       nsIContent* parentContent = GetContent();
       nsIContent* content;
       aPrevFrame = nullptr;
       while (pseudoFrame  && (parentContent ==
@@ -2468,17 +2468,17 @@ nsTableFrame::HomogenousInsertFrames(Chi
             lastIndex = index;
             aPrevFrame = kidFrame;
           }
           kidFrame = kidFrame->GetNextSibling();
         }
       }
     }
   }
-  if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == display->mDisplay) {
+  if (StyleDisplay::TableColumnGroup == display->mDisplay) {
     NS_ASSERTION(aListID == kColGroupList, "unexpected child list");
     // Insert the column group frames
     const nsFrameList::Slice& newColgroups =
       mColGroups.InsertFrames(this, aPrevFrame, aFrameList);
     // find the starting col index for the first new col group
     int32_t startColIndex = 0;
     if (aPrevFrame) {
       nsTableColGroupFrame* prevColGroup =
@@ -2587,17 +2587,17 @@ nsTableFrame::DoRemoveFrame(ChildListID 
   }
 }
 
 void
 nsTableFrame::RemoveFrame(ChildListID     aListID,
                           nsIFrame*       aOldFrame)
 {
   NS_ASSERTION(aListID == kColGroupList ||
-               NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP !=
+               StyleDisplay::TableColumnGroup !=
                  aOldFrame->StyleDisplay()->mDisplay,
                "Wrong list name; use kColGroupList iff colgroup");
   nsIPresShell* shell = PresContext()->PresShell();
   nsTableFrame* lastParent = nullptr;
   while (aOldFrame) {
     nsIFrame* oldFrameNextContinuation = aOldFrame->GetNextContinuation();
     nsTableFrame* parent = static_cast<nsTableFrame*>(aOldFrame->GetParent());
     if (parent != lastParent) {
@@ -2808,33 +2808,33 @@ nsTableFrame::OrderRowGroups(RowGroupArr
 
   nsIFrame* kidFrame = mFrames.FirstChild();
   while (kidFrame) {
     const nsStyleDisplay* kidDisplay = kidFrame->StyleDisplay();
     nsTableRowGroupFrame* rowGroup =
       static_cast<nsTableRowGroupFrame*>(kidFrame);
 
     switch (kidDisplay->mDisplay) {
-    case NS_STYLE_DISPLAY_TABLE_HEADER_GROUP:
+    case StyleDisplay::TableHeaderGroup:
       if (head) { // treat additional thead like tbody
         aChildren.AppendElement(rowGroup);
       }
       else {
         head = rowGroup;
       }
       break;
-    case NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP:
+    case StyleDisplay::TableFooterGroup:
       if (foot) { // treat additional tfoot like tbody
         aChildren.AppendElement(rowGroup);
       }
       else {
         foot = rowGroup;
       }
       break;
-    case NS_STYLE_DISPLAY_TABLE_ROW_GROUP:
+    case StyleDisplay::TableRowGroup:
       aChildren.AppendElement(rowGroup);
       break;
     default:
       NS_NOTREACHED("How did this produce an nsTableRowGroupFrame?");
       // Just ignore it
       break;
     }
     // Get the next sibling but skip it if it's also the next-in-flow, since
@@ -2862,17 +2862,17 @@ nsTableFrame::OrderRowGroups(RowGroupArr
 }
 
 nsTableRowGroupFrame*
 nsTableFrame::GetTHead() const
 {
   nsIFrame* kidFrame = mFrames.FirstChild();
   while (kidFrame) {
     if (kidFrame->StyleDisplay()->mDisplay ==
-          NS_STYLE_DISPLAY_TABLE_HEADER_GROUP) {
+          StyleDisplay::TableHeaderGroup) {
       return static_cast<nsTableRowGroupFrame*>(kidFrame);
     }
 
     // Get the next sibling but skip it if it's also the next-in-flow, since
     // a next-in-flow will not be part of the current table.
     while (kidFrame) {
       nsIFrame* nif = kidFrame->GetNextInFlow();
       kidFrame = kidFrame->GetNextSibling();
@@ -2885,17 +2885,17 @@ nsTableFrame::GetTHead() const
 }
 
 nsTableRowGroupFrame*
 nsTableFrame::GetTFoot() const
 {
   nsIFrame* kidFrame = mFrames.FirstChild();
   while (kidFrame) {
     if (kidFrame->StyleDisplay()->mDisplay ==
-          NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP) {
+          StyleDisplay::TableFooterGroup) {
       return static_cast<nsTableRowGroupFrame*>(kidFrame);
     }
 
     // Get the next sibling but skip it if it's also the next-in-flow, since
     // a next-in-flow will not be part of the current table.
     while (kidFrame) {
       nsIFrame* nif = kidFrame->GetNextInFlow();
       kidFrame = kidFrame->GetNextSibling();
@@ -6668,20 +6668,20 @@ BCPaintBorderIterator::SetNewRowGroup()
       mCellMap = mTableCellMap->GetMapFor(fifRg, nullptr);
       if (!mCellMap) ABORT1(false);
     }
     if (mRg && mTable->GetPrevInFlow() && !mRg->GetPrevInFlow()) {
       // if mRowGroup doesn't have a prev in flow, then it may be a repeated
       // header or footer
       const nsStyleDisplay* display = mRg->StyleDisplay();
       if (mRowIndex == mDamageArea.StartRow()) {
-        mIsRepeatedHeader = (NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == display->mDisplay);
+        mIsRepeatedHeader = (StyleDisplay::TableHeaderGroup == display->mDisplay);
       }
       else {
-        mIsRepeatedFooter = (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == display->mDisplay);
+        mIsRepeatedFooter = (StyleDisplay::TableFooterGroup == display->mDisplay);
       }
     }
   }
   else {
     mAtEnd = true;
   }
   return !mAtEnd;
 }
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -880,19 +880,19 @@ protected:
   nsTableCellMap*         mCellMap;            // maintains the relationships between rows, cols, and cells
   nsITableLayoutStrategy* mTableLayoutStrategy;// the layout strategy for this frame
   nsFrameList             mColGroups;          // the list of colgroup frames
 };
 
 
 inline bool nsTableFrame::IsRowGroup(int32_t aDisplayType) const
 {
-  return bool((NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == aDisplayType) ||
-                (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == aDisplayType) ||
-                (NS_STYLE_DISPLAY_TABLE_ROW_GROUP    == aDisplayType));
+  return bool((StyleDisplay::TableHeaderGroup == aDisplayType) ||
+                (StyleDisplay::TableFooterGroup == aDisplayType) ||
+                (StyleDisplay::TableRowGroup    == aDisplayType));
 }
 
 inline void nsTableFrame::SetHaveReflowedColGroups(bool aValue)
 {
   mBits.mHaveReflowedColGroups = aValue;
 }
 
 inline bool nsTableFrame::HaveReflowedColGroups() const
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -143,17 +143,17 @@ nsTableRowFrame::~nsTableRowFrame()
 void
 nsTableRowFrame::Init(nsIContent*       aContent,
                       nsContainerFrame* aParent,
                       nsIFrame*         aPrevInFlow)
 {
   // Let the base class do its initialization
   nsContainerFrame::Init(aContent, aParent, aPrevInFlow);
 
-  NS_ASSERTION(NS_STYLE_DISPLAY_TABLE_ROW == StyleDisplay()->mDisplay,
+  NS_ASSERTION(StyleDisplay::TableRow == StyleDisplay()->mDisplay,
                "wrong display on table row frame");
 
   if (aPrevInFlow) {
     // Set the row index
     nsTableRowFrame* rowFrame = (nsTableRowFrame*)aPrevInFlow;
 
     SetRowIndex(rowFrame->GetRowIndex());
   }
@@ -1396,17 +1396,17 @@ nsTableRowFrame::GetType() const
 
 nsTableRowFrame*
 nsTableRowFrame::GetNextRow() const
 {
   nsIFrame* childFrame = GetNextSibling();
   while (childFrame) {
     nsTableRowFrame *rowFrame = do_QueryFrame(childFrame);
     if (rowFrame) {
-	  NS_ASSERTION(NS_STYLE_DISPLAY_TABLE_ROW == childFrame->StyleDisplay()->mDisplay, "wrong display type on rowframe");
+	  NS_ASSERTION(StyleDisplay::TableRow == childFrame->StyleDisplay()->mDisplay, "wrong display type on rowframe");
       return rowFrame;
     }
     childFrame = childFrame->GetNextSibling();
   }
   return nullptr;
 }
 
 NS_DECLARE_FRAME_PROPERTY_SMALL_VALUE(RowUnpaginatedHeightProperty, nscoord)
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -78,17 +78,17 @@ NS_QUERYFRAME_HEAD(nsTableRowGroupFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
 
 int32_t
 nsTableRowGroupFrame::GetRowCount()
 {
 #ifdef DEBUG
   for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
     NS_ASSERTION(e.get()->StyleDisplay()->mDisplay ==
-                   NS_STYLE_DISPLAY_TABLE_ROW,
+                   StyleDisplay::TableRow,
                  "Unexpected display");
     NS_ASSERTION(e.get()->GetType() == nsGkAtoms::tableRowFrame,
                  "Unexpected frame type");
   }
 #endif
 
   return mFrames.GetLength();
 }
@@ -108,17 +108,17 @@ int32_t nsTableRowGroupFrame::GetStartRo
 
   return result;
 }
 
 void  nsTableRowGroupFrame::AdjustRowIndices(int32_t aRowIndex,
                                              int32_t anAdjustment)
 {
   for (nsIFrame* rowFrame : mFrames) {
-    if (NS_STYLE_DISPLAY_TABLE_ROW==rowFrame->StyleDisplay()->mDisplay) {
+    if (StyleDisplay::TableRow==rowFrame->StyleDisplay()->mDisplay) {
       int32_t index = ((nsTableRowFrame*)rowFrame)->GetRowIndex();
       if (index >= aRowIndex)
         ((nsTableRowFrame *)rowFrame)->SetRowIndex(index+anAdjustment);
     }
   }
 }
 nsresult
 nsTableRowGroupFrame::InitRepeatedFrame(nsTableRowGroupFrame* aHeaderFooterFrame)
@@ -1462,17 +1462,17 @@ nsTableRowGroupFrame::AppendFrames(Child
 
   // collect the new row frames in an array
   // XXXbz why are we doing the QI stuff?  There shouldn't be any non-rows here.
   AutoTArray<nsTableRowFrame*, 8> rows;
   for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) {
     nsTableRowFrame *rowFrame = do_QueryFrame(e.get());
     NS_ASSERTION(rowFrame, "Unexpected frame; frame constructor screwed up");
     if (rowFrame) {
-      NS_ASSERTION(NS_STYLE_DISPLAY_TABLE_ROW ==
+      NS_ASSERTION(StyleDisplay::TableRow ==
                      e.get()->StyleDisplay()->mDisplay,
                    "wrong display type on rowframe");
       rows.AppendElement(rowFrame);
     }
   }
 
   int32_t rowIndex = GetRowCount();
   // Append the frames to the sibling chain
@@ -1504,17 +1504,17 @@ nsTableRowGroupFrame::InsertFrames(Child
   // XXXbz why are we doing the QI stuff?  There shouldn't be any non-rows here.
   nsTableFrame* tableFrame = GetTableFrame();
   nsTArray<nsTableRowFrame*> rows;
   bool gotFirstRow = false;
   for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) {
     nsTableRowFrame *rowFrame = do_QueryFrame(e.get());
     NS_ASSERTION(rowFrame, "Unexpected frame; frame constructor screwed up");
     if (rowFrame) {
-      NS_ASSERTION(NS_STYLE_DISPLAY_TABLE_ROW ==
+      NS_ASSERTION(StyleDisplay::TableRow ==
                      e.get()->StyleDisplay()->mDisplay,
                    "wrong display type on rowframe");
       rows.AppendElement(rowFrame);
       if (!gotFirstRow) {
         rowFrame->SetFirstInserted(true);
         gotFirstRow = true;
         tableFrame->SetRowInserted(true);
       }
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -1232,17 +1232,17 @@ nsBoxFrame::AttributeChanged(int32_t aNa
   else if (aAttribute == nsGkAtoms::ordinal) {
     nsIFrame* parent = GetParentXULBox(this);
     // If our parent is not a box, there's not much we can do... but in that
     // case our ordinal doesn't matter anyway, so that's ok.
     // Also don't bother with popup frames since they are kept on the 
     // kPopupList and XULRelayoutChildAtOrdinal() only handles
     // principal children.
     if (parent && !(GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
-        StyleDisplay()->mDisplay != NS_STYLE_DISPLAY_POPUP) {
+        StyleDisplay()->mDisplay != StyleDisplay::Popup) {
       parent->XULRelayoutChildAtOrdinal(this);
       // XXXldb Should this instead be a tree change on the child or parent?
       PresContext()->PresShell()->
         FrameNeedsReflow(parent, nsIPresShell::eStyleChange,
                          NS_FRAME_IS_DIRTY);
     }
   }
   // If the accesskey changed, register for the new value