Bug 1299066: Use the new enum class, and fix remaining build bustages except in the frame constructor. r?heycam draft
authorEmilio Cobos Álvarez <ecoal95@gmail.com>
Sat, 27 Aug 2016 23:21:03 -0700
changeset 407275 10ee4b1cbe82227141a1a2223829ddda4ed63bbf
parent 407274 044c2f520be1ac25e3efd94f4c4bc9839b787a88
child 407276 88422454a54d94816482ac6fc32c3067f4cdc45c
child 407300 8f12f35af4e50831f425c7c8319369048b14e27a
push id27917
push userbmo:ecoal95@gmail.com
push dateTue, 30 Aug 2016 06:52:07 +0000
reviewersheycam
bugs1299066
milestone51.0a1
Bug 1299066: Use the new enum class, and fix remaining build bustages except in the frame constructor. r?heycam MozReview-Commit-ID: 5jyxZNoTMtQ
dom/base/nsRange.cpp
layout/base/RestyleManager.cpp
layout/base/RestyleManager.h
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/generic/ReflowInput.cpp
layout/generic/ReflowInput.h
layout/generic/nsBackdropFrame.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsIFrame.h
layout/generic/nsIFrameInlines.h
layout/generic/nsTextFrame.cpp
layout/mathml/nsMathMLmtableFrame.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsRuleNode.cpp
layout/style/nsRuleNode.h
layout/style/nsStyleContext.cpp
layout/style/nsStyleStruct.h
layout/style/nsStyleStructInlines.h
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/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -3495,16 +3495,18 @@ nsRange::GetInnerTextNoFlush(DOMString& 
         }
         break;
       case StyleDisplay::TableRow:
         if (!IsLastRowOfRowGroup(f) ||
             !IsLastNonemptyRowGroupOfTable(f->GetParent())) {
           result.Append('\n');
         }
         break;
+      default:
+        ; // Nothing
       }
       result.AddRequiredLineBreakCount(GetRequiredInnerTextLineBreakCount(f));
     }
     nsIContent* next = currentNode->GetNextSibling();
     if (next) {
       currentNode = next;
       currentState = AT_NODE;
     } else {
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1792,17 +1792,17 @@ ElementRestyler::DoConditionallyRestyleU
 }
 
 // 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,
