Bug 1361051: rename mozilla::FrameType to mozilla::LayoutFrameType. r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 01 May 2017 19:32:52 +0200
changeset 356045 fbc54f707dc421f8132340e45fa2719dbdc9621b
parent 356044 151963610e799364d0e12af286f6201e5947d625
child 356046 da7e654620e61fa405c11ff49977cef93d2cb23d
push id89829
push userkwierso@gmail.com
push dateWed, 03 May 2017 00:40:08 +0000
treeherdermozilla-inbound@1325e2a34dfc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1361051
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1361051: rename mozilla::FrameType to mozilla::LayoutFrameType. r=xidorn This avoids conflicts with mozilla::dom::FrameType. MozReview-Commit-ID: 7aEMbHRaTFk
accessible/base/nsAccessibilityService.cpp
accessible/generic/Accessible.cpp
dom/base/Element.cpp
dom/base/nsFocusManager.cpp
dom/base/nsRange.cpp
dom/events/EventStateManager.cpp
dom/html/nsGenericHTMLElement.cpp
dom/svg/SVGTextContentElement.cpp
layout/base/AccessibleCaretManager.cpp
layout/base/GeckoRestyleManager.cpp
layout/base/PresShell.cpp
layout/base/RestyleManager.cpp
layout/base/nsBidiPresUtils.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/base/nsCaret.cpp
layout/base/nsDocumentViewer.cpp
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/forms/nsColorControlFrame.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsDateTimeControlFrame.cpp
layout/forms/nsFieldSetFrame.cpp
layout/forms/nsFormControlFrame.cpp
layout/forms/nsGfxButtonControlFrame.cpp
layout/forms/nsHTMLButtonControlFrame.cpp
layout/forms/nsHTMLButtonControlFrame.h
layout/forms/nsImageControlFrame.cpp
layout/forms/nsLegendFrame.h
layout/forms/nsListControlFrame.cpp
layout/forms/nsMeterFrame.cpp
layout/forms/nsNumberControlFrame.cpp
layout/forms/nsProgressFrame.cpp
layout/forms/nsRangeFrame.cpp
layout/forms/nsTextControlFrame.cpp
layout/generic/BRFrame.cpp
layout/generic/DetailsFrame.cpp
layout/generic/ReflowInput.cpp
layout/generic/ReflowInput.h
layout/generic/RubyUtils.h
layout/generic/TextOverflow.cpp
layout/generic/TextOverflow.h
layout/generic/ViewportFrame.h
layout/generic/nsAbsoluteContainingBlock.cpp
layout/generic/nsAtomicContainerFrame.h
layout/generic/nsBackdropFrame.h
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockFrame.h
layout/generic/nsBlockReflowContext.cpp
layout/generic/nsBulletFrame.h
layout/generic/nsCanvasFrame.h
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsContainerFrame.h
layout/generic/nsFirstLetterFrame.h
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFlexContainerFrame.h
layout/generic/nsFontInflationData.cpp
layout/generic/nsFrame.cpp
layout/generic/nsFrame.h
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGfxScrollFrame.h
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsGridContainerFrame.h
layout/generic/nsHTMLCanvasFrame.h
layout/generic/nsIFrame.h
layout/generic/nsImageFrame.cpp
layout/generic/nsImageFrame.h
layout/generic/nsInlineFrame.cpp
layout/generic/nsInlineFrame.h
layout/generic/nsLeafFrame.h
layout/generic/nsLineLayout.cpp
layout/generic/nsPageContentFrame.h
layout/generic/nsPageFrame.cpp
layout/generic/nsPlaceholderFrame.h
layout/generic/nsPluginFrame.cpp
layout/generic/nsRubyBaseContainerFrame.h
layout/generic/nsRubyBaseFrame.h
layout/generic/nsRubyContentFrame.h
layout/generic/nsRubyFrame.h
layout/generic/nsRubyTextContainerFrame.h
layout/generic/nsRubyTextFrame.h
layout/generic/nsSimplePageSequenceFrame.cpp
layout/generic/nsSplittableFrame.h
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsTextFrame.cpp
layout/generic/nsTextFrame.h
layout/generic/nsVideoFrame.cpp
layout/mathml/nsMathMLContainerFrame.h
layout/painting/nsCSSRendering.cpp
layout/painting/nsDisplayList.cpp
layout/style/nsComputedDOMStyle.cpp
layout/svg/SVGFEContainerFrame.cpp
layout/svg/SVGFEImageFrame.cpp
layout/svg/SVGFELeafFrame.cpp
layout/svg/SVGFEUnstyledLeafFrame.cpp
layout/svg/SVGGeometryFrame.cpp
layout/svg/SVGGeometryFrame.h
layout/svg/SVGTextFrame.cpp
layout/svg/SVGTextFrame.h
layout/svg/SVGViewFrame.cpp
layout/svg/nsSVGAFrame.cpp
layout/svg/nsSVGClipPathFrame.cpp
layout/svg/nsSVGClipPathFrame.h
layout/svg/nsSVGContainerFrame.cpp
layout/svg/nsSVGContainerFrame.h
layout/svg/nsSVGEffects.cpp
layout/svg/nsSVGEffects.h
layout/svg/nsSVGFilterFrame.cpp
layout/svg/nsSVGFilterFrame.h
layout/svg/nsSVGForeignObjectFrame.cpp
layout/svg/nsSVGGFrame.h
layout/svg/nsSVGGenericContainerFrame.h
layout/svg/nsSVGGradientFrame.cpp
layout/svg/nsSVGGradientFrame.h
layout/svg/nsSVGImageFrame.cpp
layout/svg/nsSVGInnerSVGFrame.h
layout/svg/nsSVGMarkerFrame.h
layout/svg/nsSVGMaskFrame.h
layout/svg/nsSVGOuterSVGFrame.cpp
layout/svg/nsSVGOuterSVGFrame.h
layout/svg/nsSVGPaintServerFrame.h
layout/svg/nsSVGPatternFrame.cpp
layout/svg/nsSVGStopFrame.cpp
layout/svg/nsSVGSwitchFrame.cpp
layout/svg/nsSVGUseFrame.cpp
layout/svg/nsSVGUtils.cpp
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableCellFrame.h
layout/tables/nsTableColFrame.cpp
layout/tables/nsTableColGroupFrame.cpp
layout/tables/nsTableColGroupFrame.h
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowGroupFrame.cpp
layout/tables/nsTableWrapperFrame.cpp
layout/xul/nsBox.cpp
layout/xul/nsBox.h
layout/xul/nsBoxFrame.cpp
layout/xul/nsBoxFrame.h
layout/xul/nsDeckFrame.cpp
layout/xul/nsImageBoxFrame.cpp
layout/xul/nsLeafBoxFrame.cpp
layout/xul/nsLeafBoxFrame.h
layout/xul/nsMenuFrame.cpp
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsPopupSetFrame.h
layout/xul/nsRootBoxFrame.cpp
layout/xul/nsScrollbarFrame.h
layout/xul/nsSliderFrame.cpp
layout/xul/nsXULLabelFrame.h
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -1137,18 +1137,19 @@ nsAccessibilityService::CreateAccessible
     // XBL bindings may use @role attribute to point the accessible type
     // they belong to.
     newAcc = CreateAccessibleByType(content, document);
 
     // Any XUL box can be used as tabpanel, make sure we create a proper
     // accessible for it.
     if (!newAcc && aContext->IsXULTabpanels() &&
         content->GetParent() == aContext->GetContent()) {
-      FrameType frameType = frame->Type();
-      if (frameType == FrameType::Box || frameType == FrameType::Scroll) {
+      LayoutFrameType frameType = frame->Type();
+      if (frameType == LayoutFrameType::Box ||
+          frameType == LayoutFrameType::Scroll) {
         newAcc = new XULTabpanelAccessible(content, document);
       }
     }
   }
 
   if (!newAcc) {
     if (content->IsSVGElement()) {
       SVGGeometryFrame* geometryFrame = do_QueryFrame(frame);
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -632,17 +632,17 @@ Accessible::RelativeBounds(nsIFrame** aB
     bool* hasHitRegionRect = static_cast<bool*>(mContent->GetProperty(nsGkAtoms::hitregion));
 
     if (hasHitRegionRect && mContent->IsElement()) {
       // This is for canvas fallback content
       // Find a canvas frame the found hit region is relative to.
       nsIFrame* canvasFrame = frame->GetParent();
       if (canvasFrame) {
         canvasFrame = nsLayoutUtils::GetClosestFrameOfType(
-          canvasFrame, FrameType::HTMLCanvas);
+          canvasFrame, LayoutFrameType::HTMLCanvas);
       }
 
       // make the canvas the bounding frame
       if (canvasFrame) {
         *aBoundingFrame = canvasFrame;
         dom::HTMLCanvasElement *canvas =
           dom::HTMLCanvasElement::FromContent(canvasFrame->GetContent());
 
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -643,18 +643,19 @@ Element::GetScrollFrame(nsIFrame **aStyl
     *aStyledFrame = frame;
   }
   if (!frame) {
     return nullptr;
   }
 
   // menu frames implement GetScrollTargetFrame but we don't want
   // to use it here.  Similar for comboboxes.
-  FrameType type = frame->Type();
-  if (type != FrameType::Menu && type != FrameType::ComboboxControl) {
+  LayoutFrameType type = frame->Type();
+  if (type != LayoutFrameType::Menu &&
+      type != LayoutFrameType::ComboboxControl) {
     nsIScrollableFrame *scrollFrame = frame->GetScrollTargetFrame();
     if (scrollFrame)
       return scrollFrame;
   }
 
   nsIDocument* doc = OwnerDoc();
   bool quirksMode = doc->GetCompatibilityMode() == eCompatibility_NavQuirks;
   Element* elementWithRootScrollInfo =
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -2712,17 +2712,17 @@ nsFocusManager::DetermineElementToMoveFo
         ignoreTabIndex = true;
     }
 
     // check if the focus is currently inside a popup. Elements such as the
     // autocomplete widget use the noautofocus attribute to allow the focus to
     // remain outside the popup when it is opened.
     if (frame) {
       popupFrame =
-        nsLayoutUtils::GetClosestFrameOfType(frame, FrameType::MenuPopup);
+        nsLayoutUtils::GetClosestFrameOfType(frame, LayoutFrameType::MenuPopup);
     }
 
     if (popupFrame && !forDocumentNavigation) {
       // Don't navigate outside of a popup, so pretend that the
       // root content is the popup itself
       rootContent = popupFrame->GetContent();
       NS_ASSERTION(rootContent, "Popup frame doesn't have a content node");
     }
@@ -2938,18 +2938,18 @@ nsFocusManager::DetermineElementToMoveFo
       }
 
       // if the frame is inside a popup, make sure to scan only within the
       // popup. This handles the situation of tabbing amongst elements
       // inside an iframe which is itself inside a popup. Otherwise,
       // navigation would move outside the popup when tabbing outside the
       // iframe.
       if (!forDocumentNavigation) {
-        popupFrame =
-          nsLayoutUtils::GetClosestFrameOfType(frame, FrameType::MenuPopup);
+        popupFrame = nsLayoutUtils::GetClosestFrameOfType(
+          frame, LayoutFrameType::MenuPopup);
         if (popupFrame) {
           rootContent = popupFrame->GetContent();
           NS_ASSERTION(rootContent, "Popup frame doesn't have a content node");
         }
       }
     }
     else {
       // There is no parent, so call the tree owner. This will tell the
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -3508,18 +3508,19 @@ GetRequiredInnerTextLineBreakCount(nsIFr
     return 1;
   }
   return 0;
 }
 
 static bool
 IsLastCellOfRow(nsIFrame* aFrame)
 {
-  FrameType type = aFrame->Type();
-  if (type != FrameType::TableCell && type != FrameType::BCTableCell) {
+  LayoutFrameType type = aFrame->Type();
+  if (type != LayoutFrameType::TableCell &&
+      type != LayoutFrameType::BCTableCell) {
     return true;
   }
   for (nsIFrame* c = aFrame; c; c = c->GetNextContinuation()) {
     if (c->GetNextSibling()) {
       return false;
     }
   }
   return true;
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2734,20 +2734,20 @@ EventStateManager::DecideGestureEvent(Wi
     // assist is solving this.
     if (current && IsRemoteTarget(current->GetContent())) {
       panDirection = WidgetGestureNotifyEvent::ePanBoth;
       // We don't know when we reach bounds, so just disable feedback for now.
       displayPanFeedback = false;
       break;
     }
 
-    FrameType currentFrameType = current->Type();
+    LayoutFrameType currentFrameType = current->Type();
 
     // Scrollbars should always be draggable
-    if (currentFrameType == FrameType::Scrollbar) {
+    if (currentFrameType == LayoutFrameType::Scrollbar) {
       panDirection = WidgetGestureNotifyEvent::ePanNone;
       break;
     }
 
 #ifdef MOZ_XUL
     // Special check for trees
     nsTreeBodyFrame* treeFrame = do_QueryFrame(current);
     if (treeFrame) {
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -234,28 +234,28 @@ nsGenericHTMLElement::GetAccessKeyLabel(
   GetAccessKey(suffix);
   if (!suffix.IsEmpty()) {
     EventStateManager::GetAccessKeyLabelPrefix(this, aLabel);
     aLabel.Append(suffix);
   }
 }
 
 static bool
-IS_TABLE_CELL(FrameType frameType)
+IS_TABLE_CELL(LayoutFrameType frameType)
 {
-  return FrameType::TableCell == frameType ||
-         FrameType::BCTableCell == frameType;
+  return LayoutFrameType::TableCell == frameType ||
+         LayoutFrameType::BCTableCell == frameType;
 }
 
 static bool
 IsOffsetParent(nsIFrame* aFrame)
 {
-  FrameType frameType = aFrame->Type();
-
-  if (IS_TABLE_CELL(frameType) || frameType == FrameType::Table) {
+  LayoutFrameType frameType = aFrame->Type();
+
+  if (IS_TABLE_CELL(frameType) || frameType == LayoutFrameType::Table) {
     // Per the IDL for Element, only td, th, and table are acceptable offsetParents
     // apart from body or positioned elements; we need to check the content type as
     // well as the frame type so we ignore anonymous tables created by an element
     // with display: table-cell with no actual table
     nsIContent* content = aFrame->GetContent();
 
     return content->IsAnyOfHTMLElements(nsGkAtoms::table,
                                         nsGkAtoms::td,
--- a/dom/svg/SVGTextContentElement.cpp
+++ b/dom/svg/SVGTextContentElement.cpp
@@ -33,26 +33,26 @@ nsSVGElement::LengthInfo SVGTextContentE
   { &nsGkAtoms::textLength, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::XY }
 };
 
 SVGTextFrame*
 SVGTextContentElement::GetSVGTextFrame()
 {
   nsIFrame* frame = GetPrimaryFrame(FlushType::Layout);
   nsIFrame* textFrame =
-    nsLayoutUtils::GetClosestFrameOfType(frame, FrameType::SVGText);
+    nsLayoutUtils::GetClosestFrameOfType(frame, LayoutFrameType::SVGText);
   return static_cast<SVGTextFrame*>(textFrame);
 }
 
 SVGTextFrame*
 SVGTextContentElement::GetSVGTextFrameForNonLayoutDependentQuery()
 {
   nsIFrame* frame = GetPrimaryFrame(FlushType::Frames);
   nsIFrame* textFrame =
-    nsLayoutUtils::GetClosestFrameOfType(frame, FrameType::SVGText);
+    nsLayoutUtils::GetClosestFrameOfType(frame, LayoutFrameType::SVGText);
   return static_cast<SVGTextFrame*>(textFrame);
 }
 
 already_AddRefed<SVGAnimatedLength>
 SVGTextContentElement::TextLength()
 {
   return LengthAttributes()[TEXTLENGTH].ToDOMAnimatedLength(this);
 }
--- a/layout/base/AccessibleCaretManager.cpp
+++ b/layout/base/AccessibleCaretManager.cpp
@@ -1260,17 +1260,17 @@ AccessibleCaretManager::DragCaretInterna
   }
 
   ClearMaintainedSelection();
 
   nsIFrame* anchorFrame = nullptr;
   selection->GetPrimaryFrameForAnchorNode(&anchorFrame);
 
   nsIFrame* scrollable =
-    nsLayoutUtils::GetClosestFrameOfType(anchorFrame, FrameType::Scroll);
+    nsLayoutUtils::GetClosestFrameOfType(anchorFrame, LayoutFrameType::Scroll);
   AutoWeakFrame weakScrollable = scrollable;
   fs->HandleClick(offsets.content, offsets.StartOffset(), offsets.EndOffset(),
                   GetCaretMode() == CaretMode::Selection, false,
                   offsets.associate);
   if (!weakScrollable.IsAlive()) {
     return NS_OK;
   }
 
--- a/layout/base/GeckoRestyleManager.cpp
+++ b/layout/base/GeckoRestyleManager.cpp
@@ -856,26 +856,26 @@ GetPrevContinuationWithSameStyle(nsIFram
     prevContinuation = nullptr;
   }
   return prevContinuation;
 }
 
 nsresult
 GeckoRestyleManager::ReparentStyleContext(nsIFrame* aFrame)
 {
-  FrameType frameType = aFrame->Type();
-  if (frameType == FrameType::Placeholder) {
+  LayoutFrameType frameType = aFrame->Type();
+  if (frameType == LayoutFrameType::Placeholder) {
     // Also reparent the out-of-flow and all its continuations.
     nsIFrame* outOfFlow =
       nsPlaceholderFrame::GetRealFrameForPlaceholder(aFrame);
     NS_ASSERTION(outOfFlow, "no out-of-flow frame");
     do {
       ReparentStyleContext(outOfFlow);
     } while ((outOfFlow = outOfFlow->GetNextContinuation()));
-  } else if (frameType == FrameType::Backdrop) {
+  } else if (frameType == LayoutFrameType::Backdrop) {
     // Style context of backdrop frame has no parent style context, and
     // thus we do not need to reparent it.
     return NS_OK;
   }
 
   // DO NOT verify the style tree before reparenting.  The frame
   // tree has already been changed, so this check would just fail.
   nsStyleContext* oldContext = aFrame->StyleContext();
@@ -1655,18 +1655,18 @@ ElementRestyler::MoveStyleContextsForCon
       // FIXME: It is probably safe to just continue here instead of bailing out.
       if (child->IsPlaceholderFrame()) {
         return false;
       }
       nsStyleContext* sc = child->StyleContext();
       if (sc->GetParent() != aOldContext) {
         return false;
       }
-      FrameType type = child->Type();
-      if (type == FrameType::Letter || type == FrameType::Line) {
+      LayoutFrameType type = child->Type();
+      if (type == LayoutFrameType::Letter || type == LayoutFrameType::Line) {
         return false;
       }
       if (sc->HasChildThatUsesGrandancestorStyle()) {
         // XXX Not sure if we need this?
         return false;
       }
       nsIAtom* pseudoTag = sc->GetPseudo();
       if (pseudoTag && !nsCSSAnonBoxes::IsNonElement(pseudoTag)) {
@@ -2063,26 +2063,26 @@ ElementRestyler::ComputeRestyleResultFro
     return;
   }
 
   // Style changes might have moved children between the two nsLetterFrames
   // (the one matching ::first-letter and the one containing the rest of the
   // content).  Continue restyling to the children of the nsLetterFrame so
   // that they get the correct style context parent.  Similarly for
   // nsLineFrames.
-  FrameType type = aSelf->Type();
-
-  if (type == FrameType::Letter) {
+  LayoutFrameType type = aSelf->Type();
+
+  if (type == LayoutFrameType::Letter) {
     LOG_RESTYLE_CONTINUE("frame is a letter frame");
     aRestyleResult = RestyleResult::eContinue;
     aCanStopWithStyleChange = false;
     return;
   }
 
-  if (type == FrameType::Line) {
+  if (type == LayoutFrameType::Line) {
     LOG_RESTYLE_CONTINUE("frame is a line frame");
     aRestyleResult = RestyleResult::eContinue;
     aCanStopWithStyleChange = false;
     return;
   }
 
   // Some style computations depend not on the parent's style, but a grandparent
   // or one the grandparent's ancestors.  An example is an explicit 'inherit'
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -3533,18 +3533,18 @@ PresShell::DoScrollContentIntoView()
     // The reflow flush before this scroll got interrupted, and this frame's
     // coords and size are all zero, and it has no content showing anyway.
     // Don't bother scrolling to it.  We'll try again when we finish up layout.
     return;
   }
 
   // Make sure we skip 'frame' ... if it's scrollable, we should use its
   // scrollable ancestor as the container.
-  nsIFrame* container =
-    nsLayoutUtils::GetClosestFrameOfType(frame->GetParent(), FrameType::Scroll);
+  nsIFrame* container = nsLayoutUtils::GetClosestFrameOfType(
+    frame->GetParent(), LayoutFrameType::Scroll);
   if (!container) {
     // nothing can be scrolled
     return;
   }
 
   ScrollIntoViewData* data = static_cast<ScrollIntoViewData*>(
     mContentToScrollTo->GetProperty(nsGkAtoms::scrolling));
   if (MOZ_UNLIKELY(!data)) {
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1073,18 +1073,18 @@ DoApplyRenderingChangeToTree(nsIFrame* a
         nsSVGUtils::ScheduleReflowSVG(aFrame);
       }
     }
     if (aChange & nsChangeHint_UpdateTextPath) {
       if (nsSVGUtils::IsInSVGTextSubtree(aFrame)) {
         // Invalidate and reflow the entire SVGTextFrame:
         NS_ASSERTION(aFrame->GetContent()->IsSVGElement(nsGkAtoms::textPath),
                      "expected frame for a <textPath> element");
-        nsIFrame* text =
-          nsLayoutUtils::GetClosestFrameOfType(aFrame, FrameType::SVGText);
+        nsIFrame* text = nsLayoutUtils::GetClosestFrameOfType(
+          aFrame, LayoutFrameType::SVGText);
         NS_ASSERTION(text, "expected to find an ancestor SVGTextFrame");
         static_cast<SVGTextFrame*>(text)->NotifyGlyphMetricsChange();
       } else {
         MOZ_ASSERT(false, "unexpected frame got nsChangeHint_UpdateTextPath");
       }
     }
     if (aChange & nsChangeHint_UpdateOpacityLayer) {
       // FIXME/bug 796697: we can get away with empty transactions for
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -500,20 +500,20 @@ DumpBidiLine(BidiLineData* aData, bool a
 
 /* Some helper methods for Resolve() */
 
 // Should this frame be split between text runs?
 static bool
 IsBidiSplittable(nsIFrame* aFrame)
 {
   // Bidi inline containers should be split, unless they're line frames.
-  FrameType frameType = aFrame->Type();
+  LayoutFrameType frameType = aFrame->Type();
   return (aFrame->IsFrameOfType(nsIFrame::eBidiInlineContainer) &&
-          frameType != FrameType::Line) ||
-         frameType == FrameType::Text;
+          frameType != LayoutFrameType::Line) ||
+         frameType == LayoutFrameType::Text;
 }
 
 // Should this frame be treated as a leaf (e.g. when building mLogicalFrames)?
 static bool
 IsBidiLeaf(nsIFrame* aFrame)
 {
   nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
   return !kid || !aFrame->IsFrameOfType(nsIFrame::eBidiInlineContainer);
@@ -1120,18 +1120,18 @@ nsBidiPresUtils::TraverseFrames(nsBlockI
        * and add its index to the mContentToFrameIndex hashtable. This
        * will be used in RemoveBidiContinuation() to identify the last
        * frame in the array with a given content.
        */
       nsIContent* content = frame->GetContent();
       aBpd->AppendFrame(frame, aLineIter, content);
 
       // Append the content of the frame to the paragraph buffer
-      FrameType frameType = frame->Type();
-      if (FrameType::Text == frameType) {
+      LayoutFrameType frameType = frame->Type();
+      if (LayoutFrameType::Text == frameType) {
         if (content != aBpd->mPrevContent) {
           aBpd->mPrevContent = content;
           if (!frame->StyleText()->NewlineIsSignificant(
                 static_cast<nsTextFrame*>(frame))) {
             content->AppendTextTo(aBpd->mBuffer);
           } else {
             /*
              * For preformatted text we have to do bidi resolution on each line
@@ -1236,17 +1236,17 @@ nsBidiPresUtils::TraverseFrames(nsBlockI
                */
               if (frame && frame == nextSibling) {
                 nextSibling = frame->GetNextSibling();
               }
 
             } while (next);
           }
         }
-      } else if (FrameType::Br == frameType) {
+      } else if (LayoutFrameType::Br == frameType) {
         // break frame -- append line separator
         aBpd->AppendUnichar(kLineSeparator);
         ResolveParagraphWithinBlock(aBpd);
       } else { 
         // other frame type -- see the Unicode Bidi Algorithm:
         // "...inline objects (such as graphics) are treated as if they are ...
         // U+FFFC"
         // <wbr>, however, is treated as U+200B ZERO WIDTH SPACE. See
@@ -1559,24 +1559,24 @@ nsBidiPresUtils::RepositionRubyContentFr
 
 /* static */ nscoord
 nsBidiPresUtils::RepositionRubyFrame(
   nsIFrame* aFrame,
   const nsContinuationStates* aContinuationStates,
   const WritingMode aContainerWM,
   const LogicalMargin& aBorderPadding)
 {
-  FrameType frameType = aFrame->Type();
+  LayoutFrameType frameType = aFrame->Type();
   MOZ_ASSERT(RubyUtils::IsRubyBox(frameType));
 
   nscoord icoord = 0;
   WritingMode frameWM = aFrame->GetWritingMode();
   bool isLTR = frameWM.IsBidiLTR();
   nsSize frameSize = aFrame->GetSize();
-  if (frameType == FrameType::Ruby) {
+  if (frameType == LayoutFrameType::Ruby) {
     icoord += aBorderPadding.IStart(frameWM);
     // Reposition ruby segments in a ruby container
     for (RubySegmentEnumerator e(static_cast<nsRubyFrame*>(aFrame));
           !e.AtEnd(); e.Next()) {
       nsRubyBaseContainerFrame* rbc = e.GetBaseContainer();
       AutoRubyTextContainerArray textContainers(rbc);
 
       nscoord segmentISize = RepositionFrame(rbc, isLTR, icoord,
@@ -1585,17 +1585,17 @@ nsBidiPresUtils::RepositionRubyFrame(
       for (nsRubyTextContainerFrame* rtc : textContainers) {
         nscoord isize = RepositionFrame(rtc, isLTR, icoord, aContinuationStates,
                                         frameWM, false, frameSize);
         segmentISize = std::max(segmentISize, isize);
       }
       icoord += segmentISize;
     }
     icoord += aBorderPadding.IEnd(frameWM);
-  } else if (frameType == FrameType::RubyBaseContainer) {
+  } else if (frameType == LayoutFrameType::RubyBaseContainer) {
     // Reposition ruby columns in a ruby segment
     auto rbc = static_cast<nsRubyBaseContainerFrame*>(aFrame);
     AutoRubyTextContainerArray textContainers(rbc);
 
     for (RubyColumnEnumerator e(rbc, textContainers); !e.AtEnd(); e.Next()) {
       RubyColumn column;
       e.GetColumn(column);
 
@@ -1605,17 +1605,18 @@ nsBidiPresUtils::RepositionRubyFrame(
       for (nsRubyTextFrame* rt : column.mTextFrames) {
         nscoord isize = RepositionFrame(rt, isLTR, icoord, aContinuationStates,
                                         frameWM, false, frameSize);
         columnISize = std::max(columnISize, isize);
       }
       icoord += columnISize;
     }
   } else {
-    if (frameType == FrameType::RubyBase || frameType == FrameType::RubyText) {
+    if (frameType == LayoutFrameType::RubyBase ||
+        frameType == LayoutFrameType::RubyText) {
       RepositionRubyContentFrame(aFrame, frameWM, aBorderPadding);
     }
     // Note that, ruby text container is not present in all conditions
     // above. It is intended, because the children of rtc are reordered
     // with the children of ruby base container simultaneously. We only
     // need to return its isize here, as it should not be changed.
     icoord += aFrame->ISize(aContainerWM);
   }
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -338,18 +338,19 @@ IsAnonymousFlexOrGridItem(const nsIFrame
   return pseudoType == nsCSSAnonBoxes::anonymousFlexItem ||
          pseudoType == nsCSSAnonBoxes::anonymousGridItem;
 }
 
 // Returns true if aFrame is a flex/grid container.
 static inline bool
 IsFlexOrGridContainer(const nsIFrame* aFrame)
 {
-  const FrameType t = aFrame->Type();
-  return t == FrameType::FlexContainer || t == FrameType::GridContainer;
+  const LayoutFrameType t = aFrame->Type();
+  return t == LayoutFrameType::FlexContainer ||
+         t == LayoutFrameType::GridContainer;
 }
 
 // Returns true IFF the given nsIFrame is a nsFlexContainerFrame and
 // represents a -webkit-{inline-}box container.
 static inline bool
 IsFlexContainerForLegacyBox(const nsIFrame* aFrame)
 {
   return aFrame->IsFlexContainerFrame() &&
@@ -1966,37 +1967,37 @@ IsRubyPseudo(nsIFrame* aFrame)
 static bool
 IsTableOrRubyPseudo(nsIFrame* aFrame)
 {
   return IsTablePseudo(aFrame) || IsRubyPseudo(aFrame);
 }
 
 /* static */
 nsCSSFrameConstructor::ParentType
-nsCSSFrameConstructor::GetParentType(FrameType aFrameType)
-{
-  if (aFrameType == FrameType::Table) {
+nsCSSFrameConstructor::GetParentType(LayoutFrameType aFrameType)
+{
+  if (aFrameType == LayoutFrameType::Table) {
     return eTypeTable;
   }
-  if (aFrameType == FrameType::TableRowGroup) {
+  if (aFrameType == LayoutFrameType::TableRowGroup) {
     return eTypeRowGroup;
   }
-  if (aFrameType == FrameType::TableRow) {
+  if (aFrameType == LayoutFrameType::TableRow) {
     return eTypeRow;
   }
-  if (aFrameType == FrameType::TableColGroup) {
+  if (aFrameType == LayoutFrameType::TableColGroup) {
     return eTypeColGroup;
   }
-  if (aFrameType == FrameType::RubyBaseContainer) {
+  if (aFrameType == LayoutFrameType::RubyBaseContainer) {
     return eTypeRubyBaseContainer;
   }
-  if (aFrameType == FrameType::RubyTextContainer) {
+  if (aFrameType == LayoutFrameType::RubyTextContainer) {
     return eTypeRubyTextContainer;
   }
-  if (aFrameType == FrameType::Ruby) {
+  if (aFrameType == LayoutFrameType::Ruby) {
     return eTypeRuby;
   }
 
   return eTypeBlock;
 }
 
 static nsContainerFrame*
 AdjustCaptionParentFrame(nsContainerFrame* aParentFrame)
@@ -4230,34 +4231,34 @@ nsCSSFrameConstructor::GetAnonymousConte
   uint32_t count = aContent.Length();
   for (uint32_t i=0; i < count; i++) {
     // get our child's content and set its parent to our content
     nsIContent* content = aContent[i].mContent;
     NS_ASSERTION(content, "null anonymous content?");
 
     ConnectAnonymousTreeDescendants(content, aContent[i].mChildren);
 
-    FrameType parentFrameType = aParentFrame->Type();
-    if (parentFrameType == FrameType::SVGUse) {
+    LayoutFrameType parentFrameType = aParentFrame->Type();
+    if (parentFrameType == LayoutFrameType::SVGUse) {
       // least-surprise CSS binding until we do the SVG specified
       // cascading rules for <svg:use> - bug 265894
       content->SetFlags(NODE_IS_ANONYMOUS_ROOT);
     } else {
       content->SetIsNativeAnonymousRoot();
       // Don't mark descendants of the custom content container
       // as native anonymous.  When canvas custom content is initially
       // created and appended to the custom content container, in
       // nsIDocument::InsertAnonymousContent, it is not considered native
       // anonymous content.  But if we end up reframing the root element,
       // we will re-create the nsCanvasFrame, and we would end up in here,
       // marking it as NAC.  Existing uses of canvas custom content would
       // break if it becomes NAC (since each element starts inheriting
       // styles from its closest non-NAC ancestor, rather than from its
       // parent).
-      if (!(parentFrameType == FrameType::Canvas &&
+      if (!(parentFrameType == LayoutFrameType::Canvas &&
             content == static_cast<nsCanvasFrame*>(aParentFrame)
                          ->GetCustomContentContainer())) {
         SetNativeAnonymousBitOnDescendants(content);
       }
     }
 
     bool anonContentIsEditable = content->HasFlag(NODE_IS_EDITABLE);
 
@@ -6287,18 +6288,18 @@ nsCSSFrameConstructor::GetAbsoluteContai
       // If it's mathml, bail out -- no absolute positioning out from inside
       // mathml frames.  Note that we don't make this part of the loop
       // condition because of the stuff at the end of this method...
       return nullptr;
     }
 
     // Look for the ICB.
     if (aType == FIXED_POS) {
-      FrameType t = frame->Type();
-      if (t == FrameType::Viewport || t == FrameType::PageContent) {
+      LayoutFrameType t = frame->Type();
+      if (t == LayoutFrameType::Viewport || t == LayoutFrameType::PageContent) {
         return static_cast<nsContainerFrame*>(frame);
       }
     }
 
     // If the frame is positioned, we will probably return it as the containing
     // block (see the exceptions below).  Otherwise, we'll start looking at the
     // parent frame, unless we're dealing with a scrollframe.
     // Scrollframes are special since they're not positioned, but their
@@ -6307,41 +6308,41 @@ nsCSSFrameConstructor::GetAbsoluteContai
     // If we're looking for a fixed-pos containing block and the frame is
     // not transformed, skip it.
     if (!frame->IsAbsPosContainingBlock() ||
         (aType == FIXED_POS &&
          !frame->IsFixedPosContainingBlock())) {
       continue;
     }
     nsIFrame* absPosCBCandidate = frame;
-    FrameType type = absPosCBCandidate->Type();
-    if (type == FrameType::FieldSet) {
+    LayoutFrameType type = absPosCBCandidate->Type();
+    if (type == LayoutFrameType::FieldSet) {
       absPosCBCandidate = static_cast<nsFieldSetFrame*>(absPosCBCandidate)->GetInner();
       if (!absPosCBCandidate) {
         continue;
       }
       type = absPosCBCandidate->Type();
     }
-    if (type == FrameType::Scroll) {
+    if (type == LayoutFrameType::Scroll) {
       nsIScrollableFrame* scrollFrame = do_QueryFrame(absPosCBCandidate);
       absPosCBCandidate = scrollFrame->GetScrolledFrame();
       if (!absPosCBCandidate) {
         continue;
       }
       type = absPosCBCandidate->Type();
     }
     // Only first continuations can be containing blocks.
     absPosCBCandidate = absPosCBCandidate->FirstContinuation();
     // Is the frame really an absolute container?
     if (!absPosCBCandidate->IsAbsoluteContainer()) {
       continue;
     }
 
     // For tables, skip the inner frame and consider the table wrapper frame.
-    if (type == FrameType::Table) {
+    if (type == LayoutFrameType::Table) {
       continue;
     }
     // For table wrapper frames, we can just return absPosCBCandidate.
     MOZ_ASSERT((nsContainerFrame*)do_QueryFrame(absPosCBCandidate),
                "abs.pos. containing block must be nsContainerFrame sub-class");
     return static_cast<nsContainerFrame*>(absPosCBCandidate);
   }
 
@@ -6622,26 +6623,26 @@ nsCSSFrameConstructor::AppendFramesToPar
 // 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,
                                       StyleDisplay&          aDisplay)
 {
   nsIFrame* parentFrame = aSibling->GetParent();
-  FrameType parentType = parentFrame->Type();
+  LayoutFrameType parentType = parentFrame->Type();
 
   StyleDisplay siblingDisplay = aSibling->GetDisplay();
   if (StyleDisplay::TableColumnGroup == siblingDisplay ||
       StyleDisplay::TableColumn      == siblingDisplay ||
       StyleDisplay::TableCaption     == siblingDisplay ||
       StyleDisplay::TableHeaderGroup == siblingDisplay ||
       StyleDisplay::TableRowGroup    == siblingDisplay ||
       StyleDisplay::TableFooterGroup == siblingDisplay ||
-      FrameType::Menu == parentType) {
+      LayoutFrameType::Menu == 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();
       }
       if (!styleParent) {
@@ -6656,17 +6657,17 @@ nsCSSFrameConstructor::IsValidSibling(ns
       }
       // XXXbz when this code is killed, the state argument to
       // ResolveStyleContext can be made non-optional.
       RefPtr<nsStyleContext> styleContext =
         ResolveStyleContext(styleParent, aContent, nullptr);
       const nsStyleDisplay* display = styleContext->StyleDisplay();
       aDisplay = display->mDisplay;
     }
-    if (FrameType::Menu == parentType) {
+    if (LayoutFrameType::Menu == parentType) {
       return
         (StyleDisplay::MozPopup == aDisplay) ==
         (StyleDisplay::MozPopup == 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.
@@ -6697,21 +6698,21 @@ nsCSSFrameConstructor::IsValidSibling(ns
     // below.
   }
 
   if (IsFrameForFieldSet(parentFrame)) {
     // Legends can be sibling of legends but not of other content in the fieldset
     if (nsContainerFrame* cif = aSibling->GetContentInsertionFrame()) {
       aSibling = cif;
     }
-    FrameType sibType = aSibling->Type();
+    LayoutFrameType sibType = aSibling->Type();
     bool legendContent = aContent->IsHTMLElement(nsGkAtoms::legend);
 
-    if ((legendContent && (FrameType::Legend != sibType)) ||
-        (!legendContent && (FrameType::Legend == sibType)))
+    if ((legendContent && (LayoutFrameType::Legend != sibType)) ||
+        (!legendContent && (LayoutFrameType::Legend == sibType)))
       return false;
   }
 
   return true;
 }
 
 nsIFrame*
 nsCSSFrameConstructor::FindFrameForContentSibling(nsIContent* aContent,
@@ -7642,17 +7643,17 @@ nsCSSFrameConstructor::ContentAppended(n
                                containingBlock->StyleContext());
   }
 
   if (haveFirstLetterStyle) {
     // Before we get going, remove the current letter frames
     RemoveLetterFrames(state.mPresShell, containingBlock);
   }
 
-  FrameType frameType = parentFrame->Type();
+  LayoutFrameType frameType = parentFrame->Type();
 
   FlattenedChildIterator iter(aContainer);
   bool haveNoXBLChildren = (!iter.XBLInvolved() || !iter.GetNextChild());
   FrameConstructionItemList items;
   if (aFirstNewContent->GetPreviousSibling() &&
       GetParentType(frameType) == eTypeBlock &&
       haveNoXBLChildren) {
     // If there's a text node in the normal content list just before the new
@@ -7717,17 +7718,17 @@ nsCSSFrameConstructor::ContentAppended(n
     // GetChildAt calls instead and do this during construction of our
     // FrameConstructionItemList?
     InvalidateCanvasIfNeeded(mPresShell, child);
   }
 
   // If the container is a table and a caption was appended, it needs to be put
   // in the table wrapper frame's additional child list.
   nsFrameItems captionItems;
-  if (FrameType::Table == frameType) {
+  if (LayoutFrameType::Table == frameType) {
     // Pull out the captions.  Note that we don't want to do that as we go,
     // because processing a single caption can add a whole bunch of things to
     // the frame items due to pseudoframe processing.  So we'd have to pull
     // captions from a list anyway; might as well do that here.
     // XXXbz this is no longer true; we could pull captions directly out of the
     // FrameConstructionItemList now.
     PullOutCaptionFrames(frameItems, captionItems);
   }
@@ -7738,17 +7739,17 @@ nsCSSFrameConstructor::ContentAppended(n
     AppendFirstLineFrames(state, containingBlock->GetContent(),
                           containingBlock, frameItems);
   }
 
   // Notify the parent frame passing it the list of new frames
   // Append the flowed frames to the principal child list; captions
   // need special treatment
   if (captionItems.NotEmpty()) { // append the caption to the table wrapper
-    NS_ASSERTION(FrameType::Table == frameType, "how did that happen?");
+    NS_ASSERTION(LayoutFrameType::Table == frameType, "how did that happen?");
     nsContainerFrame* outerTable = parentFrame->GetParent();
     AppendFrames(outerTable, nsIFrame::kCaptionList, captionItems);
   }
 
   if (frameItems.NotEmpty()) { // append the in-flow kids
     AppendFramesToParent(state, parentFrame, frameItems, prevSibling);
   }
 
@@ -8065,27 +8066,27 @@ nsCSSFrameConstructor::ContentRangeInser
     IssueSingleInsertNofications(aContainer, aStartChild, aEndChild,
                                  aAllowLazyConstruction, aForReconstruction);
     LAYOUT_PHASE_TEMP_REENTER();
     return;
   }
 
   nsIContent* container = insertion.mParentFrame->GetContent();
 
-  FrameType frameType = insertion.mParentFrame->Type();
+  LayoutFrameType frameType = insertion.mParentFrame->Type();
   LAYOUT_PHASE_TEMP_EXIT();
   if (MaybeRecreateForFrameset(insertion.mParentFrame, aStartChild, aEndChild)) {
     LAYOUT_PHASE_TEMP_REENTER();
     return;
   }
   LAYOUT_PHASE_TEMP_REENTER();
 
   // We should only get here with fieldsets when doing a single insert, because
   // fieldsets have multiple insertion points.
-  NS_ASSERTION(isSingleInsert || frameType != FrameType::FieldSet,
+  NS_ASSERTION(isSingleInsert || frameType != LayoutFrameType::FieldSet,
                "Unexpected parent");
   if (IsFrameForFieldSet(insertion.mParentFrame) &&
       aStartChild->NodeInfo()->NameAtom() == nsGkAtoms::legend) {
     // Just reframe the parent, since figuring out whether this
     // should be the new legend and then handling it is too complex.
     // We could do a little better here --- check if the fieldset already
     // has a legend which occurs earlier in its child list than this node,
     // and if so, proceed. But we'd have to extend nsFieldSetFrame
@@ -8094,18 +8095,18 @@ nsCSSFrameConstructor::ContentRangeInser
     RecreateFramesForContent(insertion.mParentFrame->GetContent(), false,
                              REMOVE_FOR_RECONSTRUCTION, nullptr);
     LAYOUT_PHASE_TEMP_REENTER();
     return;
   }
 
   // We should only get here with details when doing a single insertion because
   // we treat details frame as if it has multiple insertion points.
-  MOZ_ASSERT(isSingleInsert || frameType != FrameType::Details);
-  if (frameType == FrameType::Details) {
+  MOZ_ASSERT(isSingleInsert || frameType != LayoutFrameType::Details);
+  if (frameType == LayoutFrameType::Details) {
     // When inserting an element into <details>, just reframe the details frame
     // and let it figure out where the element should be laid out. It might seem
     // expensive to recreate the entire details frame, but it's the simplest way
     // to handle the insertion.
     LAYOUT_PHASE_TEMP_EXIT();
     RecreateFramesForContent(insertion.mParentFrame->GetContent(), false,
                              REMOVE_FOR_RECONSTRUCTION, nullptr);
     LAYOUT_PHASE_TEMP_REENTER();
@@ -8286,17 +8287,18 @@ nsCSSFrameConstructor::ContentRangeInser
 
   if (frameItems.NotEmpty()) {
     for (nsIContent* child = aStartChild;
          child != aEndChild;
          child = child->GetNextSibling()){
       InvalidateCanvasIfNeeded(mPresShell, child);
     }
 
-    if (FrameType::Table == frameType || FrameType::TableWrapper == frameType) {
+    if (LayoutFrameType::Table == frameType ||
+        LayoutFrameType::TableWrapper == frameType) {
       PullOutCaptionFrames(frameItems, captionItems);
     }
   }
 
   // If the parent of our current prevSibling is different from the frame we'll
   // actually use as the parent, then the calculated insertion point is now
   // invalid and as it is unknown where to insert correctly we append instead
   // (bug 341858).
@@ -8355,18 +8357,18 @@ nsCSSFrameConstructor::ContentRangeInser
       InsertFirstLineFrames(state, container, containingBlock, &insertion.mParentFrame,
                             prevSibling, frameItems);
     }
   }
 
   // We might have captions; put them into the caption list of the
   // table wrapper frame.
   if (captionItems.NotEmpty()) {
-    NS_ASSERTION(FrameType::Table == frameType ||
-                 FrameType::TableWrapper == frameType,
+    NS_ASSERTION(LayoutFrameType::Table == frameType ||
+                 LayoutFrameType::TableWrapper == frameType,
                  "parent for caption is not table?");
     // We need to determine where to put the caption items; start with the
     // the parent frame that has already been determined and get the insertion
     // prevsibling of the first caption item.
     bool captionIsAppend;
     nsIFrame* captionPrevSibling = nullptr;
 
     // aIsRangeInsertSafe is ignored on purpose because it is irrelevant here.
@@ -8620,33 +8622,35 @@ nsCSSFrameConstructor::ContentRemoved(ns
         *aDestroyedFramesFor = container;
       }
       return;
     }
     LAYOUT_PHASE_TEMP_REENTER();
 
     // Get the childFrame's parent frame
     nsIFrame* parentFrame = childFrame->GetParent();
-    FrameType parentType = parentFrame->Type();
-
-    if (parentType == FrameType::FrameSet && IsSpecialFramesetChild(aChild)) {
+    LayoutFrameType parentType = parentFrame->Type();
+
+    if (parentType == LayoutFrameType::FrameSet &&
+        IsSpecialFramesetChild(aChild)) {
       // Just reframe the parent, since framesets are weird like that.
       *aDidReconstruct = true;
       LAYOUT_PHASE_TEMP_EXIT();
       RecreateFramesForContent(parentFrame->GetContent(), false,
                                aFlags, aDestroyedFramesFor);
       LAYOUT_PHASE_TEMP_REENTER();
       return;
     }
 
     // If we're a child of MathML, then we should reframe the MathML content.
     // If we're non-MathML, then we would be wrapped in a block so we need to
     // check our grandparent in that case.
-    nsIFrame* possibleMathMLAncestor =
-      parentType == FrameType::Block ? parentFrame->GetParent() : parentFrame;
+    nsIFrame* possibleMathMLAncestor = parentType == LayoutFrameType::Block
+                                         ? parentFrame->GetParent()
+                                         : parentFrame;
     if (possibleMathMLAncestor->IsFrameOfType(nsIFrame::eMathML)) {
       *aDidReconstruct = true;
       LAYOUT_PHASE_TEMP_EXIT();
       RecreateFramesForContent(possibleMathMLAncestor->GetContent(),
                                false, aFlags, aDestroyedFramesFor);
       LAYOUT_PHASE_TEMP_REENTER();
       return;
     }
@@ -9132,63 +9136,63 @@ nsCSSFrameConstructor::CreateContinuingF
 {
   nsIPresShell*              shell = aPresContext->PresShell();
   nsStyleContext*            styleContext = aFrame->StyleContext();
   nsIFrame*                  newFrame = nullptr;
   nsIFrame*                  nextContinuation = aFrame->GetNextContinuation();
   nsIFrame*                  nextInFlow = aFrame->GetNextInFlow();
 
   // Use the frame type to determine what type of frame to create
-  FrameType frameType = aFrame->Type();
+  LayoutFrameType frameType = aFrame->Type();
   nsIContent* content = aFrame->GetContent();
 
   NS_ASSERTION(aFrame->GetSplittableType() != NS_FRAME_NOT_SPLITTABLE,
                "why CreateContinuingFrame for a non-splittable frame?");
 
-  if (FrameType::Text == frameType) {
+  if (LayoutFrameType::Text == frameType) {
     newFrame = NS_NewContinuingTextFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::Inline == frameType) {
+  } else if (LayoutFrameType::Inline == frameType) {
     newFrame = NS_NewInlineFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::Block == frameType) {
+  } else if (LayoutFrameType::Block == frameType) {
     MOZ_ASSERT(!aFrame->IsTableCaption(),
                "no support for fragmenting table captions yet");
     newFrame = NS_NewBlockFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
 #ifdef MOZ_XUL
-  } else if (FrameType::XULLabel == frameType) {
+  } else if (LayoutFrameType::XULLabel == frameType) {
     newFrame = NS_NewXULLabelFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
 #endif
-  } else if (FrameType::ColumnSet == frameType) {
+  } else if (LayoutFrameType::ColumnSet == frameType) {
     MOZ_ASSERT(!aFrame->IsTableCaption(),
                "no support for fragmenting table captions yet");
     newFrame = NS_NewColumnSetFrame(shell, styleContext, nsFrameState(0));
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::Page == frameType) {
+  } else if (LayoutFrameType::Page == frameType) {
     nsContainerFrame* canvasFrame;
     newFrame = ConstructPageFrame(shell, aParentFrame, aFrame, canvasFrame);
-  } else if (FrameType::TableWrapper == frameType) {
+  } else if (LayoutFrameType::TableWrapper == frameType) {
     newFrame =
       CreateContinuingOuterTableFrame(shell, aPresContext, aFrame, aParentFrame,
                                       content, styleContext);
 
-  } else if (FrameType::Table == frameType) {
+  } else if (LayoutFrameType::Table == frameType) {
     newFrame =
       CreateContinuingTableFrame(shell, aFrame, aParentFrame,
                                  content, styleContext);
 
-  } else if (FrameType::TableRowGroup == frameType) {
+  } else if (LayoutFrameType::TableRowGroup == frameType) {
     newFrame = NS_NewTableRowGroupFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
     if (newFrame->GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
       nsTableFrame::RegisterPositionedTablePart(newFrame);
     }
-  } else if (FrameType::TableRow == frameType) {
+  } else if (LayoutFrameType::TableRow == frameType) {
     nsTableRowFrame* rowFrame = NS_NewTableRowFrame(shell, styleContext);
 
     rowFrame->Init(content, aParentFrame, aFrame);
     if (rowFrame->GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
       nsTableFrame::RegisterPositionedTablePart(rowFrame);
     }
 
     // Create a continuing frame for each table cell frame
@@ -9224,38 +9228,38 @@ nsCSSFrameConstructor::CreateContinuingF
     // Create a continuing area frame
     nsIFrame* blockFrame = aFrame->PrincipalChildList().FirstChild();
     nsIFrame* continuingBlockFrame =
       CreateContinuingFrame(aPresContext, blockFrame,
                             static_cast<nsContainerFrame*>(cellFrame));
 
     SetInitialSingleChild(cellFrame, continuingBlockFrame);
     newFrame = cellFrame;
-  } else if (FrameType::Line == frameType) {
+  } else if (LayoutFrameType::Line == frameType) {
     newFrame = NS_NewFirstLineFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::Letter == frameType) {
+  } else if (LayoutFrameType::Letter == frameType) {
     newFrame = NS_NewFirstLetterFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::Image == frameType) {
+  } else if (LayoutFrameType::Image == frameType) {
     newFrame = NS_NewImageFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::ImageControl == frameType) {
+  } else if (LayoutFrameType::ImageControl == frameType) {
     newFrame = NS_NewImageControlFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::Placeholder == frameType) {
+  } else if (LayoutFrameType::Placeholder == frameType) {
     // create a continuing out of flow frame
     nsIFrame* oofFrame = nsPlaceholderFrame::GetRealFrameForPlaceholder(aFrame);
     nsIFrame* oofContFrame =
       CreateContinuingFrame(aPresContext, oofFrame, aParentFrame);
     newFrame =
       CreatePlaceholderFrameFor(shell, content, oofContFrame,
                                 aParentFrame, aFrame,
                                 aFrame->GetStateBits() & PLACEHOLDER_TYPE_MASK);
-  } else if (FrameType::FieldSet == frameType) {
+  } else if (LayoutFrameType::FieldSet == frameType) {
     nsContainerFrame* fieldset = NS_NewFieldSetFrame(shell, styleContext);
 
     fieldset->Init(content, aParentFrame, aFrame);
 
     // Create a continuing area frame
     // XXXbz we really shouldn't have to do this by hand!
     nsContainerFrame* blockFrame = GetFieldSetBlockFrame(aFrame);
     if (blockFrame) {
@@ -9263,35 +9267,35 @@ nsCSSFrameConstructor::CreateContinuingF
         CreateContinuingFrame(aPresContext, blockFrame, fieldset);
       // Set the fieldset's initial child list
       SetInitialSingleChild(fieldset, continuingBlockFrame);
     } else {
       MOZ_ASSERT(aFrame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER,
                  "FieldSet block may only be null for overflow containers");
     }
     newFrame = fieldset;
-  } else if (FrameType::Legend == frameType) {
+  } else if (LayoutFrameType::Legend == frameType) {
     newFrame = NS_NewLegendFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::FlexContainer == frameType) {
+  } else if (LayoutFrameType::FlexContainer == frameType) {
     newFrame = NS_NewFlexContainerFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::GridContainer == frameType) {
+  } else if (LayoutFrameType::GridContainer == frameType) {
     newFrame = NS_NewGridContainerFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::Ruby == frameType) {
+  } else if (LayoutFrameType::Ruby == frameType) {
     newFrame = NS_NewRubyFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::RubyBaseContainer == frameType) {
+  } else if (LayoutFrameType::RubyBaseContainer == frameType) {
     newFrame = NS_NewRubyBaseContainerFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::RubyTextContainer == frameType) {
+  } else if (LayoutFrameType::RubyTextContainer == frameType) {
     newFrame = NS_NewRubyTextContainerFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
-  } else if (FrameType::Details == frameType) {
+  } else if (LayoutFrameType::Details == frameType) {
     newFrame = NS_NewDetailsFrame(shell, styleContext);
     newFrame->Init(content, aParentFrame, aFrame);
   } else {
     MOZ_CRASH("unexpected frame type");
   }
 
   // Init() set newFrame to be a fluid continuation of aFrame.
   // If we want a non-fluid continuation, we need to call SetPrevContinuation()
@@ -9697,18 +9701,18 @@ nsCSSFrameConstructor::MaybeRecreateCont
       // aFrame's parent is a pseudo, that'll be the right content node.
       RecreateFramesForContent(parent->GetContent(), true, aFlags,
                                aDestroyedFramesFor);
       return true;
     }
   }
 
   // Check ruby containers
-  FrameType parentType = parent->Type();
-  if (parentType == FrameType::Ruby ||
+  LayoutFrameType parentType = parent->Type();
+  if (parentType == LayoutFrameType::Ruby ||
       RubyUtils::IsRubyContainerBox(parentType)) {
     // In ruby containers, pseudo frames may be created from
     // whitespaces or even nothing. There are two cases we actually
     // need to handle here, but hard to check exactly:
     // 1. Status of spaces beside the frame may vary, and related
     //    frames may be constructed or destroyed accordingly.
     // 2. The type of the first child of a ruby frame determines
     //    whether a pseudo ruby base container should exist.
@@ -10124,19 +10128,19 @@ void
 nsCSSFrameConstructor::CreateNeededAnonFlexOrGridItems(
   nsFrameConstructorState& aState,
   FrameConstructionItemList& aItems,
   nsIFrame* aParentFrame)
 {
   if (aItems.IsEmpty()) {
     return;
   }
-  const FrameType parentType = aParentFrame->Type();
-  if (parentType != FrameType::FlexContainer &&
-      parentType != FrameType::GridContainer) {
+  const LayoutFrameType parentType = aParentFrame->Type();
+  if (parentType != LayoutFrameType::FlexContainer &&
+      parentType != LayoutFrameType::GridContainer) {
     return;
   }
 
   const bool isWebkitBox = IsFlexContainerForLegacyBox(aParentFrame);
   FCItemIterator iter(aItems);
   do {
     // Advance iter past children that don't want to be wrapped
     if (iter.SkipItemsThatDontNeedAnonFlexOrGridItem(aState, isWebkitBox)) {
@@ -10800,46 +10804,46 @@ void nsCSSFrameConstructor::CreateNeeded
  * purely for sanity-checking the children of these container types.
  * NOTE: See also NeedsAnonFlexOrGridItem(), for the non-debug version of this
  * logic (which operates a bit earlier, on FCData instead of frames).
  */
 static bool
 FrameWantsToBeInAnonymousItem(const nsIFrame* aContainerFrame,
                               const nsIFrame* aFrame)
 {
-  FrameType containerType = aContainerFrame->Type();
-  MOZ_ASSERT(containerType == FrameType::FlexContainer ||
-             containerType == FrameType::GridContainer);
+  LayoutFrameType containerType = aContainerFrame->Type();
+  MOZ_ASSERT(containerType == LayoutFrameType::FlexContainer ||
+             containerType == LayoutFrameType::GridContainer);
 
   // Any line-participant frames (e.g. text) definitely want to be wrapped in
   // an anonymous flex/grid item.
   if (aFrame->IsFrameOfType(nsIFrame::eLineParticipant)) {
     return true;
   }
 
   // If the container is a -webkit-box/-webkit-inline-box, then placeholders
   // also need to be wrapped, for compatibility.
-  if (containerType == FrameType::FlexContainer &&
+  if (containerType == LayoutFrameType::FlexContainer &&
       aContainerFrame->HasAnyStateBits(NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX) &&
       aFrame->IsPlaceholderFrame()) {
     return true;
   }
 
   return false;
 }
 #endif
 
 static void
 VerifyGridFlexContainerChildren(nsIFrame* aParentFrame,
                                 const nsFrameList& aChildren)
 {
 #ifdef DEBUG
   auto parentType = aParentFrame->Type();
-  if (parentType != FrameType::FlexContainer &&
-      parentType != FrameType::GridContainer) {
+  if (parentType != LayoutFrameType::FlexContainer &&
+      parentType != LayoutFrameType::GridContainer) {
     return;
   }
 
   bool prevChildWasAnonItem = false;
   for (const nsIFrame* child : aChildren) {
     MOZ_ASSERT(!FrameWantsToBeInAnonymousItem(aParentFrame, child),
                "frame wants to be inside an anonymous item, but it isn't");
     if (IsAnonymousFlexOrGridItem(child)) {
@@ -11753,33 +11757,33 @@ nsCSSFrameConstructor::WrapFramesInFirst
   bool*                    aStopLooking)
 {
   nsIFrame* prevFrame = nullptr;
   nsIFrame* frame = aParentFrameList;
 
   while (frame) {
     nsIFrame* nextFrame = frame->GetNextSibling();
 
-    FrameType frameType = frame->Type();
-    if (FrameType::Text == frameType) {
+    LayoutFrameType frameType = frame->Type();
+    if (LayoutFrameType::Text == frameType) {
       // Wrap up first-letter content in a letter frame
       nsIContent* textContent = frame->GetContent();
       if (IsFirstLetterContent(textContent)) {
         // Create letter frame to wrap up the text
         CreateLetterFrame(aBlockFrame, aBlockContinuation, textContent,
                           aParentFrame, aLetterFrames);
 
         // Provide adjustment information for parent
         *aModifiedParent = aParentFrame;
         *aTextFrame = frame;
         *aPrevFrame = prevFrame;
         *aStopLooking = true;
         return;
       }
-    } else if (IsInlineFrame(frame) && frameType != FrameType::Br) {
+    } else if (IsInlineFrame(frame) && frameType != LayoutFrameType::Br) {
       nsIFrame* kids = frame->PrincipalChildList().FirstChild();
       WrapFramesInFirstLetterFrame(aBlockFrame, aBlockContinuation,
                                    static_cast<nsContainerFrame*>(frame),
                                    kids, aModifiedParent, aTextFrame,
                                    aPrevFrame, aLetterFrames, aStopLooking);
       if (*aStopLooking) {
         return;
       }
@@ -12527,19 +12531,19 @@ nsCSSFrameConstructor::WipeContainingBlo
     return true;
   }
 
   nsIFrame* nextSibling = ::GetInsertNextSibling(aFrame, aPrevSibling);
 
   // Situation #2 is a flex or grid container frame into which we're inserting
   // new inline non-replaced children, adjacent to an existing anonymous
   // flex or grid item.
-  FrameType frameType = aFrame->Type();
-  if (frameType == FrameType::FlexContainer ||
-      frameType == FrameType::GridContainer) {
+  LayoutFrameType frameType = aFrame->Type();
+  if (frameType == LayoutFrameType::FlexContainer ||
+      frameType == LayoutFrameType::GridContainer) {
     FCItemIterator iter(aItems);
 
     // Check if we're adding to-be-wrapped content right *after* an existing
     // anonymous flex or grid item (which would need to absorb this content).
     const bool isWebkitBox = IsFlexContainerForLegacyBox(aFrame);
     if (aPrevSibling && IsAnonymousFlexOrGridItem(aPrevSibling) &&
         iter.item().NeedsAnonFlexOrGridItem(aState, isWebkitBox)) {
       RecreateFramesForContent(aFrame->GetContent(), true,
@@ -12598,17 +12602,17 @@ nsCSSFrameConstructor::WipeContainingBlo
   // spaces. It containes these two special cases apart from tables:
   // 1) There are effectively three types of white spaces in ruby frames
   //    we handle differently: leading/tailing/inter-level space,
   //    inter-base/inter-annotation space, and inter-segment space.
   //    These three types of spaces can be converted to each other when
   //    their sibling changes.
   // 2) The first effective child of a ruby frame must always be a ruby
   //    base container. It should be created or destroyed accordingly.
-  if (IsRubyPseudo(aFrame) || frameType == FrameType::Ruby ||
+  if (IsRubyPseudo(aFrame) || frameType == LayoutFrameType::Ruby ||
       RubyUtils::IsRubyContainerBox(frameType)) {
     // We want to optimize it better, and avoid reframing as much as
     // possible. But given the cases above, and the fact that a ruby
     // usually won't be very large, it should be fine to reframe it.
     RecreateFramesForContent(aFrame->GetContent(), true,
                              REMOVE_FOR_RECONSTRUCTION, nullptr);
     return true;
   }
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -609,18 +609,18 @@ private:
 #define FCDATA_DESIRED_PARENT_TYPE_TO_BITS(_type)     \
   (((uint32_t)(_type)) << FCDATA_PARENT_TYPE_OFFSET)
 
   /* Get the parent type that aParentFrame has. */
   static ParentType GetParentType(nsIFrame* aParentFrame) {
     return GetParentType(aParentFrame->Type());
   }
 
-  /* Get the parent type for the given FrameType */
-  static ParentType GetParentType(mozilla::FrameType aFrameType);
+  /* Get the parent type for the given LayoutFrameType */
+  static ParentType GetParentType(mozilla::LayoutFrameType aFrameType);
 
   static bool IsRubyParentType(ParentType aParentType) {
     return (aParentType == eTypeRuby ||
             aParentType == eTypeRubyBase ||
             aParentType == eTypeRubyBaseContainer ||
             aParentType == eTypeRubyText ||
             aParentType == eTypeRubyTextContainer);
   }
--- a/layout/base/nsCaret.cpp
+++ b/layout/base/nsCaret.cpp
@@ -370,17 +370,17 @@ nsCaret::GetGeometryForFrame(nsIFrame* a
   }
 
   rect = nsRect(framePos, vertical ? nsSize(height, caretMetrics.mCaretWidth) :
                                      nsSize(caretMetrics.mCaretWidth, height));
 
   // Clamp the inline-position to be within our scroll frame. If we don't, then
   // it clips us, and we don't appear at all. See bug 335560.
   nsIFrame* scrollFrame =
-    nsLayoutUtils::GetClosestFrameOfType(aFrame, FrameType::Scroll);
+    nsLayoutUtils::GetClosestFrameOfType(aFrame, LayoutFrameType::Scroll);
   if (scrollFrame) {
     // First, use the scrollFrame to get at the scrollable view that we're in.
     nsIScrollableFrame *sf = do_QueryFrame(scrollFrame);
     nsIFrame *scrolled = sf->GetScrolledFrame();
     nsRect caretInScroll = rect + aFrame->GetOffsetTo(scrolled);
 
     // Now see if the caret extends beyond the view's bounds. If it does,
     // then snap it back, put it as close to the edge as it can.
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2575,17 +2575,17 @@ nsDocumentViewer::FindContainerView()
     return nullptr;
   }
 
   // subdocFrame might not be a subdocument frame; the frame
   // constructor can treat a <frame> as an inline in some XBL
   // cases. Treat that as display:none, the document is not
   // displayed.
   if (!subdocFrame->IsSubDocumentFrame()) {
-    NS_WARNING_ASSERTION(subdocFrame->Type() == FrameType::None,
+    NS_WARNING_ASSERTION(subdocFrame->Type() == LayoutFrameType::None,
                          "Subdocument container has non-subdocument frame");
     return nullptr;
   }
 
   NS_ASSERTION(subdocFrame->GetView(), "Subdoc frames must have views");
   return static_cast<nsSubDocumentFrame*>(subdocFrame)->EnsureInnerView();
 }
 
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1527,35 +1527,35 @@ nsLayoutUtils::GetChildListNameFor(nsIFr
       id = nsIFrame::kPopupList;
 #endif // MOZ_XUL
     } else {
       NS_ASSERTION(aChildFrame->IsFloating(), "not a floated frame");
       id = nsIFrame::kFloatList;
     }
 
   } else {
-    FrameType childType = aChildFrame->Type();
-    if (FrameType::MenuPopup == childType) {
+    LayoutFrameType childType = aChildFrame->Type();
+    if (LayoutFrameType::MenuPopup == childType) {
       nsIFrame* parent = aChildFrame->GetParent();
       MOZ_ASSERT(parent, "nsMenuPopupFrame can't be the root frame");
       if (parent) {
         if (parent->IsPopupSetFrame()) {
           id = nsIFrame::kPopupList;
         } else {
           nsIFrame* firstPopup = parent->GetChildList(nsIFrame::kPopupList).FirstChild();
           MOZ_ASSERT(!firstPopup || !firstPopup->GetNextSibling(),
                      "We assume popupList only has one child, but it has more.");
           id = firstPopup == aChildFrame
                  ? nsIFrame::kPopupList
                  : nsIFrame::kPrincipalList;
         }
       } else {
         id = nsIFrame::kPrincipalList;
       }
-    } else if (FrameType::TableColGroup == childType) {
+    } else if (LayoutFrameType::TableColGroup == childType) {
       id = nsIFrame::kColGroupList;
     } else if (aChildFrame->IsTableCaption()) {
       id = nsIFrame::kCaptionList;
     } else {
       id = nsIFrame::kPrincipalList;
     }
   }
 
@@ -1617,34 +1617,34 @@ nsLayoutUtils::GetAfterFrame(const nsICo
 {
   Element* pseudo = GetAfterPseudo(aContent);
   return pseudo ? pseudo->GetPrimaryFrame() : nullptr;
 }
 
 // static
 nsIFrame*
 nsLayoutUtils::GetClosestFrameOfType(nsIFrame* aFrame,
-                                     FrameType aFrameType,
+                                     LayoutFrameType aFrameType,
                                      nsIFrame* aStopAt)
 {
   for (nsIFrame* frame = aFrame; frame; frame = frame->GetParent()) {
     if (frame->Type() == aFrameType) {
       return frame;
     }
     if (frame == aStopAt) {
       break;
     }
   }
   return nullptr;
 }
 
 /* static */ nsIFrame*
 nsLayoutUtils::GetPageFrame(nsIFrame* aFrame)
 {
-  return GetClosestFrameOfType(aFrame, FrameType::Page);
+  return GetClosestFrameOfType(aFrame, LayoutFrameType::Page);
 }
 
 // static
 nsIFrame*
 nsLayoutUtils::GetStyleFrame(nsIFrame* aFrame)
 {
   if (aFrame->IsTableWrapperFrame()) {
     nsIFrame* inner = aFrame->PrincipalChildList().FirstChild();
@@ -2892,17 +2892,17 @@ nsLayoutUtils::ContainsPoint(const nsRec
   rect.Inflate(aInflateSize);
   return rect.Contains(aPoint);
 }
 
 nsRect
 nsLayoutUtils::ClampRectToScrollFrames(nsIFrame* aFrame, const nsRect& aRect)
 {
   nsIFrame* closestScrollFrame =
-    nsLayoutUtils::GetClosestFrameOfType(aFrame, FrameType::Scroll);
+    nsLayoutUtils::GetClosestFrameOfType(aFrame, LayoutFrameType::Scroll);
 
   nsRect resultRect = aRect;
 
   while (closestScrollFrame) {
     nsIScrollableFrame* sf = do_QueryFrame(closestScrollFrame);
 
     nsRect scrollPortRect = sf->GetScrollPortRect();
     nsLayoutUtils::TransformRect(closestScrollFrame, aFrame, scrollPortRect);
@@ -2910,19 +2910,18 @@ nsLayoutUtils::ClampRectToScrollFrames(n
     resultRect = resultRect.Intersect(scrollPortRect);
 
     // Check whether aRect is visible in the scroll frame or not.
     if (resultRect.IsEmpty()) {
       break;
     }
 
     // Get next ancestor scroll frame.
-    closestScrollFrame =
-      nsLayoutUtils::GetClosestFrameOfType(closestScrollFrame->GetParent(),
-                                           FrameType::Scroll);
+    closestScrollFrame = nsLayoutUtils::GetClosestFrameOfType(
+      closestScrollFrame->GetParent(), LayoutFrameType::Scroll);
   }
 
   return resultRect;
 }
 
 bool
 nsLayoutUtils::GetLayerTransformForFrame(nsIFrame* aFrame,
                                          Matrix4x4* aTransform)
@@ -3008,19 +3007,18 @@ TransformGfxRectToAncestor(nsIFrame *aFr
 
 static SVGTextFrame*
 GetContainingSVGTextFrame(nsIFrame* aFrame)
 {
   if (!nsSVGUtils::IsInSVGTextSubtree(aFrame)) {
     return nullptr;
   }
 
-  return static_cast<SVGTextFrame*>
-    (nsLayoutUtils::GetClosestFrameOfType(aFrame->GetParent(),
-                                          FrameType::SVGText));
+  return static_cast<SVGTextFrame*>(nsLayoutUtils::GetClosestFrameOfType(
+    aFrame->GetParent(), LayoutFrameType::SVGText));
 }
 
 nsPoint
 nsLayoutUtils::TransformAncestorPointToFrame(nsIFrame* aFrame,
                                              const nsPoint& aPoint,
                                              nsIFrame* aAncestor)
 {
     SVGTextFrame* text = GetContainingSVGTextFrame(aFrame);
@@ -3591,28 +3589,28 @@ nsLayoutUtils::PaintFrame(nsRenderingCon
         }
       }
 
       nsDisplayListBuilder::AutoCurrentScrollParentIdSetter idSetter(&builder, id);
 
       aFrame->BuildDisplayListForStackingContext(&builder, dirtyRect, &list);
     }
 
-    FrameType frameType = aFrame->Type();
+    LayoutFrameType frameType = aFrame->Type();
 
     // For the viewport frame in print preview/page layout we want to paint
     // the grey background behind the page, not the canvas color.
-    if (frameType == FrameType::Viewport &&
+    if (frameType == LayoutFrameType::Viewport &&
         nsLayoutUtils::NeedsPrintPreviewBackground(presContext)) {
       nsRect bounds = nsRect(builder.ToReferenceFrame(aFrame),
                              aFrame->GetSize());
       nsDisplayListBuilder::AutoBuildingDisplayList
         buildingDisplayList(&builder, aFrame, bounds, false);
       presShell->AddPrintPreviewBackgroundItem(builder, list, aFrame, bounds);
-    } else if (frameType != FrameType::Page) {
+    } else if (frameType != LayoutFrameType::Page) {
       // For printing, this function is first called on an nsPageFrame, which
       // creates a display list with a PageContent item. The PageContent item's
       // paint function calls this function on the nsPageFrame's child which is
       // an nsPageContentFrame. We only want to add the canvas background color
       // item once, for the nsPageContentFrame.
 
       // Add the canvas background color to the bottom of the list. This
       // happens after we've built the list so that AddCanvasBackgroundColorItem
@@ -4652,19 +4650,20 @@ GetPercentBSize(const nsStyleCoord& aSty
   const nsStylePosition *pos = f->StylePosition();
   const nsStyleCoord& bSizeCoord = pos->BSize(wm);
   nscoord h;
   if (!GetAbsoluteCoord(bSizeCoord, h) &&
       !GetPercentBSize(bSizeCoord, f, aHorizontalAxis, h)) {
     NS_ASSERTION(bSizeCoord.GetUnit() == eStyleUnit_Auto ||
                  bSizeCoord.HasPercent(),
                  "unknown block-size unit");
-    FrameType fType = f->Type();
-    if (fType != FrameType::Viewport && fType != FrameType::Canvas &&
-        fType != FrameType::PageContent) {
+    LayoutFrameType fType = f->Type();
+    if (fType != LayoutFrameType::Viewport &&
+        fType != LayoutFrameType::Canvas &&
+        fType != LayoutFrameType::PageContent) {
       // There's no basis for the percentage height, so it acts like auto.
       // Should we consider a max-height < min-height pair a basis for
       // percentage heights?  The spec is somewhat unclear, and not doing
       // so is simpler and avoids troubling discontinuities in behavior,
       // so I'll choose not to. -LDB
       return false;
     }
 
@@ -4830,31 +4829,31 @@ static int32_t gNoiseIndent = 0;
 inline static bool
 FormControlShrinksForPercentISize(nsIFrame* aFrame)
 {
   if (!aFrame->IsFrameOfType(nsIFrame::eReplaced)) {
     // Quick test to reject most frames.
     return false;
   }
 
-  FrameType fType = aFrame->Type();
-  if (fType == FrameType::Meter || fType == FrameType::Progress) {
+  LayoutFrameType fType = aFrame->Type();
+  if (fType == LayoutFrameType::Meter || fType == LayoutFrameType::Progress) {
     // progress and meter do have this shrinking behavior
     // FIXME: Maybe these should be nsIFormControlFrame?
     return true;
   }
 
   if (!static_cast<nsIFormControlFrame*>(do_QueryFrame(aFrame))) {
     // Not a form control.  This includes fieldsets, which do not
     // shrink.
     return false;
   }
 
-  if (fType == FrameType::GfxButtonControl ||
-      fType == FrameType::HTMLButtonControl) {
+  if (fType == LayoutFrameType::GfxButtonControl ||
+      fType == LayoutFrameType::HTMLButtonControl) {
     // Buttons don't have this shrinking behavior.  (Note that color
     // inputs do, even though they inherit from button, so we can't use
     // do_QueryFrame here.)
     return false;
   }
 
   return true;
 }
@@ -5962,25 +5961,25 @@ nsLayoutUtils::GetFirstLineBaseline(Writ
 nsLayoutUtils::GetFirstLinePosition(WritingMode aWM,
                                     const nsIFrame* aFrame,
                                     LinePosition* aResult)
 {
   const nsBlockFrame* block = nsLayoutUtils::GetAsBlock(const_cast<nsIFrame*>(aFrame));
   if (!block) {
     // For the first-line baseline we also have to check for a table, and if
     // so, use the baseline of its first row.
-    FrameType fType = aFrame->Type();
-    if (fType == FrameType::TableWrapper  ||
-        fType == FrameType::FlexContainer ||
-        fType == FrameType::GridContainer) {
-      if ((fType == FrameType::GridContainer &&
+    LayoutFrameType fType = aFrame->Type();
+    if (fType == LayoutFrameType::TableWrapper ||
+        fType == LayoutFrameType::FlexContainer ||
+        fType == LayoutFrameType::GridContainer) {
+      if ((fType == LayoutFrameType::GridContainer &&
            aFrame->HasAnyStateBits(NS_STATE_GRID_SYNTHESIZE_BASELINE)) ||
-          (fType == FrameType::FlexContainer &&
+          (fType == LayoutFrameType::FlexContainer &&
            aFrame->HasAnyStateBits(NS_STATE_FLEX_SYNTHESIZE_BASELINE)) ||
-          (fType == FrameType::TableWrapper &&
+          (fType == LayoutFrameType::TableWrapper &&
            static_cast<const nsTableWrapperFrame*>(aFrame)->GetRowCount() == 0)) {
         // empty grid/flex/table container
         aResult->mBStart = 0;
         aResult->mBaseline = aFrame->SynthesizeBaselineBOffsetFromBorderBox(aWM,
                                        BaselineSharingGroup::eFirst);
         aResult->mBEnd = aFrame->BSize(aWM);
         return true;
       }
@@ -5988,17 +5987,17 @@ nsLayoutUtils::GetFirstLinePosition(Writ
       aResult->mBaseline = aFrame->GetLogicalBaseline(aWM);
       // This is what we want for the list bullet caller; not sure if
       // other future callers will want the same.
       aResult->mBEnd = aFrame->BSize(aWM);
       return true;
     }
 
     // For first-line baselines, we have to consider scroll frames.
-    if (fType == FrameType::Scroll) {
+    if (fType == LayoutFrameType::Scroll) {
       nsIScrollableFrame *sFrame = do_QueryFrame(const_cast<nsIFrame*>(aFrame));
       if (!sFrame) {
         NS_NOTREACHED("not scroll frame");
       }
       LinePosition kidPosition;
       if (GetFirstLinePosition(aWM,
                                sFrame->GetScrolledFrame(), &kidPosition)) {
         // Consider only the border and padding that contributes to the
@@ -6006,17 +6005,17 @@ nsLayoutUtils::GetFirstLinePosition(Writ
         // position.
         *aResult = kidPosition +
           aFrame->GetLogicalUsedBorderAndPadding(aWM).BStart(aWM);
         return true;
       }
       return false;
     }
 
-    if (fType == FrameType::FieldSet) {
+    if (fType == LayoutFrameType::FieldSet) {
       LinePosition kidPosition;
       nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
       // kid might be a legend frame here, but that's ok.
       if (GetFirstLinePosition(aWM, kid, &kidPosition)) {
         *aResult = kidPosition +
           kid->GetLogicalNormalPosition(aWM, aFrame->GetSize()).B(aWM);
         return true;
       }
@@ -6937,24 +6936,24 @@ nsLayoutUtils::GetFrameTransparency(nsIF
       bg->BottomLayer().mClip != StyleGeometryBox::BorderBox)
     return eTransparencyTransparent;
   return eTransparencyOpaque;
 }
 
 static bool IsPopupFrame(nsIFrame* aFrame)
 {
   // aFrame is a popup it's the list control frame dropdown for a combobox.
-  FrameType frameType = aFrame->Type();
-  if (frameType == FrameType::ListControl) {
+  LayoutFrameType frameType = aFrame->Type();
+  if (frameType == LayoutFrameType::ListControl) {
     nsListControlFrame* lcf = static_cast<nsListControlFrame*>(aFrame);
     return lcf->IsInDropDownMode();
   }
 
   // ... or if it's a XUL menupopup frame.
-  return frameType == FrameType::MenuPopup;
+  return frameType == LayoutFrameType::MenuPopup;
 }
 
 /* static */ bool
 nsLayoutUtils::IsPopup(nsIFrame* aFrame)
 {
   // Optimization: the frame can't possibly be a popup if it has no view.
   if (!aFrame->HasView()) {
     NS_ASSERTION(!IsPopupFrame(aFrame), "popup frame must have a view");
@@ -7121,19 +7120,19 @@ nsLayoutUtils::GetDeviceContextForScreen
 nsLayoutUtils::IsReallyFixedPos(nsIFrame* aFrame)
 {
   NS_PRECONDITION(aFrame->GetParent(),
                   "IsReallyFixedPos called on frame not in tree");
   NS_PRECONDITION(aFrame->StyleDisplay()->mPosition ==
                     NS_STYLE_POSITION_FIXED,
                   "IsReallyFixedPos called on non-'position:fixed' frame");
 
-  FrameType parentType = aFrame->GetParent()->Type();
-  return parentType == FrameType::Viewport ||
-         parentType == FrameType::PageContent;
+  LayoutFrameType parentType = aFrame->GetParent()->Type();
+  return parentType == LayoutFrameType::Viewport ||
+         parentType == LayoutFrameType::PageContent;
 }
 
 nsLayoutUtils::SurfaceFromElementResult
 nsLayoutUtils::SurfaceFromOffscreenCanvas(OffscreenCanvas* aOffscreenCanvas,
                                           uint32_t aSurfaceFlags,
                                           RefPtr<DrawTarget>& aTarget)
 {
   SurfaceFromElementResult result;
@@ -7932,29 +7931,29 @@ nsLayoutUtils::FontSizeInflationInner(co
 
   // If between this current frame and its font inflation container there is a
   // non-inline element with fixed width or height, then we should not inflate
   // fonts for this frame.
   for (const nsIFrame* f = aFrame;
        f && !f->IsContainerForFontSizeInflation();
        f = f->GetParent()) {
     nsIContent* content = f->GetContent();
-    FrameType fType = f->Type();
+    LayoutFrameType fType = f->Type();
     nsIFrame* parent = f->GetParent();
     // Also, if there is more than one frame corresponding to a single
     // content node, we want the outermost one.
     if (!(parent && parent->GetContent() == content) &&
         // ignore width/height on inlines since they don't apply
-        fType != FrameType::Inline &&
+        fType != LayoutFrameType::Inline &&
         // ignore width on radios and checkboxes since we enlarge them and
         // they have width/height in ua.css
-        fType != FrameType::FormControl) {
+        fType != LayoutFrameType::FormControl) {
       // ruby annotations should have the same inflation as its
       // grandparent, which is the ruby frame contains the annotation.
-      if (fType == FrameType::RubyText) {
+      if (fType == LayoutFrameType::RubyText) {
         MOZ_ASSERT(parent && parent->IsRubyTextContainerFrame());
         nsIFrame* grandparent = parent->GetParent();
         MOZ_ASSERT(grandparent && grandparent->IsRubyFrame());
         return FontSizeInflationFor(grandparent);
       }
       nsStyleCoord stylePosWidth = f->StylePosition()->mWidth;
       nsStyleCoord stylePosHeight = f->StylePosition()->mHeight;
       if (stylePosWidth.GetUnit() != eStyleUnit_Auto ||
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -61,17 +61,17 @@ class nsIDocument;
 struct gfxPoint;
 struct nsStyleFont;
 struct nsStyleImageOrientation;
 struct nsOverflowAreas;
 
 namespace mozilla {
 enum class CSSPseudoElementType : uint8_t;
 class EventListenerManager;
-enum class FrameType : uint8_t;
+enum class LayoutFrameType : uint8_t;
 struct IntrinsicSize;
 struct ContainerLayerParameters;
 class WritingMode;
 namespace dom {
 class CanvasRenderingContext2D;
 class DOMRectList;
 class Element;
 class HTMLImageElement;
@@ -314,25 +314,25 @@ public:
    *
    * @param aFrame the frame to start at
    * @param aFrameType the frame type to look for
    * @param aStopAt a frame to stop at after we checked it
    * @return a frame of the given type or nullptr if no
    *         such ancestor exists
    */
   static nsIFrame* GetClosestFrameOfType(nsIFrame* aFrame,
-                                         mozilla::FrameType aFrameType,
+                                         mozilla::LayoutFrameType aFrameType,
                                          nsIFrame* aStopAt = nullptr);
 
   /**
    * Given a frame, search up the frame tree until we find an
    * ancestor that (or the frame itself) is a "Page" frame, if any.
    *
    * @param aFrame the frame to start at
-   * @return a frame of type mozilla::FrameType::Page or nullptr if no
+   * @return a frame of type mozilla::LayoutFrameType::Page or nullptr if no
    *         such ancestor exists
    */
   static nsIFrame* GetPageFrame(nsIFrame* aFrame);
 
   /**
    * Given a frame which is the primary frame for an element,
    * return the frame that has the non-pseudoelement style context for
    * the content.
--- a/layout/forms/nsColorControlFrame.cpp
+++ b/layout/forms/nsColorControlFrame.cpp
@@ -18,17 +18,17 @@
 #include "mozilla/dom/HTMLInputElement.h"
 #include "nsIDocument.h"
 
 using mozilla::dom::Element;
 using mozilla::dom::HTMLInputElement;
 using mozilla::dom::CallerType;
 
 nsColorControlFrame::nsColorControlFrame(nsStyleContext* aContext)
-  : nsHTMLButtonControlFrame(aContext, FrameType::ColorControl)
+  : nsHTMLButtonControlFrame(aContext, LayoutFrameType::ColorControl)
 {
 }
 
 nsIFrame*
 NS_NewColorControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsColorControlFrame(aContext);
 }
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -218,17 +218,17 @@ static int32_t gReflowInx = -1;
 #define PX(__v) __v
 #endif
 
 //------------------------------------------------------
 //-- Done with macros
 //------------------------------------------------------
 
 nsComboboxControlFrame::nsComboboxControlFrame(nsStyleContext* aContext)
-  : nsBlockFrame(aContext, FrameType::ComboboxControl)
+  : nsBlockFrame(aContext, LayoutFrameType::ComboboxControl)
   , mDisplayFrame(nullptr)
   , mButtonFrame(nullptr)
   , mDropdownFrame(nullptr)
   , mListControlFrame(nullptr)
   , mDisplayISize(0)
   , mRecentSelectedIndex(NS_SKIP_NOTIFY_INDEX)
   , mDisplayedIndex(-1)
   , mLastDropDownBeforeScreenBCoord(nscoord_MIN)
@@ -1273,17 +1273,17 @@ nsComboboxControlFrame::AppendAnonymousC
 // XXXbz this is a for-now hack.  Now that display:inline-block works,
 // need to revisit this.
 class nsComboboxDisplayFrame : public nsBlockFrame {
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   nsComboboxDisplayFrame(nsStyleContext* aContext,
                          nsComboboxControlFrame* aComboBox)
-    : nsBlockFrame(aContext, FrameType::ComboboxDisplay)
+    : nsBlockFrame(aContext, LayoutFrameType::ComboboxDisplay)
     , mComboBox(aComboBox)
   {}
 
 #ifdef DEBUG_FRAME_DUMP
   nsresult GetFrameName(nsAString& aResult) const override
   {
     return MakeFrameName(NS_LITERAL_STRING("ComboboxDisplay"), aResult);
   }
--- a/layout/forms/nsDateTimeControlFrame.cpp
+++ b/layout/forms/nsDateTimeControlFrame.cpp
@@ -38,17 +38,17 @@ NS_NewDateTimeControlFrame(nsIPresShell*
 NS_IMPL_FRAMEARENA_HELPERS(nsDateTimeControlFrame)
 
 NS_QUERYFRAME_HEAD(nsDateTimeControlFrame)
   NS_QUERYFRAME_ENTRY(nsDateTimeControlFrame)
   NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
 NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
 
 nsDateTimeControlFrame::nsDateTimeControlFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::DateTimeControl)
+  : nsContainerFrame(aContext, LayoutFrameType::DateTimeControl)
 {
 }
 
 void
 nsDateTimeControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
 {
   nsContentUtils::DestroyAnonymousContent(&mInputAreaContent);
   nsContainerFrame::DestroyFrom(aDestructRoot);
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -27,17 +27,17 @@ nsContainerFrame*
 NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsFieldSetFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsFieldSetFrame)
 
 nsFieldSetFrame::nsFieldSetFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::FieldSet)
+  : nsContainerFrame(aContext, LayoutFrameType::FieldSet)
   , mLegendRect(GetWritingMode())
 {
   mLegendSpace  = 0;
 }
 
 nsRect
 nsFieldSetFrame::VisualBorderRectRelativeToSelf() const
 {
--- a/layout/forms/nsFormControlFrame.cpp
+++ b/layout/forms/nsFormControlFrame.cpp
@@ -13,17 +13,17 @@
 #include "nsDeviceContext.h"
 #include "nsIContent.h"
 
 using namespace mozilla;
 
 //#define FCF_NOISY
 
 nsFormControlFrame::nsFormControlFrame(nsStyleContext* aContext)
-  : nsAtomicContainerFrame(aContext, FrameType::FormControl)
+  : nsAtomicContainerFrame(aContext, LayoutFrameType::FormControl)
 {
 }
 
 nsFormControlFrame::~nsFormControlFrame()
 {
 }
 
 void
--- a/layout/forms/nsGfxButtonControlFrame.cpp
+++ b/layout/forms/nsGfxButtonControlFrame.cpp
@@ -14,17 +14,17 @@
 #include "nsContentList.h"
 
 #include "nsIDOMHTMLInputElement.h"
 #include "nsTextNode.h"
 
 using namespace mozilla;
 
 nsGfxButtonControlFrame::nsGfxButtonControlFrame(nsStyleContext* aContext)
-  : nsHTMLButtonControlFrame(aContext, FrameType::GfxButtonControl)
+  : nsHTMLButtonControlFrame(aContext, LayoutFrameType::GfxButtonControl)
 {
 }
 
 nsContainerFrame*
 NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsGfxButtonControlFrame(aContext);
 }
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -22,17 +22,17 @@ nsContainerFrame*
 NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsHTMLButtonControlFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsHTMLButtonControlFrame)
 
 nsHTMLButtonControlFrame::nsHTMLButtonControlFrame(nsStyleContext* aContext,
-                                                   FrameType aType)
+                                                   LayoutFrameType aType)
   : nsContainerFrame(aContext, aType)
 {
 }
 
 nsHTMLButtonControlFrame::~nsHTMLButtonControlFrame()
 {
 }
 
--- a/layout/forms/nsHTMLButtonControlFrame.h
+++ b/layout/forms/nsHTMLButtonControlFrame.h
@@ -14,17 +14,18 @@
 class nsRenderingContext;
 class nsPresContext;
 
 class nsHTMLButtonControlFrame : public nsContainerFrame,
                                  public nsIFormControlFrame
 {
 public:
   explicit nsHTMLButtonControlFrame(nsStyleContext* aContext)
-    : nsHTMLButtonControlFrame(aContext, mozilla::FrameType::HTMLButtonControl)
+    : nsHTMLButtonControlFrame(aContext,
+                               mozilla::LayoutFrameType::HTMLButtonControl)
   {}
 
   ~nsHTMLButtonControlFrame();
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
@@ -100,17 +101,18 @@ public:
 
   /**
    * Update the style of our ::-moz-button-content anonymous box.
    */
   void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet,
                                      nsStyleChangeList& aChangeList,
                                      nsChangeHint aHintForThisFrame) override;
 protected:
-  nsHTMLButtonControlFrame(nsStyleContext* aContext, mozilla::FrameType aType);
+  nsHTMLButtonControlFrame(nsStyleContext* aContext,
+                           mozilla::LayoutFrameType aType);
 
   virtual bool IsInput() { return false; }
 
   // Indicates whether we should clip our children's painting to our
   // border-box (either because of "overflow" or because of legacy reasons
   // about how <input>-flavored buttons work).
   bool ShouldClipPaintingToBorderBox();
 
--- a/layout/forms/nsImageControlFrame.cpp
+++ b/layout/forms/nsImageControlFrame.cpp
@@ -53,17 +53,17 @@ public:
                              nsIFrame::Cursor& aCursor) override;
   // nsIFormContromFrame
   virtual void SetFocus(bool aOn, bool aRepaint) override;
   virtual nsresult SetFormProperty(nsIAtom* aName,
                                    const nsAString& aValue) override;
 };
 
 nsImageControlFrame::nsImageControlFrame(nsStyleContext* aContext)
-  : nsImageFrame(aContext, FrameType::ImageControl)
+  : nsImageFrame(aContext, LayoutFrameType::ImageControl)
 {
 }
 
 nsImageControlFrame::~nsImageControlFrame()
 {
 }
 
 void
--- a/layout/forms/nsLegendFrame.h
+++ b/layout/forms/nsLegendFrame.h
@@ -12,17 +12,17 @@
 class nsLegendFrame final : public nsBlockFrame
 {
 public:
   NS_DECL_QUERYFRAME_TARGET(nsLegendFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit nsLegendFrame(nsStyleContext* aContext)
-    : nsBlockFrame(aContext, mozilla::FrameType::Legend)
+    : nsBlockFrame(aContext, mozilla::LayoutFrameType::Legend)
   {}
 
   virtual void Reflow(nsPresContext* aPresContext,
                       ReflowOutput& aDesiredSize,
                       const ReflowInput& aReflowInput,
                       nsReflowStatus& aStatus) override;
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -87,17 +87,17 @@ NS_NewListControlFrame(nsIPresShell* aPr
 
   return it;
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsListControlFrame)
 
 //---------------------------------------------------------
 nsListControlFrame::nsListControlFrame(nsStyleContext* aContext)
-  : nsHTMLScrollFrame(aContext, FrameType::ListControl, false)
+  : nsHTMLScrollFrame(aContext, LayoutFrameType::ListControl, false)
   , mView(nullptr)
   , mMightNeedSecondPass(false)
   , mHasPendingInterruptAtStartOfReflow(false)
   , mDropdownCanGrow(false)
   , mForceSelection(false)
   , mLastDropdownComputedBSize(NS_UNCONSTRAINEDSIZE)
 {
   mComboboxFrame      = nullptr;
--- a/layout/forms/nsMeterFrame.cpp
+++ b/layout/forms/nsMeterFrame.cpp
@@ -34,17 +34,17 @@ nsIFrame*
 NS_NewMeterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsMeterFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsMeterFrame)
 
 nsMeterFrame::nsMeterFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::Meter)
+  : nsContainerFrame(aContext, LayoutFrameType::Meter)
   , mBarDiv(nullptr)
 {
 }
 
 nsMeterFrame::~nsMeterFrame()
 {
 }
 
--- a/layout/forms/nsNumberControlFrame.cpp
+++ b/layout/forms/nsNumberControlFrame.cpp
@@ -45,17 +45,17 @@ NS_IMPL_FRAMEARENA_HELPERS(nsNumberContr
 
 NS_QUERYFRAME_HEAD(nsNumberControlFrame)
   NS_QUERYFRAME_ENTRY(nsNumberControlFrame)
   NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
   NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
 
 nsNumberControlFrame::nsNumberControlFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::NumberControl)
+  : nsContainerFrame(aContext, LayoutFrameType::NumberControl)
   , mHandlingInputEvent(false)
 {
 }
 
 void
 nsNumberControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
 {
   NS_ASSERTION(!GetPrevContinuation() && !GetNextContinuation(),
--- a/layout/forms/nsProgressFrame.cpp
+++ b/layout/forms/nsProgressFrame.cpp
@@ -33,17 +33,17 @@ nsIFrame*
 NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsProgressFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsProgressFrame)
 
 nsProgressFrame::nsProgressFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::Progress)
+  : nsContainerFrame(aContext, LayoutFrameType::Progress)
   , mBarDiv(nullptr)
 {
 }
 
 nsProgressFrame::~nsProgressFrame()
 {
 }
 
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -42,17 +42,17 @@ NS_IMPL_ISUPPORTS(nsRangeFrame::DummyTou
 
 nsIFrame*
 NS_NewRangeFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsRangeFrame(aContext);
 }
 
 nsRangeFrame::nsRangeFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::Range)
+  : nsContainerFrame(aContext, LayoutFrameType::Range)
 {
 }
 
 nsRangeFrame::~nsRangeFrame()
 {
 #ifdef DEBUG
   if (mOuterFocusStyle) {
     mOuterFocusStyle->FrameRelease();
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -99,17 +99,17 @@ public:
   bool EnteredMoreThanOnce() const { return !mFirstEntry; }
 private:
   nsTextControlFrame &mFrame;
   bool mFirstEntry;
 };
 #endif
 
 nsTextControlFrame::nsTextControlFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::TextInput)
+  : nsContainerFrame(aContext, LayoutFrameType::TextInput)
   , mFirstBaseline(NS_INTRINSIC_WIDTH_UNKNOWN)
   , mEditorHasBeenInitialized(false)
   , mIsProcessing(false)
   , mUsePlaceholder(false)
   , mUsePreview(false)
 #ifdef DEBUG
   , mInEditorInitialization(false)
 #endif
--- a/layout/generic/BRFrame.cpp
+++ b/layout/generic/BRFrame.cpp
@@ -59,17 +59,17 @@ public:
   }
 
 #ifdef ACCESSIBILITY
   virtual mozilla::a11y::AccType AccessibleType() override;
 #endif
 
 protected:
   explicit BRFrame(nsStyleContext* aContext)
-    : nsFrame(aContext, FrameType::Br)
+    : nsFrame(aContext, LayoutFrameType::Br)
   {}
 
   virtual ~BRFrame();
 
   nscoord mAscent;
 };
 
 } // namespace mozilla
--- a/layout/generic/DetailsFrame.cpp
+++ b/layout/generic/DetailsFrame.cpp
@@ -26,17 +26,17 @@ nsBlockFrame*
 NS_NewDetailsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) DetailsFrame(aContext);
 }
 
 namespace mozilla {
 
 DetailsFrame::DetailsFrame(nsStyleContext* aContext)
-  : nsBlockFrame(aContext, FrameType::Details)
+  : nsBlockFrame(aContext, LayoutFrameType::Details)
 {
 }
 
 DetailsFrame::~DetailsFrame()
 {
 }
 
 void
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -322,18 +322,18 @@ ReflowInput::SetComputedWidth(nscoord aC
   //    state is not used to reflow the parent, but just as a parent for the
   //    frame's own reflow state.  So given a nsBoxFrame inside some non-XUL
   //    (like a text control, for example), we'll end up creating a reflow
   //    state for the parent while the parent is reflowing.
 
   NS_PRECONDITION(aComputedWidth >= 0, "Invalid computed width");
   if (ComputedWidth() != aComputedWidth) {
     ComputedWidth() = aComputedWidth;
-    FrameType frameType = mFrame->Type();
-    if (frameType != FrameType::Viewport || // Or check GetParent()?
+    LayoutFrameType frameType = mFrame->Type();
+    if (frameType != LayoutFrameType::Viewport || // Or check GetParent()?
         mWritingMode.IsVertical()) {
       InitResizeFlags(mFrame->PresContext(), frameType);
     }
   }
 }
 
 void
 ReflowInput::SetComputedHeight(nscoord aComputedHeight)
@@ -346,18 +346,18 @@ ReflowInput::SetComputedHeight(nscoord a
   //    state is not used to reflow the parent, but just as a parent for the
   //    frame's own reflow state.  So given a nsBoxFrame inside some non-XUL
   //    (like a text control, for example), we'll end up creating a reflow
   //    state for the parent while the parent is reflowing.
 
   NS_PRECONDITION(aComputedHeight >= 0, "Invalid computed height");
   if (ComputedHeight() != aComputedHeight) {
     ComputedHeight() = aComputedHeight;
-    FrameType frameType = mFrame->Type();
-    if (frameType != FrameType::Viewport || !mWritingMode.IsVertical()) {
+    LayoutFrameType frameType = mFrame->Type();
+    if (frameType != LayoutFrameType::Viewport || !mWritingMode.IsVertical()) {
       InitResizeFlags(mFrame->PresContext(), frameType);
     }
   }
 }
 
 void
 ReflowInput::Init(nsPresContext*     aPresContext,
                         const LogicalSize* aContainingBlockSize,
@@ -385,17 +385,17 @@ ReflowInput::Init(nsPresContext*     aPr
   mStylePosition = mFrame->StylePosition();
   mStyleDisplay = mFrame->StyleDisplay();
   mStyleVisibility = mFrame->StyleVisibility();
   mStyleBorder = mFrame->StyleBorder();
   mStyleMargin = mFrame->StyleMargin();
   mStylePadding = mFrame->StylePadding();
   mStyleText = mFrame->StyleText();
 
-  FrameType type = mFrame->Type();
+  LayoutFrameType type = mFrame->Type();
 
   InitFrameType(type);
   InitCBReflowInput();
 
   LogicalSize cbSize(mWritingMode, -1, -1);
   if (aContainingBlockSize) {
     cbSize = *aContainingBlockSize;
   }
@@ -405,17 +405,17 @@ ReflowInput::Init(nsPresContext*     aPr
   InitResizeFlags(aPresContext, type);
 
   nsIFrame *parent = mFrame->GetParent();
   if (parent &&
       (parent->GetStateBits() & NS_FRAME_IN_CONSTRAINED_BSIZE) &&
       !(parent->IsScrollFrame() &&
         parent->StyleDisplay()->mOverflowY != NS_STYLE_OVERFLOW_HIDDEN)) {
     mFrame->AddStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
-  } else if (type == FrameType::SVGForeignObject) {
+  } else if (type == LayoutFrameType::SVGForeignObject) {
     // An SVG foreignObject frame is inherently constrained block-size.
     mFrame->AddStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
   } else {
     const nsStyleCoord& bSizeCoord = mStylePosition->BSize(mWritingMode);
     const nsStyleCoord& maxBSizeCoord = mStylePosition->MaxBSize(mWritingMode);
     if ((bSizeCoord.GetUnit() != eStyleUnit_Auto ||
          maxBSizeCoord.GetUnit() != eStyleUnit_None) &&
          // Don't set NS_FRAME_IN_CONSTRAINED_BSIZE on body or html elements.
@@ -461,27 +461,27 @@ ReflowInput::Init(nsPresContext*     aPr
 
   if (mParentReflowInput &&
       mParentReflowInput->GetWritingMode().IsOrthogonalTo(mWritingMode)) {
     // Orthogonal frames are always reflowed with an unconstrained
     // dimension to avoid incomplete reflow across an orthogonal
     // boundary. Normally this is the block-size, but for column sets
     // with auto-height it's the inline-size, so that they can add
     // columns in the container's block direction
-    if (type == FrameType::ColumnSet &&
+    if (type == LayoutFrameType::ColumnSet &&
         eStyleUnit_Auto == mStylePosition->ISize(mWritingMode).GetUnit()) {
       ComputedISize() = NS_UNCONSTRAINEDSIZE;
     } else {
       AvailableBSize() = NS_UNCONSTRAINEDSIZE;
     }
   }
 
   LAYOUT_WARN_IF_FALSE((mFrameType == NS_CSS_FRAME_TYPE_INLINE &&
                         !mFrame->IsFrameOfType(nsIFrame::eReplaced)) ||
-                       type == FrameType::Text ||
+                       type == LayoutFrameType::Text ||
                        ComputedISize() != NS_UNCONSTRAINEDSIZE,
                        "have unconstrained inline-size; this should only "
                        "result from very large sizes, not attempts at "
                        "intrinsic inline-size calculation");
 }
 
 void ReflowInput::InitCBReflowInput()
 {
@@ -511,36 +511,37 @@ void ReflowInput::InitCBReflowInput()
  * given reflow state, using its block as a height.  (essentially 
  * returns false for any case in which CalcQuirkContainingBlockHeight 
  * has a "continue" in its main loop.)
  *
  * XXX Maybe refactor CalcQuirkContainingBlockHeight so it uses 
  * this function as well
  */
 static bool
-IsQuirkContainingBlockHeight(const ReflowInput* rs, FrameType aFrameType)
+IsQuirkContainingBlockHeight(const ReflowInput* rs, LayoutFrameType aFrameType)
 {
-  if (FrameType::Block == aFrameType ||
+  if (LayoutFrameType::Block == aFrameType ||
 #ifdef MOZ_XUL
-      FrameType::XULLabel == aFrameType ||
+      LayoutFrameType::XULLabel == aFrameType ||
 #endif
-      FrameType::Scroll == aFrameType) {
+      LayoutFrameType::Scroll == aFrameType) {
     // Note: This next condition could change due to a style change,
     // but that would cause a style reflow anyway, which means we're ok.
     if (NS_AUTOHEIGHT == rs->ComputedHeight()) {
       if (!rs->mFrame->IsAbsolutelyPositioned()) {
         return false;
       }
     }
   }
   return true;
 }
 
 void
-ReflowInput::InitResizeFlags(nsPresContext* aPresContext, FrameType aFrameType)
+ReflowInput::InitResizeFlags(nsPresContext* aPresContext,
+                             LayoutFrameType aFrameType)
 {
   SetBResize(false);
   SetIResize(false);
 
   const WritingMode wm = mWritingMode; // just a shorthand
   // We should report that we have a resize in the inline dimension if
   // *either* the border-box size or the content-box size in that
   // dimension has changed.  It might not actually be necessary to do
@@ -804,31 +805,31 @@ ReflowInput::GetContainingBlockContentIS
     return 0;
   }
   return mCBReflowInput->GetWritingMode().IsOrthogonalTo(aWritingMode)
     ? mCBReflowInput->ComputedBSize()
     : mCBReflowInput->ComputedISize();
 }
 
 void
-ReflowInput::InitFrameType(FrameType aFrameType)
+ReflowInput::InitFrameType(LayoutFrameType aFrameType)
 {
   const nsStyleDisplay *disp = mStyleDisplay;
   nsCSSFrameType frameType;
 
   // Section 9.7 of the CSS2 spec indicates that absolute position
   // takes precedence over float which takes precedence over display.
   // XXXldb nsRuleNode::ComputeDisplayData should take care of this, right?
   // Make sure the frame was actually moved out of the flow, and don't
   // just assume what the style says, because we might not have had a
   // useful float/absolute containing block
 
   DISPLAY_INIT_TYPE(mFrame, this);
 
-  if (aFrameType == FrameType::Table) {
+  if (aFrameType == LayoutFrameType::Table) {
     mFrameType = NS_CSS_FRAME_TYPE_BLOCK;
     return;
   }
 
   NS_ASSERTION(mFrame->StyleDisplay()->IsAbsolutelyPositionedStyle() ==
                  disp->IsAbsolutelyPositionedStyle(),
                "Unexpected position style");
   NS_ASSERTION(mFrame->StyleDisplay()->IsFloatingStyle() ==
@@ -1116,26 +1117,26 @@ struct nsHypotheticalPosition {
   // offset from block-start edge of containing block (which is a padding edge)
   nscoord       mBStart;
   WritingMode   mWritingMode;
 };
 
 static bool
 GetIntrinsicSizeFor(nsIFrame* aFrame,
                     nsSize& aIntrinsicSize,
-                    FrameType aFrameType)
+                    LayoutFrameType aFrameType)
 {
   // See if it is an image frame
   bool success = false;
 
   // Currently the only type of replaced frame that we can get the intrinsic
   // size for is an image frame
   // XXX We should add back the GetReflowOutput() function and one of the
   // things should be the intrinsic size...
-  if (aFrameType == FrameType::Image) {
+  if (aFrameType == LayoutFrameType::Image) {
     nsImageFrame* imageFrame = (nsImageFrame*)aFrame;
 
     if (NS_SUCCEEDED(imageFrame->GetIntrinsicImageSize(aIntrinsicSize))) {
       success = (aIntrinsicSize != nsSize(0, 0));
     }
   }
   return success;
 }
@@ -1253,17 +1254,17 @@ static bool AreAllEarlierInFlowFramesEmp
 // |containingBlock| is the nearest block container of the placeholder frame,
 // which may be different from the absolute containing block.
 void
 ReflowInput::CalculateHypotheticalPosition(
   nsPresContext* aPresContext,
   nsIFrame* aPlaceholderFrame,
   const ReflowInput* cbrs,
   nsHypotheticalPosition& aHypotheticalPos,
-  FrameType aFrameType) const
+  LayoutFrameType aFrameType) const
 {
   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
@@ -1552,24 +1553,24 @@ ReflowInput::CalculateHypotheticalPositi
     aHypotheticalPos.mWritingMode = wm;
   }
 }
 
 void
 ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext,
                                      const ReflowInput* cbrs,
                                      const LogicalSize& aCBSize,
-                                     FrameType aFrameType)
+                                     LayoutFrameType aFrameType)
 {
   WritingMode wm = GetWritingMode();
   WritingMode cbwm = cbrs->GetWritingMode();
   NS_PRECONDITION(aCBSize.BSize(cbwm) != NS_AUTOHEIGHT,
                   "containing block bsize must be constrained");
 
-  NS_ASSERTION(aFrameType != FrameType::Table,
+  NS_ASSERTION(aFrameType != LayoutFrameType::Table,
                "InitAbsoluteConstraints should not be called on table frames");
   NS_ASSERTION(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
                "Why are we here?");
 
   const auto& styleOffset = mStylePosition->mOffset;
   bool iStartIsAuto = styleOffset.GetIStartUnit(cbwm) == eStyleUnit_Auto;
   bool iEndIsAuto   = styleOffset.GetIEndUnit(cbwm) == eStyleUnit_Auto;
   bool bStartIsAuto = styleOffset.GetBStartUnit(cbwm) == eStyleUnit_Auto;
@@ -1957,62 +1958,62 @@ CalcQuirkContainingBlockHeight(const Ref
   
   // initialize the default to NS_AUTOHEIGHT as this is the containings block
   // computed height when this function is called. It is possible that we 
   // don't alter this height especially if we are restricted to one level
   nscoord result = NS_AUTOHEIGHT;
 
   const ReflowInput* rs = aCBReflowInput;
   for (; rs; rs = rs->mParentReflowInput) {
-    FrameType frameType = rs->mFrame->Type();
+    LayoutFrameType frameType = rs->mFrame->Type();
     // if the ancestor is auto height then skip it and continue up if it
     // is the first block frame and possibly the body/html
-    if (FrameType::Block == frameType ||
+    if (LayoutFrameType::Block == frameType ||
 #ifdef MOZ_XUL
-        FrameType::XULLabel == frameType ||
+        LayoutFrameType::XULLabel == frameType ||
 #endif
-        FrameType::Scroll == frameType) {
+        LayoutFrameType::Scroll == frameType) {
 
       secondAncestorRI = firstAncestorRI;
       firstAncestorRI = rs;
 
       // If the current frame we're looking at is positioned, we don't want to
       // go any further (see bug 221784).  The behavior we want here is: 1) If
       // not auto-height, use this as the percentage base.  2) If auto-height,
       // keep looking, unless the frame is positioned.
       if (NS_AUTOHEIGHT == rs->ComputedHeight()) {
         if (rs->mFrame->IsAbsolutelyPositioned()) {
           break;
         } else {
           continue;
         }
       }
-    } else if (FrameType::Canvas == frameType) {
+    } else if (LayoutFrameType::Canvas == frameType) {
       // Always continue on to the height calculation
-    } else if (FrameType::PageContent == frameType) {
+    } else if (LayoutFrameType::PageContent == frameType) {
       nsIFrame* prevInFlow = rs->mFrame->GetPrevInFlow();
       // only use the page content frame for a height basis if it is the first in flow
       if (prevInFlow) 
         break;
     }
     else {
       break;
     }
 
     // if the ancestor is the page content frame then the percent base is 
     // the avail height, otherwise it is the computed height
-    result = (FrameType::PageContent == frameType) ? rs->AvailableHeight()
-                                                   : rs->ComputedHeight();
+    result = (LayoutFrameType::PageContent == frameType) ? rs->AvailableHeight()
+                                                         : rs->ComputedHeight();
     // if unconstrained - don't sutract borders - would result in huge height
     if (NS_AUTOHEIGHT == result) return result;
 
     // if we got to the canvas or page content frame, then subtract out 
     // margin/border/padding for the BODY and HTML elements
-    if ((FrameType::Canvas == frameType) ||
-        (FrameType::PageContent == frameType)) {
+    if ((LayoutFrameType::Canvas == frameType) ||
+        (LayoutFrameType::PageContent == frameType)) {
 
       result -= GetBlockMarginBorderPadding(firstAncestorRI);
       result -= GetBlockMarginBorderPadding(secondAncestorRI);
 
 #ifdef DEBUG
       // make sure the first ancestor is the HTML and the second is the BODY
       if (firstAncestorRI) {
         nsIContent* frameContent = firstAncestorRI->mFrame->GetContent();
@@ -2027,17 +2028,17 @@ CalcQuirkContainingBlockHeight(const Ref
           NS_ASSERTION(frameContent->IsHTMLElement(nsGkAtoms::body),
                        "Second ancestor is not BODY");
         }
       }
 #endif
 
     }
     // if we got to the html frame (a block child of the canvas) ...
-    else if (FrameType::Block == frameType && rs->mParentReflowInput &&
+    else if (LayoutFrameType::Block == frameType && rs->mParentReflowInput &&
              rs->mParentReflowInput->mFrame->IsCanvasFrame()) {
       // ... then subtract out margin/border/padding for the BODY element
       result -= GetBlockMarginBorderPadding(secondAncestorRI);
     }
     break;
   }
 
   // Make sure not to return a negative height here!
@@ -2156,17 +2157,17 @@ OffsetPercentBasis(const nsIFrame*    aF
 // XXX refactor this code to have methods for each set of properties
 // we are computing: width,height,line-height; margin; offsets
 
 void
 ReflowInput::InitConstraints(nsPresContext* aPresContext,
                              const LogicalSize& aContainingBlockSize,
                              const nsMargin* aBorder,
                              const nsMargin* aPadding,
-                             FrameType aFrameType)
+                             LayoutFrameType aFrameType)
 {
   WritingMode wm = GetWritingMode();
   DISPLAY_INIT_CONSTRAINTS(mFrame, this,
                            aContainingBlockSize.ISize(wm),
                            aContainingBlockSize.BSize(wm),
                            aBorder, aPadding);
 
   // If this is a reflow root, then set the computed width and
@@ -2205,17 +2206,17 @@ ReflowInput::InitConstraints(nsPresConte
     // If we weren't given a containing block width and height, then
     // compute one
     LogicalSize cbSize = (aContainingBlockSize == LogicalSize(wm, -1, -1))
       ? ComputeContainingBlockRectangle(aPresContext, cbrs)
       : aContainingBlockSize;
 
     // See if the containing block height is based on the size of its
     // content
-    FrameType fType;
+    LayoutFrameType fType;
     if (NS_AUTOHEIGHT == cbSize.BSize(wm)) {
       // See if the containing block is a cell frame which needs
       // to use the mComputedHeight of the cell instead of what the cell block passed in.
       // XXX It seems like this could lead to bugs with min-height and friends
       if (cbrs->mParentReflowInput) {
         fType = cbrs->mFrame->Type();
         if (IS_TABLE_CELL(fType)) {
           // use the cell's computed block size
@@ -2417,19 +2418,19 @@ ReflowInput::InitConstraints(nsPresConte
           computeSizeFlags =
             ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
         }
       } else {
         // Make sure legend frames with display:block and width:auto still
         // shrink-wrap.
         // Also shrink-wrap blocks that are orthogonal to their container.
         if (isBlock &&
-            ((aFrameType == FrameType::Legend &&
+            ((aFrameType == LayoutFrameType::Legend &&
               mFrame->StyleContext()->GetPseudo() != nsCSSAnonBoxes::scrolledContent) ||
-             (aFrameType == FrameType::Scroll &&
+             (aFrameType == LayoutFrameType::Scroll &&
               mFrame->GetContentInsertionFrame()->IsLegendFrame()) ||
              (mCBReflowInput &&
               mCBReflowInput->GetWritingMode().IsOrthogonalTo(mWritingMode)))) {
           computeSizeFlags =
             ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
         }
 
         if (alignCB && alignCB->IsFlexContainerFrame()) {
@@ -2497,17 +2498,17 @@ UpdateProp(FrameProperties& aProps,
   } else {
     aProps.Delete(aProperty);
   }
 }
 
 void
 SizeComputationInput::InitOffsets(WritingMode aWM,
                                   const LogicalSize& aPercentBasis,
-                                  FrameType aFrameType,
+                                  LayoutFrameType aFrameType,
                                   ReflowInputFlags aFlags,
                                   const nsMargin* aBorder,
                                   const nsMargin* aPadding)
 {
   DISPLAY_INIT_OFFSETS(mFrame, this, aPercentBasis, aBorder, aPadding);
 
   // Since we are in reflow, we don't need to store these properties anymore
   // unless they are dependent on width, in which case we store the new value.
@@ -2602,33 +2603,33 @@ SizeComputationInput::InitOffsets(Writin
   else if (aBorder) {  // border is an input arg
     ComputedPhysicalBorderPadding() = *aBorder;
   }
   else {
     ComputedPhysicalBorderPadding() = mFrame->StyleBorder()->GetComputedBorder();
   }
   ComputedPhysicalBorderPadding() += ComputedPhysicalPadding();
 
-  if (aFrameType == FrameType::Table) {
+  if (aFrameType == LayoutFrameType::Table) {
     nsTableFrame *tableFrame = static_cast<nsTableFrame*>(mFrame);
 
     if (tableFrame->IsBorderCollapse()) {
       // border-collapsed tables don't use any of their padding, and
       // only part of their border.  We need to do this here before we
       // try to do anything like handling 'auto' widths,
       // 'box-sizing', or 'auto' margins.
       ComputedPhysicalPadding().SizeTo(0,0,0,0);
       SetComputedLogicalBorderPadding(
         tableFrame->GetIncludedOuterBCBorder(mWritingMode));
     }
 
     // The margin is inherited to the table wrapper frame via
     // the ::-moz-table-wrapper rule in ua.css.
     ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
-  } else if (aFrameType == FrameType::Scrollbar) {
+  } else if (aFrameType == LayoutFrameType::Scrollbar) {
     // scrollbars may have had their width or height smashed to zero
     // by the associated scrollframe, in which case we must not report
     // any padding or border.
     nsSize size(mFrame->GetSize());
     if (size.width == 0 || size.height == 0) {
       ComputedPhysicalPadding().SizeTo(0,0,0,0);
       ComputedPhysicalBorderPadding().SizeTo(0,0,0,0);
     }
@@ -2640,17 +2641,17 @@ SizeComputationInput::InitOffsets(Writin
 // This code enforces section 10.3.3 of the CSS2 spec for this formula:
 //
 // 'margin-left' + 'border-left-width' + 'padding-left' + 'width' +
 //   'padding-right' + 'border-right-width' + 'margin-right'
 //   = width of containing block 
 //
 // Note: the width unit is not auto when this is called
 void
-ReflowInput::CalculateBlockSideMargins(FrameType aFrameType)
+ReflowInput::CalculateBlockSideMargins(LayoutFrameType aFrameType)
 {
   // Calculations here are done in the containing block's writing mode,
   // which is where margins will eventually be applied: we're calculating
   // margins that will be used by the container in its inline direction,
   // which in the case of an orthogonal contained block will correspond to
   // the block direction of this reflow state. So in the orthogonal-flow
   // case, "CalculateBlock*Side*Margins" will actually end up adjusting
   // the BStart/BEnd margins; those are the "sides" of the block from its
@@ -2703,17 +2704,17 @@ ReflowInput::CalculateBlockSideMargins(F
   bool isAutoStartMargin = eStyleUnit_Auto == styleSides.GetIStartUnit(cbWM);
   bool isAutoEndMargin = eStyleUnit_Auto == styleSides.GetIEndUnit(cbWM);
   if (!isAutoStartMargin && !isAutoEndMargin) {
     // Neither margin is 'auto' so we're over constrained. Use the
     // 'direction' property of the parent to tell which margin to
     // ignore
     // First check if there is an HTML alignment that we should honor
     const ReflowInput* prs = mParentReflowInput;
-    if (aFrameType == FrameType::Table) {
+    if (aFrameType == LayoutFrameType::Table) {
       NS_ASSERTION(prs->mFrame->IsTableWrapperFrame(),
                    "table not inside table wrapper");
       // Center the table within the table wrapper based on the alignment
       // of the table wrapper's parent.
       prs = prs->mParentReflowInput;
     }
     if (prs &&
         (prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_LEFT ||
@@ -2916,27 +2917,27 @@ SizeComputationInput::ComputeMargin(Writ
   }
 
   return isCBDependent;
 }
 
 bool
 SizeComputationInput::ComputePadding(WritingMode aWM,
                                      const LogicalSize& aPercentBasis,
-                                     FrameType aFrameType)
+                                     LayoutFrameType aFrameType)
 {
   // If style can provide us the padding directly, then use it.
   const nsStylePadding *stylePadding = mFrame->StylePadding();
   bool isCBDependent = !stylePadding->GetPadding(ComputedPhysicalPadding());
   // a table row/col group, row/col doesn't have padding
   // XXXldb Neither do border-collapse tables.
-  if (FrameType::TableRowGroup == aFrameType ||
-      FrameType::TableColGroup == aFrameType ||
-      FrameType::TableRow      == aFrameType ||
-      FrameType::TableCol      == aFrameType) {
+  if (LayoutFrameType::TableRowGroup == aFrameType ||
+      LayoutFrameType::TableColGroup == aFrameType ||
+      LayoutFrameType::TableRow      == aFrameType ||
+      LayoutFrameType::TableCol      == aFrameType) {
     ComputedPhysicalPadding().SizeTo(0,0,0,0);
   }
   else if (isCBDependent) {
     // We have to compute the value. This calculation is performed
     // according to the writing mode of the containing block
     // (http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-flows)
     // clamp negative calc() results to 0
     LogicalMargin p(aWM);
--- a/layout/generic/ReflowInput.h
+++ b/layout/generic/ReflowInput.h
@@ -288,22 +288,22 @@ private:
    *    The block size is usually the containing block inline-size, per
    *    CSS21 sec 8.3 (read in conjunction with CSS Writing Modes sec
    *    7.2), but may be the containing block block-size, e.g. in CSS3
    *    Flexbox and Grid.
    * @return true if the padding is dependent on the containing block size.
    */
   bool ComputePadding(mozilla::WritingMode aWM,
                       const mozilla::LogicalSize& aPercentBasis,
-                      mozilla::FrameType aFrameType);
+                      mozilla::LayoutFrameType aFrameType);
 
 protected:
   void InitOffsets(mozilla::WritingMode aWM,
                    const mozilla::LogicalSize& aPercentBasis,
-                   mozilla::FrameType aFrameType,
+                   mozilla::LayoutFrameType aFrameType,
                    ReflowInputFlags aFlags,
                    const nsMargin* aBorder = nullptr,
                    const nsMargin* aPadding = nullptr);
 
   /*
    * Convert nsStyleCoord to nscoord when percentages depend on the
    * inline size of the containing block, and enumerated values are for
    * inline size, min-inline-size, or max-inline-size.  Does not handle
@@ -960,26 +960,26 @@ public:
   static void* DisplayInitFrameTypeEnter(nsIFrame* aFrame,
                                          ReflowInput* aState);
   static void DisplayInitFrameTypeExit(nsIFrame* aFrame,
                                        ReflowInput* aState,
                                        void* aValue);
 #endif
 
 protected:
-  void InitFrameType(FrameType aFrameType);
+  void InitFrameType(LayoutFrameType aFrameType);
   void InitCBReflowInput();
   void InitResizeFlags(nsPresContext* aPresContext,
-                       mozilla::FrameType aFrameType);
+                       mozilla::LayoutFrameType aFrameType);
 
   void InitConstraints(nsPresContext* aPresContext,
                        const mozilla::LogicalSize& aContainingBlockSize,
                        const nsMargin* aBorder,
                        const nsMargin* aPadding,
-                       mozilla::FrameType aFrameType);
+                       mozilla::LayoutFrameType aFrameType);
 
   // Returns the nearest containing block or block frame (whether or not
   // it is a containing block) for the specified frame.  Also returns
   // the inline-start edge and logical size of the containing block's
   // content area.
   // These are returned in the coordinate space of the containing block.
   nsIFrame* GetHypotheticalBoxContainer(nsIFrame* aFrame,
                                         nscoord& aCBIStartEdge,
@@ -989,34 +989,34 @@ protected:
   // (for a position:fixed/absolute element) would have been placed if it were
   // positioned statically. The hypothetical box position will have a writing
   // mode with the same block direction as the absolute containing block
   // (cbrs->frame), though it may differ in inline direction.
   void CalculateHypotheticalPosition(nsPresContext* aPresContext,
                                      nsIFrame* aPlaceholderFrame,
                                      const ReflowInput* cbrs,
                                      nsHypotheticalPosition& aHypotheticalPos,
-                                     mozilla::FrameType aFrameType) const;
+                                     mozilla::LayoutFrameType aFrameType) const;
 
   void InitAbsoluteConstraints(nsPresContext* aPresContext,
                                const ReflowInput* cbrs,
                                const mozilla::LogicalSize& aContainingBlockSize,
-                               mozilla::FrameType aFrameType);
+                               mozilla::LayoutFrameType aFrameType);
 
   // Calculates the computed values for the 'min-Width', 'max-Width',
   // 'min-Height', and 'max-Height' properties, and stores them in the assorted
   // data members
   void ComputeMinMaxValues(const mozilla::LogicalSize& aContainingBlockSize);
 
   // aInsideBoxSizing returns the part of the padding, border, and margin
   // in the aAxis dimension that goes inside the edge given by box-sizing;
   // aOutsideBoxSizing returns the rest.
   void CalculateBorderPaddingMargin(mozilla::LogicalAxis aAxis,
                                     nscoord aContainingBlockSize,
                                     nscoord* aInsideBoxSizing,
                                     nscoord* aOutsideBoxSizing) const;
 
-  void CalculateBlockSideMargins(FrameType aFrameType);
+  void CalculateBlockSideMargins(LayoutFrameType aFrameType);
 };
 
 } // namespace mozilla
 
 #endif // mozilla_ReflowInput_h
--- a/layout/generic/RubyUtils.h
+++ b/layout/generic/RubyUtils.h
@@ -50,37 +50,37 @@ namespace mozilla {
  *    one of its ruby text containers does.
  * 3. If a ruby text container has a larger final isize, its children
  *    must not have.
  */
 
 class RubyUtils
 {
 public:
-  static inline bool IsRubyContentBox(FrameType aFrameType)
+  static inline bool IsRubyContentBox(LayoutFrameType aFrameType)
   {
-    return aFrameType == mozilla::FrameType::RubyBase ||
-           aFrameType == mozilla::FrameType::RubyText;
+    return aFrameType == mozilla::LayoutFrameType::RubyBase ||
+           aFrameType == mozilla::LayoutFrameType::RubyText;
   }
 
-  static inline bool IsRubyContainerBox(FrameType aFrameType)
+  static inline bool IsRubyContainerBox(LayoutFrameType aFrameType)
   {
-    return aFrameType == mozilla::FrameType::RubyBaseContainer ||
-           aFrameType == mozilla::FrameType::RubyTextContainer;
+    return aFrameType == mozilla::LayoutFrameType::RubyBaseContainer ||
+           aFrameType == mozilla::LayoutFrameType::RubyTextContainer;
   }
 
-  static inline bool IsRubyBox(FrameType aFrameType)
+  static inline bool IsRubyBox(LayoutFrameType aFrameType)
   {
-    return aFrameType == mozilla::FrameType::Ruby ||
+    return aFrameType == mozilla::LayoutFrameType::Ruby ||
            IsRubyContentBox(aFrameType) || IsRubyContainerBox(aFrameType);
   }
 
   static inline bool IsExpandableRubyBox(nsIFrame* aFrame)
   {
-    mozilla::FrameType type = aFrame->Type();
+    mozilla::LayoutFrameType type = aFrame->Type();
     return IsRubyContentBox(type) || IsRubyContainerBox(type);
   }
 
   static inline bool IsRubyPseudo(nsIAtom* aPseudo)
   {
     return aPseudo == nsCSSAnonBoxes::ruby ||
            aPseudo == nsCSSAnonBoxes::rubyBase ||
            aPseudo == nsCSSAnonBoxes::rubyText ||
--- a/layout/generic/TextOverflow.cpp
+++ b/layout/generic/TextOverflow.cpp
@@ -64,22 +64,22 @@ GetSelfOrNearestBlock(nsIFrame* aFrame)
   return nsLayoutUtils::GetAsBlock(aFrame) ? aFrame :
          nsLayoutUtils::FindNearestBlockAncestor(aFrame);
 }
 
 // Return true if the frame is an atomic inline-level element.
 // It's not supposed to be called for block frames since we never
 // process block descendants for text-overflow.
 static bool
-IsAtomicElement(nsIFrame* aFrame, FrameType aFrameType)
+IsAtomicElement(nsIFrame* aFrame, LayoutFrameType aFrameType)
 {
   NS_PRECONDITION(!nsLayoutUtils::GetAsBlock(aFrame) ||
                   !aFrame->IsBlockOutside(),
                   "unexpected block frame");
-  NS_PRECONDITION(aFrameType != FrameType::Placeholder,
+  NS_PRECONDITION(aFrameType != LayoutFrameType::Placeholder,
                   "unexpected placeholder frame");
   return !aFrame->IsFrameOfType(nsIFrame::eLineParticipant);
 }
 
 static bool
 IsFullyClipped(nsTextFrame* aFrame, nscoord aLeft, nscoord aRight,
                nscoord* aSnappedLeft, nscoord* aSnappedRight)
 {
@@ -342,18 +342,19 @@ void
 TextOverflow::ExamineFrameSubtree(nsIFrame*       aFrame,
                                   const LogicalRect& aContentArea,
                                   const LogicalRect& aInsideMarkersArea,
                                   FrameHashtable* aFramesToHide,
                                   AlignmentEdges* aAlignmentEdges,
                                   bool*           aFoundVisibleTextOrAtomic,
                                   InnerClipEdges* aClippedMarkerEdges)
 {
-  const FrameType frameType = aFrame->Type();
-  if (frameType == FrameType::Br || frameType == FrameType::Placeholder) {
+  const LayoutFrameType frameType = aFrame->Type();
+  if (frameType == LayoutFrameType::Br ||
+      frameType == LayoutFrameType::Placeholder) {
     return;
   }
   const bool isAtomic = IsAtomicElement(aFrame, frameType);
   if (aFrame->StyleVisibility()->IsVisible()) {
     LogicalRect childRect =
       GetLogicalScrollableOverflowRectRelativeToBlock(aFrame);
     bool overflowIStart =
       childRect.IStart(mBlockWM) < aContentArea.IStart(mBlockWM);
@@ -363,17 +364,17 @@ TextOverflow::ExamineFrameSubtree(nsIFra
       mIStart.mHasOverflow = true;
     }
     if (overflowIEnd) {
       mIEnd.mHasOverflow = true;
     }
     if (isAtomic && ((mIStart.mActive && overflowIStart) ||
                      (mIEnd.mActive && overflowIEnd))) {
       aFramesToHide->PutEntry(aFrame);
-    } else if (isAtomic || frameType == FrameType::Text) {
+    } else if (isAtomic || frameType == LayoutFrameType::Text) {
       AnalyzeMarkerEdges(aFrame, frameType, aInsideMarkersArea,
                          aFramesToHide, aAlignmentEdges,
                          aFoundVisibleTextOrAtomic,
                          aClippedMarkerEdges);
     }
   }
   if (isAtomic) {
     return;
@@ -384,17 +385,17 @@ TextOverflow::ExamineFrameSubtree(nsIFra
                         aFramesToHide, aAlignmentEdges,
                         aFoundVisibleTextOrAtomic,
                         aClippedMarkerEdges);
   }
 }
 
 void
 TextOverflow::AnalyzeMarkerEdges(nsIFrame* aFrame,
-                                 FrameType aFrameType,
+                                 LayoutFrameType aFrameType,
                                  const LogicalRect& aInsideMarkersArea,
                                  FrameHashtable* aFramesToHide,
                                  AlignmentEdges* aAlignmentEdges,
                                  bool* aFoundVisibleTextOrAtomic,
                                  InnerClipEdges* aClippedMarkerEdges)
 {
   LogicalRect borderRect(mBlockWM,
                          nsRect(aFrame->GetOffsetTo(mBlock),
@@ -419,17 +420,17 @@ TextOverflow::AnalyzeMarkerEdges(nsIFram
     aClippedMarkerEdges->AccumulateIEnd(mBlockWM, borderRect);
     if (!mIEnd.mActive) {
       iendOverlap = 0;
     }
   }
 
   if ((istartOverlap > 0 && insideIStartEdge) ||
       (iendOverlap > 0 && insideIEndEdge)) {
-    if (aFrameType == FrameType::Text) {
+    if (aFrameType == LayoutFrameType::Text) {
       if (aInsideMarkersArea.IStart(mBlockWM) <
           aInsideMarkersArea.IEnd(mBlockWM)) {
         // a clipped text frame and there is some room between the markers
         nscoord snappedIStart, snappedIEnd;
         auto textFrame = static_cast<nsTextFrame*>(aFrame);
         bool isFullyClipped = mBlockWM.IsBidiLTR() ?
           IsFullyClipped(textFrame, istartOverlap, iendOverlap,
                          &snappedIStart, &snappedIEnd) :
--- a/layout/generic/TextOverflow.h
+++ b/layout/generic/TextOverflow.h
@@ -170,17 +170,17 @@ class TextOverflow {
    *   inline-level frames that are inside the area between the markers
    *                       inside aInsideMarkersArea
    * @param aFoundVisibleTextOrAtomic is set to true if a text or atomic
    *   inline-level frame is visible between the marker edges
    * @param aClippedMarkerEdges the innermost edges of all text and atomic
    *   inline-level frames that are clipped by the current marker width
    */
   void AnalyzeMarkerEdges(nsIFrame* aFrame,
-                          mozilla::FrameType aFrameType,
+                          mozilla::LayoutFrameType aFrameType,
                           const LogicalRect& aInsideMarkersArea,
                           FrameHashtable* aFramesToHide,
                           AlignmentEdges* aAlignmentEdges,
                           bool* aFoundVisibleTextOrAtomic,
                           InnerClipEdges* aClippedMarkerEdges);
 
   /**
    * Clip or remove items given the final marker edges. ("clip" here just means
--- a/layout/generic/ViewportFrame.h
+++ b/layout/generic/ViewportFrame.h
@@ -25,17 +25,17 @@ namespace mozilla {
   */
 class ViewportFrame : public nsContainerFrame {
 public:
   NS_DECL_QUERYFRAME_TARGET(ViewportFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit ViewportFrame(nsStyleContext* aContext)
-    : ViewportFrame(aContext, mozilla::FrameType::Viewport)
+    : ViewportFrame(aContext, mozilla::LayoutFrameType::Viewport)
   {}
 
   virtual ~ViewportFrame() { } // useful for debugging
 
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
                     nsIFrame*         aPrevInFlow) override;
 
@@ -73,17 +73,17 @@ public:
    */
   nsRect AdjustReflowInputAsContainingBlock(ReflowInput* aReflowInput) const;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
 #endif
 
 protected:
-  ViewportFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  ViewportFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType)
     : nsContainerFrame(aContext, aType)
     , mView(nullptr)
   {}
 
   /**
    * Calculate how much room is available for fixed frames. That means
    * determining if the viewport is scrollable and whether the vertical and/or
    * horizontal scrollbars are visible.  Adjust the computed width/height and
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -420,25 +420,25 @@ OffsetToAlignedStaticPos(const ReflowInp
   WritingMode pcWM = aPlaceholderContainer->GetWritingMode();
 
   // Find what axis aAbsPosCBAxis corresponds to, in placeholder's parent's
   // writing-mode.
   LogicalAxis pcAxis = (pcWM.IsOrthogonalTo(aAbsPosCBWM)
                         ? GetOrthogonalAxis(aAbsPosCBAxis)
                         : aAbsPosCBAxis);
 
-  FrameType parentType = aPlaceholderContainer->Type();
+  LayoutFrameType parentType = aPlaceholderContainer->Type();
   LogicalSize alignAreaSize(pcWM);
-  if (parentType == FrameType::FlexContainer) {
+  if (parentType == LayoutFrameType::FlexContainer) {
     // The alignment container is the flex container's content box:
     alignAreaSize = aPlaceholderContainer->GetLogicalSize(pcWM);
     LogicalMargin pcBorderPadding =
       aPlaceholderContainer->GetLogicalUsedBorderAndPadding(pcWM);
     alignAreaSize -= pcBorderPadding.Size(pcWM);
-  } else if (parentType == FrameType::GridContainer) {
+  } else if (parentType == LayoutFrameType::GridContainer) {
     // This abspos elem's parent is a grid container. Per CSS Grid 10.1 & 10.2:
     //  - If the grid container *also* generates the abspos containing block (a
     // grid area) for this abspos child, we use that abspos containing block as
     // the alignment container, too. (And its size is aAbsPosCBSize.)
     //  - Otherwise, we use the grid's padding box as the alignment container.
     // https://drafts.csswg.org/css-grid/#static-position
     if (aPlaceholderContainer == aKidReflowInput.mCBReflowInput->mFrame) {
       // The alignment container is the grid area that we're using as the
--- a/layout/generic/nsAtomicContainerFrame.h
+++ b/layout/generic/nsAtomicContainerFrame.h
@@ -35,14 +35,15 @@ public:
     return nsFrame::PeekOffsetCharacter(aForward, aOffset, aRespectClusters);
   }
   nsSplittableType GetSplittableType() const override
   {
     return nsFrame::GetSplittableType();
   }
 
 protected:
-  nsAtomicContainerFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  nsAtomicContainerFrame(nsStyleContext* aContext,
+                         mozilla::LayoutFrameType aType)
     : nsContainerFrame(aContext, aType)
   {}
 };
 
 #endif // nsAtomicContainerFrame_h___
--- a/layout/generic/nsBackdropFrame.h
+++ b/layout/generic/nsBackdropFrame.h
@@ -12,17 +12,17 @@
 #include "nsFrame.h"
 
 class nsBackdropFrame final : public nsFrame
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit nsBackdropFrame(nsStyleContext* aContext)
-    : nsFrame(aContext, mozilla::FrameType::Backdrop)
+    : nsFrame(aContext, mozilla::LayoutFrameType::Backdrop)
   {}
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
 #endif
   virtual nsStyleContext*
     GetParentStyleContext(nsIFrame** aProviderFrame) const override;
   virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -3076,19 +3076,19 @@ nsBlockFrame::AttributeChanged(int32_t  
     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/grid/flex ancestor.
       // XXXldb I think that's a bad assumption.
       nsContainerFrame* ancestor = GetParent();
       for (; ancestor; ancestor = ancestor->GetParent()) {
         auto frameType = ancestor->Type();
-        if (frameType == FrameType::Block ||
-            frameType == FrameType::FlexContainer ||
-            frameType == FrameType::GridContainer) {
+        if (frameType == LayoutFrameType::Block ||
+            frameType == LayoutFrameType::FlexContainer ||
+            frameType == LayoutFrameType::GridContainer) {
           break;
         }
       }
       // Tell the ancestor to renumber list items within itself.
       if (ancestor) {
         // XXX Not sure if this is necessary anymore
         if (ancestor->RenumberList()) {
           PresContext()->PresShell()->
@@ -5348,22 +5348,22 @@ nsBlockFrame::RemoveFrame(ChildListID aL
   PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange,
                      NS_FRAME_HAS_DIRTY_CHILDREN); // XXX sufficient?
 }
 
 static bool
 ShouldPutNextSiblingOnNewLine(nsIFrame* aLastFrame)
 {
-  FrameType type = aLastFrame->Type();
-  if (type == FrameType::Br) {
+  LayoutFrameType type = aLastFrame->Type();
+  if (type == LayoutFrameType::Br) {
     return true;
   }
   // XXX the TEXT_OFFSETS_NEED_FIXING check is a wallpaper for bug 822910.
-  if (type == FrameType::Text &&
+  if (type == LayoutFrameType::Text &&
       !(aLastFrame->GetStateBits() & TEXT_OFFSETS_NEED_FIXING)) {
     return aLastFrame->HasSignificantTerminalNewline();
   }
   return false;
 }
 
 void
 nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling)
@@ -6226,17 +6226,17 @@ nsBlockFrame::AdjustFloatAvailableSpace(
   }
 
   nscoord availBSize = NS_UNCONSTRAINEDSIZE == aState.ContentBSize()
                        ? NS_UNCONSTRAINEDSIZE
                        : std::max(0, aState.ContentBEnd() - aState.mBCoord);
 
   if (availBSize != NS_UNCONSTRAINEDSIZE &&
       !aState.mFlags.mFloatFragmentsInsideColumnEnabled &&
-      nsLayoutUtils::GetClosestFrameOfType(this, FrameType::ColumnSet)) {
+      nsLayoutUtils::GetClosestFrameOfType(this, LayoutFrameType::ColumnSet)) {
     // Tell the float it has unrestricted block-size, so it won't break.
     // If the float doesn't actually fit in the column it will fail to be
     // placed, and either move to the block-start of the next column or just
     // overflow.
     availBSize = NS_UNCONSTRAINEDSIZE;
   }
 
   return LogicalRect(wm, aState.ContentIStart(), aState.ContentBStart(),
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -392,28 +392,28 @@ public:
   static nsBlockFrame* GetNearestAncestorBlock(nsIFrame* aCandidate);
 
   struct FrameLines {
     nsLineList mLines;
     nsFrameList mFrames;
   };
 
 protected:
-  nsBlockFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  nsBlockFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType)
     : nsContainerFrame(aContext, aType)
     , mMinWidth(NS_INTRINSIC_WIDTH_UNKNOWN)
     , mPrefWidth(NS_INTRINSIC_WIDTH_UNKNOWN)
   {
 #ifdef DEBUG
   InitDebugFlags();
 #endif
   }
 
   explicit nsBlockFrame(nsStyleContext* aContext)
-    : nsBlockFrame(aContext, mozilla::FrameType::Block)
+    : nsBlockFrame(aContext, mozilla::LayoutFrameType::Block)
   {}
 
   virtual ~nsBlockFrame();
 
 #ifdef DEBUG
   already_AddRefed<nsStyleContext> GetFirstLetterStyle(nsPresContext* aPresContext);
 #endif
 
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -33,18 +33,18 @@ nsBlockReflowContext::nsBlockReflowConte
     mOuterReflowInput(aParentRS),
     mSpace(aParentRS.GetWritingMode()),
     mMetrics(aParentRS)
 {
 }
 
 static nsIFrame* DescendIntoBlockLevelFrame(nsIFrame* aFrame)
 {
-  FrameType type = aFrame->Type();
-  if (type == FrameType::ColumnSet) {
+  LayoutFrameType type = aFrame->Type();
+  if (type == LayoutFrameType::ColumnSet) {
     static_cast<nsColumnSetFrame*>(aFrame)->DrainOverflowColumns();
     nsIFrame* child = aFrame->PrincipalChildList().FirstChild();
     if (child) {
       return DescendIntoBlockLevelFrame(child);
     }
   }
   return aFrame;
 }
--- a/layout/generic/nsBulletFrame.h
+++ b/layout/generic/nsBulletFrame.h
@@ -49,17 +49,17 @@ class nsBulletFrame final : public nsFra
 public:
   NS_DECL_FRAMEARENA_HELPERS
 #ifdef DEBUG
   NS_DECL_QUERYFRAME_TARGET(nsBulletFrame)
   NS_DECL_QUERYFRAME
 #endif
 
   explicit nsBulletFrame(nsStyleContext* aContext)
-    : nsFrame(aContext, mozilla::FrameType::Bullet)
+    : nsFrame(aContext, mozilla::LayoutFrameType::Bullet)
     , mPadding(GetWritingMode())
     , mIntrinsicSize(GetWritingMode())
     , mOrdinal(0)
     , mRequestRegistered(false)
     , mBlockingOnload(false)
   {}
 
   virtual ~nsBulletFrame();
--- a/layout/generic/nsCanvasFrame.h
+++ b/layout/generic/nsCanvasFrame.h
@@ -29,17 +29,17 @@ class nsRenderingContext;
  * frame in the main child list.
  */
 class nsCanvasFrame final : public nsContainerFrame,
                             public nsIScrollPositionListener,
                             public nsIAnonymousContentCreator
 {
 public:
   explicit nsCanvasFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext, mozilla::FrameType::Canvas)
+    : nsContainerFrame(aContext, mozilla::LayoutFrameType::Canvas)
     , mDoPaintFocus(false)
     , mAddedScrollPositionListener(false)
   {}
 
   NS_DECL_QUERYFRAME_TARGET(nsCanvasFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -124,17 +124,17 @@ NS_NewColumnSetFrame(nsIPresShell* aPres
   nsColumnSetFrame* it = new (aPresShell) nsColumnSetFrame(aContext);
   it->AddStateBits(aStateFlags | NS_BLOCK_MARGIN_ROOT);
   return it;
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsColumnSetFrame)
 
 nsColumnSetFrame::nsColumnSetFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::ColumnSet)
+  : nsContainerFrame(aContext, LayoutFrameType::ColumnSet)
   , mLastBalanceBSize(NS_INTRINSICSIZE)
 {
 }
 
 void
 nsColumnSetFrame::CreateBorderRenderers(nsTArray<nsCSSBorderRenderer>& aBorderRenderers,
                                         nsRenderingContext* aCtx,
                                         const nsRect& aDirtyRect,
--- a/layout/generic/nsContainerFrame.h
+++ b/layout/generic/nsContainerFrame.h
@@ -529,17 +529,17 @@ public:
   // Use this to suppress the CRAZY_SIZE assertions.
   NS_DECLARE_FRAME_PROPERTY_SMALL_VALUE(DebugReflowingWithInfiniteISize, bool)
   bool IsCrazySizeAssertSuppressed() const {
     return Properties().Get(DebugReflowingWithInfiniteISize());
   }
 #endif
 
 protected:
-  nsContainerFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  nsContainerFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType)
     : nsSplittableFrame(aContext, aType)
   {}
 
   ~nsContainerFrame();
 
   /**
    * Helper for DestroyFrom. DestroyAbsoluteFrames is called before
    * destroying frames on lists that can contain placeholders.
--- a/layout/generic/nsFirstLetterFrame.h
+++ b/layout/generic/nsFirstLetterFrame.h
@@ -13,17 +13,17 @@
 
 class nsFirstLetterFrame final : public nsContainerFrame {
 public:
   NS_DECL_QUERYFRAME_TARGET(nsFirstLetterFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit nsFirstLetterFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext, mozilla::FrameType::Letter)
+    : nsContainerFrame(aContext, mozilla::LayoutFrameType::Letter)
   {}
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists) override;
 
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -3894,17 +3894,18 @@ nsFlexContainerFrame::SizeItemInCrossAxi
   nscoord crossAxisBorderPadding = aItem.GetBorderPadding().TopBottom();
   if (reflowResult.Height() < crossAxisBorderPadding) {
     // Child's requested size isn't large enough for its border/padding!
     // This is OK for the trivial nsFrame::Reflow() impl, but other frame
     // classes should know better. So, if we get here, the child had better be
     // an instance of nsFrame (i.e. it should return null from GetType()).
     // XXXdholbert Once we've fixed bug 765861, we should upgrade this to an
     // assertion that trivially passes if bug 765861's flag has been flipped.
-    NS_WARNING_ASSERTION(aItem.Frame()->Type() == FrameType::None,
+    NS_WARNING_ASSERTION(
+      aItem.Frame()->Type() == LayoutFrameType::None,
       "Child should at least request space for border/padding");
     aItem.SetCrossSize(0);
   } else {
     // (normal case)
     aItem.SetCrossSize(reflowResult.Height() - crossAxisBorderPadding);
   }
 
   aItem.SetAscent(reflowResult.Ascent());
--- a/layout/generic/nsFlexContainerFrame.h
+++ b/layout/generic/nsFlexContainerFrame.h
@@ -128,17 +128,17 @@ public:
                                     uint8_t aAlignVal,
                                     nscoord* aFirstSubjectOffset,
                                     uint32_t* aNumPackingSpacesRemaining,
                                     nscoord* aPackingSpaceRemaining);
 
 protected:
   // Protected constructor & destructor
   explicit nsFlexContainerFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext, mozilla::FrameType::FlexContainer)
+    : nsContainerFrame(aContext, mozilla::LayoutFrameType::FlexContainer)
     , mBaselineFromLastReflow(NS_INTRINSIC_WIDTH_UNKNOWN)
     , mLastBaselineFromLastReflow(NS_INTRINSIC_WIDTH_UNKNOWN)
   {}
 
   virtual ~nsFlexContainerFrame();
 
   /*
    * This method does the bulk of the flex layout, implementing the algorithm
--- a/layout/generic/nsFontInflationData.cpp
+++ b/layout/generic/nsFontInflationData.cpp
@@ -328,45 +328,45 @@ nsFontInflationData::ScanTextIn(nsIFrame
     nsFrameList::Enumerator kids(lists.CurrentList());
     for (; !kids.AtEnd(); kids.Next()) {
       nsIFrame *kid = kids.get();
       if (kid->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) {
         // Goes in a different set of inflation data.
         continue;
       }
 
-      FrameType fType = kid->Type();
-      if (fType == FrameType::Text) {
+      LayoutFrameType fType = kid->Type();
+      if (fType == LayoutFrameType::Text) {
         nsIContent *content = kid->GetContent();
         if (content && kid == content->GetPrimaryFrame()) {
           uint32_t len = nsTextFrameUtils::
             ComputeApproximateLengthWithWhitespaceCompression(
               content, kid->StyleText());
           if (len != 0) {
             nscoord fontSize = kid->StyleFont()->mFont.size;
             if (fontSize > 0) {
               mTextAmount += fontSize * len;
             }
           }
         }
-      } else if (fType == FrameType::TextInput) {
+      } else if (fType == LayoutFrameType::TextInput) {
         // We don't want changes to the amount of text in a text input
         // to change what we count towards inflation.
         nscoord fontSize = kid->StyleFont()->mFont.size;
         int32_t charCount = static_cast<nsTextControlFrame*>(kid)->GetCols();
         mTextAmount += charCount * fontSize;
-      } else if (fType == FrameType::ComboboxControl) {
+      } else if (fType == LayoutFrameType::ComboboxControl) {
         // See textInputFrame above (with s/amount of text/selected option/).
         // Don't just recurse down to the list control inside, since we
         // need to exclude the display frame.
         nscoord fontSize = kid->StyleFont()->mFont.size;
         int32_t charCount = CharCountOfLargestOption(
           static_cast<nsComboboxControlFrame*>(kid)->GetDropDown());
         mTextAmount += charCount * fontSize;
-      } else if (fType == FrameType::ListControl) {
+      } else if (fType == LayoutFrameType::ListControl) {
         // See textInputFrame above (with s/amount of text/selected option/).
         nscoord fontSize = kid->StyleFont()->mFont.size;
         int32_t charCount = CharCountOfLargestOption(kid);
         mTextAmount += charCount * fontSize;
       } else {
         // recursive step
         ScanTextIn(kid);
       }
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -444,20 +444,20 @@ WeakFrame::Init(nsIFrame* aFrame)
       mFrame = nullptr;
     }
   }
 }
 
 nsIFrame*
 NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
-  return new (aPresShell) nsFrame(aContext, FrameType::None);
-}
-
-nsFrame::nsFrame(nsStyleContext* aContext, FrameType aType)
+  return new (aPresShell) nsFrame(aContext, LayoutFrameType::None);
+}
+
+nsFrame::nsFrame(nsStyleContext* aContext, LayoutFrameType aType)
   : nsBox(aType)
 {
   MOZ_COUNT_CTOR(nsFrame);
 
   mState = NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY;
   mStyleContext = aContext;
   mWritingMode = WritingMode(mStyleContext);
   mStyleContext->AddRef();
@@ -535,21 +535,21 @@ IsFontSizeInflationContainer(nsIFrame* a
    */
 
   // The root frame should always be an inflation container.
   if (!aFrame->GetParent()) {
     return true;
   }
 
   nsIContent *content = aFrame->GetContent();
-  FrameType frameType = aFrame->Type();
+  LayoutFrameType frameType = aFrame->Type();
   bool isInline = (aFrame->GetDisplay() == StyleDisplay::Inline ||
                    RubyUtils::IsRubyBox(frameType) ||
                    (aFrame->IsFloating() &&
-                    frameType == FrameType::Letter) ||
+                    frameType == LayoutFrameType::Letter) ||
                    // 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,
                                                              nsGkAtoms::optgroup,
                                                              nsGkAtoms::select) ||
                                 content->IsInNativeAnonymousSubtree()))) &&
@@ -871,17 +871,17 @@ AddAndRemoveImageAssociations(nsFrame* a
 }
 
 // Subclass hook for style post processing
 /* virtual */ void
 nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
 {
   if (nsSVGUtils::IsInSVGTextSubtree(this)) {
     SVGTextFrame* svgTextFrame = static_cast<SVGTextFrame*>(
-      nsLayoutUtils::GetClosestFrameOfType(this, FrameType::SVGText));
+      nsLayoutUtils::GetClosestFrameOfType(this, LayoutFrameType::SVGText));
     nsIFrame* anonBlock = svgTextFrame->PrincipalChildList().FirstChild();
     // Just as in SVGTextFrame::DidSetStyleContext, we need to ensure that
     // any non-display SVGTextFrames get reflowed when a child text frame
     // gets new style.
     //
     // Note that we must check NS_FRAME_FIRST_REFLOW on our SVGTextFrame's
     // anonymous block frame rather than our self, since NS_FRAME_FIRST_REFLOW
     // may be set on us if we're a new frame that has been inserted after the
@@ -3855,17 +3855,17 @@ NS_IMETHODIMP nsFrame::HandleDrag(nsPres
 
   RefPtr<nsFrameSelection> frameselection = GetFrameSelection();
   bool mouseDown = frameselection->GetDragState();
   if (!mouseDown) {
     return NS_OK;
   }
 
   nsIFrame* scrollbar =
-    nsLayoutUtils::GetClosestFrameOfType(this, FrameType::Scrollbar);
+    nsLayoutUtils::GetClosestFrameOfType(this, LayoutFrameType::Scrollbar);
   if (!scrollbar) {
     // XXX Do we really need to exclude non-selectable content here?
     // GetContentOffsetsFromPoint can handle it just fine, although some
     // other stuff might not like it.
     // NOTE: DisplaySelection() returns SELECTION_OFF for non-selectable frames.
     if (DisplaySelection(aPresContext) == nsISelectionController::SELECTION_OFF) {
       return NS_OK;
     }
@@ -4087,23 +4087,23 @@ struct MOZ_STACK_CLASS FrameContentRange
 // Retrieve the content offsets of a frame
 static FrameContentRange GetRangeForFrame(nsIFrame* aFrame) {
   nsCOMPtr<nsIContent> content, parent;
   content = aFrame->GetContent();
   if (!content) {
     NS_WARNING("Frame has no content");
     return FrameContentRange(nullptr, -1, -1);
   }
-  FrameType type = aFrame->Type();
-  if (type == FrameType::Text) {
+  LayoutFrameType type = aFrame->Type();
+  if (type == LayoutFrameType::Text) {
     int32_t offset, offsetEnd;
     aFrame->GetOffsets(offset, offsetEnd);
     return FrameContentRange(content, offset, offsetEnd);
   }
-  if (type == FrameType::Br) {
+  if (type == LayoutFrameType::Br) {
     parent = content->GetParent();
     int32_t beginOffset = parent->IndexOf(content);
     return FrameContentRange(parent, beginOffset, beginOffset);
   }
   // Loop to deal with anonymous content, which has no index; this loop
   // probably won't run more than twice under normal conditions
   do {
     parent  = content->GetParent();
@@ -5960,22 +5960,22 @@ nsIFrame* nsIFrame::GetTailContinuation(
 // Associated view object
 void
 nsIFrame::SetView(nsView* aView)
 {
   if (aView) {
     aView->SetFrame(this);
 
 #ifdef DEBUG
-    FrameType frameType = Type();
-    NS_ASSERTION(frameType == FrameType::SubDocument ||
-                 frameType == FrameType::ListControl ||
-                 frameType == FrameType::Object ||
-                 frameType == FrameType::Viewport ||
-                 frameType == FrameType::MenuPopup,
+    LayoutFrameType frameType = Type();
+    NS_ASSERTION(frameType == LayoutFrameType::SubDocument ||
+                 frameType == LayoutFrameType::ListControl ||
+                 frameType == LayoutFrameType::Object ||
+                 frameType == LayoutFrameType::Viewport ||
+                 frameType == LayoutFrameType::MenuPopup,
                  "Only specific frame types can have an nsView");
 #endif
 
     // Store the view on the frame.
     SetViewInternal(aView);
 
     // Set the frame state bit that says the frame has a view
     AddStateBits(NS_FRAME_HAS_VIEW);
@@ -8720,21 +8720,21 @@ UnionBorderBoxes(nsIFrame* aFrame, bool 
   } else {
     if (!doTransform &&
         bounds.IsEqualEdges(aFrame->GetVisualOverflowRect()) &&
         bounds.IsEqualEdges(aFrame->GetScrollableOverflowRect())) {
       return u;
     }
   }
   const nsStyleDisplay* disp = aFrame->StyleDisplay();
-  FrameType fType = aFrame->Type();
+  LayoutFrameType fType = aFrame->Type();
   if (nsFrame::ShouldApplyOverflowClipping(aFrame, disp) ||
-      fType == FrameType::Scroll ||
-      fType == FrameType::ListControl ||
-      fType == FrameType::SVGOuterSVG) {
+      fType == LayoutFrameType::Scroll ||
+      fType == LayoutFrameType::ListControl ||
+      fType == LayoutFrameType::SVGOuterSVG) {
     return u;
   }
 
   const nsStyleEffects* effects = aFrame->StyleEffects();
   Maybe<nsRect> clipPropClipRect =
     aFrame->GetClipPropClipRect(disp, effects, bounds.Size());
 
   // Iterate over all children except pop-ups.
@@ -10693,20 +10693,20 @@ struct DR_FrameTypeInfo;
 struct DR_FrameTreeNode;
 struct DR_Rule;
 
 struct DR_State
 {
   DR_State();
   ~DR_State();
   void Init();
-  void AddFrameTypeInfo(FrameType aFrameType,
+  void AddFrameTypeInfo(LayoutFrameType aFrameType,
                         const char* aFrameNameAbbrev,
                         const char* aFrameName);
-  DR_FrameTypeInfo* GetFrameTypeInfo(FrameType aFrameType);
+  DR_FrameTypeInfo* GetFrameTypeInfo(LayoutFrameType aFrameType);
   DR_FrameTypeInfo* GetFrameTypeInfo(char* aFrameName);
   void InitFrameTypeTable();
   DR_FrameTreeNode* CreateTreeNode(nsIFrame*                aFrame,
                                    const ReflowInput* aReflowInput);
   void FindMatchingRule(DR_FrameTreeNode& aNode);
   bool RuleMatches(DR_Rule&          aRule,
                      DR_FrameTreeNode& aNode);
   bool GetToken(FILE* aFile,
@@ -10739,24 +10739,24 @@ struct DR_State
   // reflow specific state
   nsTArray<DR_FrameTreeNode*> mFrameTreeLeaves;
 };
 
 static DR_State *DR_state; // the one and only DR_State
 
 struct DR_RulePart
 {
-  explicit DR_RulePart(FrameType aFrameType)
+  explicit DR_RulePart(LayoutFrameType aFrameType)
     : mFrameType(aFrameType)
     , mNext(0)
   {}
 
   void Destroy();
 
-  FrameType mFrameType;
+  LayoutFrameType mFrameType;
   DR_RulePart* mNext;
 };
 
 void DR_RulePart::Destroy()
 {
   if (mNext) {
     mNext->Destroy();
   }
@@ -10767,54 +10767,54 @@ struct DR_Rule
 {
   DR_Rule() : mLength(0), mTarget(nullptr), mDisplay(false) {
     MOZ_COUNT_CTOR(DR_Rule);
   }
   ~DR_Rule() {
     if (mTarget) mTarget->Destroy();
     MOZ_COUNT_DTOR(DR_Rule);
   }
-  void AddPart(FrameType aFrameType);
+  void AddPart(LayoutFrameType aFrameType);
 
   uint32_t      mLength;
   DR_RulePart*  mTarget;
   bool          mDisplay;
 };
 
 void
-DR_Rule::AddPart(FrameType aFrameType)
+DR_Rule::AddPart(LayoutFrameType aFrameType)
 {
   DR_RulePart* newPart = new DR_RulePart(aFrameType);
   newPart->mNext = mTarget;
   mTarget = newPart;
   mLength++;
 }
 
 struct DR_FrameTypeInfo
 {
-  DR_FrameTypeInfo(FrameType aFrameType,
+  DR_FrameTypeInfo(LayoutFrameType aFrameType,
                    const char* aFrameNameAbbrev,
                    const char* aFrameName);
   ~DR_FrameTypeInfo() {
       int32_t numElements;
       numElements = mRules.Length();
       for (int32_t i = numElements - 1; i >= 0; i--) {
         delete mRules.ElementAt(i);
       }
    }
 
-  FrameType   mType;
+  LayoutFrameType   mType;
   char        mNameAbbrev[16];
   char        mName[32];
   nsTArray<DR_Rule*> mRules;
 private:
   DR_FrameTypeInfo& operator=(const DR_FrameTypeInfo&) = delete;
 };
 
-DR_FrameTypeInfo::DR_FrameTypeInfo(FrameType aFrameType,
+DR_FrameTypeInfo::DR_FrameTypeInfo(LayoutFrameType aFrameType,
                                    const char* aFrameNameAbbrev,
                                    const char* aFrameName)
 {
   mType = aFrameType;
   PL_strncpyz(mNameAbbrev, aFrameNameAbbrev, sizeof(mNameAbbrev));
   PL_strncpyz(mName, aFrameName, sizeof(mName));
 }
 
@@ -10963,17 +10963,17 @@ DR_Rule* DR_State::ParseRule(FILE* aFile
         printf("unexpected token - %s \n", buf);
       }
     }
     else {
       if (!rule) {
         rule = new DR_Rule;
       }
       if (strcmp(buf, "*") == 0) {
-        rule->AddPart(FrameType::None);
+        rule->AddPart(LayoutFrameType::None);
       }
       else {
         DR_FrameTypeInfo* info = GetFrameTypeInfo(buf);
         if (info) {
           rule->AddPart(info->mType);
         }
         else {
           printf("invalid frame type - %s \n", buf);
@@ -11002,17 +11002,17 @@ void DR_State::AddRule(nsTArray<DR_Rule*
 void DR_State::ParseRulesFile()
 {
   char* path = PR_GetEnv("GECKO_DISPLAY_REFLOW_RULES_FILE");
   if (path) {
     FILE* inFile = fopen(path, "r");
     if (inFile) {
       for (DR_Rule* rule = ParseRule(inFile); rule; rule = ParseRule(inFile)) {
         if (rule->mTarget) {
-          FrameType fType = rule->mTarget->mFrameType;
+          LayoutFrameType fType = rule->mTarget->mFrameType;
           DR_FrameTypeInfo* info = GetFrameTypeInfo(fType);
           if (info) {
             AddRule(info->mRules, *rule);
           }
           else {
             AddRule(mWildRules, *rule);
           }
           mActive = true;
@@ -11020,25 +11020,25 @@ void DR_State::ParseRulesFile()
       }
 
       fclose(inFile);
     }
   }
 }
 
 void
-DR_State::AddFrameTypeInfo(FrameType aFrameType,
+DR_State::AddFrameTypeInfo(LayoutFrameType aFrameType,
                            const char* aFrameNameAbbrev,
                            const char* aFrameName)
 {
   mFrameTypeTable.AppendElement(DR_FrameTypeInfo(aFrameType, aFrameNameAbbrev, aFrameName));
 }
 
 DR_FrameTypeInfo*
-DR_State::GetFrameTypeInfo(FrameType aFrameType)
+DR_State::GetFrameTypeInfo(LayoutFrameType aFrameType)
 {
   int32_t numEntries = mFrameTypeTable.Length();
   NS_ASSERTION(numEntries != 0, "empty FrameTypeTable");
   for (int32_t i = 0; i < numEntries; i++) {
     DR_FrameTypeInfo& info = mFrameTypeTable.ElementAt(i);
     if (info.mType == aFrameType) {
       return &info;
     }
@@ -11056,53 +11056,53 @@ DR_FrameTypeInfo* DR_State::GetFrameType
       return &info;
     }
   }
   return &mFrameTypeTable.ElementAt(numEntries - 1); // return unknown frame type
 }
 
 void DR_State::InitFrameTypeTable()
 {
-  AddFrameTypeInfo(FrameType::Block,            "block",     "block");
-  AddFrameTypeInfo(FrameType::Br,               "br",        "br");
-  AddFrameTypeInfo(FrameType::Bullet,           "bullet",    "bullet");
-  AddFrameTypeInfo(FrameType::ColorControl,     "color",     "colorControl");
-  AddFrameTypeInfo(FrameType::GfxButtonControl, "button",    "gfxButtonControl");
-  AddFrameTypeInfo(FrameType::HTMLButtonControl, "HTMLbutton",    "HTMLButtonControl");
-  AddFrameTypeInfo(FrameType::HTMLCanvas,       "HTMLCanvas","HTMLCanvas");
-  AddFrameTypeInfo(FrameType::SubDocument,      "subdoc",    "subDocument");
-  AddFrameTypeInfo(FrameType::Image,            "img",       "image");
-  AddFrameTypeInfo(FrameType::Inline,           "inline",    "inline");
-  AddFrameTypeInfo(FrameType::Letter,           "letter",    "letter");
-  AddFrameTypeInfo(FrameType::Line,             "line",      "line");
-  AddFrameTypeInfo(FrameType::ListControl,      "select",    "select");
-  AddFrameTypeInfo(FrameType::Object,           "obj",       "object");
-  AddFrameTypeInfo(FrameType::Page,             "page",      "page");
-  AddFrameTypeInfo(FrameType::Placeholder,      "place",     "placeholder");
-  AddFrameTypeInfo(FrameType::Canvas,           "canvas",    "canvas");
-  AddFrameTypeInfo(FrameType::Root,             "root",      "root");
-  AddFrameTypeInfo(FrameType::Scroll,           "scroll",    "scroll");
-  AddFrameTypeInfo(FrameType::TableCell,        "cell",      "tableCell");
-  AddFrameTypeInfo(FrameType::BCTableCell,      "bcCell",    "bcTableCell");
-  AddFrameTypeInfo(FrameType::TableCol,         "col",       "tableCol");
-  AddFrameTypeInfo(FrameType::TableColGroup,    "colG",      "tableColGroup");
-  AddFrameTypeInfo(FrameType::Table,            "tbl",       "table");
-  AddFrameTypeInfo(FrameType::TableWrapper,     "tblW",      "tableWrapper");
-  AddFrameTypeInfo(FrameType::TableRowGroup,    "rowG",      "tableRowGroup");
-  AddFrameTypeInfo(FrameType::TableRow,         "row",       "tableRow");
-  AddFrameTypeInfo(FrameType::TextInput,        "textCtl",   "textInput");
-  AddFrameTypeInfo(FrameType::Text,             "text",      "text");
-  AddFrameTypeInfo(FrameType::Viewport,         "VP",        "viewport");
+  AddFrameTypeInfo(LayoutFrameType::Block,            "block",     "block");
+  AddFrameTypeInfo(LayoutFrameType::Br,               "br",        "br");
+  AddFrameTypeInfo(LayoutFrameType::Bullet,           "bullet",    "bullet");
+  AddFrameTypeInfo(LayoutFrameType::ColorControl,     "color",     "colorControl");
+  AddFrameTypeInfo(LayoutFrameType::GfxButtonControl, "button",    "gfxButtonControl");
+  AddFrameTypeInfo(LayoutFrameType::HTMLButtonControl, "HTMLbutton",    "HTMLButtonControl");
+  AddFrameTypeInfo(LayoutFrameType::HTMLCanvas,       "HTMLCanvas","HTMLCanvas");
+  AddFrameTypeInfo(LayoutFrameType::SubDocument,      "subdoc",    "subDocument");
+  AddFrameTypeInfo(LayoutFrameType::Image,            "img",       "image");
+  AddFrameTypeInfo(LayoutFrameType::Inline,           "inline",    "inline");
+  AddFrameTypeInfo(LayoutFrameType::Letter,           "letter",    "letter");
+  AddFrameTypeInfo(LayoutFrameType::Line,             "line",      "line");
+  AddFrameTypeInfo(LayoutFrameType::ListControl,      "select",    "select");
+  AddFrameTypeInfo(LayoutFrameType::Object,           "obj",       "object");
+  AddFrameTypeInfo(LayoutFrameType::Page,             "page",      "page");
+  AddFrameTypeInfo(LayoutFrameType::Placeholder,      "place",     "placeholder");
+  AddFrameTypeInfo(LayoutFrameType::Canvas,           "canvas",    "canvas");
+  AddFrameTypeInfo(LayoutFrameType::Root,             "root",      "root");
+  AddFrameTypeInfo(LayoutFrameType::Scroll,           "scroll",    "scroll");
+  AddFrameTypeInfo(LayoutFrameType::TableCell,        "cell",      "tableCell");
+  AddFrameTypeInfo(LayoutFrameType::BCTableCell,      "bcCell",    "bcTableCell");
+  AddFrameTypeInfo(LayoutFrameType::TableCol,         "col",       "tableCol");
+  AddFrameTypeInfo(LayoutFrameType::TableColGroup,    "colG",      "tableColGroup");
+  AddFrameTypeInfo(LayoutFrameType::Table,            "tbl",       "table");
+  AddFrameTypeInfo(LayoutFrameType::TableWrapper,     "tblW",      "tableWrapper");
+  AddFrameTypeInfo(LayoutFrameType::TableRowGroup,    "rowG",      "tableRowGroup");
+  AddFrameTypeInfo(LayoutFrameType::TableRow,         "row",       "tableRow");
+  AddFrameTypeInfo(LayoutFrameType::TextInput,        "textCtl",   "textInput");
+  AddFrameTypeInfo(LayoutFrameType::Text,             "text",      "text");
+  AddFrameTypeInfo(LayoutFrameType::Viewport,         "VP",        "viewport");
 #ifdef MOZ_XUL
-  AddFrameTypeInfo(FrameType::XULLabel,         "XULLabel",  "XULLabel");
-  AddFrameTypeInfo(FrameType::Box,              "Box",       "Box");
-  AddFrameTypeInfo(FrameType::Slider,           "Slider",    "Slider");
-  AddFrameTypeInfo(FrameType::PopupSet,         "PopupSet",  "PopupSet");
+  AddFrameTypeInfo(LayoutFrameType::XULLabel,         "XULLabel",  "XULLabel");
+  AddFrameTypeInfo(LayoutFrameType::Box,              "Box",       "Box");
+  AddFrameTypeInfo(LayoutFrameType::Slider,           "Slider",    "Slider");
+  AddFrameTypeInfo(LayoutFrameType::PopupSet,         "PopupSet",  "PopupSet");
 #endif
-  AddFrameTypeInfo(FrameType::None,             "unknown",   "unknown");
+  AddFrameTypeInfo(LayoutFrameType::None,             "unknown",   "unknown");
 }
 
 
 void DR_State::DisplayFrameTypeInfo(nsIFrame* aFrame,
                                     int32_t   aIndent)
 {
   DR_FrameTypeInfo* frameTypeInfo = GetFrameTypeInfo(aFrame->Type());
   if (frameTypeInfo) {
@@ -11130,17 +11130,17 @@ DR_State::RuleMatches(DR_Rule& aRule, DR
 {
   NS_ASSERTION(aRule.mTarget, "program error");
 
   DR_RulePart* rulePart;
   DR_FrameTreeNode* parentNode;
   for (rulePart = aRule.mTarget->mNext, parentNode = aNode.mParent;
        rulePart && parentNode;
        rulePart = rulePart->mNext, parentNode = parentNode->mParent) {
-    if (rulePart->mFrameType != FrameType::None) {
+    if (rulePart->mFrameType != LayoutFrameType::None) {
       if (parentNode->mFrame) {
         if (rulePart->mFrameType != parentNode->mFrame->Type()) {
           return false;
         }
       } else NS_ASSERTION(false, "program error");
     }
     // else wild card match
   }
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -574,17 +574,17 @@ public:
    *                           Must not be null.
    * @param aChildPseudo the child's pseudo type, if any.
    */
   static nsIFrame*
   CorrectStyleParentFrame(nsIFrame* aProspectiveParent, nsIAtom* aChildPseudo);
 
 protected:
   // Protected constructor and destructor
-  explicit nsFrame(nsStyleContext* aContext, mozilla::FrameType aType);
+  explicit nsFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType);
   virtual ~nsFrame();
 
   /**
    * To be called by |BuildDisplayLists| of this class or derived classes to add
    * a translucent overlay if this frame's content is selected.
    * @param aContentType an nsISelectionDisplay DISPLAY_ constant identifying
    * which kind of content this is for
    */
@@ -628,27 +628,27 @@ public:
                      !aFrame->IsListControlFrame())) {
       return true;
     }
 
     // and overflow:hidden that we should interpret as -moz-hidden-unscrollable
     if (aDisp->mOverflowX == NS_STYLE_OVERFLOW_HIDDEN &&
         aDisp->mOverflowY == NS_STYLE_OVERFLOW_HIDDEN) {
       // REVIEW: these are the frame types that set up clipping.
-      mozilla::FrameType type = aFrame->Type();
-      if (type == mozilla::FrameType::Table ||
-          type == mozilla::FrameType::TableCell ||
-          type == mozilla::FrameType::BCTableCell ||
-          type == mozilla::FrameType::SVGOuterSVG ||
-          type == mozilla::FrameType::SVGInnerSVG ||
-          type == mozilla::FrameType::SVGForeignObject) {
+      mozilla::LayoutFrameType type = aFrame->Type();
+      if (type == mozilla::LayoutFrameType::Table ||
+          type == mozilla::LayoutFrameType::TableCell ||
+          type == mozilla::LayoutFrameType::BCTableCell ||
+          type == mozilla::LayoutFrameType::SVGOuterSVG ||
+          type == mozilla::LayoutFrameType::SVGInnerSVG ||
+          type == mozilla::LayoutFrameType::SVGForeignObject) {
         return true;
       }
       if (aFrame->IsFrameOfType(nsIFrame::eReplacedContainsBlock)) {
-        if (type == mozilla::FrameType::TextInput) {
+        if (type == mozilla::LayoutFrameType::TextInput) {
           // It always has an anonymous scroll frame that handles any overflow.
           return false;
         }
         return true;
       }
     }
 
     if ((aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT)) {
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -154,17 +154,17 @@ public:
 
   virtual void Reflow(nsPresContext*           aPresContext,
                           ReflowOutput&     aDesiredSize,
                           const ReflowInput& aReflowInput,
                           nsReflowStatus&          aStatus) override;
 
 protected:
   explicit nsHTMLFramesetBlankFrame(nsStyleContext* aContext)
-    : nsLeafFrame(aContext, FrameType::None)
+    : nsLeafFrame(aContext, LayoutFrameType::None)
   {}
 
   virtual ~nsHTMLFramesetBlankFrame();
   virtual nscoord GetIntrinsicISize() override;
   virtual nscoord GetIntrinsicBSize() override;
 
   friend class nsHTMLFramesetFrame;
   friend class nsHTMLFrameset;
@@ -172,17 +172,17 @@ protected:
 
 /*******************************************************************************
  * nsHTMLFramesetFrame
  ******************************************************************************/
 bool    nsHTMLFramesetFrame::gDragInProgress = false;
 #define DEFAULT_BORDER_WIDTH_PX 6
 
 nsHTMLFramesetFrame::nsHTMLFramesetFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::FrameSet)
+  : nsContainerFrame(aContext, LayoutFrameType::FrameSet)
 {
   mNumRows             = 0;
   mNumCols             = 0;
   mEdgeVisibility      = 0;
   mParentFrameborder   = eFrameborder_Yes; // default
   mParentBorderWidth   = -1; // default not set
   mParentBorderColor   = NO_COLOR; // default not set
   mFirstDragPoint.x     = mFirstDragPoint.y = 0;
@@ -1332,17 +1332,17 @@ NS_IMPL_FRAMEARENA_HELPERS(nsHTMLFramese
 
 /*******************************************************************************
  * nsHTMLFramesetBorderFrame
  ******************************************************************************/
 nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(nsStyleContext* aContext,
                                                      int32_t aWidth,
                                                      bool aVertical,
                                                      bool aVisibility)
-  : nsLeafFrame(aContext, FrameType::None)
+  : nsLeafFrame(aContext, LayoutFrameType::None)
   , mWidth(aWidth)
   , mVertical(aVertical)
   , mVisibility(aVisibility)
 {
    mCanResize    = true;
    mColor        = NO_COLOR;
    mPrevNeighbor = 0;
    mNextNeighbor = 0;
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -105,17 +105,17 @@ nsHTMLScrollFrame*
 NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsRoot)
 {
   return new (aPresShell) nsHTMLScrollFrame(aContext, aIsRoot);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsHTMLScrollFrame)
 
 nsHTMLScrollFrame::nsHTMLScrollFrame(nsStyleContext* aContext,
-                                     FrameType aType,
+                                     LayoutFrameType aType,
                                      bool aIsRoot)
   : nsContainerFrame(aContext, aType)
   , mHelper(ALLOW_THIS_IN_INITIALIZER_LIST(this), aIsRoot)
 {
 }
 
 void
 nsHTMLScrollFrame::ScrollbarActivityStarted() const
@@ -1156,17 +1156,17 @@ NS_NewXULScrollFrame(nsIPresShell* aPres
                                            aClipAllDescendants);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsXULScrollFrame)
 
 nsXULScrollFrame::nsXULScrollFrame(nsStyleContext* aContext,
                                    bool aIsRoot,
                                    bool aClipAllDescendants)
-  : nsBoxFrame(aContext, FrameType::Scroll, aIsRoot)
+  : nsBoxFrame(aContext, LayoutFrameType::Scroll, aIsRoot)
   , mHelper(ALLOW_THIS_IN_INITIALIZER_LIST(this), aIsRoot)
 {
   SetXULLayoutManager(nullptr);
   mHelper.mClipAllDescendants = aClipAllDescendants;
 }
 
 void
 nsXULScrollFrame::ScrollbarActivityStarted() const
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -1055,21 +1055,21 @@ public:
 #endif
 
 #ifdef ACCESSIBILITY
   virtual mozilla::a11y::AccType AccessibleType() override;
 #endif
 
 protected:
   nsHTMLScrollFrame(nsStyleContext* aContext, bool aIsRoot)
-    : nsHTMLScrollFrame(aContext, mozilla::FrameType::Scroll, aIsRoot)
+    : nsHTMLScrollFrame(aContext, mozilla::LayoutFrameType::Scroll, aIsRoot)
   {}
 
   nsHTMLScrollFrame(nsStyleContext* aContext,
-                    mozilla::FrameType aType,
+                    mozilla::LayoutFrameType aType,
                     bool aIsRoot);
   void SetSuppressScrollbarUpdate(bool aSuppress) {
     mHelper.mSupppressScrollbarUpdate = aSuppress;
   }
   bool GuessHScrollbarNeeded(const ScrollReflowInput& aState);
   bool GuessVScrollbarNeeded(const ScrollReflowInput& aState);
 
   bool IsScrollbarUpdateSuppressed() const {
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -4866,19 +4866,20 @@ nsGridContainerFrame::GetNearestFragment
   for ( ; cbRI; cbRI = cbRI->mCBReflowInput) {
     nsIScrollableFrame* sf = do_QueryFrame(cbRI->mFrame);
     if (sf) {
       break;
     }
     if (wm.IsOrthogonalTo(cbRI->GetWritingMode())) {
       break;
     }
-    FrameType frameType = cbRI->mFrame->Type();
-    if ((frameType == FrameType::Canvas && PresContext()->IsPaginated()) ||
-        frameType == FrameType::ColumnSet) {
+    LayoutFrameType frameType = cbRI->mFrame->Type();
+    if ((frameType == LayoutFrameType::Canvas &&
+         PresContext()->IsPaginated()) ||
+        frameType == LayoutFrameType::ColumnSet) {
       data.emplace();
       data->mIsTopOfPage = gridRI->mFlags.mIsTopOfPage;
       data->mToFragmentainerEnd = aState.mFragBStart +
         gridRI->AvailableBSize() - aState.mBorderPadding.BStart(wm);
       const auto numRows = aState.mRows.mSizes.Length();
       data->mCanBreakAtStart =
         numRows > 0 && aState.mRows.mSizes[0].mPosition > 0;
       nscoord bSize = gridRI->ComputedBSize();
--- a/layout/generic/nsGridContainerFrame.h
+++ b/layout/generic/nsGridContainerFrame.h
@@ -253,17 +253,17 @@ protected:
   struct LineRange;
   struct SharedGridData;
   struct TrackSizingFunctions;
   struct Tracks;
   struct TranslatedLineRange;
   friend nsContainerFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell,
                                                     nsStyleContext* aContext);
   explicit nsGridContainerFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext, mozilla::FrameType::GridContainer)
+    : nsContainerFrame(aContext, mozilla::LayoutFrameType::GridContainer)
     , mCachedMinISize(NS_INTRINSIC_WIDTH_UNKNOWN)
     , mCachedPrefISize(NS_INTRINSIC_WIDTH_UNKNOWN)
   {
     mBaseline[0][0] = NS_INTRINSIC_WIDTH_UNKNOWN;
     mBaseline[0][1] = NS_INTRINSIC_WIDTH_UNKNOWN;
     mBaseline[1][0] = NS_INTRINSIC_WIDTH_UNKNOWN;
     mBaseline[1][1] = NS_INTRINSIC_WIDTH_UNKNOWN;
   }
--- a/layout/generic/nsHTMLCanvasFrame.h
+++ b/layout/generic/nsHTMLCanvasFrame.h
@@ -32,17 +32,17 @@ public:
   typedef mozilla::layers::LayerManager LayerManager;
   typedef mozilla::ContainerLayerParameters ContainerLayerParameters;
 
   NS_DECL_QUERYFRAME_TARGET(nsHTMLCanvasFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit nsHTMLCanvasFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext, mozilla::FrameType::HTMLCanvas)
+    : nsContainerFrame(aContext, mozilla::LayoutFrameType::HTMLCanvas)
     , mBorderPadding(GetWritingMode())
   {}
 
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
                     nsIFrame*         aPrevInFlow) override;
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -162,17 +162,17 @@ typedef uint32_t nsSplittableType;
 // (reflowing with an NS_UNCONSTRAINEDSIZE available inline size isn't allowed
 //  and leads to assertions)
 #define INFINITE_ISIZE_COORD nscoord(NS_MAXSIZE - (1000000*60))
 
 //----------------------------------------------------------------------
 
 namespace mozilla {
 
-enum class FrameType : uint8_t {
+enum class LayoutFrameType : uint8_t {
 #define FRAME_TYPE(ty_) ty_,
 #include "mozilla/FrameTypeList.h"
 #undef FRAME_TYPE
 };
 
 } // namespace mozilla
 
 enum nsSelectionAmount {
@@ -597,17 +597,17 @@ public:
   typedef mozilla::gfx::DrawTarget DrawTarget;
   typedef mozilla::gfx::Matrix Matrix;
   typedef mozilla::gfx::Matrix4x4 Matrix4x4;
   typedef mozilla::Sides Sides;
   typedef mozilla::LogicalSides LogicalSides;
 
   NS_DECL_QUERYFRAME_TARGET(nsIFrame)
 
-  explicit nsIFrame(mozilla::FrameType aType)
+  explicit nsIFrame(mozilla::LayoutFrameType aType)
     : mRect()
     , mContent(nullptr)
     , mStyleContext(nullptr)
     , mParent(nullptr)
     , mNextSibling(nullptr)
     , mPrevSibling(nullptr)
     , mType(aType)
   {
@@ -2631,22 +2631,25 @@ public:
    * of this frame to the returned widget expressed in appunits of |this| (the
    * widget might be in a different document with a different zoom).
    */
   nsIWidget* GetNearestWidget(nsPoint& aOffset) const;
 
   /**
    * Get the "type" of the frame.
    *
-   * @see mozilla::FrameType
+   * @see mozilla::LayoutFrameType
    */
-  mozilla::FrameType Type() const { return mType; }
+  mozilla::LayoutFrameType Type() const { return mType; }
 
 #define FRAME_TYPE(name_)                                                      \
-  bool Is##name_##Frame() const { return mType == mozilla::FrameType::name_; }
+  bool Is##name_##Frame() const                                                \
+  {                                                                            \
+    return mType == mozilla::LayoutFrameType::name_;                           \
+  }
 #include "mozilla/FrameTypeList.h"
 #undef FRAME_TYPE
 
   /**
    * Returns a transformation matrix that converts points in this frame's
    * coordinate space to points in some ancestor frame's coordinate space.
    * The frame decides which ancestor it will use as a reference point.
    * If this frame has no ancestor, aOutAncestor will be set to null.
@@ -3800,17 +3803,17 @@ protected:
     uint32_t     mType;
     VisualDeltas mVisualDeltas;
   } mOverflow;
 
   /** @see GetWritingMode() */
   mozilla::WritingMode mWritingMode;
 
   /** The type of the frame. */
-  mozilla::FrameType mType;
+  mozilla::LayoutFrameType mType;
 
   // Helpers
   /**
    * Can we stop inside this frame when we're skipping non-rendered whitespace?
    * @param  aForward [in] Are we moving forward (or backward) in content order.
    * @param  aOffset [in/out] At what offset into the frame to start looking.
    *         on output - what offset was reached (whether or not we found a place to stop).
    * @return STOP: An appropriate offset was found within this frame,
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -130,17 +130,17 @@ inline bool HaveFixedSize(const ReflowIn
 nsIFrame*
 NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsImageFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsImageFrame)
 
-nsImageFrame::nsImageFrame(nsStyleContext* aContext, FrameType aType)
+nsImageFrame::nsImageFrame(nsStyleContext* aContext, LayoutFrameType aType)
   : nsAtomicContainerFrame(aContext, aType)
   , mComputedSize(0, 0)
   , mIntrinsicRatio(0, 0)
   , mDisplayingIcon(false)
   , mFirstFrameComplete(false)
   , mReflowCallbackPosted(false)
   , mForceSyncDecoding(false)
 {
--- a/layout/generic/nsImageFrame.h
+++ b/layout/generic/nsImageFrame.h
@@ -67,17 +67,17 @@ public:
   typedef mozilla::image::DrawResult DrawResult;
   typedef mozilla::layers::ImageContainer ImageContainer;
   typedef mozilla::layers::ImageLayer ImageLayer;
   typedef mozilla::layers::LayerManager LayerManager;
 
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit nsImageFrame(nsStyleContext* aContext)
-    : nsImageFrame(aContext, mozilla::FrameType::Image)
+    : nsImageFrame(aContext, mozilla::LayoutFrameType::Image)
   {}
 
   NS_DECL_QUERYFRAME_TARGET(nsImageFrame)
   NS_DECL_QUERYFRAME
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
   virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) override;
 
@@ -178,17 +178,17 @@ public:
 
   void DisconnectMap();
 
   // nsIReflowCallback
   virtual bool ReflowFinished() override;
   virtual void ReflowCallbackCanceled() override;
 
 protected:
-  nsImageFrame(nsStyleContext* aContext, mozilla::FrameType aType);
+  nsImageFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType);
 
   virtual ~nsImageFrame();
 
   void EnsureIntrinsicSizeAndRatio();
 
   virtual mozilla::LogicalSize
   ComputeSize(nsRenderingContext *aRenderingContext,
               mozilla::WritingMode aWritingMode,
--- a/layout/generic/nsInlineFrame.cpp
+++ b/layout/generic/nsInlineFrame.cpp
@@ -55,30 +55,30 @@ nsInlineFrame::GetFrameName(nsAString& a
   return MakeFrameName(NS_LITERAL_STRING("Inline"), aResult);
 }
 #endif
 
 void
 nsInlineFrame::InvalidateFrame(uint32_t aDisplayItemKey)
 {
   if (nsSVGUtils::IsInSVGTextSubtree(this)) {
-    nsIFrame* svgTextFrame =
-      nsLayoutUtils::GetClosestFrameOfType(GetParent(), FrameType::SVGText);
+    nsIFrame* svgTextFrame = nsLayoutUtils::GetClosestFrameOfType(
+      GetParent(), LayoutFrameType::SVGText);
     svgTextFrame->InvalidateFrame();
     return;
   }
   nsContainerFrame::InvalidateFrame(aDisplayItemKey);
 }
 
 void
 nsInlineFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
 {
   if (nsSVGUtils::IsInSVGTextSubtree(this)) {
-    nsIFrame* svgTextFrame =
-      nsLayoutUtils::GetClosestFrameOfType(GetParent(), FrameType::SVGText);
+    nsIFrame* svgTextFrame = nsLayoutUtils::GetClosestFrameOfType(
+      GetParent(), LayoutFrameType::SVGText);
     svgTextFrame->InvalidateFrame();
     return;
   }
   nsContainerFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey);
 }
 
 static inline bool
 IsMarginZero(const nsStyleCoord &aCoord)
@@ -476,17 +476,17 @@ nsInlineFrame::AttributeChanged(int32_t 
     nsContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
 
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   if (nsSVGUtils::IsInSVGTextSubtree(this)) {
     SVGTextFrame* f = static_cast<SVGTextFrame*>(
-      nsLayoutUtils::GetClosestFrameOfType(this, FrameType::SVGText));
+      nsLayoutUtils::GetClosestFrameOfType(this, LayoutFrameType::SVGText));
     f->HandleAttributeChangeInDescendant(mContent->AsElement(),
                                          aNameSpaceID, aAttribute);
   }
 
   return NS_OK;
 }
 
 bool
--- a/layout/generic/nsInlineFrame.h
+++ b/layout/generic/nsInlineFrame.h
@@ -136,22 +136,22 @@ protected:
       mPrevFrame = nullptr;
       mNextInFlow = nullptr;
       mLineContainer = nullptr;
       mLineLayout = nullptr;
       mSetParentPointer = false;
     }
   };
 
-  nsInlineFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  nsInlineFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType)
     : nsContainerFrame(aContext, aType)
   {}
 
   explicit nsInlineFrame(nsStyleContext* aContext)
-    : nsInlineFrame(aContext, mozilla::FrameType::Inline)
+    : nsInlineFrame(aContext, mozilla::LayoutFrameType::Inline)
   {}
 
   virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
 
   void ReflowFrames(nsPresContext* aPresContext,
                     const ReflowInput& aReflowInput,
                     InlineReflowInput& rs,
                     ReflowOutput& aMetrics,
@@ -227,17 +227,17 @@ public:
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
                     nsIFrame*         aPrevInFlow) override;
   virtual void PullOverflowsFromPrevInFlow() override;
   virtual bool DrainSelfOverflowList() override;
 
 protected:
   explicit nsFirstLineFrame(nsStyleContext* aContext)
-    : nsInlineFrame(aContext, mozilla::FrameType::Line)
+    : nsInlineFrame(aContext, mozilla::LayoutFrameType::Line)
   {}
 
   virtual nsIFrame* PullOneFrame(nsPresContext* aPresContext,
                                  InlineReflowInput& rs,
                                  bool* aIsComplete) override;
 };
 
 #endif /* nsInlineFrame_h___ */
--- a/layout/generic/nsLeafFrame.h
+++ b/layout/generic/nsLeafFrame.h
@@ -72,17 +72,17 @@ public:
   virtual bool IsFrameOfType(uint32_t aFlags) const override
   {
     // We don't actually contain a block, but we do always want a
     // computed width, so tell a little white lie here.
     return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplacedContainsBlock));
   }
 
 protected:
-  nsLeafFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  nsLeafFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType)
     : nsFrame(aContext, aType)
   {}
 
   virtual ~nsLeafFrame();
 
   /**
    * Return the intrinsic isize of the frame's content area. Note that this
    * should not include borders or padding and should not depend on the applied
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -461,22 +461,22 @@ nsLineLayout::AttachFrameToBaseLineLayou
   NS_PRECONDITION(mBaseLineLayout,
                   "This method must not be called in a base line layout.");
 
   PerFrameData* baseFrame = mBaseLineLayout->LastFrame();
   MOZ_ASSERT(aFrame && baseFrame);
   MOZ_ASSERT(!aFrame->mIsLinkedToBase,
              "The frame must not have been linked with the base");
 #ifdef DEBUG
-  FrameType baseType = baseFrame->mFrame->Type();
-  FrameType annotationType = aFrame->mFrame->Type();
-  MOZ_ASSERT((baseType == FrameType::RubyBaseContainer &&
-              annotationType == FrameType::RubyTextContainer) ||
-             (baseType == FrameType::RubyBase &&
-              annotationType == FrameType::RubyText));
+  LayoutFrameType baseType = baseFrame->mFrame->Type();
+  LayoutFrameType annotationType = aFrame->mFrame->Type();
+  MOZ_ASSERT((baseType == LayoutFrameType::RubyBaseContainer &&
+              annotationType == LayoutFrameType::RubyTextContainer) ||
+             (baseType == LayoutFrameType::RubyBase &&
+              annotationType == LayoutFrameType::RubyText));
 #endif
 
   aFrame->mNextAnnotation = baseFrame->mNextAnnotation;
   baseFrame->mNextAnnotation = aFrame;
   aFrame->mIsLinkedToBase = true;
 }
 
 int32_t
@@ -706,24 +706,24 @@ HasPercentageUnitSide(const nsStyleSides
   return false;
 }
 
 static bool
 IsPercentageAware(const nsIFrame* aFrame)
 {
   NS_ASSERTION(aFrame, "null frame is not allowed");
 
-  FrameType fType = aFrame->Type();
-  if (fType == FrameType::Text) {
+  LayoutFrameType fType = aFrame->Type();
+  if (fType == LayoutFrameType::Text) {
     // None of these things can ever be true for text frames.
     return false;
   }
 
   // Some of these things don't apply to non-replaced inline frames
-  // (that is, fType == FrameType::Inline), but we won't bother making
+  // (that is, fType == LayoutFrameType::Inline), but we won't bother making
   // things unnecessarily complicated, since they'll probably be set
   // quite rarely.
 
   const nsStyleMargin* margin = aFrame->StyleMargin();
   if (HasPercentageUnitSide(margin->mMargin)) {
     return true;
   }
 
@@ -746,20 +746,20 @@ IsPercentageAware(const nsIFrame* aFrame
   }
 
   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 == StyleDisplay::InlineBlock ||
         disp->mDisplay == StyleDisplay::InlineTable ||
-        fType == FrameType::HTMLButtonControl ||
-        fType == FrameType::GfxButtonControl ||
-        fType == FrameType::FieldSet ||
-        fType == FrameType::ComboboxDisplay) {
+        fType == LayoutFrameType::HTMLButtonControl ||
+        fType == LayoutFrameType::GfxButtonControl ||
+        fType == LayoutFrameType::FieldSet ||
+        fType == LayoutFrameType::ComboboxDisplay) {
       return true;
     }
 
     // Per CSS 2.1, section 10.3.2:
     //   If 'height' and 'width' both have computed values of 'auto' and
     //   the element has an intrinsic ratio but no intrinsic height or
     //   width and the containing block's width does not itself depend
     //   on the replaced element's width, then the used value of 'width'
@@ -833,18 +833,18 @@ nsLineLayout::ReflowFrame(nsIFrame* aFra
   // we can move the line down below float(s).)
   //
   // Capture this state *before* we reflow the frame in case it clears
   // the state out. We need to know how to treat the current frame
   // when breaking.
   bool notSafeToBreak = LineIsEmpty() && !mImpactedByFloats;
 
   // Figure out whether we're talking about a textframe here
-  FrameType frameType = aFrame->Type();
-  bool isText = frameType == FrameType::Text;
+  LayoutFrameType frameType = aFrame->Type();
+  bool isText = frameType == LayoutFrameType::Text;
 
   // Inline-ish and text-ish things don't compute their width;
   // everything else does.  We need to give them an available width that
   // reflects the space left on the line.
   LAYOUT_WARN_IF_FALSE(psd->mIEnd != NS_UNCONSTRAINEDSIZE,
                       "have unconstrained width; this should only result from "
                       "very large sizes, not attempts at intrinsic width "
                       "calculation");
@@ -929,20 +929,20 @@ nsLineLayout::ReflowFrame(nsIFrame* aFra
   pfd->mJustificationInfo = mJustificationInfo;
   mJustificationInfo = JustificationInfo();
 
   // See if the frame is a placeholderFrame and if it is process
   // the float. At the same time, check if the frame has any non-collapsed-away
   // content.
   bool placedFloat = false;
   bool isEmpty;
-  if (frameType == FrameType::None) {
+  if (frameType == LayoutFrameType::None) {
     isEmpty = pfd->mFrame->IsEmpty();
   } else {
-    if (FrameType::Placeholder == frameType) {
+    if (LayoutFrameType::Placeholder == frameType) {
       isEmpty = true;
       pfd->mSkipWhenTrimmingWhitespace = true;
       nsIFrame* outOfFlowFrame = nsLayoutUtils::GetFloatFromPlaceholder(aFrame);
       if (outOfFlowFrame) {
         // Add mTrimmableISize to the available width since if the line ends
         // here, the width of the inline content will be reduced by
         // mTrimmableISize.
         nscoord availableISize = psd->mIEnd - (psd->mICoord - mTrimmableISize);
@@ -974,21 +974,21 @@ nsLineLayout::ReflowFrame(nsIFrame* aFra
         pfd->mIsNonEmptyTextFrame = true;
         nsIContent* content = textFrame->GetContent();
 
         const nsTextFragment* frag = content->GetText();
         if (frag) {
           pfd->mIsNonWhitespaceTextFrame = !content->TextIsOnlyWhitespace();
         }
       }
-    } else if (FrameType::Br == frameType) {
+    } else if (LayoutFrameType::Br == frameType) {
       pfd->mSkipWhenTrimmingWhitespace = true;
       isEmpty = false;
     } else {
-      if (FrameType::Letter == frameType) {
+      if (LayoutFrameType::Letter == frameType) {
         pfd->mIsLetterFrame = true;
       }
       if (pfd->mSpan) {
         isEmpty = !pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty();
       } else {
         isEmpty = pfd->mFrame->IsEmpty();
       }
     }
@@ -1085,17 +1085,17 @@ nsLineLayout::ReflowFrame(nsIFrame* aFra
                       aReflowStatus, &optionalBreakAfterFits)) {
       if (!isEmpty) {
         psd->mHasNonemptyContent = true;
         mLineIsEmpty = false;
         if (!pfd->mSpan) {
           // nonempty leaf content has been placed
           mLineAtStart = false;
         }
-        if (FrameType::Ruby == frameType) {
+        if (LayoutFrameType::Ruby == frameType) {
           mHasRuby = true;
           SyncAnnotationBounds(pfd);
         }
       }
 
       // Place the frame, updating aBounds with the final size and
       // location.  Then apply the bottom+right margins (as
       // appropriate) to the frame.
@@ -1718,17 +1718,17 @@ nsLineLayout::AdjustLeadings(nsIFrame* s
 }
 
 static float
 GetInflationForBlockDirAlignment(nsIFrame* aFrame,
                                  nscoord aInflationMinFontSize)
 {
   if (nsSVGUtils::IsInSVGTextSubtree(aFrame)) {
     const nsIFrame* container =
-      nsLayoutUtils::GetClosestFrameOfType(aFrame, FrameType::SVGText);
+      nsLayoutUtils::GetClosestFrameOfType(aFrame, LayoutFrameType::SVGText);
     NS_ASSERTION(container, "expected to find an ancestor SVGTextFrame");
     return
       static_cast<const SVGTextFrame*>(container)->GetFontSizeScaleFactor();
   }
   return nsLayoutUtils::FontSizeInflationInner(aFrame, aInflationMinFontSize);
 }
 
 #define BLOCKDIR_ALIGN_FRAMES_NO_MINIMUM nscoord_MAX
@@ -2805,40 +2805,40 @@ nsLineLayout::ComputeFrameJustification(
 
 void
 nsLineLayout::AdvanceAnnotationInlineBounds(PerFrameData* aPFD,
                                             const nsSize& aContainerSize,
                                             nscoord aDeltaICoord,
                                             nscoord aDeltaISize)
 {
   nsIFrame* frame = aPFD->mFrame;
-  FrameType frameType = frame->Type();
-  MOZ_ASSERT(frameType == FrameType::RubyText ||
-             frameType == FrameType::RubyTextContainer);
+  LayoutFrameType frameType = frame->Type();
+  MOZ_ASSERT(frameType == LayoutFrameType::RubyText ||
+             frameType == LayoutFrameType::RubyTextContainer);
   MOZ_ASSERT(aPFD->mSpan, "rt and rtc should have span.");
 
   PerSpanData* psd = aPFD->mSpan;
   WritingMode lineWM = mRootSpan->mWritingMode;
   aPFD->mBounds.IStart(lineWM) += aDeltaICoord;
 
   // Check whether this expansion should be counted into the reserved
   // isize or not. When it is a ruby text container, and it has some
   // children linked to the base, it must not have reserved isize,
   // or its children won't align with their bases.  Otherwise, this
   // expansion should be reserved.  There are two cases a ruby text
   // container does not have children linked to the base:
   // 1. it is a container for span; 2. its children are collapsed.
   // See bug 1055674 for the second case.
-  if (frameType == FrameType::RubyText ||
+  if (frameType == LayoutFrameType::RubyText ||
       // This ruby text container is a span.
       (psd->mFirstFrame == psd->mLastFrame && psd->mFirstFrame &&
        !psd->mFirstFrame->mIsLinkedToBase)) {
     // For ruby text frames, only increase frames
     // which are not auto-hidden.
-    if (frameType != FrameType::RubyText ||
+    if (frameType != LayoutFrameType::RubyText ||
         !static_cast<nsRubyTextFrame*>(frame)->IsAutoHidden()) {
       nscoord reservedISize = RubyUtils::GetReservedISize(frame);
       RubyUtils::SetReservedISize(frame, reservedISize + aDeltaISize);
     }
   } else {
     // It is a normal ruby text container. Its children will expand
     // themselves properly. We only need to expand its own size here.
     aPFD->mBounds.ISize(lineWM) += aDeltaISize;
--- a/layout/generic/nsPageContentFrame.h
+++ b/layout/generic/nsPageContentFrame.h
@@ -39,16 +39,16 @@ public:
 
 #ifdef DEBUG_FRAME_DUMP
   // Debugging
   virtual nsresult  GetFrameName(nsAString& aResult) const override;
 #endif
 
 protected:
   explicit nsPageContentFrame(nsStyleContext* aContext)
-    : ViewportFrame(aContext, mozilla::FrameType::PageContent)
+    : ViewportFrame(aContext, mozilla::LayoutFrameType::PageContent)
   {}
 
   nsSharedPageData*         mPD;
 };
 
 #endif /* nsPageContentFrame_h___ */
 
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -36,17 +36,17 @@ NS_NewPageFrame(nsIPresShell* aPresShell
 
 NS_IMPL_FRAMEARENA_HELPERS(nsPageFrame)
 
 NS_QUERYFRAME_HEAD(nsPageFrame)
   NS_QUERYFRAME_ENTRY(nsPageFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
 
 nsPageFrame::nsPageFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::Page)
+  : nsContainerFrame(aContext, LayoutFrameType::Page)
 {
 }
 
 nsPageFrame::~nsPageFrame()
 {
 }
 
 void
@@ -677,17 +677,17 @@ NS_NewPageBreakFrame(nsIPresShell* aPres
   NS_ASSERTION(aPresShell->GetPresContext()->IsPaginated(), "created a page break frame while not printing");
 
   return new (aPresShell) nsPageBreakFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsPageBreakFrame)
 
 nsPageBreakFrame::nsPageBreakFrame(nsStyleContext* aContext)
-  : nsLeafFrame(aContext, FrameType::PageBreak)
+  : nsLeafFrame(aContext, LayoutFrameType::PageBreak)
   , mHaveReflowed(false)
 {
 }
 
 nsPageBreakFrame::~nsPageBreakFrame()
 {
 }
 
--- a/layout/generic/nsPlaceholderFrame.h
+++ b/layout/generic/nsPlaceholderFrame.h
@@ -63,17 +63,17 @@ public:
   /**
    * Create a new placeholder frame.  aTypeBit must be one of the
    * PLACEHOLDER_FOR_* constants above.
    */
   friend nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell,
                                           nsStyleContext* aContext,
                                           nsFrameState aTypeBit);
   nsPlaceholderFrame(nsStyleContext* aContext, nsFrameState aTypeBit)
-    : nsFrame(aContext, mozilla::FrameType::Placeholder)
+    : nsFrame(aContext, mozilla::LayoutFrameType::Placeholder)
   {
     NS_PRECONDITION(aTypeBit == PLACEHOLDER_FOR_FLOAT ||
                     aTypeBit == PLACEHOLDER_FOR_ABSPOS ||
                     aTypeBit == PLACEHOLDER_FOR_FIXEDPOS ||
                     aTypeBit == PLACEHOLDER_FOR_POPUP ||
                     aTypeBit == PLACEHOLDER_FOR_TOPLAYER,
                     "Unexpected type bit");
     AddStateBits(aTypeBit);
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -140,17 +140,17 @@ protected:
     return false;
   }
 
   uint64_t mLastSequenceNumber;
   nsPluginFrame* mFrame;
 };
 
 nsPluginFrame::nsPluginFrame(nsStyleContext* aContext)
-  : nsFrame(aContext, FrameType::Object)
+  : nsFrame(aContext, LayoutFrameType::Object)
   , mInstanceOwner(nullptr)
   , mOuterView(nullptr)
   , mInnerView(nullptr)
   , mBackgroundSink(nullptr)
   , mReflowCallbackPosted(false)
 {
   MOZ_LOG(sPluginFrameLog, LogLevel::Debug,
          ("Created new nsPluginFrame %p\n", this));
--- a/layout/generic/nsRubyBaseContainerFrame.h
+++ b/layout/generic/nsRubyBaseContainerFrame.h
@@ -62,17 +62,17 @@ public:
   }
 
 protected:
   friend nsContainerFrame*
     NS_NewRubyBaseContainerFrame(nsIPresShell* aPresShell,
                                  nsStyleContext* aContext);
 
   explicit nsRubyBaseContainerFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext, mozilla::FrameType::RubyBaseContainer)
+    : nsContainerFrame(aContext, mozilla::LayoutFrameType::RubyBaseContainer)
   {}
 
   struct RubyReflowInput;
   nscoord ReflowColumns(const RubyReflowInput& aReflowInput,
                         nsReflowStatus& aStatus);
   nscoord ReflowOneColumn(const RubyReflowInput& aReflowInput,
                           uint32_t aColumnIndex,
                           const mozilla::RubyColumn& aColumn,
--- a/layout/generic/nsRubyBaseFrame.h
+++ b/layout/generic/nsRubyBaseFrame.h
@@ -28,13 +28,13 @@ public:
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
 #endif
 
 protected:
   friend nsContainerFrame* NS_NewRubyBaseFrame(nsIPresShell* aPresShell,
                                                nsStyleContext* aContext);
   explicit nsRubyBaseFrame(nsStyleContext* aContext)
-    : nsRubyContentFrame(aContext, mozilla::FrameType::RubyBase)
+    : nsRubyContentFrame(aContext, mozilla::LayoutFrameType::RubyBase)
   {}
 };
 
 #endif /* nsRubyBaseFrame_h___ */
--- a/layout/generic/nsRubyContentFrame.h
+++ b/layout/generic/nsRubyContentFrame.h
@@ -23,14 +23,14 @@ public:
   // an anonymous frame that was created to contain non-droppable
   // whitespaces directly inside a ruby level container. This impacts
   // ruby pairing behavior.
   // See http://dev.w3.org/csswg/css-ruby/#anon-gen-interpret-space
   bool IsIntraLevelWhitespace() const;
 
 protected:
   explicit nsRubyContentFrame(nsStyleContext* aContext,
-                              mozilla::FrameType aType)
+                              mozilla::LayoutFrameType aType)
     : nsInlineFrame(aContext, aType)
   {}
 };
 
 #endif /* nsRubyContentFrame_h___ */
--- a/layout/generic/nsRubyFrame.h
+++ b/layout/generic/nsRubyFrame.h
@@ -44,17 +44,17 @@ public:
   mozilla::RubyBlockLeadings GetBlockLeadings() const {
     return mLeadings;
   }
 
 protected:
   friend nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
                                            nsStyleContext* aContext);
   explicit nsRubyFrame(nsStyleContext* aContext)
-    : nsInlineFrame(aContext, mozilla::FrameType::Ruby)
+    : nsInlineFrame(aContext, mozilla::LayoutFrameType::Ruby)
   {}
 
   void ReflowSegment(nsPresContext* aPresContext,
                      const ReflowInput& aReflowInput,
                      nsRubyBaseContainerFrame* aBaseContainer,
                      nsReflowStatus& aStatus);
 
   nsRubyBaseContainerFrame* PullOneSegment(const nsLineLayout* aLineLayout,
--- a/layout/generic/nsRubyTextContainerFrame.h
+++ b/layout/generic/nsRubyTextContainerFrame.h
@@ -52,17 +52,17 @@ public:
   }
 
 protected:
   friend nsContainerFrame*
     NS_NewRubyTextContainerFrame(nsIPresShell* aPresShell,
                                  nsStyleContext* aContext);
 
   explicit nsRubyTextContainerFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext, mozilla::FrameType::RubyTextContainer)
+    : nsContainerFrame(aContext, mozilla::LayoutFrameType::RubyTextContainer)
     , mISize(0)
   {}
 
   void UpdateSpanFlag();
 
   friend class nsRubyBaseContainerFrame;
   void SetISize(nscoord aISize) { mISize = aISize; }
 
--- a/layout/generic/nsRubyTextFrame.h
+++ b/layout/generic/nsRubyTextFrame.h
@@ -45,13 +45,13 @@ public:
   {
     return GetStateBits() & NS_RUBY_TEXT_FRAME_AUTOHIDE;
   }
 
 protected:
   friend nsContainerFrame* NS_NewRubyTextFrame(nsIPresShell* aPresShell,
                                                nsStyleContext* aContext);
   explicit nsRubyTextFrame(nsStyleContext* aContext)
-    : nsRubyContentFrame(aContext, mozilla::FrameType::RubyText)
+    : nsRubyContentFrame(aContext, mozilla::LayoutFrameType::RubyText)
   {}
 };
 
 #endif /* nsRubyTextFrame_h___ */
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -40,17 +40,17 @@ nsSimplePageSequenceFrame*
 NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsSimplePageSequenceFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSimplePageSequenceFrame)
 
 nsSimplePageSequenceFrame::nsSimplePageSequenceFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::Sequence)
+  : nsContainerFrame(aContext, LayoutFrameType::Sequence)
   , mTotalPages(-1)
   , mSelectionHeight(-1)
   , mYSelOffset(0)
   , mCalledBeginPage(false)
   , mCurrentCanvasListSetup(false)
 {
   nscoord halfInch = PresContext()->CSSTwipsToAppUnits(NS_INCHES_TO_TWIPS(0.5));
   mMargin.SizeTo(halfInch, halfInch, halfInch, halfInch);
--- a/layout/generic/nsSplittableFrame.h
+++ b/layout/generic/nsSplittableFrame.h
@@ -69,17 +69,18 @@ public:
   virtual nsIFrame* FirstInFlow() const override;
   virtual nsIFrame* LastInFlow() const override;
 
   // Remove the frame from the flow. Connects the frame's prev-in-flow
   // and its next-in-flow. This should only be called in frame Destroy() methods.
   static void RemoveFromFlow(nsIFrame* aFrame);
 
 protected:
-  explicit nsSplittableFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  explicit nsSplittableFrame(nsStyleContext* aContext,
+                             mozilla::LayoutFrameType aType)
     : nsFrame(aContext, aType)
     , mPrevContinuation(nullptr)
     , mNextContinuation(nullptr)
   {}
 
   /**
    * Return the sum of the block-axis content size of our prev-in-flows.
    * @param aWM a writing-mode to determine the block-axis
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -54,17 +54,17 @@ GetDocumentFromView(nsView* aView)
   NS_PRECONDITION(aView, "");
 
   nsViewManager* vm = aView->GetViewManager();
   nsIPresShell* ps =  vm ? vm->GetPresShell() : nullptr;
   return ps ? ps->GetDocument() : nullptr;
 }
 
 nsSubDocumentFrame::nsSubDocumentFrame(nsStyleContext* aContext)
-  : nsAtomicContainerFrame(aContext, FrameType::SubDocument)
+  : nsAtomicContainerFrame(aContext, LayoutFrameType::SubDocument)
   , mOuterView(nullptr)
   , mInnerView(nullptr)
   , mIsInline(false)
   , mPostedReflowCallback(false)
   , mDidCreateDoc(false)
   , mCallingShow(false)
 {
 }
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -681,17 +681,17 @@ InvalidateFrameDueToGlyphsChanged(nsIFra
 
     // If this is a non-display text frame within SVG <text>, we need
     // to reflow the SVGTextFrame. (This is similar to reflowing the
     // SVGTextFrame in response to style changes, in
     // SVGTextFrame::DidSetStyleContext.)
     if (nsSVGUtils::IsInSVGTextSubtree(f) &&
         f->GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
       auto svgTextFrame = static_cast<SVGTextFrame*>(
-        nsLayoutUtils::GetClosestFrameOfType(f, FrameType::SVGText));
+        nsLayoutUtils::GetClosestFrameOfType(f, LayoutFrameType::SVGText));
       svgTextFrame->ScheduleReflowSVGNonDisplayText(nsIPresShell::eResize);
     } else {
       // Theoretically we could just update overflow areas, perhaps using
       // OverflowChangedTracker, but that would do a bunch of work eagerly that
       // we should probably do lazily here since there could be a lot
       // of text frames affected and we'd like to coalesce the work. So that's
       // not easy to do well.
       shell->FrameNeedsReflow(f, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
@@ -1282,25 +1282,26 @@ CanTextCrossFrameBoundary(nsIFrame* aFra
     }
   }
   return result;
 }
 
 BuildTextRunsScanner::FindBoundaryResult
 BuildTextRunsScanner::FindBoundaries(nsIFrame* aFrame, FindBoundaryState* aState)
 {
-  FrameType frameType = aFrame->Type();
-  if (frameType == FrameType::RubyTextContainer) {
+  LayoutFrameType frameType = aFrame->Type();
+  if (frameType == LayoutFrameType::RubyTextContainer) {
     // Don't stop a text run for ruby text container. We want ruby text
     // containers to be skipped, but continue the text run across them.
     return FB_CONTINUE;
   }
 
-  nsTextFrame* textFrame =
-    frameType == FrameType::Text ? static_cast<nsTextFrame*>(aFrame) : nullptr;
+  nsTextFrame* textFrame = frameType == LayoutFrameType::Text
+                             ? static_cast<nsTextFrame*>(aFrame)
+                             : nullptr;
   if (textFrame) {
     if (aState->mLastTextFrame &&
         textFrame != aState->mLastTextFrame->GetNextInFlow() &&
         !ContinueTextRunAcrossFrames(aState->mLastTextFrame, textFrame)) {
       aState->mSeenTextRunBoundaryOnThisLine = true;
       if (aState->mSeenSpaceForLineBreakingOnThisLine)
         return FB_FOUND_VALID_TEXTRUN_BOUNDARY;
     }
@@ -1834,43 +1835,43 @@ BuildTextRunsScanner::ContinueTextRunAcr
     fontStyle1->mLanguage == fontStyle2->mLanguage &&
     textStyle1->mTextTransform == textStyle2->mTextTransform &&
     nsLayoutUtils::GetTextRunFlagsForStyle(sc1, fontStyle1, textStyle1, letterSpacing1) ==
       nsLayoutUtils::GetTextRunFlagsForStyle(sc2, fontStyle2, textStyle2, letterSpacing2);
 }
 
 void BuildTextRunsScanner::ScanFrame(nsIFrame* aFrame)
 {
-  FrameType frameType = aFrame->Type();
-  if (frameType == FrameType::RubyTextContainer) {
+  LayoutFrameType frameType = aFrame->Type();
+  if (frameType == LayoutFrameType::RubyTextContainer) {
     // Don't include any ruby text container into the text run.
     return;
   }
 
   // First check if we can extend the current mapped frame block. This is common.
   if (mMappedFlows.Length() > 0) {
     MappedFlow* mappedFlow = &mMappedFlows[mMappedFlows.Length() - 1];
     if (mappedFlow->mEndFrame == aFrame &&
         (aFrame->GetStateBits() & NS_FRAME_IS_FLUID_CONTINUATION)) {
-      NS_ASSERTION(frameType == FrameType::Text,
+      NS_ASSERTION(frameType == LayoutFrameType::Text,
                    "Flow-sibling of a text frame is not a text frame?");
 
       // Don't do this optimization if mLastFrame has a terminal newline...
       // it's quite likely preformatted and we might want to end the textrun here.
       // This is almost always true:
       if (mLastFrame->StyleContext() == aFrame->StyleContext() &&
           !HasTerminalNewline(mLastFrame)) {
         AccumulateRunInfo(static_cast<nsTextFrame*>(aFrame));
         return;
       }
     }
   }
 
   // Now see if we can add a new set of frames to the current textrun
-  if (frameType == FrameType::Text) {
+  if (frameType == LayoutFrameType::Text) {
     nsTextFrame* frame = static_cast<nsTextFrame*>(aFrame);
 
     if (mLastFrame) {
       if (!ContinueTextRunAcrossFrames(mLastFrame, frame)) {
         FlushFrames(false, false);
       } else {
         if (mLastFrame->GetContent() == frame->GetContent()) {
           AccumulateRunInfo(frame);
@@ -1890,17 +1891,17 @@ void BuildTextRunsScanner::ScanFrame(nsI
     if (mMappedFlows.Length() == 1) {
       mCurrentFramesAllSameTextRun = frame->GetTextRun(mWhichTextRun);
       mCurrentRunContextInfo = mNextRunContextInfo;
     }
     return;
   }
 
   FrameTextTraversal traversal = CanTextCrossFrameBoundary(aFrame);
-  bool isBR = frameType == FrameType::Br;
+  bool isBR = frameType == LayoutFrameType::Br;
   if (!traversal.mLineBreakerCanCrossFrameBoundary) {
     // BR frames are special. We do not need or want to record a break opportunity
     // before a BR frame.
     FlushFrames(true, isBR);
     mCommonAncestorWithLastFrame = aFrame;
     mNextRunContextInfo &= ~nsTextFrameUtils::INCOMING_WHITESPACE;
     mStartOfLine = false;
   } else if (!traversal.mTextRunCanCrossFrameBoundary) {
@@ -4598,30 +4599,30 @@ nsTextFrame::LastContinuation() const
   MOZ_ASSERT(lastContinuation, "post-condition failed");
   return lastContinuation;
 }
 
 void
 nsTextFrame::InvalidateFrame(uint32_t aDisplayItemKey)
 {
   if (nsSVGUtils::IsInSVGTextSubtree(this)) {
-    nsIFrame* svgTextFrame =
-      nsLayoutUtils::GetClosestFrameOfType(GetParent(), FrameType::SVGText);
+    nsIFrame* svgTextFrame = nsLayoutUtils::GetClosestFrameOfType(
+      GetParent(), LayoutFrameType::SVGText);
     svgTextFrame->InvalidateFrame();
     return;
   }
   nsFrame::InvalidateFrame(aDisplayItemKey);
 }
 
 void
 nsTextFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
 {
   if (nsSVGUtils::IsInSVGTextSubtree(this)) {
-    nsIFrame* svgTextFrame =
-      nsLayoutUtils::GetClosestFrameOfType(GetParent(), FrameType::SVGText);
+    nsIFrame* svgTextFrame = nsLayoutUtils::GetClosestFrameOfType(
+      GetParent(), LayoutFrameType::SVGText);
     svgTextFrame->InvalidateFrame();
     return;
   }
   nsFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey);
 }
 
 gfxTextRun*
 nsTextFrame::GetUninflatedTextRun()
--- a/layout/generic/nsTextFrame.h
+++ b/layout/generic/nsTextFrame.h
@@ -45,17 +45,17 @@ class nsTextFrame : public nsFrame
   typedef mozilla::gfx::DrawTarget DrawTarget;
   typedef mozilla::gfx::Point Point;
   typedef mozilla::gfx::Rect Rect;
   typedef mozilla::gfx::Size Size;
   typedef gfxTextRun::Range Range;
 
 public:
   explicit nsTextFrame(nsStyleContext* aContext)
-    : nsTextFrame(aContext, mozilla::FrameType::Text)
+    : nsTextFrame(aContext, mozilla::LayoutFrameType::Text)
   {}
 
   NS_DECL_QUERYFRAME_TARGET(nsTextFrame)
   NS_DECL_FRAMEARENA_HELPERS
 
   friend class nsContinuingTextFrame;
   friend class nsDisplayTextGeometry;
   friend class nsDisplayText;
@@ -643,17 +643,17 @@ public:
   bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
 
   void AssignJustificationGaps(const mozilla::JustificationAssignment& aAssign);
   mozilla::JustificationAssignment GetJustificationAssignment() const;
 
   uint32_t CountGraphemeClusters() const;
 
 protected:
-  nsTextFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  nsTextFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType)
     : nsFrame(aContext, aType)
     , mNextContinuation(nullptr)
     , mContentOffset(0)
     , mContentLengthHint(0)
     , mAscent(0)
   {
     NS_ASSERTION(mContentOffset == 0, "Bogus content offset");
   }
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -70,17 +70,17 @@ SwapScaleWidthHeightForRotation(IntSize&
       aDegrees == VideoInfo::Rotation::kDegree_270) {
     int32_t tmpWidth = aSize.width;
     aSize.width = aSize.height;
     aSize.height = tmpWidth;
   }
 }
 
 nsVideoFrame::nsVideoFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::HTMLVideo)
+  : nsContainerFrame(aContext, LayoutFrameType::HTMLVideo)
 {
   EnableVisibilityTracking();
 }
 
 nsVideoFrame::~nsVideoFrame()
 {
 }
 
--- a/layout/mathml/nsMathMLContainerFrame.h
+++ b/layout/mathml/nsMathMLContainerFrame.h
@@ -27,17 +27,17 @@
 #define STRETCH_CONSIDER_ACTUAL_SIZE    0x00000001 // just use our current size
 #define STRETCH_CONSIDER_EMBELLISHMENTS 0x00000002 // size calculations include embellishments
 
 class nsMathMLContainerFrame : public nsContainerFrame,
                                public nsMathMLFrame {
   friend class nsMathMLmfencedFrame;
 public:
   nsMathMLContainerFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext, mozilla::FrameType::None)
+    : nsContainerFrame(aContext, mozilla::LayoutFrameType::None)
     , mIntrinsicWidth(NS_INTRINSIC_WIDTH_UNKNOWN)
     , mBlockStartAscent(0)
   {}
 
   NS_DECL_QUERYFRAME_TARGET(nsMathMLContainerFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_ABSTRACT_FRAME(nsMathMLContainerFrame)
 
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -1230,21 +1230,21 @@ nsCSSRendering::FindNonTransparentBackgr
 
 // Returns true if aFrame is a canvas frame.
 // We need to treat the viewport as canvas because, even though
 // it does not actually paint a background, we need to get the right
 // background style so we correctly detect transparent documents.
 bool
 nsCSSRendering::IsCanvasFrame(nsIFrame* aFrame)
 {
-  FrameType frameType = aFrame->Type();
-  return frameType == FrameType::Canvas ||
-         frameType == FrameType::Root ||
-         frameType == FrameType::PageContent ||
-         frameType == FrameType::Viewport;
+  LayoutFrameType frameType = aFrame->Type();
+  return frameType == LayoutFrameType::Canvas ||
+         frameType == LayoutFrameType::Root ||
+         frameType == LayoutFrameType::PageContent ||
+         frameType == LayoutFrameType::Viewport;
 }
 
 nsIFrame*
 nsCSSRendering::FindBackgroundStyleFrame(nsIFrame* aForFrame)
 {
   const nsStyleBackground* result = aForFrame->StyleBackground();
 
   // Check if we need to do propagation from BODY rather than HTML.
@@ -2804,19 +2804,19 @@ nsCSSRendering::ComputeImageLayerPositio
 
     // For SVG frames, the return value is relative to the stroke box
     return nsRect(toStrokeBoxOffset, positionArea.Size());
   }
 
   MOZ_ASSERT(!aForFrame->IsFrameOfType(nsIFrame::eSVG) ||
              aForFrame->IsSVGOuterSVGFrame());
 
-  FrameType frameType = aForFrame->Type();
+  LayoutFrameType frameType = aForFrame->Type();
   nsIFrame* geometryFrame = aForFrame;
-  if (MOZ_UNLIKELY(frameType == FrameType::Scroll &&
+  if (MOZ_UNLIKELY(frameType == LayoutFrameType::Scroll &&
                    NS_STYLE_IMAGELAYER_ATTACHMENT_LOCAL == aLayer.mAttachment)) {
     nsIScrollableFrame* scrollableFrame = do_QueryFrame(aForFrame);
     positionArea = nsRect(
       scrollableFrame->GetScrolledFrame()->GetPosition()
         // For the dir=rtl case:
         + scrollableFrame->GetScrollRange().TopLeft(),
       scrollableFrame->GetScrolledRect().Size());
     // The ScrolledRect’s size does not include the borders or scrollbars,
@@ -2833,17 +2833,17 @@ nsCSSRendering::ComputeImageLayerPositio
       positionArea.Deflate(padding);
       NS_ASSERTION(layerOrigin == StyleGeometryBox::ContentBox,
                    "unknown background-origin value");
     }
     *aAttachedToFrame = aForFrame;
     return positionArea;
   }
 
-  if (MOZ_UNLIKELY(frameType == FrameType::Canvas)) {
+  if (MOZ_UNLIKELY(frameType == LayoutFrameType::Canvas)) {
     geometryFrame = aForFrame->PrincipalChildList().FirstChild();
     // geometryFrame might be null if this canvas is a page created
     // as an overflow container (e.g. the in-flow content has already
     // finished and this page only displays the continuations of
     // absolutely positioned content).
     if (geometryFrame) {
       positionArea = geometryFrame->GetRect();
     }
@@ -2876,18 +2876,18 @@ nsCSSRendering::ComputeImageLayerPositio
   if (NS_STYLE_IMAGELAYER_ATTACHMENT_FIXED == aLayer.mAttachment) {
     // If it's a fixed background attachment, then the image is placed
     // relative to the viewport, which is the area of the root frame
     // in a screen context or the page content frame in a print context.
     attachedToFrame = aPresContext->PresShell()->FrameManager()->GetRootFrame();
     NS_ASSERTION(attachedToFrame, "no root frame");
     nsIFrame* pageContentFrame = nullptr;
     if (aPresContext->IsPaginated()) {
-      pageContentFrame =
-        nsLayoutUtils::GetClosestFrameOfType(aForFrame, FrameType::PageContent);
+      pageContentFrame = nsLayoutUtils::GetClosestFrameOfType(
+        aForFrame, LayoutFrameType::PageContent);
       if (pageContentFrame) {
         attachedToFrame = pageContentFrame;
       }
       // else this is an embedded shell and its root frame is what we want
     }
 
     // If the background is affected by a transform, treat is as if it
     // wasn't fixed.
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -1017,18 +1017,18 @@ nsDisplayListBuilder::FindAnimatedGeomet
 AnimatedGeometryRoot*
 nsDisplayListBuilder::FindAnimatedGeometryRootFor(nsDisplayItem* aItem)
 {
   if (aItem->ShouldFixToViewport(this)) {
     // Make its active scrolled root be the active scrolled root of
     // the enclosing viewport, since it shouldn't be scrolled by scrolled
     // frames in its document. InvalidateFixedBackgroundFramesFromList in
     // nsGfxScrollFrame will not repaint this item when scrolling occurs.
-    nsIFrame* viewportFrame =
-      nsLayoutUtils::GetClosestFrameOfType(aItem->Frame(), FrameType::Viewport, RootReferenceFrame());
+    nsIFrame* viewportFrame = nsLayoutUtils::GetClosestFrameOfType(
+      aItem->Frame(), LayoutFrameType::Viewport, RootReferenceFrame());
     if (viewportFrame) {
       return FindAnimatedGeometryRootFor(viewportFrame);
     }
   }
   return FindAnimatedGeometryRootFor(aItem->Frame());
 }
 
 
@@ -1498,31 +1498,32 @@ nsDisplayListBuilder::IsAnimatedGeometry
   if (aFrame->IsTransformed()) {
     return true;
   }
 
   nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrame(aFrame);
   if (!parent)
     return true;
 
-  FrameType parentType = parent->Type();
+  LayoutFrameType parentType = parent->Type();
   // Treat the slider thumb as being as an active scrolled root when it wants
   // its own layer so that it can move without repainting.
-  if (parentType == FrameType::Slider &&
+  if (parentType == LayoutFrameType::Slider &&
       nsLayoutUtils::IsScrollbarThumbLayerized(aFrame)) {
     return true;
   }
 
   if (aFrame->StyleDisplay()->mPosition == NS_STYLE_POSITION_STICKY &&
       IsStickyFrameActive(this, aFrame, parent))
   {
     return true;
   }
 
-  if (parentType == FrameType::Scroll || parentType == FrameType::ListControl) {
+  if (parentType == LayoutFrameType::Scroll ||
+      parentType == LayoutFrameType::ListControl) {
     nsIScrollableFrame* sf = do_QueryFrame(parent);
     if (sf->IsScrollingActive(this) && sf->GetScrolledFrame() == aFrame) {
       return true;
     }
   }
 
   // Fixed-pos frames are parented by the viewport frame, which has no parent.
   if (nsLayoutUtils::IsFixedPosFrameInDisplayPort(aFrame)) {
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -804,18 +804,18 @@ nsComputedDOMStyle::UpdateCurrentStyleSo
                             : nsGkAtoms::afterPseudoProperty;
 
       auto* pseudo = static_cast<Element*>(mContent->GetProperty(property));
       mOuterFrame = pseudo ? pseudo->GetPrimaryFrame() : nullptr;
     }
 
     mInnerFrame = mOuterFrame;
     if (mOuterFrame) {
-      FrameType type = mOuterFrame->Type();
-      if (type == FrameType::TableWrapper) {
+      LayoutFrameType type = mOuterFrame->Type();
+      if (type == LayoutFrameType::TableWrapper) {
         // If the frame is a table wrapper frame then we should get the style
         // from the inner table frame.
         mInnerFrame = mOuterFrame->PrincipalChildList().FirstChild();
         NS_ASSERTION(mInnerFrame, "table wrapper must have an inner");
         NS_ASSERTION(!mInnerFrame->GetNextSibling(),
                      "table wrapper frames should have just one child, "
                      "the inner table");
       }
--- a/layout/svg/SVGFEContainerFrame.cpp
+++ b/layout/svg/SVGFEContainerFrame.cpp
@@ -16,17 +16,17 @@
  * have special child elements that provide parameters.
  */
 class SVGFEContainerFrame : public nsContainerFrame
 {
   friend nsIFrame*
   NS_NewSVGFEContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit SVGFEContainerFrame(nsStyleContext* aContext)
-    : nsContainerFrame(aContext, mozilla::FrameType::SVGFEContainer)
+    : nsContainerFrame(aContext, mozilla::LayoutFrameType::SVGFEContainer)
   {
     AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   virtual bool IsFrameOfType(uint32_t aFlags) const override
--- a/layout/svg/SVGFEImageFrame.cpp
+++ b/layout/svg/SVGFEImageFrame.cpp
@@ -17,17 +17,17 @@ using namespace mozilla;
 using namespace mozilla::dom;
 
 class SVGFEImageFrame final : public nsFrame
 {
   friend nsIFrame*
   NS_NewSVGFEImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit SVGFEImageFrame(nsStyleContext* aContext)
-    : nsFrame(aContext, FrameType::SVGFEImage)
+    : nsFrame(aContext, LayoutFrameType::SVGFEImage)
   {
     AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
 
     // This frame isn't actually displayed, but it contains an image and we want
     // to use the nsImageLoadingContent machinery for managing images, which
     // requires visibility tracking, so we enable visibility tracking and
     // forcibly mark it visible below.
     EnableVisibilityTracking();
--- a/layout/svg/SVGFELeafFrame.cpp
+++ b/layout/svg/SVGFELeafFrame.cpp
@@ -15,17 +15,17 @@
  * have special child elements that provide parameters.
  */
 class SVGFELeafFrame final : public nsFrame
 {
   friend nsIFrame*
   NS_NewSVGFELeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit SVGFELeafFrame(nsStyleContext* aContext)
-    : nsFrame(aContext, FrameType::SVGFELeaf)
+    : nsFrame(aContext, LayoutFrameType::SVGFELeaf)
   {
     AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
 #ifdef DEBUG
--- a/layout/svg/SVGFEUnstyledLeafFrame.cpp
+++ b/layout/svg/SVGFEUnstyledLeafFrame.cpp
@@ -11,17 +11,17 @@
 #include "nsSVGFilters.h"
 
 class SVGFEUnstyledLeafFrame : public nsFrame
 {
   friend nsIFrame*
   NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit SVGFEUnstyledLeafFrame(nsStyleContext* aContext)
-    : nsFrame(aContext, FrameType::SVGFEUnstyledLeaf)
+    : nsFrame(aContext, LayoutFrameType::SVGFEUnstyledLeaf)
   {
     AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
--- a/layout/svg/SVGGeometryFrame.cpp
+++ b/layout/svg/SVGGeometryFrame.cpp
@@ -726,35 +726,35 @@ SVGGeometryFrame::GetMarkerProperties(SV
 }
 
 nsSVGMarkerFrame *
 SVGGeometryFrame::MarkerProperties::GetMarkerStartFrame()
 {
   if (!mMarkerStart)
     return nullptr;
   return static_cast<nsSVGMarkerFrame*>(
-    mMarkerStart->GetReferencedFrame(FrameType::SVGMarker, nullptr));
+    mMarkerStart->GetReferencedFrame(LayoutFrameType::SVGMarker, nullptr));
 }
 
 nsSVGMarkerFrame *
 SVGGeometryFrame::MarkerProperties::GetMarkerMidFrame()
 {
   if (!mMarkerMid)
     return nullptr;
   return static_cast<nsSVGMarkerFrame*>(
-    mMarkerMid->GetReferencedFrame(FrameType::SVGMarker, nullptr));
+    mMarkerMid->GetReferencedFrame(LayoutFrameType::SVGMarker, nullptr));
 }
 
 nsSVGMarkerFrame *
 SVGGeometryFrame::MarkerProperties::GetMarkerEndFrame()
 {
   if (!mMarkerEnd)
     return nullptr;
   return static_cast<nsSVGMarkerFrame*>(
-    mMarkerEnd->GetReferencedFrame(FrameType::SVGMarker, nullptr));
+    mMarkerEnd->GetReferencedFrame(LayoutFrameType::SVGMarker, nullptr));
 }
 
 DrawResult
 SVGGeometryFrame::Render(gfxContext* aContext,
                          uint32_t aRenderComponents,
                          const gfxMatrix& aNewTransform,
                          uint32_t aFlags)
 {
--- a/layout/svg/SVGGeometryFrame.h
+++ b/layout/svg/SVGGeometryFrame.h
@@ -44,24 +44,24 @@ class SVGGeometryFrame : public nsFrame
   typedef mozilla::gfx::DrawTarget DrawTarget;
 
   friend nsIFrame*
   ::NS_NewSVGGeometryFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
   friend class ::nsDisplaySVGGeometry;
 
 protected:
-  SVGGeometryFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  SVGGeometryFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType)
     : nsFrame(aContext, aType)
   {
      AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_MAY_BE_TRANSFORMED);
   }
 
   explicit SVGGeometryFrame(nsStyleContext* aContext)
-    : SVGGeometryFrame(aContext, mozilla::FrameType::SVGGeometry)
+    : SVGGeometryFrame(aContext, mozilla::LayoutFrameType::SVGGeometry)
   {}
 
 public:
   NS_DECL_QUERYFRAME_TARGET(SVGGeometryFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame interface:
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -2764,17 +2764,17 @@ public:
   void NotifyGlyphPathEmitted() override;
   void NotifyAfterText() override;
 
 private:
   void SetupContext();
 
   bool IsClipPathChild() const {
     return nsLayoutUtils::GetClosestFrameOfType
-             (mFrame->GetParent(), FrameType::SVGText)->GetStateBits() &
+             (mFrame->GetParent(), LayoutFrameType::SVGText)->GetStateBits() &
              NS_STATE_SVG_CLIPPATH_CHILD;
   }
 
   /**
    * Paints a piece of text geometry.  This is called when glyphs
    * or text decorations have been emitted to the gfxContext.
    */
   void HandleTextGeometry();
@@ -5441,17 +5441,17 @@ SVGTextFrame::GetFontSizeScaleFactor() c
  * which rendered run the point hits.
  */
 Point
 SVGTextFrame::TransformFramePointToTextChild(const Point& aPoint,
                                              nsIFrame* aChildFrame)
 {
   NS_ASSERTION(aChildFrame &&
                nsLayoutUtils::GetClosestFrameOfType
-                 (aChildFrame->GetParent(), FrameType::SVGText) == this,
+                 (aChildFrame->GetParent(), LayoutFrameType::SVGText) == this,
                "aChildFrame must be a descendant of this frame");
 
   UpdateGlyphPositioning();
 
   nsPresContext* presContext = PresContext();
 
   // Add in the mRect offset to aPoint, as that will have been taken into
   // account when transforming the point from the ancestor frame down
@@ -5520,17 +5520,17 @@ SVGTextFrame::TransformFramePointToTextC
  * and union them all together.
  */
 gfxRect
 SVGTextFrame::TransformFrameRectToTextChild(const gfxRect& aRect,
                                             nsIFrame* aChildFrame)
 {
   NS_ASSERTION(aChildFrame &&
                nsLayoutUtils::GetClosestFrameOfType
-                 (aChildFrame->GetParent(), FrameType::SVGText) == this,
+                 (aChildFrame->GetParent(), LayoutFrameType::SVGText) == this,
                "aChildFrame must be a descendant of this frame");
 
   UpdateGlyphPositioning();
 
   nsPresContext* presContext = PresContext();
 
   // Add in the mRect offset to aRect, as that will have been taken into
   // account when transforming the rect from the ancestor frame down
@@ -5601,17 +5601,17 @@ SVGTextFrame::TransformFrameRectToTextCh
  * The result is the union of all of these.
  */
 gfxRect
 SVGTextFrame::TransformFrameRectFromTextChild(const nsRect& aRect,
                                               nsIFrame* aChildFrame)
 {
   NS_ASSERTION(aChildFrame &&
                nsLayoutUtils::GetClosestFrameOfType
-                 (aChildFrame->GetParent(), FrameType::SVGText) == this,
+                 (aChildFrame->GetParent(), LayoutFrameType::SVGText) == this,
                "aChildFrame must be a descendant of this frame");
 
   UpdateGlyphPositioning();
 
   nsPresContext* presContext = PresContext();
 
   gfxRect result;
   TextRenderedRunIterator it(this, TextRenderedRunIterator::eAllFrames,
--- a/layout/svg/SVGTextFrame.h
+++ b/layout/svg/SVGTextFrame.h
@@ -189,17 +189,17 @@ class SVGTextFrame final : public nsSVGD
   typedef gfxTextRun::Range Range;
   typedef mozilla::gfx::DrawTarget DrawTarget;
   typedef mozilla::gfx::Path Path;
   typedef mozilla::gfx::Point Point;
   typedef mozilla::image::DrawResult DrawResult;
 
 protected:
   explicit SVGTextFrame(nsStyleContext* aContext)
-    : nsSVGDisplayContainerFrame(aContext, mozilla::FrameType::SVGText)
+    : nsSVGDisplayContainerFrame(aContext, mozilla::LayoutFrameType::SVGText)
     , mTrailingUndisplayedCharacters(0)
     , mFontSizeScaleFactor(1.0f)
     , mLastContextScale(1.0f)
     , mLengthAdjustScaleFactor(1.0f)
   {
     AddStateBits(NS_STATE_SVG_POSITIONING_DIRTY);
   }
 
--- a/layout/svg/SVGViewFrame.cpp
+++ b/layout/svg/SVGViewFrame.cpp
@@ -19,17 +19,17 @@ using namespace mozilla::dom;
  * the view receives to the overridden <svg> element (if there is one).
  **/
 class SVGViewFrame : public nsFrame
 {
   friend nsIFrame*
   NS_NewSVGViewFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit SVGViewFrame(nsStyleContext* aContext)
-    : nsFrame(aContext, FrameType::SVGView)
+    : nsFrame(aContext, LayoutFrameType::SVGView)
   {
     AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
 #ifdef DEBUG
--- a/layout/svg/nsSVGAFrame.cpp
+++ b/layout/svg/nsSVGAFrame.cpp
@@ -15,17 +15,17 @@
 using namespace mozilla;
 
 class nsSVGAFrame : public nsSVGDisplayContainerFrame
 {
   friend nsIFrame*
   NS_NewSVGAFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit nsSVGAFrame(nsStyleContext* aContext)
-    : nsSVGDisplayContainerFrame(aContext, FrameType::SVGA)
+    : nsSVGDisplayContainerFrame(aContext, LayoutFrameType::SVGA)
   {}
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
 #ifdef DEBUG
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
--- a/layout/svg/nsSVGClipPathFrame.cpp
+++ b/layout/svg/nsSVGClipPathFrame.cpp
@@ -392,32 +392,33 @@ nsSVGClipPathFrame::IsValid()
 
   if (nsSVGEffects::GetEffectProperties(this).HasInvalidClipPath()) {
     return false;
   }
 
   for (nsIFrame* kid = mFrames.FirstChild(); kid;
        kid = kid->GetNextSibling()) {
 
-    FrameType kidType = kid->Type();
+    LayoutFrameType kidType = kid->Type();
 
-    if (kidType == FrameType::SVGUse) {
+    if (kidType == LayoutFrameType::SVGUse) {
       for (nsIFrame* grandKid : kid->PrincipalChildList()) {
 
-        FrameType grandKidType = grandKid->Type();
+        LayoutFrameType grandKidType = grandKid->Type();
 
-        if (grandKidType != FrameType::SVGGeometry &&
-            grandKidType != FrameType::SVGText) {
+        if (grandKidType != LayoutFrameType::SVGGeometry &&
+            grandKidType != LayoutFrameType::SVGText) {
           return false;
         }
       }
       continue;
     }
 
-    if (kidType != FrameType::SVGGeometry && kidType != FrameType::SVGText) {
+    if (kidType != LayoutFrameType::SVGGeometry &&
+        kidType != LayoutFrameType::SVGText) {
       return false;
     }
   }
 
   return true;
 }
 
 nsresult
--- a/layout/svg/nsSVGClipPathFrame.h
+++ b/layout/svg/nsSVGClipPathFrame.h
@@ -20,17 +20,17 @@ class nsSVGClipPathFrame final : public 
   NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
   typedef mozilla::gfx::Matrix Matrix;
   typedef mozilla::gfx::SourceSurface SourceSurface;
   typedef mozilla::image::DrawResult DrawResult;
 
 protected:
   explicit nsSVGClipPathFrame(nsStyleContext* aContext)
-    : nsSVGContainerFrame(aContext, mozilla::FrameType::SVGClipPath)
+    : nsSVGContainerFrame(aContext, mozilla::LayoutFrameType::SVGClipPath)
     , mIsBeingProcessed(false)
   {
     AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
--- a/layout/svg/nsSVGContainerFrame.cpp
+++ b/layout/svg/nsSVGContainerFrame.cpp
@@ -29,17 +29,17 @@ NS_QUERYFRAME_HEAD(nsSVGDisplayContainer
   NS_QUERYFRAME_ENTRY(nsSVGDisplayableFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsSVGContainerFrame)
 
 nsIFrame*
 NS_NewSVGContainerFrame(nsIPresShell* aPresShell,
                         nsStyleContext* aContext)
 {
   nsIFrame* frame =
-    new (aPresShell) nsSVGContainerFrame(aContext, FrameType::None);
+    new (aPresShell) nsSVGContainerFrame(aContext, LayoutFrameType::None);
   // If we were called directly, then the frame is for a <defs> or
   // an unknown element type. In both cases we prevent the content
   // from displaying directly.
   frame->AddStateBits(NS_FRAME_IS_NONDISPLAY);
   return frame;
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGContainerFrame)
@@ -112,22 +112,22 @@ nsSVGContainerFrame::ReflowSVGNonDisplay
 {
   NS_ASSERTION(aContainer->GetStateBits() & NS_FRAME_IS_DIRTY,
                "expected aContainer to be NS_FRAME_IS_DIRTY");
   NS_ASSERTION((aContainer->GetStateBits() & NS_FRAME_IS_NONDISPLAY) ||
                !aContainer->IsFrameOfType(nsIFrame::eSVG),
                "it is wasteful to call ReflowSVGNonDisplayText on a container "
                "frame that is not NS_FRAME_IS_NONDISPLAY");
   for (nsIFrame* kid : aContainer->PrincipalChildList()) {
-    FrameType type = kid->Type();
-    if (type == FrameType::SVGText) {
+    LayoutFrameType type = kid->Type();
+    if (type == LayoutFrameType::SVGText) {
       static_cast<SVGTextFrame*>(kid)->ReflowSVGNonDisplayText();
     } else {
       if (kid->IsFrameOfType(nsIFrame::eSVG | nsIFrame::eSVGContainer) ||
-          type == FrameType::SVGForeignObject ||
+          type == LayoutFrameType::SVGForeignObject ||
           !kid->IsFrameOfType(nsIFrame::eSVG)) {
         ReflowSVGNonDisplayText(kid);
       }
     }
   }
 }
 
 void
--- a/layout/svg/nsSVGContainerFrame.h
+++ b/layout/svg/nsSVGContainerFrame.h
@@ -35,17 +35,17 @@ struct nsRect;
  * Do *not* blindly cast to SVG element types in this class's methods (see the
  * warning comment for nsSVGDisplayContainerFrame below). 
  */
 class nsSVGContainerFrame : public nsContainerFrame
 {
   friend nsIFrame* NS_NewSVGContainerFrame(nsIPresShell* aPresShell,
                                            nsStyleContext* aContext);
 protected:
-  nsSVGContainerFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  nsSVGContainerFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType)
     : nsContainerFrame(aContext, aType)
   {
     AddStateBits(NS_FRAME_SVG_LAYOUT);
   }
 
 public:
   NS_DECL_QUERYFRAME_TARGET(nsSVGContainerFrame)
   NS_DECL_QUERYFRAME
@@ -106,17 +106,18 @@ protected:
  * an SVG element class since this class is inherited by
  * nsSVGGenericContainerFrame which is used for unrecognized elements in the
  * SVG namespace. Do *not* blindly cast to SVG element types.
  */
 class nsSVGDisplayContainerFrame : public nsSVGContainerFrame,
                                    public nsSVGDisplayableFrame
 {
 protected:
-  nsSVGDisplayContainerFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  nsSVGDisplayContainerFrame(nsStyleContext* aContext,
+                             mozilla::LayoutFrameType aType)
     : nsSVGContainerFrame(aContext, aType)
   {
      AddStateBits(NS_FRAME_MAY_BE_TRANSFORMED);
   }
 
 public:
   NS_DECL_QUERYFRAME_TARGET(nsSVGDisplayContainerFrame)
   NS_DECL_QUERYFRAME
--- a/layout/svg/nsSVGEffects.cpp
+++ b/layout/svg/nsSVGEffects.cpp
@@ -77,17 +77,18 @@ nsSVGRenderingObserver::GetReferencedEle
 nsIFrame*
 nsSVGRenderingObserver::GetReferencedFrame()
 {
   Element* referencedElement = GetReferencedElement();
   return referencedElement ? referencedElement->GetPrimaryFrame() : nullptr;
 }
 
 nsIFrame*
-nsSVGRenderingObserver::GetReferencedFrame(FrameType aFrameType, bool* aOK)
+nsSVGRenderingObserver::GetReferencedFrame(LayoutFrameType aFrameType,
+                                           bool* aOK)
 {
   nsIFrame* frame = GetReferencedFrame();
   if (frame) {
     if (frame->Type() == aFrameType)
       return frame;
     if (aOK) {
       *aOK = false;
     }
@@ -255,17 +256,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
   NS_INTERFACE_MAP_ENTRY(nsISVGFilterReference)
 NS_INTERFACE_MAP_END
 
 nsSVGFilterFrame *
 nsSVGFilterReference::GetFilterFrame()
 {
   return static_cast<nsSVGFilterFrame*>(
-    GetReferencedFrame(FrameType::SVGFilter, nullptr));
+    GetReferencedFrame(LayoutFrameType::SVGFilter, nullptr));
 }
 
 void
 nsSVGFilterReference::DoUpdate()
 {
   nsSVGIDRenderingObserver::DoUpdate();
 
   if (mFilterChainObserver) {
@@ -621,49 +622,49 @@ nsSVGEffects::GetPaintServer(nsIFrame* a
   nsSVGPaintingProperty *property =
     nsSVGEffects::GetPaintingProperty(paintServerURL, frame, aType);
   if (!property)
     return nullptr;
   nsIFrame* result = property->GetReferencedFrame();
   if (!result)
     return nullptr;
 
-  FrameType type = result->Type();
-  if (type != FrameType::SVGLinearGradient &&
-      type != FrameType::SVGRadialGradient &&
-      type != FrameType::SVGPattern)
+  LayoutFrameType type = result->Type();
+  if (type != LayoutFrameType::SVGLinearGradient &&
+      type != LayoutFrameType::SVGRadialGradient &&
+      type != LayoutFrameType::SVGPattern)
     return nullptr;
 
   return static_cast<nsSVGPaintServerFrame*>(result);
 }
 
 nsSVGClipPathFrame *
 nsSVGEffects::EffectProperties::GetClipPathFrame()
 {
   if (!mClipPath)
     return nullptr;
 
   nsSVGClipPathFrame* frame = static_cast<nsSVGClipPathFrame*>(
-    mClipPath->GetReferencedFrame(FrameType::SVGClipPath, nullptr));
+    mClipPath->GetReferencedFrame(LayoutFrameType::SVGClipPath, nullptr));
 
   return frame;
 }
 
 nsTArray<nsSVGMaskFrame *>
 nsSVGEffects::EffectProperties::GetMaskFrames()
 {
   nsTArray<nsSVGMaskFrame *> result;
   if (!mMask)
     return result;
 
   bool ok = true;
   const nsTArray<RefPtr<nsSVGPaintingProperty>>& props = mMask->GetProps();
   for (size_t i = 0; i < props.Length(); i++) {
     nsSVGMaskFrame* maskFrame = static_cast<nsSVGMaskFrame*>(
-      props[i]->GetReferencedFrame(FrameType::SVGMask, &ok));
+      props[i]->GetReferencedFrame(LayoutFrameType::SVGMask, &ok));
     MOZ_ASSERT_IF(maskFrame, ok);
     result.AppendElement(maskFrame);
   }
 
   return result;
 }
 
 bool
@@ -673,33 +674,33 @@ nsSVGEffects::EffectProperties::HasNoOrV
 }
 
 bool
 nsSVGEffects::EffectProperties::HasNoOrValidClipPath()
 {
   if (mClipPath) {
     bool ok = true;
     nsSVGClipPathFrame* frame = static_cast<nsSVGClipPathFrame*>(
-      mClipPath->GetReferencedFrame(FrameType::SVGClipPath, &ok));
+      mClipPath->GetReferencedFrame(LayoutFrameType::SVGClipPath, &ok));
     if (!ok || (frame && !frame->IsValid())) {
       return false;
     }
   }
 
   return true;
 }
 
 bool
 nsSVGEffects::EffectProperties::HasNoOrValidMask()
 {
   if (mMask) {
     bool ok = true;
     const nsTArray<RefPtr<nsSVGPaintingProperty>>& props = mMask->GetProps();
     for (size_t i = 0; i < props.Length(); i++) {
-      props[i]->GetReferencedFrame(FrameType::SVGMask, &ok);
+      props[i]->GetReferencedFrame(LayoutFrameType::SVGMask, &ok);
       if (!ok) {
         return false;
       }
     }
   }
 
   return true;
 }
--- a/layout/svg/nsSVGEffects.h
+++ b/layout/svg/nsSVGEffects.h
@@ -71,17 +71,17 @@ public:
 
   bool IsInObserverList() const { return mInObserverList; }
 
   nsIFrame* GetReferencedFrame();
   /**
    * @param aOK this is only for the convenience of callers. We set *aOK to false
    * if the frame is the wrong type
    */
-  nsIFrame* GetReferencedFrame(mozilla::FrameType aFrameType, bool* aOK);
+  nsIFrame* GetReferencedFrame(mozilla::LayoutFrameType aFrameType, bool* aOK);
 
   Element* GetReferencedElement();
 
   virtual bool ObservesReflow() { return true; }
 
 protected:
   // Non-virtual protected methods
   void StartListening();
--- a/layout/svg/nsSVGFilterFrame.cpp
+++ b/layout/svg/nsSVGFilterFrame.cpp
@@ -148,18 +148,18 @@ nsSVGFilterFrame::GetReferencedFilter()
     if (!property)
       return nullptr;
   }
 
   nsIFrame *result = property->GetReferencedFrame();
   if (!result)
     return nullptr;
 
-  FrameType frameType = result->Type();
-  if (frameType != FrameType::SVGFilter)
+  LayoutFrameType frameType = result->Type();
+  if (frameType != LayoutFrameType::SVGFilter)
     return nullptr;
 
   return static_cast<nsSVGFilterFrame*>(result);
 }
 
 nsresult
 nsSVGFilterFrame::AttributeChanged(int32_t  aNameSpaceID,
                                    nsIAtom* aAttribute,
--- a/layout/svg/nsSVGFilterFrame.h
+++ b/layout/svg/nsSVGFilterFrame.h
@@ -28,17 +28,17 @@ class SVGFilterElement;
 } // namespace mozilla
 
 class nsSVGFilterFrame : public nsSVGContainerFrame
 {
   friend nsIFrame*
   NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit nsSVGFilterFrame(nsStyleContext* aContext)
-    : nsSVGContainerFrame(aContext, mozilla::FrameType::SVGFilter)
+    : nsSVGContainerFrame(aContext, mozilla::LayoutFrameType::SVGFilter)
     , mLoopFlag(false)
     , mNoHRefURI(false)
   {
     AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
--- a/layout/svg/nsSVGForeignObjectFrame.cpp
+++ b/layout/svg/nsSVGForeignObjectFrame.cpp
@@ -35,17 +35,17 @@ NS_NewSVGForeignObjectFrame(nsIPresShell
                             nsStyleContext *aContext)
 {
   return new (aPresShell) nsSVGForeignObjectFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGForeignObjectFrame)
 
 nsSVGForeignObjectFrame::nsSVGForeignObjectFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::SVGForeignObject)
+  : nsContainerFrame(aContext, LayoutFrameType::SVGForeignObject)
   , mInReflow(false)
 {
   AddStateBits(NS_FRAME_REFLOW_ROOT | NS_FRAME_MAY_BE_TRANSFORMED |
                NS_FRAME_SVG_LAYOUT);
 }
 
 //----------------------------------------------------------------------
 // nsIFrame methods
--- a/layout/svg/nsSVGGFrame.h
+++ b/layout/svg/nsSVGGFrame.h
@@ -11,22 +11,22 @@
 #include "nsAutoPtr.h"
 #include "nsSVGContainerFrame.h"
 
 class nsSVGGFrame : public nsSVGDisplayContainerFrame
 {
   friend nsIFrame*
   NS_NewSVGGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
-  nsSVGGFrame(nsStyleContext* aContext, mozilla::FrameType aType)
+  nsSVGGFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType)
     : nsSVGDisplayContainerFrame(aContext, aType)
   {}
 
   explicit nsSVGGFrame(nsStyleContext* aContext)
-    : nsSVGGFrame(aContext, mozilla::FrameType::SVGG)
+    : nsSVGGFrame(aContext, mozilla::LayoutFrameType::SVGG)
   {}
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
 #ifdef DEBUG
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
--- a/layout/svg/nsSVGGenericContainerFrame.h
+++ b/layout/svg/nsSVGGenericContainerFrame.h
@@ -21,17 +21,17 @@ class nsStyleContext;
 class nsSVGGenericContainerFrame final : public nsSVGDisplayContainerFrame
 {
   friend nsIFrame*
   NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 protected:
   explicit nsSVGGenericContainerFrame(nsStyleContext* aContext)
     : nsSVGDisplayContainerFrame(aContext,
-                                 mozilla::FrameType::SVGGenericContainer)
+                                 mozilla::LayoutFrameType::SVGGenericContainer)
   {}
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame:
   virtual nsresult  AttributeChanged(int32_t         aNameSpaceID,
                                      nsIAtom*        aAttribute,
--- a/layout/svg/nsSVGGradientFrame.cpp
+++ b/layout/svg/nsSVGGradientFrame.cpp
@@ -21,17 +21,17 @@
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 
 //----------------------------------------------------------------------
 // Implementation
 
 nsSVGGradientFrame::nsSVGGradientFrame(nsStyleContext* aContext,
-                                       FrameType aType)
+                                       LayoutFrameType aType)
   : nsSVGPaintServerFrame(aContext, aType)
   , mLoopFlag(false)
   , mNoHRefURI(false)
 {
 }
 
 //----------------------------------------------------------------------
 // nsIFrame methods:
@@ -368,19 +368,19 @@ nsSVGGradientFrame::GetReferencedGradien
     if (!property)
       return nullptr;
   }
 
   nsIFrame *result = property->GetReferencedFrame();
   if (!result)
     return nullptr;
 
-  FrameType frameType = result->Type();
-  if (frameType != FrameType::SVGLinearGradient &&
-      frameType != FrameType::SVGRadialGradient)
+  LayoutFrameType frameType = result->Type();
+  if (frameType != LayoutFrameType::SVGLinearGradient &&
+      frameType != LayoutFrameType::SVGRadialGradient)
     return nullptr;
 
   return static_cast<nsSVGGradientFrame*>(result);
 }
 
 void
 nsSVGGradientFrame::GetStopFrames(nsTArray<nsIFrame*>* aStopFrames)
 {
--- a/layout/svg/nsSVGGradientFrame.h
+++ b/layout/svg/nsSVGGradientFrame.h
@@ -35,17 +35,17 @@ class SVGRadialGradientElement;
  * Gradients can refer to other gradients. We create an nsSVGPaintingProperty
  * with property type nsGkAtoms::href to track the referenced gradient.
  */
 class nsSVGGradientFrame : public nsSVGPaintServerFrame
 {
   typedef mozilla::gfx::ExtendMode ExtendMode;
 
 protected:
-  nsSVGGradientFrame(nsStyleContext* aContext, mozilla::FrameType aType);
+  nsSVGGradientFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType);
 
 public:
   NS_DECL_ABSTRACT_FRAME(nsSVGGradientFrame)
 
   // nsSVGPaintServerFrame methods:
   virtual mozilla::Pair<DrawResult, RefPtr<gfxPattern>>
     GetPaintServerPattern(nsIFrame* aSource,
                           const DrawTarget* aDrawTarget,
@@ -122,17 +122,17 @@ private:
 // -------------------------------------------------------------------------
 
 class nsSVGLinearGradientFrame : public nsSVGGradientFrame
 {
   friend nsIFrame* NS_NewSVGLinearGradientFrame(nsIPresShell* aPresShell,
                                                 nsStyleContext* aContext);
 protected:
   explicit nsSVGLinearGradientFrame(nsStyleContext* aContext)
-    : nsSVGGradientFrame(aContext, mozilla::FrameType::SVGLinearGradient)
+    : nsSVGGradientFrame(aContext, mozilla::LayoutFrameType::SVGLinearGradient)
   {}
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame interface:
 #ifdef DEBUG
   virtual void Init(nsIContent*       aContent,
@@ -164,17 +164,17 @@ protected:
 // -------------------------------------------------------------------------
 
 class nsSVGRadialGradientFrame : public nsSVGGradientFrame
 {
   friend nsIFrame* NS_NewSVGRadialGradientFrame(nsIPresShell* aPresShell,
                                                 nsStyleContext* aContext);
 protected:
   explicit nsSVGRadialGradientFrame(nsStyleContext* aContext)
-    : nsSVGGradientFrame(aContext, mozilla::FrameType::SVGRadialGradient)
+    : nsSVGGradientFrame(aContext, mozilla::LayoutFrameType::SVGRadialGradient)
   {}
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame interface:
 #ifdef DEBUG
   virtual void Init(nsIContent*       aContent,
--- a/layout/svg/nsSVGImageFrame.cpp
+++ b/layout/svg/nsSVGImageFrame.cpp
@@ -50,17 +50,17 @@ class nsSVGImageFrame final
   : public SVGGeometryFrame
   , public nsIReflowCallback
 {
   friend nsIFrame*
   NS_NewSVGImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 protected:
   explicit nsSVGImageFrame(nsStyleContext* aContext)
-    : SVGGeometryFrame(aContext, FrameType::SVGImage)
+    : SVGGeometryFrame(aContext, LayoutFrameType::SVGImage)
     , mReflowCallbackPosted(false)
   {
     EnableVisibilityTracking();
   }
 
   virtual ~nsSVGImageFrame();
 
 public:
--- a/layout/svg/nsSVGInnerSVGFrame.h
+++ b/layout/svg/nsSVGInnerSVGFrame.h
@@ -16,17 +16,18 @@ class gfxContext;
 class nsSVGInnerSVGFrame final
   : public nsSVGDisplayContainerFrame
   , public nsISVGSVGFrame
 {
   friend nsIFrame*
   NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit nsSVGInnerSVGFrame(nsStyleContext* aContext)
-    : nsSVGDisplayContainerFrame(aContext, mozilla::FrameType::SVGInnerSVG)
+    : nsSVGDisplayContainerFrame(aContext,
+                                 mozilla::LayoutFrameType::SVGInnerSVG)
   {
   }
 
 public:
   NS_DECL_QUERYFRAME_TARGET(nsSVGInnerSVGFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
--- a/layout/svg/nsSVGMarkerFrame.h
+++ b/layout/svg/nsSVGMarkerFrame.h
@@ -28,17 +28,17 @@ struct nsSVGMark;
 
 class nsSVGMarkerFrame final : public nsSVGContainerFrame
 {
   friend class nsSVGMarkerAnonChildFrame;
   friend nsContainerFrame*
   NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit nsSVGMarkerFrame(nsStyleContext* aContext)
-    : nsSVGContainerFrame(aContext, mozilla::FrameType::SVGMarker)
+    : nsSVGContainerFrame(aContext, mozilla::LayoutFrameType::SVGMarker)
     , mMarkedFrame(nullptr)
     , mInUse(false)
     , mInUse2(false)
   {
     AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
@@ -135,17 +135,17 @@ private:
 class nsSVGMarkerAnonChildFrame final : public nsSVGDisplayContainerFrame
 {
   friend nsContainerFrame*
   NS_NewSVGMarkerAnonChildFrame(nsIPresShell* aPresShell,
                                 nsStyleContext* aContext);
 
   explicit nsSVGMarkerAnonChildFrame(nsStyleContext* aContext)
     : nsSVGDisplayContainerFrame(aContext,
-                                 mozilla::FrameType::SVGMarkerAnonChild)
+                                 mozilla::LayoutFrameType::SVGMarkerAnonChild)
   {}
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
 #ifdef DEBUG
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
--- a/layout/svg/nsSVGMaskFrame.h
+++ b/layout/svg/nsSVGMaskFrame.h
@@ -38,17 +38,17 @@ class nsSVGMaskFrame final : public nsSV
   NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
   typedef mozilla::gfx::Matrix Matrix;
   typedef mozilla::gfx::SourceSurface SourceSurface;
   typedef mozilla::image::DrawResult DrawResult;
 
 protected:
   explicit nsSVGMaskFrame(nsStyleContext* aContext)
-    : nsSVGContainerFrame(aContext, mozilla::FrameType::SVGMask)
+    : nsSVGContainerFrame(aContext, mozilla::LayoutFrameType::SVGMask)
     , mInUse(false)
   {
     AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
--- a/layout/svg/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/nsSVGOuterSVGFrame.cpp
@@ -60,17 +60,17 @@ nsContainerFrame*
 NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsSVGOuterSVGFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGOuterSVGFrame)
 
 nsSVGOuterSVGFrame::nsSVGOuterSVGFrame(nsStyleContext* aContext)
-  : nsSVGDisplayContainerFrame(aContext, FrameType::SVGOuterSVG)
+  : nsSVGDisplayContainerFrame(aContext, LayoutFrameType::SVGOuterSVG)
   , mCallingReflowSVG(false)
   , mFullZoom(aContext->PresContext()->GetFullZoom())
   , mViewportInitialized(false)
   , mIsRootContent(false)
 {
   // Outer-<svg> has CSS layout, so remove this bit:
   RemoveStateBits(NS_FRAME_SVG_LAYOUT);
 }
--- a/layout/svg/nsSVGOuterSVGFrame.h
+++ b/layout/svg/nsSVGOuterSVGFrame.h
@@ -227,17 +227,17 @@ protected:
 class nsSVGOuterSVGAnonChildFrame final : public nsSVGDisplayContainerFrame
 {
   friend nsContainerFrame*
   NS_NewSVGOuterSVGAnonChildFrame(nsIPresShell* aPresShell,
                                   nsStyleContext* aContext);
 
   explicit nsSVGOuterSVGAnonChildFrame(nsStyleContext* aContext)
     : nsSVGDisplayContainerFrame(aContext,
-                                 mozilla::FrameType::SVGOuterSVGAnonChild)
+                                 mozilla::LayoutFrameType::SVGOuterSVGAnonChild)
   {}
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
 #ifdef DEBUG
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
--- a/layout/svg/nsSVGPaintServerFrame.h
+++ b/layout/svg/nsSVGPaintServerFrame.h
@@ -54,17 +54,17 @@ private:
 
 class nsSVGPaintServerFrame : public nsSVGContainerFrame
 {
 protected:
   typedef mozilla::gfx::DrawTarget DrawTarget;
   typedef mozilla::image::DrawResult DrawResult;
 
   explicit nsSVGPaintServerFrame(nsStyleContext* aContext,
-                                 mozilla::FrameType aType)
+                                 mozilla::LayoutFrameType aType)
     : nsSVGContainerFrame(aContext, aType)
   {
     AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_ABSTRACT_FRAME(nsSVGPaintServerFrame)
 
--- a/layout/svg/nsSVGPatternFrame.cpp
+++ b/layout/svg/nsSVGPatternFrame.cpp
@@ -29,17 +29,17 @@ using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 using namespace mozilla::image;
 
 //----------------------------------------------------------------------
 // Implementation
 
 nsSVGPatternFrame::nsSVGPatternFrame(nsStyleContext* aContext)
-  : nsSVGPaintServerFrame(aContext, FrameType::SVGPattern)
+  : nsSVGPaintServerFrame(aContext, LayoutFrameType::SVGPattern)
   , mLoopFlag(false)
   , mNoHRefURI(false)
 {
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGPatternFrame)
 
 //----------------------------------------------------------------------
@@ -610,18 +610,18 @@ nsSVGPatternFrame::GetReferencedPattern(
     if (!property)
       return nullptr;
   }
 
   nsIFrame *result = property->GetReferencedFrame();
   if (!result)
     return nullptr;
 
-  FrameType frameType = result->Type();
-  if (frameType != FrameType::SVGPattern)
+  LayoutFrameType frameType = result->Type();
+  if (frameType != LayoutFrameType::SVGPattern)
     return nullptr;
 
   return static_cast<nsSVGPatternFrame*>(result);
 }
 
 gfxRect
 nsSVGPatternFrame::GetPatternRect(uint16_t aPatternUnits,
                                   const gfxRect &aTargetBBox,
--- a/layout/svg/nsSVGStopFrame.cpp
+++ b/layout/svg/nsSVGStopFrame.cpp
@@ -15,17 +15,17 @@
 // within the nsSVGGradientFrame, which is the parent for this frame
 
 class nsSVGStopFrame : public nsFrame
 {
   friend nsIFrame*
   NS_NewSVGStopFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit nsSVGStopFrame(nsStyleContext* aContext)
-    : nsFrame(aContext, FrameType::SVGStop)
+    : nsFrame(aContext, LayoutFrameType::SVGStop)
   {
     AddStateBits(NS_FRAME_IS_NONDISPLAY);
   }
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame interface:
--- a/layout/svg/nsSVGSwitchFrame.cpp
+++ b/layout/svg/nsSVGSwitchFrame.cpp
@@ -14,17 +14,17 @@ using namespace mozilla::gfx;
 using namespace mozilla::image;
 
 class nsSVGSwitchFrame final : public nsSVGGFrame
 {
   friend nsIFrame*
   NS_NewSVGSwitchFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 protected:
   explicit nsSVGSwitchFrame(nsStyleContext* aContext)
-    : nsSVGGFrame(aContext, FrameType::SVGSwitch)
+    : nsSVGGFrame(aContext, LayoutFrameType::SVGSwitch)
   {}
 
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
 #ifdef DEBUG
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
--- a/layout/svg/nsSVGUseFrame.cpp
+++ b/layout/svg/nsSVGUseFrame.cpp
@@ -16,17 +16,17 @@ class nsSVGUseFrame final
   : public nsSVGGFrame
   , public nsIAnonymousContentCreator
 {
   friend nsIFrame*
   NS_NewSVGUseFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 protected:
   explicit nsSVGUseFrame(nsStyleContext* aContext)
-    : nsSVGGFrame(aContext, FrameType::SVGUse)
+    : nsSVGGFrame(aContext, LayoutFrameType::SVGUse)
     , mHasValidDimensions(true)
   {}
 
 public:
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame interface:
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -407,21 +407,21 @@ gfxMatrix
 nsSVGUtils::GetCanvasTM(nsIFrame *aFrame)
 {
   // XXX yuck, we really need a common interface for GetCanvasTM
 
   if (!aFrame->IsFrameOfType(nsIFrame::eSVG)) {
     return GetCSSPxToDevPxMatrix(aFrame);
   }
 
-  FrameType type = aFrame->Type();
-  if (type == FrameType::SVGForeignObject) {
+  LayoutFrameType type = aFrame->Type();
+  if (type == LayoutFrameType::SVGForeignObject) {
     return static_cast<nsSVGForeignObjectFrame*>(aFrame)->GetCanvasTM();
   }
-  if (type == FrameType::SVGOuterSVG) {
+  if (type == LayoutFrameType::SVGOuterSVG) {
     return GetCSSPxToDevPxMatrix(aFrame);
   }
 
   nsSVGContainerFrame *containerFrame = do_QueryFrame(aFrame);
   if (containerFrame) {
     return containerFrame->GetCanvasTM();
   }
 
@@ -1299,25 +1299,26 @@ nsSVGUtils::GetRelativeRect(uint16_t aUn
 }
 
 bool
 nsSVGUtils::CanOptimizeOpacity(nsIFrame *aFrame)
 {
   if (!(aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT)) {
     return false;
   }
-  FrameType type = aFrame->Type();
-  if (type != FrameType::SVGImage && type != FrameType::SVGGeometry) {
+  LayoutFrameType type = aFrame->Type();
+  if (type != LayoutFrameType::SVGImage &&
+      type != LayoutFrameType::SVGGeometry) {
     return false;
   }
   if (aFrame->StyleEffects()->HasFilters()) {
     return false;
   }
   // XXX The SVG WG is intending to allow fill, stroke and markers on <image>
-  if (type == FrameType::SVGImage) {
+  if (type == LayoutFrameType::SVGImage) {
     return true;
   }
   const nsStyleSVG *style = aFrame->StyleSVG();
   if (style->HasMarker()) {
     return false;
   }
   if (!style->HasFill() || !HasStroke(aFrame)) {
     return true;
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -39,17 +39,17 @@
 #include "mozilla/LookAndFeel.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::image;
 
 nsTableCellFrame::nsTableCellFrame(nsStyleContext* aContext,
                                    nsTableFrame* aTableFrame,
-                                   FrameType aType)
+                                   LayoutFrameType aType)
   : nsContainerFrame(aContext, aType)
   , mDesiredSize(aTableFrame->GetWritingMode())
 {
   mColIndex = 0;
   mPriorAvailISize = 0;
 
   SetContentEmpty(false);
   SetHasPctOverBSize(false);
@@ -170,30 +170,30 @@ nsTableCellFrame::NeedsToObserve(const R
   }
   rs = rs->mParentReflowInput;
   if (!rs) {
     return false;
   }
 
   // We always need to let the percent bsize observer be propagated
   // from a table wrapper frame to an inner table frame.
-  FrameType fType = aReflowInput.mFrame->Type();
-  if (fType == FrameType::Table) {
+  LayoutFrameType fType = aReflowInput.mFrame->Type();
+  if (fType == LayoutFrameType::Table) {
     return true;
   }
 
   // We need the observer to be propagated to all children of the cell
   // (i.e., children of the child block) in quirks mode, but only to
   // tables in standards mode.
   // XXX This may not be true in the case of orthogonal flows within
   // the cell (bug 1174711 comment 8); we may need to observe isizes
   // instead of bsizes for orthogonal children.
   return rs->mFrame == this &&
          (PresContext()->CompatibilityMode() == eCompatibility_NavQuirks ||
-          fType == FrameType::TableWrapper);
+          fType == LayoutFrameType::TableWrapper);
 }
 
 nsresult
 nsTableCellFrame::GetRowIndex(int32_t &aRowIndex) const
 {
   nsresult result;
   nsTableRowFrame* row = static_cast<nsTableRowFrame*>(GetParent());
   if (row) {
@@ -707,22 +707,22 @@ nsTableCellFrame::CellHasVisibleContent(
                                         nsIFrame*     kidFrame)
 {
   // see  http://www.w3.org/TR/CSS21/tables.html#empty-cells
   if (height > 0)
     return true;
   if (tableFrame->IsBorderCollapse())
     return true;
   for (nsIFrame* innerFrame : kidFrame->PrincipalChildList()) {
-    FrameType frameType = innerFrame->Type();
-    if (FrameType::Text == frameType) {
+    LayoutFrameType frameType = innerFrame->Type();
+    if (LayoutFrameType::Text == frameType) {
       nsTextFrame* textFrame = static_cast<nsTextFrame*>(innerFrame);
       if (textFrame->HasNoncollapsedCharacters())
         return true;
-    } else if (FrameType::Placeholder != frameType) {
+    } else if (LayoutFrameType::Placeholder != frameType) {
       return true;
     }
     else {
       nsIFrame *floatFrame = nsLayoutUtils::GetFloatFromPlaceholder(innerFrame);
       if (floatFrame)
         return true;
     }
   }
@@ -1115,17 +1115,17 @@ nsTableCellFrame::GetFrameName(nsAString
   return MakeFrameName(NS_LITERAL_STRING("TableCell"), aResult);
 }
 #endif
 
 // nsBCTableCellFrame
 
 nsBCTableCellFrame::nsBCTableCellFrame(nsStyleContext* aContext,
                                        nsTableFrame* aTableFrame)
-  : nsTableCellFrame(aContext, aTableFrame, FrameType::BCTableCell)
+  : nsTableCellFrame(aContext, aTableFrame, LayoutFrameType::BCTableCell)
 {
   mBStartBorder = mIEndBorder = mBEndBorder = mIStartBorder = 0;
 }
 
 nsBCTableCellFrame::~nsBCTableCellFrame()
 {
 }
 
--- a/layout/tables/nsTableCellFrame.h
+++ b/layout/tables/nsTableCellFrame.h
@@ -45,17 +45,19 @@ protected:
 public:
   NS_DECL_QUERYFRAME_TARGET(nsTableCellFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   // default constructor supplied by the compiler
 
   nsTableCellFrame(nsStyleContext* aContext, nsTableFrame* aTableFrame)
-    : nsTableCellFrame(aContext, aTableFrame, mozilla::FrameType::TableCell)
+    : nsTableCellFrame(aContext,
+                       aTableFrame,
+                       mozilla::LayoutFrameType::TableCell)
   {}
 
   ~nsTableCellFrame();
 
   nsTableRowFrame* GetTableRowFrame() const
   {
     nsIFrame* parent = GetParent();
     MOZ_ASSERT(parent && parent->IsTableRowFrame());
@@ -233,17 +235,17 @@ public:
   
   virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) override;
   virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) override;
   virtual void InvalidateFrameForRemoval() override { InvalidateFrameSubtree(); }
 
 protected:
   nsTableCellFrame(nsStyleContext* aContext,
                    nsTableFrame* aTableFrame,
-                   mozilla::FrameType aType);
+                   mozilla::LayoutFrameType aType);
 
   virtual LogicalSides
   GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
 
   /**
    * GetBorderOverflow says how far the cell's own borders extend
    * outside its own bounds.  In the separated borders model this should
    * just be zero (as it is for most frames), but in the collapsed
--- a/layout/tables/nsTableColFrame.cpp
+++ b/layout/tables/nsTableColFrame.cpp
@@ -19,17 +19,17 @@ using namespace mozilla;
                                        NS_FRAME_STATE_BIT(29) | \
                                        NS_FRAME_STATE_BIT(30) | \
                                        NS_FRAME_STATE_BIT(31))
 #define COL_TYPE_OFFSET               28
 
 using namespace mozilla;
 
 nsTableColFrame::nsTableColFrame(nsStyleContext* aContext)
-  : nsSplittableFrame(aContext, FrameType::TableCol)
+  : nsSplittableFrame(aContext, LayoutFrameType::TableCol)
   , mMinCoord(0)
   , mPrefCoord(0)
   , mSpanMinCoord(0)
   , mSpanPrefCoord(0)
   , mPrefPercent(0.0f)
   , mSpanPrefPercent(0.0f)
   , mFinalISize(0)
   , mColIndex(0)
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -223,18 +223,18 @@ nsTableColGroupFrame::InsertFrames(Child
   NS_ASSERTION(!aPrevFrame || aPrevFrame == aPrevFrame->LastContinuation(),
                "Prev frame should be last in continuation chain");
   NS_ASSERTION(!aPrevFrame || !GetNextColumn(aPrevFrame) ||
                GetNextColumn(aPrevFrame)->GetColType() != eColAnonymousCol,
                "Shouldn't be inserting before a spanned colframe");
 
   const nsFrameList::Slice& newFrames =
     mFrames.InsertFrames(this, aPrevFrame, aFrameList);
-  nsIFrame* prevFrame =
-    nsTableFrame::GetFrameAtOrBefore(this, aPrevFrame, FrameType::TableCol);
+  nsIFrame* prevFrame = nsTableFrame::GetFrameAtOrBefore(
+    this, aPrevFrame, LayoutFrameType::TableCol);
 
   int32_t colIndex = (prevFrame) ? ((nsTableColFrame*)prevFrame)->GetColIndex() + 1 : GetStartColumnIndex();
   InsertColsReflow(colIndex, newFrames);
 }
 
 void
 nsTableColGroupFrame::InsertColsReflow(int32_t                   aColIndex,
                                        const nsFrameList::Slice& aCols)
--- a/layout/tables/nsTableColGroupFrame.h
+++ b/layout/tables/nsTableColGroupFrame.h
@@ -219,17 +219,17 @@ protected:
   int32_t mStartColIndex;
 
   // border width in pixels
   BCPixelSize mBStartContBorderWidth;
   BCPixelSize mBEndContBorderWidth;
 };
 
 inline nsTableColGroupFrame::nsTableColGroupFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, mozilla::FrameType::TableColGroup)
+  : nsContainerFrame(aContext, mozilla::LayoutFrameType::TableColGroup)
   , mColCount(0)
   , mStartColIndex(0)
 {
   SetColType(eColGroupContent);
 }
 
 inline int32_t nsTableColGroupFrame::GetStartColumnIndex()
 {
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -139,17 +139,17 @@ nsTableFrame::GetParentStyleContext(nsIF
     *aProviderFrame = nullptr;
     return nullptr;
   }
 
   return GetParent()->DoGetParentStyleContext(aProviderFrame);
 }
 
 nsTableFrame::nsTableFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::Table)
+  : nsContainerFrame(aContext, LayoutFrameType::Table)
   , mCellMap(nullptr)
   , mTableLayoutStrategy(nullptr)
 {
   memset(&mBits, 0, sizeof(mBits));
 }
 
 void
 nsTableFrame::Init(nsIContent*       aContent,
@@ -1254,25 +1254,25 @@ public:
 
   virtual void Paint(nsDisplayListBuilder* aBuilder,
                      nsRenderingContext* aCtx) override;
   NS_DISPLAY_DECL_NAME("TableBorderBackground", TYPE_TABLE_BORDER_BACKGROUND)
 };
 
 #ifdef DEBUG
 static bool
-IsFrameAllowedInTable(FrameType aType)
+IsFrameAllowedInTable(LayoutFrameType aType)
 {
   return IS_TABLE_CELL(aType) ||
-         FrameType::TableRow == aType ||
-         FrameType::TableRowGroup == aType ||
-         FrameType::Scroll == aType ||
-         FrameType::Table == aType ||
-         FrameType::TableCol == aType ||
-         FrameType::TableColGroup == aType;
+         LayoutFrameType::TableRow == aType ||
+         LayoutFrameType::TableRowGroup == aType ||
+         LayoutFrameType::Scroll == aType ||
+         LayoutFrameType::Table == aType ||
+         LayoutFrameType::TableCol == aType ||
+         LayoutFrameType::TableColGroup == aType;
 }
 #endif
 
 void
 nsDisplayTableBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
                                       nsRenderingContext* aCtx)
 {
   DrawResult result = static_cast<nsTableFrame*>(mFrame)->
@@ -1280,22 +1280,22 @@ nsDisplayTableBorderBackground::Paint(ns
                                ToReferenceFrame());
 
   nsDisplayTableItemGeometry::UpdateDrawResult(this, result);
 }
 
 static int32_t
 GetTablePartRank(nsDisplayItem* aItem)
 {
-  FrameType type = aItem->Frame()->Type();
-  if (type == FrameType::Table)
+  LayoutFrameType type = aItem->Frame()->Type();
+  if (type == LayoutFrameType::Table)
     return 0;
-  if (type == FrameType::TableRowGroup)
+  if (type == LayoutFrameType::TableRowGroup)
     return 1;
-  if (type == FrameType::TableRow)
+  if (type == LayoutFrameType::TableRow)
     return 2;
   return 3;
 }
 
 struct TablePartRankComparator {
   bool operator()(nsDisplayItem* aItem1, nsDisplayItem* aItem2) const {
     return GetTablePartRank(aItem1) < GetTablePartRank(aItem2);
   }
@@ -1804,27 +1804,27 @@ nsTableFrame::ComputeAutoSize(nsRenderin
 // Return true if aParentReflowInput.frame or any of its ancestors within
 // the containing table have non-auto bsize. (e.g. pct or fixed bsize)
 bool
 nsTableFrame::AncestorsHaveStyleBSize(const ReflowInput& aParentReflowInput)
 {
   WritingMode wm = aParentReflowInput.GetWritingMode();
   for (const ReflowInput* rs = &aParentReflowInput;
        rs && rs->mFrame; rs = rs->mParentReflowInput) {
-    FrameType frameType = rs->mFrame->Type();
+    LayoutFrameType frameType = rs->mFrame->Type();
     if (IS_TABLE_CELL(frameType) ||
-        (FrameType::TableRow      == frameType) ||
-        (FrameType::TableRowGroup == frameType)) {
+        (LayoutFrameType::TableRow      == frameType) ||
+        (LayoutFrameType::TableRowGroup == frameType)) {
       const nsStyleCoord &bsize = rs->mStylePosition->BSize(wm);
       // calc() with percentages treated like 'auto' on internal table elements
       if (bsize.GetUnit() != eStyleUnit_Auto &&
           (!bsize.IsCalcUnit() || !bsize.HasPercent())) {
         return true;
       }
-    } else if (FrameType::Table == frameType) {
+    } else if (LayoutFrameType::Table == frameType) {
       // we reached the containing table, so always return
       return rs->mStylePosition->BSize(wm).GetUnit() != eStyleUnit_Auto;
     }
   }
   return false;
 }
 
 // See if a special block-size reflow needs to occur and if so,
@@ -1852,25 +1852,25 @@ nsTableFrame::CheckRequestSpecialBSizeRe
 // row, or cell returns the last size it was reflowed at. However, the table may
 // change the bsize of row groups, rows, cells in DistributeBSizeToRows after.
 // And the row group can change the bsize of rows, cells in CalculateRowBSizes.
 void
 nsTableFrame::RequestSpecialBSizeReflow(const ReflowInput& aReflowInput)
 {
   // notify the frame and its ancestors of the special reflow, stopping at the containing table
   for (const ReflowInput* rs = &aReflowInput; rs && rs->mFrame; rs = rs->mParentReflowInput) {
-    FrameType frameType = rs->mFrame->Type();
+    LayoutFrameType frameType = rs->mFrame->Type();
     NS_ASSERTION(IS_TABLE_CELL(frameType) ||
-                 FrameType::TableRow == frameType ||
-                 FrameType::TableRowGroup == frameType ||
-                 FrameType::Table == frameType,
+                 LayoutFrameType::TableRow == frameType ||
+                 LayoutFrameType::TableRowGroup == frameType ||
+                 LayoutFrameType::Table == frameType,
                  "unexpected frame type");
 
     rs->mFrame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
-    if (FrameType::Table == frameType) {
+    if (LayoutFrameType::Table == frameType) {
       NS_ASSERTION(rs != &aReflowInput,
                    "should not request special bsize reflow for table");
       // always stop when we reach a table
       break;
     }
   }
 }
 
@@ -2608,17 +2608,17 @@ nsTableFrame::HomogenousInsertFrames(Chi
     // 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 =
         (nsTableColGroupFrame*)GetFrameAtOrBefore(this, aPrevFrame,
-                                                  FrameType::TableColGroup);
+                                                  LayoutFrameType::TableColGroup);
       if (prevColGroup) {
         startColIndex = prevColGroup->GetStartColumnIndex() + prevColGroup->GetColCount();
       }
     }
     InsertColGroups(startColIndex, newColgroups);
   } else if (IsRowGroup(display->mDisplay)) {
     NS_ASSERTION(aListID == kPrincipalList, "unexpected child list");
     DrainSelfOverflowList(); // ensure aPrevFrame is in mFrames
@@ -4063,17 +4063,17 @@ nsTableFrame::GetFrameName(nsAString& aR
 }
 #endif
 
 // Find the closet sibling before aPriorChildFrame (including aPriorChildFrame) that
 // is of type aChildType
 nsIFrame*
 nsTableFrame::GetFrameAtOrBefore(nsIFrame* aParentFrame,
                                  nsIFrame* aPriorChildFrame,
-                                 FrameType aChildType)
+                                 LayoutFrameType aChildType)
 {
   nsIFrame* result = nullptr;
   if (!aPriorChildFrame) {
     return result;
   }
   if (aChildType == aPriorChildFrame->Type()) {
     return aPriorChildFrame;
   }
@@ -4165,17 +4165,17 @@ nsTableFrame::Dump(bool            aDump
         break;
       case eColAnonymousCell:
         printf(" anonymous-cell ");
         break;
       }
     }
     printf("\n colgroups->");
     for (nsIFrame* childFrame : mColGroups) {
-      if (FrameType::TableColGroup == childFrame->Type()) {
+      if (LayoutFrameType::TableColGroup == childFrame->Type()) {
         nsTableColGroupFrame* colGroupFrame = (nsTableColGroupFrame *)childFrame;
         colGroupFrame->Dump(1);
       }
     }
     for (colIdx = 0; colIdx < numCols; colIdx++) {
       printf("\n");
       nsTableColFrame* colFrame = GetColFrame(colIdx);
       colFrame->Dump(1);
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -29,20 +29,20 @@ namespace mozilla {
 class WritingMode;
 class LogicalMargin;
 struct TableReflowInput;
 } // namespace mozilla
 
 struct BCPropertyData;
 
 static inline bool
-IS_TABLE_CELL(mozilla::FrameType frameType)
+IS_TABLE_CELL(mozilla::LayoutFrameType frameType)
 {
-  return frameType == mozilla::FrameType::TableCell ||
-         frameType == mozilla::FrameType::BCTableCell;
+  return frameType == mozilla::LayoutFrameType::TableCell ||
+         frameType == mozilla::LayoutFrameType::BCTableCell;
 }
 
 class nsDisplayTableItem : public nsDisplayItem
 {
 public:
   nsDisplayTableItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
                      bool aDrawsBackground = true) :
       nsDisplayItem(aBuilder, aFrame),
@@ -247,17 +247,17 @@ public:
                                       const nsDisplayListSet& aLists,
                                       nsDisplayTableItem* aDisplayItem,
                                       DisplayGenericTablePartTraversal aTraversal = GenericTraversal);
 
   // Return the closest sibling of aPriorChildFrame (including aPriroChildFrame)
   // of type aChildType.
   static nsIFrame* GetFrameAtOrBefore(nsIFrame* aParentFrame,
                                       nsIFrame* aPriorChildFrame,
-                                      mozilla::FrameType aChildType);
+                                      mozilla::LayoutFrameType aChildType);
   bool IsAutoBSize(mozilla::WritingMode aWM);
 
   /** @return true if aDisplayType represents a rowgroup of any sort
     * (header, footer, or body)
     */
   bool IsRowGroup(mozilla::StyleDisplay aDisplayType) const;
 
   virtual const nsFrameList& GetChildList(ChildListID aListID) const override;
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -125,17 +125,17 @@ nsTableRowFrame::SetPctBSize(float aPctV
 
 /* ----------- nsTableRowFrame ---------- */
 
 NS_QUERYFRAME_HEAD(nsTableRowFrame)
   NS_QUERYFRAME_ENTRY(nsTableRowFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
 
 nsTableRowFrame::nsTableRowFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::TableRow)
+  : nsContainerFrame(aContext, LayoutFrameType::TableRow)
   , mContentBSize(0)
   , mStylePctBSize(0)
   , mStyleFixedBSize(0)
   , mMaxCellAscent(0)
   , mMaxCellDescent(0)
   , mBStartBorderWidth(0)
   , mBEndBorderWidth(0)
   , mIEndContBorderWidth(0)
@@ -233,18 +233,18 @@ nsTableRowFrame::InsertFrames(ChildListI
   NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == this,
                "inserting after sibling frame with different parent");
   DrainSelfOverflowList(); // ensure aPrevFrame is in mFrames
   //Insert Frames in the frame list
   const nsFrameList::Slice& newCells = mFrames.InsertFrames(nullptr, aPrevFrame, aFrameList);
 
   // Get the table frame
   nsTableFrame* tableFrame = GetTableFrame();
-  FrameType cellFrameType = tableFrame->IsBorderCollapse()
-      ? FrameType::BCTableCell : FrameType::TableCell;
+  LayoutFrameType cellFrameType = tableFrame->IsBorderCollapse()
+      ? LayoutFrameType::BCTableCell : LayoutFrameType::TableCell;
   nsTableCellFrame* prevCellFrame = (nsTableCellFrame *)nsTableFrame::GetFrameAtOrBefore(this, aPrevFrame, cellFrameType);
   nsTArray<nsTableCellFrame*> cellChildren;
   for (nsFrameList::Enumerator e(newCells); !e.AtEnd(); e.Next()) {
     nsIFrame *childFrame = e.get();
     NS_ASSERTION(IS_TABLE_CELL(childFrame->Type()),
                  "Not a table cell frame/pseudo frame construction failure");
     cellChildren.AppendElement(static_cast<nsTableCellFrame*>(childFrame));
   }
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -49,17 +49,17 @@ struct TableRowGroupReflowInput {
   }
 
   ~TableRowGroupReflowInput() {}
 };
 
 } // namespace mozilla
 
 nsTableRowGroupFrame::nsTableRowGroupFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::TableRowGroup)
+  : nsContainerFrame(aContext, LayoutFrameType::TableRowGroup)
 {
   SetRepeatable(false);
 }
 
 nsTableRowGroupFrame::~nsTableRowGroupFrame()
 {
 }
 
@@ -1583,17 +1583,17 @@ nsTableRowGroupFrame::InsertFrames(Child
   }
 
   int32_t startRowIndex = GetStartRowIndex();
   // Insert the frames in the sibling chain
   mFrames.InsertFrames(nullptr, aPrevFrame, aFrameList);
 
   int32_t numRows = rows.Length();
   if (numRows > 0) {
-    nsTableRowFrame* prevRow = (nsTableRowFrame *)nsTableFrame::GetFrameAtOrBefore(this, aPrevFrame, FrameType::TableRow);
+    nsTableRowFrame* prevRow = (nsTableRowFrame *)nsTableFrame::GetFrameAtOrBefore(this, aPrevFrame, LayoutFrameType::TableRow);
     int32_t rowIndex = (prevRow) ? prevRow->GetRowIndex() + 1 : startRowIndex;
     tableFrame->InsertRows(this, rows, rowIndex, true);
 
     PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange,
                        NS_FRAME_HAS_DIRTY_CHILDREN);
     tableFrame->SetGeometryDirty();
   }
--- a/layout/tables/nsTableWrapperFrame.cpp
+++ b/layout/tables/nsTableWrapperFrame.cpp
@@ -38,17 +38,17 @@ nsTableWrapperFrame::GetLogicalBaseline(
     return nsContainerFrame::GetLogicalBaseline(aWritingMode);
   }
 
   return kid->GetLogicalBaseline(aWritingMode) +
          kid->BStart(aWritingMode, mRect.Size());
 }
 
 nsTableWrapperFrame::nsTableWrapperFrame(nsStyleContext* aContext)
-  : nsContainerFrame(aContext, FrameType::TableWrapper)
+  : nsContainerFrame(aContext, LayoutFrameType::TableWrapper)
 {
 }
 
 nsTableWrapperFrame::~nsTableWrapperFrame()
 {
 }
 
 NS_QUERYFRAME_HEAD(nsTableWrapperFrame)
--- a/layout/xul/nsBox.cpp
+++ b/layout/xul/nsBox.cpp
@@ -171,17 +171,17 @@ nsBox::EndXULLayout(nsBoxLayoutState& aS
   #endif
 
   return SyncLayout(aState);
 }
 
 bool nsBox::gGotTheme = false;
 nsITheme* nsBox::gTheme = nullptr;
 
-nsBox::nsBox(FrameType aType)
+nsBox::nsBox(LayoutFrameType aType)
   : nsIFrame(aType)
 {
   MOZ_COUNT_CTOR(nsBox);
   //mX = 0;
   //mY = 0;
   if (!gGotTheme) {
     gGotTheme = true;
     CallGetService("@mozilla.org/chrome/chrome-native-theme;1", &gTheme);
--- a/layout/xul/nsBox.h
+++ b/layout/xul/nsBox.h
@@ -45,17 +45,17 @@ public:
   NS_IMETHOD GetDebugBoxAt(const nsPoint& aPoint, nsIFrame** aBox);
   virtual nsresult GetXULDebug(bool& aDebug) override;
   virtual nsresult SetXULDebug(nsBoxLayoutState& aState, bool aDebug) override;
 
   virtual nsresult XULDumpBox(FILE* out) override;
   void PropagateDebug(nsBoxLayoutState& aState);
 #endif
 
-  explicit nsBox(mozilla::FrameType);
+  explicit nsBox(mozilla::LayoutFrameType);
   virtual ~nsBox();
 
   /**
    * Returns true if this box clips its children, e.g., if this box is an sc
 rollbox.
   */
   virtual bool DoesClipChildren();
   virtual bool ComputesOwnOverflowArea() = 0;
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -111,17 +111,17 @@ NS_IMPL_FRAMEARENA_HELPERS(nsBoxFrame)
 
 #ifdef DEBUG
 NS_QUERYFRAME_HEAD(nsBoxFrame)
   NS_QUERYFRAME_ENTRY(nsBoxFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
 #endif
 
 nsBoxFrame::nsBoxFrame(nsStyleContext* aContext,
-                       FrameType aType,
+                       LayoutFrameType aType,
                        bool aIsRoot,
                        nsBoxLayout* aLayoutManager)
   : nsContainerFrame(aContext, aType)
 {
   mState |= NS_STATE_IS_HORIZONTAL;
   mState |= NS_STATE_AUTO_STRETCH;
 
   if (aIsRoot) 
--- a/layout/xul/nsBoxFrame.h
+++ b/layout/xul/nsBoxFrame.h
@@ -139,17 +139,20 @@ public:
 
   virtual bool HonorPrintBackgroundSettings() override;
 
   virtual ~nsBoxFrame();
 
   explicit nsBoxFrame(nsStyleContext* aContext,
                       bool aIsRoot = false,
                       nsBoxLayout* aLayoutManager = nullptr)
-    : nsBoxFrame(aContext, mozilla::FrameType::Box, aIsRoot, aLayoutManager)
+    : nsBoxFrame(aContext,
+                 mozilla::LayoutFrameType::Box,
+                 aIsRoot,
+                 aLayoutManager)
   {}
 
   // virtual so nsStackFrame, nsButtonBoxFrame, nsSliderFrame and nsMenuFrame
   // can override it
   virtual void BuildDisplayListForChildren(nsDisplayListBuilder*   aBuilder,
                                            const nsRect&           aDirtyRect,
                                            const nsDisplayListSet& aLists);
 
@@ -177,17 +180,17 @@ public:
   /**
    * This defaults to true, but some box frames (nsListBoxBodyFrame for
    * example) don't support ordinals in their children.
    */
   virtual bool SupportsOrdinalsInChildren();
 
 protected:
   nsBoxFrame(nsStyleContext* aContext,
-             mozilla::FrameType aType,
+             mozilla::LayoutFrameType aType,
              bool aIsRoot = false,
              nsBoxLayout* aLayoutManager = nullptr);
 
 #ifdef DEBUG_LAYOUT
     virtual void GetBoxName(nsAutoString& aName) override;
     void PaintXULDebugBackground(nsRenderingContext& aRenderingContext,
                                  nsPoint aPt);
     void PaintXULDebugOverlay(DrawTarget& aRenderingContext,
--- a/layout/xul/nsDeckFrame.cpp
+++ b/layout/xul/nsDeckFrame.cpp
@@ -38,19 +38,18 @@ NS_NewDeckFrame(nsIPresShell* aPresShell
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsDeckFrame)
 
 NS_QUERYFRAME_HEAD(nsDeckFrame)
   NS_QUERYFRAME_ENTRY(nsDeckFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
 
-
 nsDeckFrame::nsDeckFrame(nsStyleContext* aContext)
-  : nsBoxFrame(aContext, FrameType::Deck)
+  : nsBoxFrame(aContext, LayoutFrameType::Deck)
   , mIndex(0)
 {
   nsCOMPtr<nsBoxLayout> layout;
   NS_NewStackLayout(layout);
   SetXULLayoutManager(layout);
 }
 
 nsresult
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -146,17 +146,17 @@ nsImageBoxFrame::AttributeChanged(int32_
   }
   else if (aAttribute == nsGkAtoms::validate)
     UpdateLoadFlags();
 
   return rv;
 }
 
 nsImageBoxFrame::nsImageBoxFrame(nsStyleContext* aContext)
-  : nsLeafBoxFrame(aContext, FrameType::ImageBox)
+  : nsLeafBoxFrame(aContext, LayoutFrameType::ImageBox)
   , mIntrinsicSize(0, 0)
   , mLoadFlags(nsIRequest::LOAD_NORMAL)
   , mRequestRegistered(false)
   , mUseSrcAttr(false)
   , mSuppressStyleCheck(false)
 {
   MarkIntrinsicISizesDirty();
 }
--- a/layout/xul/nsLeafBoxFrame.cpp
+++ b/layout/xul/nsLeafBoxFrame.cpp
@@ -35,17 +35,17 @@ using namespace mozilla;
 nsIFrame*
 NS_NewLeafBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsLeafBoxFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsLeafBoxFrame)
 
-nsLeafBoxFrame::nsLeafBoxFrame(nsStyleContext* aContext, FrameType aType)
+nsLeafBoxFrame::nsLeafBoxFrame(nsStyleContext* aContext, LayoutFrameType aType)
   : nsLeafFrame(aContext, aType)
 {
 }
 
 #ifdef DEBUG_LAYOUT
 void
 nsLeafBoxFrame::GetBoxName(nsAutoString& aName)
 {
--- a/layout/xul/nsLeafBoxFrame.h
+++ b/layout/xul/nsLeafBoxFrame.h
@@ -78,20 +78,20 @@ protected:
 
 #ifdef DEBUG_LAYOUT
   virtual void GetBoxName(nsAutoString& aName) override;
 #endif
 
   virtual nscoord GetIntrinsicISize() override;
 
   explicit nsLeafBoxFrame(nsStyleContext* aContext)
-    : nsLeafBoxFrame(aContext, mozilla::FrameType::LeafBox)
+    : nsLeafBoxFrame(aContext, mozilla::LayoutFrameType::LeafBox)
   {}
 
-  nsLeafBoxFrame(nsStyleContext* aContext, mozilla::FrameType aType);
+  nsLeafBoxFrame(nsStyleContext* aContext, mozilla::LayoutFrameType aType);
 
 private:
 
  void UpdateMouseThrough();
 
 
 }; // class nsLeafBoxFrame
 
--- a/layout/xul/nsMenuFrame.cpp
+++ b/layout/xul/nsMenuFrame.cpp
@@ -165,17 +165,17 @@ NS_NewMenuItemFrame(nsIPresShell* aPresS
 
 NS_IMPL_FRAMEARENA_HELPERS(nsMenuFrame)
 
 NS_QUERYFRAME_HEAD(nsMenuFrame)
   NS_QUERYFRAME_ENTRY(nsMenuFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
 
 nsMenuFrame::nsMenuFrame(nsStyleContext* aContext)
-  : nsBoxFrame(aContext, FrameType::Menu)
+  : nsBoxFrame(aContext, LayoutFrameType::Menu)
   , mIsMenu(false)
   , mChecked(false)
   , mIgnoreAccelTextChange(false)
   , mReflowCallbackPosted(false)
   , mType(eMenuType_Normal)
   , mBlinkState(0)
 {
 }
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -90,17 +90,17 @@ NS_IMPL_FRAMEARENA_HELPERS(nsMenuPopupFr
 NS_QUERYFRAME_HEAD(nsMenuPopupFrame)
   NS_QUERYFRAME_ENTRY(nsMenuPopupFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
 
 //
 // nsMenuPopupFrame ctor
 //
 nsMenuPopupFrame::nsMenuPopupFrame(nsStyleContext* aContext)
-  : nsBoxFrame(aContext, FrameType::MenuPopup)
+  : nsBoxFrame(aContext, LayoutFrameType::MenuPopup)
   , mCurrentMenu(nullptr)
   , mView(nullptr)
   , mPrefSize(-1, -1)
   , mLastClientOffset(0, 0)
   , mPopupType(ePopupTypePanel)
   , mPopupState(ePopupClosed)
   , mPopupAlignment(POPUPALIGNMENT_NONE)
   , mPopupAnchor(POPUPALIGNMENT_NONE)
--- a/layout/xul/nsPopupSetFrame.h
+++ b/layout/xul/nsPopupSetFrame.h
@@ -14,17 +14,17 @@
 nsIFrame* NS_NewPopupSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 class nsPopupSetFrame final : public nsBoxFrame
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit nsPopupSetFrame(nsStyleContext* aContext)
-    : nsBoxFrame(aContext, mozilla::FrameType::PopupSet)
+    : nsBoxFrame(aContext, mozilla::LayoutFrameType::PopupSet)
   {}
 
   ~nsPopupSetFrame() {}
 
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
                     nsIFrame*         aPrevInFlow) override;
 
--- a/layout/xul/nsRootBoxFrame.cpp
+++ b/layout/xul/nsRootBoxFrame.cpp
@@ -102,17 +102,17 @@ nsContainerFrame*
 NS_NewRootBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsRootBoxFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsRootBoxFrame)
 
 nsRootBoxFrame::nsRootBoxFrame(nsStyleContext* aContext)
-  : nsBoxFrame(aContext, FrameType::Root, true)
+  : nsBoxFrame(aContext, LayoutFrameType::Root, true)
   , mPopupSetFrame(nullptr)
   , mDefaultTooltip(nullptr)
 {
   nsCOMPtr<nsBoxLayout> layout;
   NS_NewStackLayout(layout);
   SetXULLayoutManager(layout);
 }
 
--- a/layout/xul/nsScrollbarFrame.h
+++ b/layout/xul/nsScrollbarFrame.h
@@ -16,17 +16,17 @@
 class nsIScrollbarMediator;
 
 nsIFrame* NS_NewScrollbarFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 class nsScrollbarFrame : public nsBoxFrame
 {
 public:
   explicit nsScrollbarFrame(nsStyleContext* aContext)
-    : nsBoxFrame(aContext, mozilla::FrameType::Scrollbar)
+    : nsBoxFrame(aContext, mozilla::LayoutFrameType::Scrollbar)
     , mScrollbarMediator(nullptr)
   {}
 
   NS_DECL_QUERYFRAME_TARGET(nsScrollbarFrame)
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override {
     return MakeFrameName(NS_LITERAL_STRING("ScrollbarFrame"), aResult);
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -77,17 +77,17 @@ NS_NewSliderFrame (nsIPresShell* aPresSh
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSliderFrame)
 
 NS_QUERYFRAME_HEAD(nsSliderFrame)
   NS_QUERYFRAME_ENTRY(nsSliderFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
 
 nsSliderFrame::nsSliderFrame(nsStyleContext* aContext)
-  : nsBoxFrame(aContext, FrameType::Slider)
+  : nsBoxFrame(aContext, LayoutFrameType::Slider)
   , mRatio(0.0f)
   , mCurPos(0)
   , mChange(0)
   , mDragFinished(true)
   , mUserChanged(false)
   , mScrollingWithAPZ(false)
   , mSuppressionActive(false)
 {
--- a/layout/xul/nsXULLabelFrame.h
+++ b/layout/xul/nsXULLabelFrame.h
@@ -35,17 +35,17 @@ public:
                                     int32_t aModType) override;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
 #endif
 
 protected:
   explicit nsXULLabelFrame(nsStyleContext* aContext)
-    : nsBlockFrame(aContext, mozilla::FrameType::XULLabel)
+    : nsBlockFrame(aContext, mozilla::LayoutFrameType::XULLabel)
   {}
 
   nsresult RegUnregAccessKey(bool aDoReg);
 };
 
 nsIFrame*
 NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);