+    const StyleDisplay aDisplay,
     Element* aRestyleRoot)
 {
   MOZ_ASSERT(aDisplay == StyleDisplay::None_ ||
              aDisplay == StyleDisplay::Contents);
   if (!aUndisplayed) {
     return;
   }
 
@@ -3427,21 +3427,21 @@ ElementRestyler::DoRestyleUndisplayedDes
   nodes = fc->GetAllDisplayContentsIn(aParent);
   RestyleUndisplayedNodes(aChildRestyleHint, nodes, aParent,
                           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,
-                                         nsStyleContext*  aParentContext,
-                                         const uint8_t    aDisplay)
+ElementRestyler::RestyleUndisplayedNodes(nsRestyleHint      aChildRestyleHint,
+                                         UndisplayedNode*   aUndisplayed,
+                                         nsIContent*        aUndisplayedParent,
+                                         nsStyleContext*    aParentContext,
+                                         const StyleDisplay aDisplay)
 {
   nsIContent* undisplayedParent = aUndisplayedParent;
   UndisplayedNode* undisplayed = aUndisplayed;
   TreeMatchContext::AutoAncestorPusher pusher(mTreeMatchContext);
   if (undisplayed) {
     pusher.PushAncestorAndStyleScope(undisplayedParent);
   }
   for (; undisplayed; undisplayed = undisplayed->mNext) {
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -740,21 +740,21 @@ private:
   /**
    * In the following two methods, aParentStyleContext is either
    * mFrame->StyleContext() if we have a frame, or a display:contents
    * style context if we don't.
    */
   void DoRestyleUndisplayedDescendants(nsRestyleHint aChildRestyleHint,
                                        nsIContent* aParent,
                                        nsStyleContext* aParentStyleContext);
-  void RestyleUndisplayedNodes(nsRestyleHint    aChildRestyleHint,
-                               UndisplayedNode* aUndisplayed,
-                               nsIContent*      aUndisplayedParent,
-                               nsStyleContext*  aParentStyleContext,
-                               const uint8_t    aDisplay);
+  void RestyleUndisplayedNodes(nsRestyleHint      aChildRestyleHint,
+                               UndisplayedNode*   aUndisplayed,
+                               nsIContent*        aUndisplayedParent,
+                               nsStyleContext*    aParentStyleContext,
+                               const StyleDisplay aDisplay);
   void MaybeReframeForBeforePseudo();
   void MaybeReframeForAfterPseudo(nsIFrame* aFrame);
   void MaybeReframeForPseudo(CSSPseudoElementType aPseudoType,
                              nsIFrame* aGenConParentFrame,
                              nsIFrame* aFrame,
                              nsIContent* aContent,
                              nsStyleContext* aStyleContext);
 #ifdef DEBUG
@@ -793,17 +793,17 @@ private:
   void ConditionallyRestyleContentChildren(nsIFrame* aFrame,
                                            Element* aRestyleRoot);
   void ConditionallyRestyleUndisplayedDescendants(nsIFrame* aFrame,
                                                   Element* aRestyleRoot);
   void DoConditionallyRestyleUndisplayedDescendants(nsIContent* aParent,
                                                     Element* aRestyleRoot);
   void ConditionallyRestyleUndisplayedNodes(UndisplayedNode* aUndisplayed,
                                             nsIContent* aUndisplayedParent,
-                                            const uint8_t aDisplay,
+                                            const StyleDisplay aDisplay,
                                             Element* aRestyleRoot);
   void ConditionallyRestyleContentDescendants(Element* aElement,
                                               Element* aRestyleRoot);
   bool ConditionallyRestyle(nsIFrame* aFrame, Element* aRestyleRoot);
   bool ConditionallyRestyle(Element* aElement, Element* aRestyleRoot);
 
 #ifdef RESTYLE_LOGGING
   int32_t& LoggingDepth() { return mLoggingDepth; }
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -6471,41 +6471,41 @@ nsCSSFrameConstructor::AppendFramesToPar
     return NS_OK;
   }
 
   // Insert the frames after our aPrevSibling
   InsertFrames(aParentFrame, kPrincipalList, aPrevSibling, aFrameList);
   return NS_OK;
 }
 
-#define UNSET_DISPLAY 255
+#define UNSET_DISPLAY static_cast<StyleDisplay>(255)
 
 // This gets called to see if the frames corresponding to aSibling and aContent
 // should be siblings in the frame tree. Although (1) rows and cols, (2) row
 // groups and col groups, (3) row groups and captions, (4) legends and content
 // inside fieldsets, (5) popups and other kids of the menu are siblings from a
 // content perspective, they are not considered siblings in the frame tree.
 bool
 nsCSSFrameConstructor::IsValidSibling(nsIFrame*              aSibling,
                                       nsIContent*            aContent,
-                                      uint8_t&               aDisplay)
+                                      StyleDisplay&          aDisplay)
 {
   nsIFrame* parentFrame = aSibling->GetParent();
   nsIAtom* parentType = nullptr;
   if (parentFrame) {
     parentType = parentFrame->GetType();
   }
 
-  uint8_t siblingDisplay = aSibling->GetDisplay();
-  if ((StyleDisplay::TableColumnGroup == siblingDisplay) ||
-      (StyleDisplay::TableColumn       == siblingDisplay) ||
-      (StyleDisplay::TableCaption      == siblingDisplay) ||
-      (StyleDisplay::TableHeaderGroup == siblingDisplay) ||
-      (StyleDisplay::TableRowGroup    == siblingDisplay) ||
-      (StyleDisplay::TableFooterGroup == siblingDisplay) ||
+  StyleDisplay siblingDisplay = aSibling->GetDisplay();
+  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();
       }
@@ -6570,17 +6570,17 @@ nsCSSFrameConstructor::IsValidSibling(ns
   }
 
   return true;
 }
 
 nsIFrame*
 nsCSSFrameConstructor::FindFrameForContentSibling(nsIContent* aContent,
                                                   nsIContent* aTargetContent,
-                                                  uint8_t& aTargetContentDisplay,
+                                                  StyleDisplay& aTargetContentDisplay,
                                                   nsContainerFrame* aParentFrame,
                                                   bool aPrevSibling)
 {
   nsIFrame* sibling = aContent->GetPrimaryFrame();
   if (!sibling && GetDisplayContentsStyleFor(aContent)) {
     // A display:contents node - check if it has a ::before / ::after frame...
     sibling = aPrevSibling ?
       nsLayoutUtils::GetAfterFrameForContent(aParentFrame, aContent) :
@@ -6637,17 +6637,17 @@ nsCSSFrameConstructor::FindFrameForConte
   }
 
   return sibling;
 }
 
 nsIFrame*
 nsCSSFrameConstructor::FindPreviousSibling(FlattenedChildIterator aIter,
                                            nsIContent* aTargetContent,
-                                           uint8_t& aTargetContentDisplay,
+                                           StyleDisplay& aTargetContentDisplay,
                                            nsContainerFrame* aParentFrame)
 {
   // Note: not all content objects are associated with a frame (e.g., if it's
   // `display: none') so keep looking until we find a previous frame.
   while (nsIContent* sibling = aIter.GetPreviousChild()) {
     MOZ_ASSERT(sibling != aTargetContent);
     nsIFrame* prevSibling =
       FindFrameForContentSibling(sibling, aTargetContent, aTargetContentDisplay,
@@ -6659,17 +6659,17 @@ nsCSSFrameConstructor::FindPreviousSibli
   }
 
   return nullptr;
 }
 
 nsIFrame*
 nsCSSFrameConstructor::FindNextSibling(FlattenedChildIterator aIter,
                                        nsIContent* aTargetContent,
-                                       uint8_t& aTargetContentDisplay,
+                                       StyleDisplay& aTargetContentDisplay,
                                        nsContainerFrame* aParentFrame)
 {
   while (nsIContent* sibling = aIter.GetNextChild()) {
     MOZ_ASSERT(sibling != aTargetContent);
     nsIFrame* nextSibling =
       FindFrameForContentSibling(sibling, aTargetContent, aTargetContentDisplay,
                                  aParentFrame, false);
 
@@ -6736,17 +6736,17 @@ nsCSSFrameConstructor::GetInsertionPrevS
     iter.GetNextChild();
     MOZ_ASSERT(aChild->GetProperty(nsGkAtoms::restylableAnonymousNode),
                "Someone passed native anonymous content directly into frame "
                "construction.  Stop doing that!");
   }
 
   // Note that FindPreviousSibling is passed the iterator by value, so that
   // the later usage of the iterator starts from the same place.
-  uint8_t childDisplay = UNSET_DISPLAY;
+  StyleDisplay childDisplay = UNSET_DISPLAY;
   nsIFrame* prevSibling =
     FindPreviousSibling(iter, iter.Get(), childDisplay, aInsertion->mParentFrame);
 
   // Now, find the geometric parent so that we can handle
   // continuations properly. Use the prev sibling if we have it;
   // otherwise use the next sibling.
   if (prevSibling) {
     aInsertion->mParentFrame = prevSibling->GetParent()->GetContentInsertionFrame();
@@ -7844,17 +7844,17 @@ nsCSSFrameConstructor::ContentRangeInser
   nsContainerFrame* containingBlock = state.mFloatedItems.containingBlock;
   bool haveFirstLetterStyle = false;
   bool haveFirstLineStyle = false;
 
   // In order to shave off some cycles, we only dig up the
   // 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();
+  StyleDisplay 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 ((StyleDisplay::Block == parentDisplay) ||
       (StyleDisplay::ListItem == parentDisplay) ||
       (StyleDisplay::Inline == parentDisplay) ||
       (StyleDisplay::InlineBlock == parentDisplay)) {
@@ -9181,17 +9181,17 @@ 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 = StyleDisplay::None_;
+  StyleDisplay oldDisplay = StyleDisplay::None_;
   if (!oldContext) {
     oldContext = GetDisplayContentsStyleFor(aElement);
     if (!oldContext) {
       return nullptr;
     }
     oldDisplay = StyleDisplay::Contents;
   }
 
@@ -9921,18 +9921,18 @@ nsCSSFrameConstructor::CreateNeededAnonF
     // wrapper. This advances |iter| to point to |endIter|.
     iter.AppendItemsToList(endIter, newItem->mChildItems);
 
     iter.InsertItem(newItem);
   } while (!iter.IsDone());
 }
 
 /* static */ nsCSSFrameConstructor::RubyWhitespaceType
-nsCSSFrameConstructor::ComputeRubyWhitespaceType(uint_fast8_t aPrevDisplay,
-                                                 uint_fast8_t aNextDisplay)
+nsCSSFrameConstructor::ComputeRubyWhitespaceType(StyleDisplay aPrevDisplay,
+                                                 StyleDisplay aNextDisplay)
 {
   MOZ_ASSERT(nsStyleDisplay::IsRubyDisplayType(aPrevDisplay) &&
              nsStyleDisplay::IsRubyDisplayType(aNextDisplay));
   if (aPrevDisplay == aNextDisplay &&
       (aPrevDisplay == StyleDisplay::RubyBase ||
        aPrevDisplay == StyleDisplay::RubyText)) {
     return eRubyInterLeafWhitespace;
   }
@@ -9981,17 +9981,17 @@ nsCSSFrameConstructor::InterpretRubyWhit
  * parent into either a ruby base box or a ruby text box.  When it
  * returns, |aIter| points to the first item it doesn't wrap.
  */
 void
 nsCSSFrameConstructor::WrapItemsInPseudoRubyLeafBox(
   FCItemIterator& aIter,
   nsStyleContext* aParentStyle, nsIContent* aParentContent)
 {
-  uint_fast8_t parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
+  StyleDisplay parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
   ParentType parentType, wrapperType;
   if (parentDisplay == StyleDisplay::RubyTextContainer) {
     parentType = eTypeRubyTextContainer;
     wrapperType = eTypeRubyText;
   } else {
     MOZ_ASSERT(parentDisplay == StyleDisplay::RubyBaseContainer);
     parentType = eTypeRubyBaseContainer;
     wrapperType = eTypeRubyBase;
@@ -10368,17 +10368,17 @@ void
 nsCSSFrameConstructor::WrapItemsInPseudoParent(nsIContent* aParentContent,
                                                nsStyleContext* aParentStyle,
                                                ParentType aWrapperType,
                                                FCItemIterator& aIter,
                                                const FCItemIterator& aEndIter)
 {
   const PseudoParentData& pseudoData = sPseudoParentData[aWrapperType];
   nsIAtom* pseudoType = *pseudoData.mPseudoType;
-  uint8_t parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
+  StyleDisplay parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
 
   if (pseudoType == nsCSSAnonBoxes::table &&
       (parentDisplay == StyleDisplay::Inline ||
        parentDisplay == StyleDisplay::RubyBase ||
        parentDisplay == StyleDisplay::RubyText)) {
     pseudoType = nsCSSAnonBoxes::inlineTable;
   }
 
@@ -10437,17 +10437,17 @@ void nsCSSFrameConstructor::CreateNeeded
     nsIFrame* aParentFrame)
 {
   if (aItems.IsEmpty() ||
       GetParentType(aParentFrame) != eTypeRuby) {
     return;
   }
 
   FCItemIterator iter(aItems);
-  int firstDisplay = iter.item().mStyleContext->StyleDisplay()->mDisplay;
+  StyleDisplay firstDisplay = iter.item().mStyleContext->StyleDisplay()->mDisplay;
   if (firstDisplay == StyleDisplay::RubyBaseContainer) {
     return;
   }
   NS_ASSERTION(firstDisplay == StyleDisplay::RubyTextContainer,
                "Child of ruby frame should either a rbc or a rtc");
 
   const PseudoParentData& pseudoData =
     sPseudoParentData[eTypeRubyBaseContainer];
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -1187,17 +1187,17 @@ private:
     eRubyInterSegmentWhitespace
   };
 
   /**
    * Function to compute the whitespace type according to the display
    * values of the previous and the next elements.
    */
   static inline RubyWhitespaceType ComputeRubyWhitespaceType(
-    uint_fast8_t aPrevDisplay, uint_fast8_t aNextDisplay);
+    mozilla::StyleDisplay aPrevDisplay, mozilla::StyleDisplay aNextDisplay);
 
   /**
    * Function to interpret the type of whitespace between
    * |aStartIter| and |aEndIter|.
    */
   static inline RubyWhitespaceType InterpretRubyWhitespace(
     nsFrameConstructorState& aState,
     const FCItemIterator& aStartIter, const FCItemIterator& aEndIter);
@@ -1941,17 +1941,17 @@ private:
    *          already known, UNSET_DISPLAY otherwise. It will be filled in
    *          if needed.
    * @param aParentFrame the nearest ancestor frame, used internally for
    *          finding ::after / ::before frames
    * @param aPrevSibling true if we're searching in reverse DOM order
    */
   nsIFrame* FindFrameForContentSibling(nsIContent* aContent,
                                        nsIContent* aTargetContent,
-                                       uint8_t& aTargetContentDisplay,
+                                       mozilla::StyleDisplay& aTargetContentDisplay,
                                        nsContainerFrame* aParentFrame,
                                        bool aPrevSibling);
 
   /**
    * Find the frame for the content immediately preceding the one aIter
    * points to, following continuations if necessary.  aIter is passed by
    * value on purpose, so as not to modify the caller's iterator.
    *
@@ -1961,17 +1961,17 @@ private:
    * @param aTargetContentDisplay the CSS display enum for aTargetContent if
    *          already known, UNSET_DISPLAY otherwise. It will be filled in
    *          if needed.
    * @param aParentFrame the nearest ancestor frame, used inernally for
    *          finding ::after / ::before frames
    */
   nsIFrame* FindPreviousSibling(mozilla::dom::FlattenedChildIterator aIter,
                                 nsIContent* aTargetContent,
-                                uint8_t& aTargetContentDisplay,
+                                mozilla::StyleDisplay& aTargetContentDisplay,
                                 nsContainerFrame* aParentFrame);
 
   /**
    * Find the frame for the content node immediately following the one aIter
    * points to, following continuations if necessary.  aIter is passed by value
    * on purpose, so as not to modify the caller's iterator.
    *
    * @param aIter should be positioned such that aIter.GetNextChild()
@@ -1980,17 +1980,17 @@ private:
    * @param aTargetContentDisplay the CSS display enum for aTargetContent if
    *          already known, UNSET_DISPLAY otherwise. It will be filled in
    *          if needed.
    * @param aParentFrame the nearest ancestor frame, used inernally for
    *          finding ::after / ::before frames
    */
   nsIFrame* FindNextSibling(mozilla::dom::FlattenedChildIterator aIter,
                             nsIContent* aTargetContent,
-                            uint8_t& aTargetContentDisplay,
+                            mozilla::StyleDisplay& aTargetContentDisplay,
                             nsContainerFrame* aParentFrame);
 
   // Find the right previous sibling for an insertion.  This also updates the
   // parent frame to point to the correct continuation of the parent frame to
   // use, and returns whether this insertion is to be treated as an append.
   // aChild is the child being inserted.
   // aIsRangeInsertSafe returns whether it is safe to do a range insert with
   // aChild being the first child in the range. It is the callers'
@@ -2014,18 +2014,18 @@ private:
    */
   nsContainerFrame* GetContentInsertionFrameFor(nsIContent* aContent);
 
   // see if aContent and aSibling are legitimate siblings due to restrictions
   // imposed by table columns
   // XXXbz this code is generally wrong, since the frame for aContent
   // may be constructed based on tag, not based on aDisplay!
   bool IsValidSibling(nsIFrame*              aSibling,
-                        nsIContent*            aContent,
-                        uint8_t&               aDisplay);
+                      nsIContent*            aContent,
+                      mozilla::StyleDisplay& aDisplay);
 
   void QuotesDirty() {
     NS_PRECONDITION(mUpdateCount != 0, "Instant quote updates are bad news");
     mQuotesDirty = true;
     mDocument->SetNeedLayoutFlush();
   }
 
   void CountersDirty() {
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -2978,13 +2978,13 @@ ReflowInput::SetTruncated(const ReflowOu
 }
 
 bool
 ReflowInput::IsFloating() const
 {
   return mStyleDisplay->IsFloating(mFrame);
 }
 
-uint8_t
+mozilla::StyleDisplay
 ReflowInput::GetDisplay() const
 {
   return mStyleDisplay->GetDisplay(mFrame);
 }
--- a/layout/generic/ReflowInput.h
+++ b/layout/generic/ReflowInput.h
@@ -583,17 +583,17 @@ public:
   const nsStyleMargin*     mStyleMargin;
   MOZ_INIT_OUTSIDE_CTOR
   const nsStylePadding*    mStylePadding;
   MOZ_INIT_OUTSIDE_CTOR
   const nsStyleText*       mStyleText;
 
   bool IsFloating() const;
 
-  uint8_t GetDisplay() const;
+  mozilla::StyleDisplay GetDisplay() const;
 
   // a frame (e.g. nsTableCellFrame) which may need to generate a special 
   // reflow for percent bsize calculations
   nsIPercentBSizeObserver* mPercentBSizeObserver;
 
   // CSS margin collapsing sometimes requires us to reflow
   // optimistically assuming that margins collapse to see if clearance
   // is required. When we discover that clearance is required, we
--- 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 == StyleDisplay::None_ ||
-      display == StyleDisplay::Contents) {
+  if (display == mozilla::StyleDisplay::None_ ||
+      display == mozilla::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 (StyleDisplay::ListItem == styleDisplay->mDisplay) {
+    if (mozilla::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 (StyleDisplay::Table != floatDisplay->mDisplay ||
+  if (mozilla::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
@@ -6884,17 +6884,17 @@ nsBlockFrame::SetInitialChildList(ChildL
     nsIFrame* possibleListItem = this;
     while (1) {
       nsIFrame* parent = possibleListItem->GetParent();
       if (parent->GetContent() != GetContent()) {
         break;
       }
       possibleListItem = parent;
     }
-    if (StyleDisplay::ListItem ==
+    if (mozilla::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 ==
-                 StyleDisplay::ListItem && HasOutsideBullet(),
+               mozilla::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 (StyleDisplay::ListItem == display->mDisplay) {
+  if (mozilla::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;
@@ -7152,18 +7152,17 @@ nsBlockFrame::RenumberListsFor(nsPresCon
       // itself (ASSUMED!) not to be a counter-resetter.
       bool meToo = RenumberListsInBlock(aPresContext, listItem, aOrdinal,
                                         aDepth + 1, aIncrement,
                                         aForCounting);
       if (meToo) {
         kidRenumberedABullet = true;
       }
     }
-  }
-  else if (StyleDisplay::Block == display->mDisplay) {
+  } else if (mozilla::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 == StyleDisplay::WebkitBox ||
-    aStyleDisp->mDisplay == StyleDisplay::WebkitInlineBox;
+  return aStyleDisp->mDisplay == mozilla::StyleDisplay::WebkitBox ||
+    aStyleDisp->mDisplay == mozilla::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 == StyleDisplay::Block) {
+  if (aStyleDisp->mDisplay == mozilla::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
@@ -10792,20 +10792,21 @@ ReflowInput::DisplayInitFrameTypeExit(ns
       "table-column", "table-column-group", "table-header-group",
       "table-footer-group", "table-row", "table-cell", "table-caption",
       "box", "inline-box",
 #ifdef MOZ_XUL
       "grid", "inline-grid", "grid-group", "grid-line", "stack",
       "inline-stack", "deck", "popup", "groupbox",
 #endif
     };
-    if (disp->mDisplay >= ArrayLength(displayTypes))
-      printf(" display=%u", disp->mDisplay);
+    const uint32_t display = static_cast<uint32_t>(disp->mDisplay);
+    if (display >= ArrayLength(displayTypes))
+      printf(" display=%u", display);
     else
-      printf(" display=%s", displayTypes[disp->mDisplay]);
+      printf(" display=%s", displayTypes[display]);
 
     // This array must exactly match the NS_CSS_FRAME_TYPE constants.
     const char *const cssFrameTypes[] = {
       "unknown", "inline", "block", "floating", "absolute", "internal-table"
     };
     nsCSSFrameType bareType = NS_FRAME_GET_TYPE(aState->mFrameType);
     bool repNoBlock = NS_FRAME_IS_REPLACED_NOBLOCK(aState->mFrameType);
     bool repBlock = NS_FRAME_IS_REPLACED_CONTAINS_BLOCK(aState->mFrameType);
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -3167,17 +3167,17 @@ public:
   /**
    * @return true if this frame is used as a table caption.
    */
   inline bool IsTableCaption() const;
 
   inline bool IsBlockInside() const;
   inline bool IsBlockOutside() const;
   inline bool IsInlineOutside() const;
-  inline uint8_t GetDisplay() const;
+  inline mozilla::StyleDisplay GetDisplay() const;
   inline bool IsFloating() const;
   inline bool IsAbsPosContainingBlock() const;
   inline bool IsFixedPosContainingBlock() const;
   inline bool IsRelativelyPositioned() const;
   inline bool IsAbsolutelyPositioned() const;
 
   /**
    * Returns the vertical-align value to be used for layout, if it is one
--- 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 == StyleDisplay::TableCaption &&
+  return StyleDisplay()->mDisplay == mozilla::StyleDisplay::TableCaption &&
     GetParent()->StyleContext()->GetPseudo() == nsCSSAnonBoxes::tableWrapper;
 }
 
 bool
 nsIFrame::IsFloating() const
 {
   return StyleDisplay()->IsFloating(this);
 }
@@ -85,15 +85,15 @@ nsIFrame::IsBlockOutside() const
 }
 
 bool
 nsIFrame::IsInlineOutside() const
 {
   return StyleDisplay()->IsInlineOutside(this);
 }
 
-uint8_t
+mozilla::StyleDisplay
 nsIFrame::GetDisplay() const
 {
   return StyleDisplay()->GetDisplay(this);
 }
 
 #endif
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5214,20 +5214,20 @@ nsTextFrame::GetTextDecorations(
           nsTextFrame::LineDecoration(f, baselineOffset, color, style));
       }
     }
 
     // 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 != StyleDisplay::Inline &&
+    mozilla::StyleDisplay display = f->GetDisplay();
+    if (display != mozilla::StyleDisplay::Inline &&
         (!nsStyleDisplay::IsRubyDisplayType(display) ||
-         display == StyleDisplay::RubyTextContainer) &&
+         display == mozilla::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/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -330,18 +330,19 @@ public:
                                                  flags,
                                                  mFrame->GetSkipSides());
 
     nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
   }
 };
 
 #ifdef DEBUG
-#define DEBUG_VERIFY_THAT_FRAME_IS(_frame, _expected) \
-  NS_ASSERTION(NS_STYLE_DISPLAY_##_expected == _frame->StyleDisplay()->mDisplay, "internal error");
+#define DEBUG_VERIFY_THAT_FRAME_IS(_frame, _expected)                              \
+  MOZ_ASSERT(mozilla::StyleDisplay::_expected == _frame->StyleDisplay()->mDisplay, \
+             "internal error");
 #else
 #define DEBUG_VERIFY_THAT_FRAME_IS(_frame, _expected)
 #endif
 
 static void
 ParseFrameAttribute(nsIFrame* aFrame,
                     nsIAtom* aAttribute,
                     bool aAllowMultiValues)
@@ -583,25 +584,25 @@ MapAllAttributesIntoCSS(nsMathMLmtableFr
   ParseSpacingAttributes(aTableFrame);
 
   // mtable is simple and only has one (pseudo) row-group
   nsIFrame* rgFrame = aTableFrame->PrincipalChildList().FirstChild();
   if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
     return;
 
   for (nsIFrame* rowFrame : rgFrame->PrincipalChildList()) {
-    DEBUG_VERIFY_THAT_FRAME_IS(rowFrame, TABLE_ROW);
+    DEBUG_VERIFY_THAT_FRAME_IS(rowFrame, TableRow);
     if (rowFrame->GetType() == nsGkAtoms::tableRowFrame) {
       // Map row rowalign.
       ParseFrameAttribute(rowFrame, nsGkAtoms::rowalign_, false);
       // Map row columnalign.
       ParseFrameAttribute(rowFrame, nsGkAtoms::columnalign_, true);
 
       for (nsIFrame* cellFrame : rowFrame->PrincipalChildList()) {
-        DEBUG_VERIFY_THAT_FRAME_IS(cellFrame, TABLE_CELL);
+        DEBUG_VERIFY_THAT_FRAME_IS(cellFrame, TableCell);
         if (IS_TABLE_CELL(cellFrame->GetType())) {
           // Map cell rowalign.
           ParseFrameAttribute(cellFrame, nsGkAtoms::rowalign_, false);
           // Map row columnalign.
           ParseFrameAttribute(cellFrame, nsGkAtoms::columnalign_, false);
         }
       }
     }
@@ -802,17 +803,17 @@ nsMathMLmtableWrapperFrame::GetRowFrameA
     nsIFrame* tableFrame = mFrames.FirstChild();
     NS_ASSERTION(tableFrame && tableFrame->GetType() == nsGkAtoms::tableFrame,
                  "should always have an inner table frame");
     nsIFrame* rgFrame = tableFrame->PrincipalChildList().FirstChild();
     if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
       return nullptr;
     for (nsIFrame* rowFrame : rgFrame->PrincipalChildList()) {
       if (aRowIndex == 0) {
-        DEBUG_VERIFY_THAT_FRAME_IS(rowFrame, TABLE_ROW);
+        DEBUG_VERIFY_THAT_FRAME_IS(rowFrame, TableRow);
         if (rowFrame->GetType() != nsGkAtoms::tableRowFrame)
           return nullptr;
 
         return rowFrame;
       }
       --aRowIndex;
     }
   }
--- 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 == StyleDisplay::Inline &&
+    if (displayData->mDisplay == mozilla::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 == StyleDisplay::Inline &&
+    if (displayData->mDisplay == mozilla::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
@@ -189,17 +189,17 @@ nsRuleNode::ChildrenHashOps = {
 //    CSS21 says that position/float do not convert 'list-item' to 'block',
 //    but it explicitly does not define whether 'list-item' should be
 //    converted to block *on the root node*. To allow for flexibility
 //    (so that we don't have to support a list-item root node), this method
 //    lets the caller pick either behavior, using the 'aConvertListItem' arg.
 //    Reference: http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo
 /* static */
 void
-nsRuleNode::EnsureBlockDisplay(uint8_t& display,
+nsRuleNode::EnsureBlockDisplay(StyleDisplay& display,
                                bool aConvertListItem /* = false */)
 {
   // see if the display value is already a block
   switch (display) {
   case StyleDisplay::ListItem :
     if (aConvertListItem) {
       display = StyleDisplay::Block;
       break;
@@ -235,28 +235,28 @@ nsRuleNode::EnsureBlockDisplay(uint8_t& 
     display = StyleDisplay::WebkitBox;
     break;
 
   case StyleDisplay::InlineGrid:
     // make inline grid containers into grid containers
     display = StyleDisplay::Grid;
     break;
 
-  default :
+  default:
     // make it a 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)
+nsRuleNode::EnsureInlineDisplay(StyleDisplay& display)
 {
   // see if the display value is already inline
   switch (display) {
     case StyleDisplay::Block :
       display = StyleDisplay::InlineBlock;
       break;
     case StyleDisplay::Table :
       display = StyleDisplay::InlineTable;
@@ -271,16 +271,18 @@ nsRuleNode::EnsureInlineDisplay(uint8_t&
       display = StyleDisplay::InlineGrid;
       break;
     case StyleDisplay::Box:
       display = StyleDisplay::InlineBox;
       break;
     case StyleDisplay::Stack:
       display = StyleDisplay::InlineStack;
       break;
+    default:
+      ; // Nothing
   }
 }
 
 static nscoord CalcLengthWith(const nsCSSValue& aValue,
                               nscoord aFontSize,
                               const nsStyleFont* aStyleFont,
                               nsStyleContext* aStyleContext,
                               nsPresContext* aPresContext,
@@ -1340,16 +1342,21 @@ struct SetEnumValueHelper
   DEFINE_ENUM_CLASS_SETTER(StyleBoxOrient, Horizontal, Vertical)
   DEFINE_ENUM_CLASS_SETTER(StyleBoxPack, Start, Justify)
   DEFINE_ENUM_CLASS_SETTER(StyleBoxSizing, Content, Border)
   DEFINE_ENUM_CLASS_SETTER(StyleFillRule, Nonzero, Evenodd)
   DEFINE_ENUM_CLASS_SETTER(StyleFloat, None_, InlineEnd)
   DEFINE_ENUM_CLASS_SETTER(StyleFloatEdge, ContentBox, MarginBox)
   DEFINE_ENUM_CLASS_SETTER(StyleUserFocus, None_, SelectMenu)
   DEFINE_ENUM_CLASS_SETTER(StyleUserSelect, None_, MozText)
+#ifdef MOZ_XUL
+  DEFINE_ENUM_CLASS_SETTER(StyleDisplay, None_, Popup)
+#else
+  DEFINE_ENUM_CLASS_SETTER(StyleDisplay, None_, InlineBox)
+#endif
 
 #undef DEF_SET_ENUMERATED_VALUE
 };
 
 template<typename FieldT>
 struct SetIntegerValueHelper
 {
   static void SetIntegerValue(FieldT& aField, const nsCSSValue& aValue)
@@ -6197,16 +6204,18 @@ nsRuleNode::ComputeDisplayData(void* aSt
           display->mDisplay = StyleDisplay::Grid;
           conditions.SetUncacheable();
           break;
         case StyleDisplay::Flex:
         case StyleDisplay::InlineFlex:
           display->mDisplay = StyleDisplay::Flex;
           conditions.SetUncacheable();
           break;
+        default:
+          ; // Nothing
       }
     }
 
     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 = StyleDisplay::Inline;
--- a/layout/style/nsRuleNode.h
+++ b/layout/style/nsRuleNode.h
@@ -787,19 +787,19 @@ private:
   nsRuleNode(nsPresContext* aPresContext, nsRuleNode* aParent,
              nsIStyleRule* aRule, mozilla::SheetType aLevel, bool aIsImportant);
   ~nsRuleNode();
 
 public:
   // This is infallible; it will never return nullptr.
   static already_AddRefed<nsRuleNode> CreateRootNode(nsPresContext* aPresContext);
 
-  static void EnsureBlockDisplay(uint8_t& display,
+  static void EnsureBlockDisplay(mozilla::StyleDisplay& display,
                                  bool aConvertListItem = false);
-  static void EnsureInlineDisplay(uint8_t& display);
+  static void EnsureInlineDisplay(mozilla::StyleDisplay& display);
 
   // Transition never returns null; on out of memory it'll just return |this|.
   nsRuleNode* Transition(nsIStyleRule* aRule, mozilla::SheetType aLevel,
                          bool aIsImportantRule);
   nsRuleNode* GetParent() const { return mParent; }
   bool IsRoot() const { return mParent == nullptr; }
 
   // Return the root of the rule tree that this rule node is in.
--- 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 == StyleDisplay::Inline ||
-        aParentDisplay->mDisplay == StyleDisplay::Contents ||
-        aParentDisplay->mDisplay == StyleDisplay::Ruby ||
-        aParentDisplay->mDisplay == StyleDisplay::RubyBaseContainer) {
+    if (aParentDisplay->mDisplay == mozilla::StyleDisplay::Inline ||
+        aParentDisplay->mDisplay == mozilla::StyleDisplay::Contents ||
+        aParentDisplay->mDisplay == mozilla::StyleDisplay::Ruby ||
+        aParentDisplay->mDisplay == mozilla::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 != StyleDisplay::RubyBaseContainer &&
-       aDisplay->mDisplay != StyleDisplay::RubyTextContainer) ||
+       aDisplay->mDisplay != mozilla::StyleDisplay::RubyBaseContainer &&
+       aDisplay->mDisplay != mozilla::StyleDisplay::RubyTextContainer) ||
       // Since ruby base and ruby text may exist themselves without any
       // non-anonymous frame outside, we should also check them.
-      aDisplay->mDisplay == StyleDisplay::RubyBase ||
-      aDisplay->mDisplay == StyleDisplay::RubyText) {
+      aDisplay->mDisplay == mozilla::StyleDisplay::RubyBase ||
+      aDisplay->mDisplay == mozilla::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 StyleDisplay::Flex == displayVal ||
-    StyleDisplay::InlineFlex == displayVal ||
-    StyleDisplay::Grid == displayVal ||
-    StyleDisplay::InlineGrid == displayVal;
+  return mozilla::StyleDisplay::Flex == displayVal ||
+    mozilla::StyleDisplay::InlineFlex == displayVal ||
+    mozilla::StyleDisplay::Grid == displayVal ||
+    mozilla::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 == StyleDisplay::None_) {
+      disp->mDisplay == mozilla::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 == StyleDisplay::Contents) {
+      while (containerDisp->mDisplay == mozilla::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 == StyleDisplay::Table) {
+  if (disp->mDisplay == mozilla::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)
@@ -800,24 +800,24 @@ nsStyleContext::ApplyStyleFixups(bool aS
   // CSS2.1 section 9.2.4 specifies fixups for the 'display' property of
   // 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 != StyleDisplay::Contents) {
+    auto displayVal = disp->mDisplay;
+    if (displayVal != mozilla::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 = StyleDisplay::Block;
+      displayVal = mozilla::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,32 +838,32 @@ 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 == StyleDisplay::Contents) {
+    while (containerDisp->mDisplay == mozilla::StyleDisplay::Contents) {
       if (!containerContext->GetParent()) {
         break;
       }
       containerContext = containerContext->GetParent();
       containerDisp = containerContext->StyleDisplay();
     }
     if (ShouldBlockifyChildren(containerDisp) &&
         !nsCSSAnonBoxes::IsNonElement(GetPseudo())) {
       // NOTE: Technically, we shouldn't modify the 'display' value of
       // positioned elements, since they aren't flex/grid items. However,
       // we don't need to worry about checking for that, because if we're
       // positioned, we'll have already been through a call to
       // EnsureBlockDisplay() in nsRuleNode, so this call here won't change
       // anything. So we're OK.
-      uint8_t displayVal = disp->mDisplay;
+      auto displayVal = disp->mDisplay;
       nsRuleNode::EnsureBlockDisplay(displayVal);
       if (displayVal != disp->mDisplay) {
         NS_ASSERTION(!disp->IsAbsolutelyPositionedStyle(),
                      "We shouldn't be changing the display value of "
                      "positioned content (and we should have already "
                      "converted its display value to be block-level...)");
         nsStyleDisplay* mutable_display = GET_UNIQUE_STYLE_DATA(Display);
         disp = mutable_display;
@@ -872,27 +872,27 @@ nsStyleContext::ApplyStyleFixups(bool aS
     }
   }
 
   // Note: This must come after the blockification above, otherwise we fail
   // the grid-item-blockifying-001.html reftest.
   if (mParent && ::ShouldSuppressLineBreak(this, disp, mParent,
                                            mParent->StyleDisplay())) {
     mBits |= NS_STYLE_SUPPRESS_LINEBREAK;
-    uint8_t displayVal = disp->mDisplay;
+    auto displayVal = disp->mDisplay;
     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 == StyleDisplay::RubyBaseContainer ||
-      disp->mDisplay == StyleDisplay::RubyTextContainer) {
+  if (disp->mDisplay == mozilla::StyleDisplay::RubyBaseContainer ||
+      disp->mDisplay == mozilla::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 == StyleDisplay::Inline &&
+  if (disp->mDisplay == mozilla::StyleDisplay::Inline &&
       !nsCSSAnonBoxes::IsNonElement(mPseudoTag) &&
       mParent) {
     auto cbContext = mParent;
-    while (cbContext->StyleDisplay()->mDisplay == StyleDisplay::Contents) {
+    while (cbContext->StyleDisplay()->mDisplay == mozilla::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 =
-        StyleDisplay::InlineBlock;
+        mozilla::StyleDisplay::InlineBlock;
     }
   }
 
   // Compute User Interface style, to trigger loads of cursors
   StyleUserInterface();
 #undef GET_UNIQUE_STYLE_DATA
 }
 
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2820,18 +2820,18 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
     // sometimes handled for descendants as hints not handled for
     // descendants.
     return nsChangeHint(0);
   }
 
   // We guarantee that if mBinding is non-null, so are mBinding->GetURI() and
   // mBinding->mOriginPrincipal.
   RefPtr<mozilla::css::URLValue> mBinding;    // [reset]
-  uint8_t mDisplay;             // [reset] see nsStyleConsts.h NS_STYLE_DISPLAY_*
-  uint8_t mOriginalDisplay;     // [reset] saved mDisplay for position:absolute/fixed
+  mozilla::StyleDisplay mDisplay;             // [reset] see nsStyleConsts.h SyleDisplay
+  mozilla::StyleDisplay mOriginalDisplay;     // [reset] saved mDisplay for position:absolute/fixed
                                 //         and float:left/right; otherwise equal
                                 //         to mDisplay
   uint8_t mContain;             // [reset] see nsStyleConsts.h NS_STYLE_CONTAIN_*
   uint8_t mAppearance;          // [reset]
   uint8_t mPosition;            // [reset] see nsStyleConsts.h
 
   // [reset] See StyleFloat in nsStyleConsts.h.
   mozilla::StyleFloat mFloat;
@@ -2900,69 +2900,69 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
            mAnimationDirectionCount,
            mAnimationFillModeCount,
            mAnimationPlayStateCount,
            mAnimationIterationCountCount;
 
   mozilla::StyleShapeOutside mShapeOutside; // [reset]
 
   bool IsBlockInsideStyle() const {
-    return StyleDisplay::Block == mDisplay ||
-           StyleDisplay::ListItem == mDisplay ||
-           StyleDisplay::InlineBlock == mDisplay ||
-           StyleDisplay::TableCaption == mDisplay;
+    return mozilla::StyleDisplay::Block == mDisplay ||
+           mozilla::StyleDisplay::ListItem == mDisplay ||
+           mozilla::StyleDisplay::InlineBlock == mDisplay ||
+           mozilla::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 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 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;
+    return mozilla::StyleDisplay::Block == mDisplay ||
+           mozilla::StyleDisplay::Flex == mDisplay ||
+           mozilla::StyleDisplay::WebkitBox == mDisplay ||
+           mozilla::StyleDisplay::Grid == mDisplay ||
+           mozilla::StyleDisplay::ListItem == mDisplay ||
+           mozilla::StyleDisplay::Table == mDisplay;
+  }
+
+  static bool IsDisplayTypeInlineOutside(mozilla::StyleDisplay aDisplay) {
+    return mozilla::StyleDisplay::Inline == aDisplay ||
+           mozilla::StyleDisplay::InlineBlock == aDisplay ||
+           mozilla::StyleDisplay::InlineTable == aDisplay ||
+           mozilla::StyleDisplay::InlineBox == aDisplay ||
+           mozilla::StyleDisplay::InlineFlex == aDisplay ||
+           mozilla::StyleDisplay::WebkitInlineBox == aDisplay ||
+           mozilla::StyleDisplay::InlineGrid == aDisplay ||
+           mozilla::StyleDisplay::InlineXulGrid == aDisplay ||
+           mozilla::StyleDisplay::InlineStack == aDisplay ||
+           mozilla::StyleDisplay::Ruby == aDisplay ||
+           mozilla::StyleDisplay::RubyBase == aDisplay ||
+           mozilla::StyleDisplay::RubyBaseContainer == aDisplay ||
+           mozilla::StyleDisplay::RubyText == aDisplay ||
+           mozilla::StyleDisplay::RubyTextContainer == aDisplay ||
+           mozilla::StyleDisplay::Contents == aDisplay;
   }
 
   bool IsInlineOutsideStyle() const {
     return IsDisplayTypeInlineOutside(mDisplay);
   }
 
   bool IsOriginalDisplayInlineOutsideStyle() const {
     return IsDisplayTypeInlineOutside(mOriginalDisplay);
   }
 
   bool IsInnerTableStyle() const {
-    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;
+    return mozilla::StyleDisplay::TableCaption == mDisplay ||
+           mozilla::StyleDisplay::TableCell == mDisplay ||
+           mozilla::StyleDisplay::TableRow == mDisplay ||
+           mozilla::StyleDisplay::TableRowGroup == mDisplay ||
+           mozilla::StyleDisplay::TableHeaderGroup == mDisplay ||
+           mozilla::StyleDisplay::TableFooterGroup == mDisplay ||
+           mozilla::StyleDisplay::TableColumn == mDisplay ||
+           mozilla::StyleDisplay::TableColumnGroup == mDisplay;
   }
 
   bool IsFloatingStyle() const {
     return mozilla::StyleFloat::None_ != mFloat;
   }
 
   bool IsAbsolutelyPositionedStyle() const {
     return NS_STYLE_POSITION_ABSOLUTE == mPosition ||
@@ -2973,22 +2973,22 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
     return NS_STYLE_POSITION_RELATIVE == mPosition ||
            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 StyleDisplay::Ruby == aDisplay ||
-           StyleDisplay::RubyBase == aDisplay ||
-           StyleDisplay::RubyBaseContainer == aDisplay ||
-           StyleDisplay::RubyText == aDisplay ||
-           StyleDisplay::RubyTextContainer == aDisplay;
+  static bool IsRubyDisplayType(mozilla::StyleDisplay aDisplay) {
+    return mozilla::StyleDisplay::Ruby == aDisplay ||
+           mozilla::StyleDisplay::RubyBase == aDisplay ||
+           mozilla::StyleDisplay::RubyBaseContainer == aDisplay ||
+           mozilla::StyleDisplay::RubyText == aDisplay ||
+           mozilla::StyleDisplay::RubyTextContainer == aDisplay;
   }
 
   bool IsRubyDisplayType() const {
     return IsRubyDisplayType(mDisplay);
   }
 
   bool IsOutOfFlowStyle() const {
     return (IsAbsolutelyPositionedStyle() || IsFloatingStyle());
@@ -3026,17 +3026,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   // The aContextFrame argument on each of these is the frame this
   // style struct is for.  If the frame is for SVG text, the return
   // value will be massaged to be something that makes sense for
   // SVG text.
   inline bool IsBlockInside(const nsIFrame* aContextFrame) const;
   inline bool IsBlockOutside(const nsIFrame* aContextFrame) const;
   inline bool IsInlineOutside(const nsIFrame* aContextFrame) const;
   inline bool IsOriginalDisplayInlineOutside(const nsIFrame* aContextFrame) const;
-  inline uint8_t GetDisplay(const nsIFrame* aContextFrame) const;
+  inline mozilla::StyleDisplay GetDisplay(const nsIFrame* aContextFrame) const;
   inline bool IsFloating(const nsIFrame* aContextFrame) const;
   inline bool IsRelativelyPositioned(const nsIFrame* aContextFrame) const;
   inline bool IsAbsolutelyPositioned(const nsIFrame* aContextFrame) const;
 
   // These methods are defined in nsStyleStructInlines.h.
 
   /**
    * Returns whether the element is a containing block for its
--- a/layout/style/nsStyleStructInlines.h
+++ b/layout/style/nsStyleStructInlines.h
@@ -109,25 +109,23 @@ nsStyleDisplay::IsOriginalDisplayInlineO
 {
   NS_ASSERTION(aContextFrame->StyleDisplay() == this, "unexpected aContextFrame");
   if (aContextFrame->IsSVGText()) {
     return aContextFrame->GetType() != nsGkAtoms::blockFrame;
   }
   return IsOriginalDisplayInlineOutsideStyle();
 }
 
-uint8_t
+mozilla::StyleDisplay
 nsStyleDisplay::GetDisplay(const nsIFrame* aContextFrame) const
 {
   NS_ASSERTION(aContextFrame->StyleDisplay() == this, "unexpected aContextFrame");
-  if (aContextFrame->IsSVGText() &&
-      mDisplay != StyleDisplay::None_) {
+  if (aContextFrame->IsSVGText() && mDisplay != mozilla::StyleDisplay::None_) {
     return aContextFrame->GetType() == nsGkAtoms::blockFrame ?
-             StyleDisplay::Block :
-             StyleDisplay::Inline;
+             mozilla::StyleDisplay::Block : mozilla::StyleDisplay::Inline;
   }
   return mDisplay;
 }
 
 bool
 nsStyleDisplay::IsFloating(const nsIFrame* aContextFrame) const
 {
   NS_ASSERTION(aContextFrame->StyleDisplay() == this, "unexpected aContextFrame");
--- 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 (StyleDisplay::TableColumn ==
+    if (mozilla::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 (StyleDisplay::TableColumnGroup == childDisplay->mDisplay) {
+    if (mozilla::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 (StyleDisplay::TableRow==rows.get()->StyleDisplay()->mDisplay) {
+        if (mozilla::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 (StyleDisplay::TableColumn ==
+      if (mozilla::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 (StyleDisplay::TableColumn ==
+      if (mozilla::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 (StyleDisplay::TableHeaderGroup == childDisplay->mDisplay) {
+    if (mozilla::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 (StyleDisplay::TableFooterGroup == childDisplay->mDisplay) {
+    } else if (mozilla::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 (StyleDisplay::TableRowGroup == childDisplay->mDisplay) {
+    } else if (mozilla::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 (StyleDisplay::TableColumn == colDisplay->mDisplay) {
+      if (mozilla::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 (StyleDisplay::TableColumnGroup == display->mDisplay) {
+    if (mozilla::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 == StyleDisplay::TableColumnGroup) {
+      if (display->mDisplay == mozilla::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 = StyleDisplay::TableColumnGroup == display->mDisplay;
+  bool isColGroup = mozilla::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 == StyleDisplay::TableColumnGroup),
+               (nextDisplay == mozilla::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 == StyleDisplay::TableColumnGroup) !=
-        (prevDisplay->mDisplay == StyleDisplay::TableColumnGroup)) {
+    if ((display->mDisplay == mozilla::StyleDisplay::TableColumnGroup) !=
+        (prevDisplay->mDisplay == mozilla::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 (StyleDisplay::TableColumnGroup == display->mDisplay) {
+  if (mozilla::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 ||
-               StyleDisplay::TableColumnGroup !=
+               mozilla::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 StyleDisplay::TableHeaderGroup:
+    case mozilla::StyleDisplay::TableHeaderGroup:
       if (head) { // treat additional thead like tbody
         aChildren.AppendElement(rowGroup);
       }
       else {
         head = rowGroup;
       }
       break;
-    case StyleDisplay::TableFooterGroup:
+    case mozilla::StyleDisplay::TableFooterGroup:
       if (foot) { // treat additional tfoot like tbody
         aChildren.AppendElement(rowGroup);
       }
       else {
         foot = rowGroup;
       }
       break;
-    case StyleDisplay::TableRowGroup:
+    case mozilla::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 ==
-          StyleDisplay::TableHeaderGroup) {
+          mozilla::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 ==
-          StyleDisplay::TableFooterGroup) {
+          mozilla::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,19 @@ 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 = (StyleDisplay::TableHeaderGroup == display->mDisplay);
-      }
-      else {
-        mIsRepeatedFooter = (StyleDisplay::TableFooterGroup == display->mDisplay);
+        mIsRepeatedHeader = (mozilla::StyleDisplay::TableHeaderGroup == display->mDisplay);
+      } else {
+        mIsRepeatedFooter = (mozilla::StyleDisplay::TableFooterGroup == display->mDisplay);
       }
     }
   }
   else {
     mAtEnd = true;
   }
   return !mAtEnd;
 }
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -258,17 +258,17 @@ public:
   static nsIFrame* GetFrameAtOrBefore(nsIFrame*       aParentFrame,
                                       nsIFrame*       aPriorChildFrame,
                                       nsIAtom*        aChildType);
   bool IsAutoBSize(mozilla::WritingMode aWM);
 
   /** @return true if aDisplayType represents a rowgroup of any sort
     * (header, footer, or body)
     */
-  bool IsRowGroup(int32_t aDisplayType) const;
+  bool IsRowGroup(mozilla::StyleDisplay aDisplayType) const;
 
   virtual const nsFrameList& GetChildList(ChildListID aListID) const override;
   virtual void GetChildLists(nsTArray<ChildList>* aLists) const override;
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists) override;
 
@@ -878,21 +878,21 @@ protected:
   } mBits;
 
   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
+inline bool nsTableFrame::IsRowGroup(mozilla::StyleDisplay aDisplayType) const
 {
-  return bool((StyleDisplay::TableHeaderGroup == aDisplayType) ||
-                (StyleDisplay::TableFooterGroup == aDisplayType) ||
-                (StyleDisplay::TableRowGroup    == aDisplayType));
+  return mozilla::StyleDisplay::TableHeaderGroup == aDisplayType ||
+         mozilla::StyleDisplay::TableFooterGroup == aDisplayType ||
+         mozilla::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(StyleDisplay::TableRow == StyleDisplay()->mDisplay,
+  NS_ASSERTION(mozilla::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,18 @@ nsTableRowFrame::GetType() const
 
 nsTableRowFrame*
 nsTableRowFrame::GetNextRow() const
 {
   nsIFrame* childFrame = GetNextSibling();
   while (childFrame) {
     nsTableRowFrame *rowFrame = do_QueryFrame(childFrame);
     if (rowFrame) {
-	  NS_ASSERTION(StyleDisplay::TableRow == childFrame->StyleDisplay()->mDisplay, "wrong display type on rowframe");
+	  NS_ASSERTION(mozilla::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 ==
-                   StyleDisplay::TableRow,
+                 mozilla::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 (StyleDisplay::TableRow==rowFrame->StyleDisplay()->mDisplay) {
+    if (mozilla::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(StyleDisplay::TableRow ==
+      NS_ASSERTION(mozilla::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(StyleDisplay::TableRow ==
+      NS_ASSERTION(mozilla::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 != StyleDisplay::Popup) {
+        StyleDisplay()->mDisplay != mozilla::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