Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 25 Apr 2019 23:03:04 +0000
changeset 530219 62da064b1b8f2274df270f8f2de784e9b4d0302d
parent 530218 15cb052119fe2c70a42b0eeba69a4583f53a5718
child 530220 ee95a11e12edabbf8f75fb17517524ef043e265d
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1546697
milestone68.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 1546697 - Use a consistent style for enum classes in layout. r=dholbert Per the discussion in: https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ They should be CamelCase, and that's what most of them already do. This converts the rest, which are a few. For the ones that already used `e` or `k` prefixes, I've mostly done: for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done For the ones that used uppercase, I've removed the prefix if it was already in the type name, and turn them into CamelCase. Depends on D28680 Differential Revision: https://phabricator.services.mozilla.com/D28681
accessible/base/NotificationController.cpp
accessible/base/nsAccessibilityService.cpp
accessible/base/nsCoreUtils.cpp
accessible/base/nsTextEquivUtils.cpp
accessible/generic/Accessible.cpp
accessible/generic/HyperTextAccessible.cpp
docshell/base/nsDocShell.cpp
dom/animation/KeyframeUtils.cpp
dom/base/Document.cpp
dom/base/Element.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsGlobalWindowInner.cpp
dom/base/nsImageLoadingContent.cpp
dom/base/nsRange.cpp
dom/events/EventStateManager.cpp
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMediaElement.h
dom/html/ImageDocument.cpp
dom/html/nsTextEditorState.cpp
dom/media/MediaDecoder.cpp
dom/svg/SVGElement.cpp
gfx/thebes/gfxTextRun.h
layout/base/PresShell.cpp
layout/base/ScrollTypes.h
layout/base/nsDocumentViewer.cpp
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/base/nsPresContext.h
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsFieldSetFrame.cpp
layout/forms/nsHTMLButtonControlFrame.cpp
layout/forms/nsListControlFrame.cpp
layout/forms/nsRangeFrame.cpp
layout/forms/nsTextControlFrame.h
layout/generic/CSSAlignUtils.cpp
layout/generic/CSSAlignUtils.h
layout/generic/MathMLTextRunFactory.cpp
layout/generic/ScrollAnchorContainer.cpp
layout/generic/ViewportFrame.cpp
layout/generic/Visibility.h
layout/generic/nsAbsoluteContainingBlock.cpp
layout/generic/nsAbsoluteContainingBlock.h
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockFrame.h
layout/generic/nsBulletFrame.h
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFlexContainerFrame.h
layout/generic/nsFloatManager.cpp
layout/generic/nsFloatManager.h
layout/generic/nsFrame.cpp
layout/generic/nsFrameSelection.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGfxScrollFrame.h
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsGridContainerFrame.h
layout/generic/nsIFrame.h
layout/generic/nsIFrameInlines.h
layout/generic/nsIScrollableFrame.h
layout/generic/nsImageFrame.cpp
layout/generic/nsPageFrame.cpp
layout/generic/nsSimplePageSequenceFrame.cpp
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsTextFrame.cpp
layout/generic/nsTextFrame.h
layout/generic/nsTextFrameUtils.cpp
layout/generic/nsTextFrameUtils.h
layout/inspector/InspectorUtils.cpp
layout/mathml/nsMathMLChar.cpp
layout/mathml/nsMathMLmtableFrame.cpp
layout/painting/FrameLayerBuilder.cpp
layout/painting/FrameLayerBuilder.h
layout/painting/nsCSSRendering.cpp
layout/painting/nsCSSRendering.h
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
layout/style/CSSEnabledState.h
layout/style/CSSStyleRule.cpp
layout/style/nsCSSProps.h
layout/style/nsCSSPseudoElements.cpp
layout/style/nsCSSPseudoElements.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsStyleTransformMatrix.cpp
layout/style/nsStyleTransformMatrix.h
layout/style/nsTransitionManager.cpp
layout/svg/SVGTextFrame.cpp
layout/svg/nsSVGForeignObjectFrame.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/tables/nsTableFrame.cpp
layout/tables/nsTableWrapperFrame.h
layout/xul/nsBoxFrame.cpp
layout/xul/nsGroupBoxFrame.cpp
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsSliderFrame.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
toolkit/components/sessionstore/SessionStoreUtils.cpp
--- a/accessible/base/NotificationController.cpp
+++ b/accessible/base/NotificationController.cpp
@@ -692,18 +692,18 @@ void NotificationController::WillRefresh
     }
 
 #ifdef A11Y_LOG
     nsIContent* containerElm =
         containerNode->IsElement() ? containerNode->AsElement() : nullptr;
 #endif
 
     nsIFrame::RenderedText text = textFrame->GetRenderedText(
-        0, UINT32_MAX, nsIFrame::TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-        nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
+        0, UINT32_MAX, nsIFrame::TextOffsetType::OffsetsInContentText,
+        nsIFrame::TrailingWhitespace::DontTrim);
 
     // Remove text accessible if rendered text is empty.
     if (textAcc) {
       if (text.mString.IsEmpty()) {
 #ifdef A11Y_LOG
         if (logging::IsEnabled(logging::eTree | logging::eText)) {
           logging::MsgBegin("TREE", "text node lost its content; doc: %p",
                             mDocument);
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -962,18 +962,18 @@ Accessible* nsAccessibilityService::Crea
 #endif
 
   // Attempt to create an accessible based on what we know.
   RefPtr<Accessible> newAcc;
 
   // Create accessible for visible text frames.
   if (content->IsText()) {
     nsIFrame::RenderedText text = frame->GetRenderedText(
-        0, UINT32_MAX, nsIFrame::TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-        nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
+        0, UINT32_MAX, nsIFrame::TextOffsetType::OffsetsInContentText,
+        nsIFrame::TrailingWhitespace::DontTrim);
     // Ignore not rendered text nodes and whitespace text nodes between table
     // cells.
     if (text.mString.IsEmpty() ||
         (aContext->IsTableRow() &&
          nsCoreUtils::IsWhitespaceString(text.mString))) {
       if (aIsSubtreeHidden) *aIsSubtreeHidden = true;
 
       return nullptr;
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -254,17 +254,17 @@ void nsCoreUtils::ScrollFrameToPoint(nsI
   nsPoint point =
       ToAppUnits(aPoint, aFrame->PresContext()->AppUnitsPerDevPixel());
   nsRect frameRect = aFrame->GetScreenRectInAppUnits();
   nsPoint deltaPoint = point - frameRect.TopLeft();
 
   nsPoint scrollPoint = scrollableFrame->GetScrollPosition();
   scrollPoint -= deltaPoint;
 
-  scrollableFrame->ScrollTo(scrollPoint, ScrollMode::eInstant);
+  scrollableFrame->ScrollTo(scrollPoint, ScrollMode::Instant);
 }
 
 void nsCoreUtils::ConvertScrollTypeToPercents(
     uint32_t aScrollType, nsIPresShell::ScrollAxis *aVertical,
     nsIPresShell::ScrollAxis *aHorizontal) {
   WhereToScroll whereY, whereX;
   WhenToScroll whenY, whenX;
   switch (aScrollType) {
--- a/accessible/base/nsTextEquivUtils.cpp
+++ b/accessible/base/nsTextEquivUtils.cpp
@@ -120,18 +120,18 @@ nsresult nsTextEquivUtils::AppendTextEqu
         }
       }
     }
 
     if (aContent->TextLength() > 0) {
       nsIFrame* frame = aContent->GetPrimaryFrame();
       if (frame) {
         nsIFrame::RenderedText text = frame->GetRenderedText(
-            0, UINT32_MAX, nsIFrame::TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-            nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
+            0, UINT32_MAX, nsIFrame::TextOffsetType::OffsetsInContentText,
+            nsIFrame::TrailingWhitespace::DontTrim);
         aString->Append(text.mString);
       } else {
         // If aContent is an object that is display: none, we have no a frame.
         aContent->GetAsText()->AppendTextTo(*aString);
       }
       if (isHTMLBlock && !aString->IsEmpty()) {
         aString->Append(char16_t(' '));
       }
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -376,18 +376,18 @@ uint64_t Accessible::VisibilityState() c
   // Zero area rects can occur in the first frame of a multi-frame text flow,
   // in which case the rendered text is not empty and the frame should not be
   // marked invisible.
   // XXX Can we just remove this check? Why do we need to mark empty
   // text invisible?
   if (frame->IsTextFrame() && !(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
       frame->GetRect().IsEmpty()) {
     nsIFrame::RenderedText text = frame->GetRenderedText(
-        0, UINT32_MAX, nsIFrame::TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-        nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
+        0, UINT32_MAX, nsIFrame::TextOffsetType::OffsetsInContentText,
+        nsIFrame::TrailingWhitespace::DontTrim);
     if (text.mString.IsEmpty()) {
       return states::INVISIBLE;
     }
   }
 
   return 0;
 }
 
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -1845,18 +1845,18 @@ nsresult HyperTextAccessible::ContentToR
   }
 
   NS_ASSERTION(aFrame->IsTextFrame(), "Need text frame for offset conversion");
   NS_ASSERTION(aFrame->GetPrevContinuation() == nullptr,
                "Call on primary frame only");
 
   nsIFrame::RenderedText text = aFrame->GetRenderedText(
       aContentOffset, aContentOffset + 1,
-      nsIFrame::TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-      nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
+      nsIFrame::TextOffsetType::OffsetsInContentText,
+      nsIFrame::TrailingWhitespace::DontTrim);
   *aRenderedOffset = text.mOffsetWithinNodeRenderedText;
 
   return NS_OK;
 }
 
 nsresult HyperTextAccessible::RenderedToContentOffset(
     nsIFrame* aFrame, uint32_t aRenderedOffset, int32_t* aContentOffset) const {
   if (IsTextField()) {
@@ -1868,18 +1868,18 @@ nsresult HyperTextAccessible::RenderedTo
   NS_ENSURE_TRUE(aFrame, NS_ERROR_FAILURE);
 
   NS_ASSERTION(aFrame->IsTextFrame(), "Need text frame for offset conversion");
   NS_ASSERTION(aFrame->GetPrevContinuation() == nullptr,
                "Call on primary frame only");
 
   nsIFrame::RenderedText text = aFrame->GetRenderedText(
       aRenderedOffset, aRenderedOffset + 1,
-      nsIFrame::TextOffsetType::OFFSETS_IN_RENDERED_TEXT,
-      nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
+      nsIFrame::TextOffsetType::OffsetsInContentText,
+      nsIFrame::TrailingWhitespace::DontTrim);
   *aContentOffset = text.mOffsetWithinNodeText;
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HyperTextAccessible public
 
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -5654,20 +5654,20 @@ nsPoint nsDocShell::GetCurScrollPos() {
   return scrollPos;
 }
 
 nsresult nsDocShell::SetCurScrollPosEx(int32_t aCurHorizontalPos,
                                        int32_t aCurVerticalPos) {
   nsIScrollableFrame* sf = GetRootScrollFrame();
   NS_ENSURE_TRUE(sf, NS_ERROR_FAILURE);
 
-  ScrollMode scrollMode = ScrollMode::eInstant;
+  ScrollMode scrollMode = ScrollMode::Instant;
   if (sf->GetScrollStyles().mScrollBehavior ==
       NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
-    scrollMode = ScrollMode::eSmoothMsd;
+    scrollMode = ScrollMode::SmoothMsd;
   }
 
   nsPoint targetPos(aCurHorizontalPos, aCurVerticalPos);
   sf->ScrollTo(targetPos, scrollMode);
 
   // Set the visual viewport offset as well.
 
   RefPtr<PresShell> presShell = GetPresShell();
--- a/dom/animation/KeyframeUtils.cpp
+++ b/dom/animation/KeyframeUtils.cpp
@@ -502,17 +502,17 @@ static bool GetPropertyValuesPairs(JSCon
     return false;
   }
   for (size_t i = 0, n = ids.length(); i < n; i++) {
     nsAutoJSString propName;
     if (!propName.init(aCx, ids[i])) {
       return false;
     }
     nsCSSPropertyID property = nsCSSProps::LookupPropertyByIDLName(
-        propName, CSSEnabledState::eForAllContent);
+        propName, CSSEnabledState::ForAllContent);
     if (KeyframeUtils::IsAnimatableProperty(property)) {
       AdditionalProperty* p = properties.AppendElement();
       p->mProperty = property;
       p->mJsidIndex = i;
     }
   }
 
   // Sort the entries by IDL name and then get each value and
@@ -1183,17 +1183,17 @@ static bool HasImplicitKeyframeValues(co
     // frame, 1.0 for the last frame, and 0.5 for everything else.
     double computedOffset = i == len - 1 ? 1.0 : i == 0 ? 0.0 : 0.5;
     double offsetToUse = frame.mOffset ? frame.mOffset.value() : computedOffset;
 
     for (const PropertyValuePair& pair : frame.mPropertyValues) {
       if (nsCSSProps::IsShorthand(pair.mProperty)) {
         MOZ_ASSERT(pair.mServoDeclarationBlock);
         CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(prop, pair.mProperty,
-                                             CSSEnabledState::eForAllContent) {
+                                             CSSEnabledState::ForAllContent) {
           addToPropertySets(*prop, offsetToUse);
         }
       } else {
         addToPropertySets(pair.mProperty, offsetToUse);
       }
     }
   }
 
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -5479,17 +5479,17 @@ static PseudoStyleType GetPseudoElementT
   MOZ_ASSERT(!aString.IsEmpty(),
              "GetPseudoElementType aString should be non-null");
   if (aString.Length() <= 2 || aString[0] != ':' || aString[1] != ':') {
     aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
     return PseudoStyleType::NotPseudo;
   }
   RefPtr<nsAtom> pseudo = NS_Atomize(Substring(aString, 1));
   return nsCSSPseudoElements::GetPseudoType(pseudo,
-                                            CSSEnabledState::eInUASheets);
+                                            CSSEnabledState::InUASheets);
 }
 
 already_AddRefed<Element> Document::CreateElement(
     const nsAString& aTagName, const ElementCreationOptionsOrString& aOptions,
     ErrorResult& rv) {
   rv = nsContentUtils::CheckQName(aTagName, false);
   if (rv.Failed()) {
     return nullptr;
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -788,23 +788,23 @@ void Element::ScrollIntoView(const Scrol
       nsIPresShell::ScrollAxis(whereToScrollHorizontally, WhenToScroll::Always),
       scrollFlags);
 }
 
 void Element::Scroll(const CSSIntPoint& aScroll,
                      const ScrollOptions& aOptions) {
   nsIScrollableFrame* sf = GetScrollFrame();
   if (sf) {
-    ScrollMode scrollMode = ScrollMode::eInstant;
+    ScrollMode scrollMode = ScrollMode::Instant;
     if (aOptions.mBehavior == ScrollBehavior::Smooth) {
-      scrollMode = ScrollMode::eSmoothMsd;
+      scrollMode = ScrollMode::SmoothMsd;
     } else if (aOptions.mBehavior == ScrollBehavior::Auto) {
       ScrollStyles styles = sf->GetScrollStyles();
       if (styles.mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
-        scrollMode = ScrollMode::eSmoothMsd;
+        scrollMode = ScrollMode::SmoothMsd;
       }
     }
 
     sf->ScrollToCSSPixels(aScroll, scrollMode);
   }
 }
 
 void Element::Scroll(double aXScroll, double aYScroll) {
@@ -851,23 +851,23 @@ void Element::ScrollBy(const ScrollToOpt
     CSSIntPoint scrollDelta;
     if (aOptions.mLeft.WasPassed()) {
       scrollDelta.x = mozilla::ToZeroIfNonfinite(aOptions.mLeft.Value());
     }
     if (aOptions.mTop.WasPassed()) {
       scrollDelta.y = mozilla::ToZeroIfNonfinite(aOptions.mTop.Value());
     }
 
-    ScrollMode scrollMode = ScrollMode::eInstant;
+    ScrollMode scrollMode = ScrollMode::Instant;
     if (aOptions.mBehavior == ScrollBehavior::Smooth) {
-      scrollMode = ScrollMode::eSmoothMsd;
+      scrollMode = ScrollMode::SmoothMsd;
     } else if (aOptions.mBehavior == ScrollBehavior::Auto) {
       ScrollStyles styles = sf->GetScrollStyles();
       if (styles.mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
-        scrollMode = ScrollMode::eSmoothMsd;
+        scrollMode = ScrollMode::SmoothMsd;
       }
     }
 
     sf->ScrollByCSSPixels(scrollDelta, scrollMode, nsGkAtoms::relative);
   }
 }
 
 int32_t Element::ScrollTop() {
@@ -881,20 +881,20 @@ void Element::SetScrollTop(int32_t aScro
   // need to flush frames so we ensure we find the right scrollable frame if
   // there is one.
   //
   // If aScrollTop is nonzero, we need to flush layout because we need to figure
   // out what our real scrollTopMax is.
   FlushType flushType = aScrollTop == 0 ? FlushType::Frames : FlushType::Layout;
   nsIScrollableFrame* sf = GetScrollFrame(nullptr, flushType);
   if (sf) {
-    ScrollMode scrollMode = ScrollMode::eInstant;
+    ScrollMode scrollMode = ScrollMode::Instant;
     if (sf->GetScrollStyles().mScrollBehavior ==
         NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
-      scrollMode = ScrollMode::eSmoothMsd;
+      scrollMode = ScrollMode::SmoothMsd;
     }
     sf->ScrollToCSSPixels(
         CSSIntPoint(sf->GetScrollPositionCSSPixels().x, aScrollTop),
         scrollMode);
   }
 }
 
 int32_t Element::ScrollLeft() {
@@ -903,20 +903,20 @@ int32_t Element::ScrollLeft() {
 }
 
 void Element::SetScrollLeft(int32_t aScrollLeft) {
   // We can't assume things here based on the value of aScrollLeft, because
   // depending on our direction and layout 0 may or may not be in our scroll
   // range.  So we need to flush layout no matter what.
   nsIScrollableFrame* sf = GetScrollFrame();
   if (sf) {
-    ScrollMode scrollMode = ScrollMode::eInstant;
+    ScrollMode scrollMode = ScrollMode::Instant;
     if (sf->GetScrollStyles().mScrollBehavior ==
         NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
-      scrollMode = ScrollMode::eSmoothMsd;
+      scrollMode = ScrollMode::SmoothMsd;
     }
 
     sf->ScrollToCSSPixels(
         CSSIntPoint(aScrollLeft, sf->GetScrollPositionCSSPixels().y),
         scrollMode);
   }
 }
 
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -493,21 +493,21 @@ nsDOMWindowUtils::SetDisplayPortForEleme
     // any more paint requests when it is hidden.
     if (displayport.IsEmpty() &&
         rootFrame == nsLayoutUtils::GetDisplayRootFrame(rootFrame)) {
       nsCOMPtr<nsIWidget> widget = GetWidget();
       if (widget) {
         LayerManager* manager = widget->GetLayerManager();
         manager->BeginTransaction();
         using PaintFrameFlags = nsLayoutUtils::PaintFrameFlags;
-        nsLayoutUtils::PaintFrame(
-            nullptr, rootFrame, nsRegion(), NS_RGB(255, 255, 255),
-            nsDisplayListBuilderMode::PAINTING,
-            PaintFrameFlags::PAINT_WIDGET_LAYERS |
-                PaintFrameFlags::PAINT_EXISTING_TRANSACTION);
+        nsLayoutUtils::PaintFrame(nullptr, rootFrame, nsRegion(),
+                                  NS_RGB(255, 255, 255),
+                                  nsDisplayListBuilderMode::Painting,
+                                  PaintFrameFlags::WidgetLayers |
+                                      PaintFrameFlags::ExistingTransaction);
       }
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -1430,20 +1430,20 @@ nsDOMWindowUtils::ScrollToVisual(float a
       break;
     default:
       return NS_ERROR_INVALID_ARG;
   }
 
   ScrollMode scrollMode;
   switch (aScrollMode) {
     case SCROLL_MODE_INSTANT:
-      scrollMode = ScrollMode::eInstant;
+      scrollMode = ScrollMode::Instant;
       break;
     case SCROLL_MODE_SMOOTH:
-      scrollMode = ScrollMode::eSmoothMsd;
+      scrollMode = ScrollMode::SmoothMsd;
       break;
     default:
       return NS_ERROR_INVALID_ARG;
   }
 
   presContext->PresShell()->ScrollToVisual(
       CSSPoint::ToAppUnits(CSSPoint(aOffsetX, aOffsetY)), updateType,
       scrollMode);
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -3552,17 +3552,17 @@ void nsGlobalWindowInner::ScrollTo(const
     if (scroll.y > maxpx) {
       scroll.y = maxpx;
     }
 
     bool smoothScroll =
         sf->GetScrollStyles().IsSmoothScroll(aOptions.mBehavior);
 
     sf->ScrollToCSSPixels(
-        scroll, smoothScroll ? ScrollMode::eSmoothMsd : ScrollMode::eInstant);
+        scroll, smoothScroll ? ScrollMode::SmoothMsd : ScrollMode::Instant);
   }
 }
 
 void nsGlobalWindowInner::ScrollBy(double aXScrollDif, double aYScrollDif) {
   FlushPendingNotifications(FlushType::Layout);
   nsIScrollableFrame* sf = GetScrollFrame();
 
   if (sf) {
@@ -3584,23 +3584,23 @@ void nsGlobalWindowInner::ScrollBy(const
     CSSIntPoint scrollDelta;
     if (aOptions.mLeft.WasPassed()) {
       scrollDelta.x = mozilla::ToZeroIfNonfinite(aOptions.mLeft.Value());
     }
     if (aOptions.mTop.WasPassed()) {
       scrollDelta.y = mozilla::ToZeroIfNonfinite(aOptions.mTop.Value());
     }
 
-    ScrollMode scrollMode = ScrollMode::eInstant;
+    ScrollMode scrollMode = ScrollMode::Instant;
     if (aOptions.mBehavior == ScrollBehavior::Smooth) {
-      scrollMode = ScrollMode::eSmoothMsd;
+      scrollMode = ScrollMode::SmoothMsd;
     } else if (aOptions.mBehavior == ScrollBehavior::Auto) {
       ScrollStyles styles = sf->GetScrollStyles();
       if (styles.mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
-        scrollMode = ScrollMode::eSmoothMsd;
+        scrollMode = ScrollMode::SmoothMsd;
       }
     }
 
     sf->ScrollByCSSPixels(scrollDelta, scrollMode, nsGkAtoms::relative);
   }
 }
 
 void nsGlobalWindowInner::ScrollByLines(int32_t numLines,
@@ -3610,33 +3610,33 @@ void nsGlobalWindowInner::ScrollByLines(
   if (sf) {
     // It seems like it would make more sense for ScrollByLines to use
     // SMOOTH mode, but tests seem to depend on the synchronous behaviour.
     // Perhaps Web content does too.
     bool smoothScroll =
         sf->GetScrollStyles().IsSmoothScroll(aOptions.mBehavior);
 
     sf->ScrollBy(nsIntPoint(0, numLines), nsIScrollableFrame::LINES,
-                 smoothScroll ? ScrollMode::eSmoothMsd : ScrollMode::eInstant);
+                 smoothScroll ? ScrollMode::SmoothMsd : ScrollMode::Instant);
   }
 }
 
 void nsGlobalWindowInner::ScrollByPages(int32_t numPages,
                                         const ScrollOptions& aOptions) {
   FlushPendingNotifications(FlushType::Layout);
   nsIScrollableFrame* sf = GetScrollFrame();
   if (sf) {
     // It seems like it would make more sense for ScrollByPages to use
     // SMOOTH mode, but tests seem to depend on the synchronous behaviour.
     // Perhaps Web content does too.
     bool smoothScroll =
         sf->GetScrollStyles().IsSmoothScroll(aOptions.mBehavior);
 
     sf->ScrollBy(nsIntPoint(0, numPages), nsIScrollableFrame::PAGES,
-                 smoothScroll ? ScrollMode::eSmoothMsd : ScrollMode::eInstant);
+                 smoothScroll ? ScrollMode::SmoothMsd : ScrollMode::Instant);
   }
 }
 
 void nsGlobalWindowInner::MozScrollSnap() {
   FlushPendingNotifications(FlushType::Layout);
   nsIScrollableFrame* sf = GetScrollFrame();
   if (sf) {
     sf->ScrollSnap();
--- a/dom/base/nsImageLoadingContent.cpp
+++ b/dom/base/nsImageLoadingContent.cpp
@@ -302,17 +302,17 @@ void nsImageLoadingContent::OnUnlockedDr
     return;
   }
 
   nsIFrame* frame = GetOurPrimaryFrame();
   if (!frame) {
     return;
   }
 
-  if (frame->GetVisibility() == Visibility::APPROXIMATELY_VISIBLE) {
+  if (frame->GetVisibility() == Visibility::ApproximatelyVisible) {
     // This frame is already marked visible; there's nothing to do.
     return;
   }
 
   nsPresContext* presContext = frame->PresContext();
   if (!presContext) {
     return;
   }
@@ -1095,17 +1095,17 @@ nsresult nsImageLoadingContent::LoadImag
   AutoRestore<bool> guard(mIsStartingImageLoad);
   mIsStartingImageLoad = true;
 
   // Data documents, or documents from DOMParser shouldn't perform image
   // loading.
   if (aDocument->IsLoadedAsData()) {
     // This is the only codepath on which we can reach SetBlockedRequest while
     // our pending request exists.  Just clear it out here if we do have one.
-    ClearPendingRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DISCARD_IMAGES));
+    ClearPendingRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DiscardImages));
 
     SetBlockedRequest(nsIContentPolicy::REJECT_REQUEST);
 
     FireEvent(NS_LITERAL_STRING("error"));
     FireEvent(NS_LITERAL_STRING("loadend"));
     return NS_OK;
   }
 
@@ -1321,18 +1321,18 @@ void nsImageLoadingContent::UpdateImageS
 
   NS_ASSERTION(thisContent->IsElement(), "Not an element?");
   thisContent->AsElement()->UpdateState(aNotify);
 }
 
 void nsImageLoadingContent::CancelImageRequests(bool aNotify) {
   RejectDecodePromises(NS_ERROR_DOM_IMAGE_INVALID_REQUEST);
   AutoStateChanger changer(this, aNotify);
-  ClearPendingRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DISCARD_IMAGES));
-  ClearCurrentRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DISCARD_IMAGES));
+  ClearPendingRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DiscardImages));
+  ClearCurrentRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DiscardImages));
 }
 
 Document* nsImageLoadingContent::GetOurOwnerDoc() {
   return AsContent()->OwnerDoc();
 }
 
 Document* nsImageLoadingContent::GetOurCurrentDoc() {
   return AsContent()->GetComposedDoc();
@@ -1445,34 +1445,34 @@ void nsImageLoadingContent::SetBlockedRe
 
 RefPtr<imgRequestProxy>& nsImageLoadingContent::PrepareCurrentRequest(
     ImageLoadType aImageLoadType) {
   // Blocked images go through SetBlockedRequest, which is a separate path. For
   // everything else, we're unblocked.
   mImageBlockingStatus = nsIContentPolicy::ACCEPT;
 
   // Get rid of anything that was there previously.
-  ClearCurrentRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DISCARD_IMAGES));
+  ClearCurrentRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DiscardImages));
 
   if (mNewRequestsWillNeedAnimationReset) {
     mCurrentRequestFlags |= REQUEST_NEEDS_ANIMATION_RESET;
   }
 
   if (aImageLoadType == eImageLoadType_Imageset) {
     mCurrentRequestFlags |= REQUEST_IS_IMAGESET;
   }
 
   // Return a reference.
   return mCurrentRequest;
 }
 
 RefPtr<imgRequestProxy>& nsImageLoadingContent::PreparePendingRequest(
     ImageLoadType aImageLoadType) {
   // Get rid of anything that was there previously.
-  ClearPendingRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DISCARD_IMAGES));
+  ClearPendingRequest(NS_BINDING_ABORTED, Some(OnNonvisible::DiscardImages));
 
   if (mNewRequestsWillNeedAnimationReset) {
     mPendingRequestFlags |= REQUEST_NEEDS_ANIMATION_RESET;
   }
 
   if (aImageLoadType == eImageLoadType_Imageset) {
     mPendingRequestFlags |= REQUEST_IS_IMAGESET;
   }
@@ -1628,27 +1628,27 @@ void nsImageLoadingContent::UnbindFromTr
 
   UntrackImage(mCurrentRequest);
   UntrackImage(mPendingRequest);
 }
 
 void nsImageLoadingContent::OnVisibilityChange(
     Visibility aNewVisibility, const Maybe<OnNonvisible>& aNonvisibleAction) {
   switch (aNewVisibility) {
-    case Visibility::APPROXIMATELY_VISIBLE:
+    case Visibility::ApproximatelyVisible:
       TrackImage(mCurrentRequest);
       TrackImage(mPendingRequest);
       break;
 
-    case Visibility::APPROXIMATELY_NONVISIBLE:
+    case Visibility::ApproximatelyNonVisible:
       UntrackImage(mCurrentRequest, aNonvisibleAction);
       UntrackImage(mPendingRequest, aNonvisibleAction);
       break;
 
-    case Visibility::UNTRACKED:
+    case Visibility::Untracked:
       MOZ_ASSERT_UNREACHABLE("Shouldn't notify for untracked visibility");
       break;
   }
 }
 
 void nsImageLoadingContent::TrackImage(imgIRequest* aImage,
                                        nsIFrame* aFrame /*= nullptr */) {
   if (!aImage) return;
@@ -1671,17 +1671,17 @@ void nsImageLoadingContent::TrackImage(i
    * on the display of the element (ie inline, block, etc). Inline, block, etc
    * frames don't register for visibility tracking so they will return UNTRACKED
    * from GetVisibility(). So this line is choosing to mark such images as
    * visible. Once the image loads we will get an nsImageFrame and the proper
    * visibility. This is a pitfall of tracking the visibility on the frames
    * instead of the content node.
    */
   if (!aFrame ||
-      aFrame->GetVisibility() == Visibility::APPROXIMATELY_NONVISIBLE) {
+      aFrame->GetVisibility() == Visibility::ApproximatelyNonVisible) {
     return;
   }
 
   if (aImage == mCurrentRequest &&
       !(mCurrentRequestFlags & REQUEST_IS_TRACKED)) {
     mCurrentRequestFlags |= REQUEST_IS_TRACKED;
     doc->ImageTracker()->Add(mCurrentRequest);
   }
@@ -1705,33 +1705,33 @@ void nsImageLoadingContent::UntrackImage
   // on destruction.  But if we were never in the document we may need to force
   // discarding the image here, since this is the only chance we have.
   Document* doc = GetOurCurrentDoc();
   if (aImage == mCurrentRequest) {
     if (doc && (mCurrentRequestFlags & REQUEST_IS_TRACKED)) {
       mCurrentRequestFlags &= ~REQUEST_IS_TRACKED;
       doc->ImageTracker()->Remove(
           mCurrentRequest,
-          aNonvisibleAction == Some(OnNonvisible::DISCARD_IMAGES)
+          aNonvisibleAction == Some(OnNonvisible::DiscardImages)
               ? ImageTracker::REQUEST_DISCARD
               : 0);
-    } else if (aNonvisibleAction == Some(OnNonvisible::DISCARD_IMAGES)) {
+    } else if (aNonvisibleAction == Some(OnNonvisible::DiscardImages)) {
       // If we're not in the document we may still need to be discarded.
       aImage->RequestDiscard();
     }
   }
   if (aImage == mPendingRequest) {
     if (doc && (mPendingRequestFlags & REQUEST_IS_TRACKED)) {
       mPendingRequestFlags &= ~REQUEST_IS_TRACKED;
       doc->ImageTracker()->Remove(
           mPendingRequest,
-          aNonvisibleAction == Some(OnNonvisible::DISCARD_IMAGES)
+          aNonvisibleAction == Some(OnNonvisible::DiscardImages)
               ? ImageTracker::REQUEST_DISCARD
               : 0);
-    } else if (aNonvisibleAction == Some(OnNonvisible::DISCARD_IMAGES)) {
+    } else if (aNonvisibleAction == Some(OnNonvisible::DiscardImages)) {
       // If we're not in the document we may still need to be discarded.
       aImage->RequestDiscard();
     }
   }
 }
 
 void nsImageLoadingContent::CreateStaticImageClone(
     nsImageLoadingContent* aDest) const {
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -2792,18 +2792,18 @@ static nsresult GetPartialTextRect(nsLay
       }
       r = nsLayoutUtils::TransformFrameRectToAncestor(f, r, relativeTo);
       aCallback->AddRect(r);
 
       // Finally capture the text, if requested.
       if (aTextList) {
         nsIFrame::RenderedText renderedText = f->GetRenderedText(
             textContentStart, textContentEnd,
-            nsIFrame::TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-            nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
+            nsIFrame::TextOffsetType::OffsetsInContentText,
+            nsIFrame::TrailingWhitespace::DontTrim);
 
         aTextList->AppendElement(renderedText.mString, fallible);
       }
     }
   }
   return NS_OK;
 }
 
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2671,31 +2671,31 @@ void EventStateManager::DoScrollText(nsI
 
   bool isDeltaModePixel =
       (aEvent->mDeltaMode == WheelEvent_Binding::DOM_DELTA_PIXEL);
 
   ScrollMode mode;
   switch (aEvent->mScrollType) {
     case WidgetWheelEvent::SCROLL_DEFAULT:
       if (isDeltaModePixel) {
-        mode = ScrollMode::eNormal;
+        mode = ScrollMode::Normal;
       } else if (aEvent->mFlags.mHandledByAPZ) {
-        mode = ScrollMode::eSmoothMsd;
+        mode = ScrollMode::SmoothMsd;
       } else {
-        mode = ScrollMode::eSmooth;
+        mode = ScrollMode::Smooth;
       }
       break;
     case WidgetWheelEvent::SCROLL_SYNCHRONOUSLY:
-      mode = ScrollMode::eInstant;
+      mode = ScrollMode::Instant;
       break;
     case WidgetWheelEvent::SCROLL_ASYNCHRONOUSELY:
-      mode = ScrollMode::eNormal;
+      mode = ScrollMode::Normal;
       break;
     case WidgetWheelEvent::SCROLL_SMOOTHLY:
-      mode = ScrollMode::eSmooth;
+      mode = ScrollMode::Smooth;
       break;
     default:
       MOZ_CRASH("Invalid mScrollType value comes");
   }
 
   nsIScrollableFrame::ScrollMomentum momentum =
       aEvent->mIsMomentum ? nsIScrollableFrame::SYNTHESIZED_MOMENTUM_EVENT
                           : nsIScrollableFrame::NOT_MOMENTUM;
@@ -5705,17 +5705,17 @@ nsresult EventStateManager::DoContentCom
   nsIntPoint pt(0, 0);
   if (aEvent->mScroll.mIsHorizontal) {
     pt.x = aEvent->mScroll.mAmount;
   } else {
     pt.y = aEvent->mScroll.mAmount;
   }
 
   // The caller may want synchronous scrolling.
-  sf->ScrollBy(pt, scrollUnit, ScrollMode::eInstant);
+  sf->ScrollBy(pt, scrollUnit, ScrollMode::Instant);
   return NS_OK;
 }
 
 void EventStateManager::SetActiveManager(EventStateManager* aNewESM,
                                          nsIContent* aContent) {
   if (sActiveESM && aNewESM != sActiveESM) {
     sActiveESM->SetContentState(nullptr, NS_EVENT_STATE_ACTIVE);
   }
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1633,17 +1633,17 @@ void HTMLMediaElement::SetVisible(bool a
   }
 }
 
 bool HTMLMediaElement::IsVideoDecodingSuspended() const {
   return mDecoder && mDecoder->IsVideoDecodingSuspended();
 }
 
 bool HTMLMediaElement::IsVisible() const {
-  return mVisibilityState == Visibility::APPROXIMATELY_VISIBLE;
+  return mVisibilityState == Visibility::ApproximatelyVisible;
 }
 
 already_AddRefed<layers::Image> HTMLMediaElement::GetCurrentImage() {
   MarkAsTainted();
 
   // TODO: In bug 1345404, handle case when video decoder is already suspended.
   ImageContainer* container = GetImageContainer();
   if (!container) {
@@ -4309,17 +4309,17 @@ void HTMLMediaElement::ReportTelemetry()
         }
       }
     }
   }
 }
 
 void HTMLMediaElement::UnbindFromTree(bool aDeep, bool aNullParent) {
   mUnboundFromTree = true;
-  mVisibilityState = Visibility::UNTRACKED;
+  mVisibilityState = Visibility::Untracked;
 
   if (IsInComposedDoc()) {
     NotifyUAWidgetTeardown();
   }
 
   nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
 
   MOZ_ASSERT(IsHidden());
@@ -6347,24 +6347,24 @@ bool HTMLMediaElement::AudioChannelAgent
   // state.
   const auto suspendType = mAudioChannelWrapper->GetSuspendType();
   return suspendType == nsISuspendedTypes::SUSPENDED_PAUSE ||
          suspendType == nsISuspendedTypes::SUSPENDED_BLOCK;
 }
 
 static const char* VisibilityString(Visibility aVisibility) {
   switch (aVisibility) {
-    case Visibility::UNTRACKED: {
-      return "UNTRACKED";
-    }
-    case Visibility::APPROXIMATELY_NONVISIBLE: {
-      return "APPROXIMATELY_NONVISIBLE";
-    }
-    case Visibility::APPROXIMATELY_VISIBLE: {
-      return "APPROXIMATELY_VISIBLE";
+    case Visibility::Untracked: {
+      return "Untracked";
+    }
+    case Visibility::ApproximatelyNonVisible: {
+      return "ApproximatelyNonVisible";
+    }
+    case Visibility::ApproximatelyVisible: {
+      return "ApproximatelyVisible";
     }
   }
 
   return "NAN";
 }
 
 void HTMLMediaElement::OnVisibilityChange(Visibility aNewVisibility) {
   LOG(LogLevel::Debug,
@@ -6375,29 +6375,29 @@ void HTMLMediaElement::OnVisibilityChang
     DispatchAsyncEvent(NS_LITERAL_STRING("visibilitychanged"));
   }
 
   if (!mDecoder) {
     return;
   }
 
   switch (aNewVisibility) {
-    case Visibility::UNTRACKED: {
+    case Visibility::Untracked: {
       MOZ_ASSERT_UNREACHABLE("Shouldn't notify for untracked visibility");
       return;
     }
-    case Visibility::APPROXIMATELY_NONVISIBLE: {
+    case Visibility::ApproximatelyNonVisible: {
       if (mPlayTime.IsStarted()) {
         // Not visible, play time is running -> Start hidden play time if
         // needed.
         HiddenVideoStart();
       }
       break;
     }
-    case Visibility::APPROXIMATELY_VISIBLE: {
+    case Visibility::ApproximatelyVisible: {
       // Visible -> Just pause hidden play time (no-op if already paused).
       HiddenVideoStop();
       break;
     }
   }
 
   NotifyDecoderActivityChanges();
 }
@@ -6937,17 +6937,17 @@ void HTMLMediaElement::NotifyCueDisplayS
   if (!mTextTrackManager) {
     return;
   }
 
   mTextTrackManager->DispatchUpdateCueDisplay();
 }
 
 void HTMLMediaElement::MarkAsContentSource(CallerAPI aAPI) {
-  const bool isVisible = mVisibilityState == Visibility::APPROXIMATELY_VISIBLE;
+  const bool isVisible = mVisibilityState == Visibility::ApproximatelyVisible;
 
   if (isVisible) {
     // 0 = ALL_VISIBLE
     Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 0);
   } else {
     // 1 = ALL_INVISIBLE
     Telemetry::Accumulate(Telemetry::VIDEO_AS_CONTENT_SOURCE, 1);
 
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -1790,17 +1790,17 @@ class HTMLMediaElement : public nsGeneri
   // True if media element has been forced into being considered 'hidden'.
   // For use by mochitests. Enabling pref "media.test.video-suspend"
   bool mForcedHidden = false;
 
   // True if audio tracks and video tracks are constructed and added into the
   // track list, false if all tracks are removed from the track list.
   bool mMediaTracksConstructed = false;
 
-  Visibility mVisibilityState = Visibility::UNTRACKED;
+  Visibility mVisibilityState = Visibility::Untracked;
 
   UniquePtr<ErrorSink> mErrorSink;
 
   // This wrapper will handle all audio channel related stuffs, eg. the
   // operations of tab audio indicator, Fennec's media control. Note:
   // mAudioChannelWrapper might be null after GC happened.
   RefPtr<AudioChannelAgentCallback> mAudioChannelWrapper;
 
--- a/dom/html/ImageDocument.cpp
+++ b/dom/html/ImageDocument.cpp
@@ -418,17 +418,17 @@ void ImageDocument::ScrollImageTo(int32_
   if (ratio <= 0.0) {
     return;
   }
   nsRect portRect = sf->GetScrollPortRect();
   sf->ScrollTo(
       nsPoint(
           nsPresContext::CSSPixelsToAppUnits(aX / ratio) - portRect.width / 2,
           nsPresContext::CSSPixelsToAppUnits(aY / ratio) - portRect.height / 2),
-      ScrollMode::eInstant);
+      ScrollMode::Instant);
 }
 
 void ImageDocument::RestoreImage() {
   if (!mImageContent) {
     return;
   }
   // Keep image content alive while changing the attributes.
   nsCOMPtr<Element> imageContent = mImageContent;
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -636,17 +636,17 @@ nsTextInputSelectionImpl::PageMove(bool 
           nsISelectionController::SCROLL_FOR_CARET_MOVE);
 }
 
 NS_IMETHODIMP
 nsTextInputSelectionImpl::CompleteScroll(bool aForward) {
   if (!mScrollFrame) return NS_ERROR_NOT_INITIALIZED;
 
   mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
-                         nsIScrollableFrame::WHOLE, ScrollMode::eInstant);
+                         nsIScrollableFrame::WHOLE, ScrollMode::Instant);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTextInputSelectionImpl::CompleteMove(bool aForward, bool aExtend) {
   NS_ENSURE_STATE(mFrameSelection);
   RefPtr<nsFrameSelection> frameSelection = mFrameSelection;
 
@@ -679,35 +679,35 @@ nsTextInputSelectionImpl::CompleteMove(b
   return CompleteScroll(aForward);
 }
 
 NS_IMETHODIMP
 nsTextInputSelectionImpl::ScrollPage(bool aForward) {
   if (!mScrollFrame) return NS_ERROR_NOT_INITIALIZED;
 
   mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
-                         nsIScrollableFrame::PAGES, ScrollMode::eSmooth);
+                         nsIScrollableFrame::PAGES, ScrollMode::Smooth);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTextInputSelectionImpl::ScrollLine(bool aForward) {
   if (!mScrollFrame) return NS_ERROR_NOT_INITIALIZED;
 
   mScrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
-                         nsIScrollableFrame::LINES, ScrollMode::eSmooth);
+                         nsIScrollableFrame::LINES, ScrollMode::Smooth);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTextInputSelectionImpl::ScrollCharacter(bool aRight) {
   if (!mScrollFrame) return NS_ERROR_NOT_INITIALIZED;
 
   mScrollFrame->ScrollBy(nsIntPoint(aRight ? 1 : -1, 0),
-                         nsIScrollableFrame::LINES, ScrollMode::eSmooth);
+                         nsIScrollableFrame::LINES, ScrollMode::Smooth);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTextInputSelectionImpl::SelectAll() {
   if (mFrameSelection) {
     RefPtr<nsFrameSelection> frameSelection = mFrameSelection;
     return frameSelection->SelectAll();
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -299,17 +299,17 @@ MediaDecoder::MediaDecoder(MediaDecoderI
       mDuration(std::numeric_limits<double>::quiet_NaN()),
       mOwner(aInit.mOwner),
       mAbstractMainThread(aInit.mOwner->AbstractMainThread()),
       mFrameStats(new FrameStatistics()),
       mVideoFrameContainer(aInit.mOwner->GetVideoFrameContainer()),
       mMinimizePreroll(aInit.mMinimizePreroll),
       mFiredMetadataLoaded(false),
       mIsDocumentVisible(false),
-      mElementVisibility(Visibility::UNTRACKED),
+      mElementVisibility(Visibility::Untracked),
       mIsElementInTree(false),
       mForcedHidden(false),
       mHasSuspendTaint(aInit.mHasSuspendTaint),
       mIsCloningVisually(false),
       mPlaybackRate(aInit.mPlaybackRate),
       mLogicallySeeking(false, "MediaDecoder::mLogicallySeeking"),
       INIT_MIRROR(mBuffered, TimeIntervals()),
       INIT_MIRROR(mCurrentPosition, TimeUnit::Zero()),
@@ -1023,28 +1023,28 @@ void MediaDecoder::UpdateVideoDecodeMode
         "and hovered.");
     mDecoderStateMachine->SetVideoDecodeMode(VideoDecodeMode::Normal);
     return;
   }
 
   // If the element is in-tree with UNTRACKED visibility, that means the element
   // is not close enough to the viewport so we have not start to update its
   // visibility. In this case, it's equals to invisible.
-  if (mIsElementInTree && mElementVisibility == Visibility::UNTRACKED) {
+  if (mIsElementInTree && mElementVisibility == Visibility::Untracked) {
     LOG("UpdateVideoDecodeMode(), set Suspend because element hasn't be "
         "updated visibility state.");
     mDecoderStateMachine->SetVideoDecodeMode(VideoDecodeMode::Suspend);
     return;
   }
 
   // Otherwise, depends on the owner's visibility state.
   // A element is visible only if its document is visible and the element
   // itself is visible.
   if (mIsDocumentVisible &&
-      mElementVisibility == Visibility::APPROXIMATELY_VISIBLE) {
+      mElementVisibility == Visibility::ApproximatelyVisible) {
     LOG("UpdateVideoDecodeMode(), set Normal because the element visible.");
     mDecoderStateMachine->SetVideoDecodeMode(VideoDecodeMode::Normal);
   } else {
     LOG("UpdateVideoDecodeMode(), set Suspend because the element is not "
         "visible.");
     mDecoderStateMachine->SetVideoDecodeMode(VideoDecodeMode::Suspend);
   }
 }
--- a/dom/svg/SVGElement.cpp
+++ b/dom/svg/SVGElement.cpp
@@ -1092,17 +1092,17 @@ void MappedAttrParser::ParseMappedAttrVa
         ParsingMode::AllowUnitlessLength,
         mElement->OwnerDoc()->GetCompatibilityMode(), mLoader, {});
 
     if (changed) {
       // The normal reporting of use counters by the nsCSSParser won't happen
       // since it doesn't have a sheet.
       if (nsCSSProps::IsShorthand(propertyID)) {
         CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subprop, propertyID,
-                                             CSSEnabledState::eForAllContent) {
+                                             CSSEnabledState::ForAllContent) {
           UseCounter useCounter = nsCSSProps::UseCounterFor(*subprop);
           if (useCounter != eUseCounter_UNKNOWN) {
             mElement->OwnerDoc()->SetDocumentAndPageUseCounter(useCounter);
           }
         }
       } else {
         UseCounter useCounter = nsCSSProps::UseCounterFor(propertyID);
         if (useCounter != eUseCounter_UNKNOWN) {
--- a/gfx/thebes/gfxTextRun.h
+++ b/gfx/thebes/gfxTextRun.h
@@ -650,24 +650,24 @@ class gfxTextRun : public gfxShapedText 
       MOZ_MUST_OVERRIDE;
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
       MOZ_MUST_OVERRIDE;
 
   nsTextFrameUtils::Flags GetFlags2() const { return mFlags2; }
 
   // Get the size, if it hasn't already been gotten, marking as it goes.
   size_t MaybeSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) {
-    if (mFlags2 & nsTextFrameUtils::Flags::TEXT_RUN_SIZE_ACCOUNTED) {
+    if (mFlags2 & nsTextFrameUtils::Flags::RunSizeAccounted) {
       return 0;
     }
-    mFlags2 |= nsTextFrameUtils::Flags::TEXT_RUN_SIZE_ACCOUNTED;
+    mFlags2 |= nsTextFrameUtils::Flags::RunSizeAccounted;
     return SizeOfIncludingThis(aMallocSizeOf);
   }
   void ResetSizeOfAccountingFlags() {
-    mFlags2 &= ~nsTextFrameUtils::Flags::TEXT_RUN_SIZE_ACCOUNTED;
+    mFlags2 &= ~nsTextFrameUtils::Flags::RunSizeAccounted;
   }
 
   // shaping state - for some font features, fallback is required that
   // affects the entire run. for example, fallback for one script/font
   // portion of a textrun requires fallback to be applied to the entire run
 
   enum ShapingState : uint8_t {
     eShapingState_Normal,               // default state
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -222,17 +222,17 @@ struct RangePaintInfo {
   nsDisplayListBuilder mBuilder;
   nsDisplayList mList;
 
   // offset of builder's reference frame to the root frame
   nsPoint mRootOffset;
 
   RangePaintInfo(nsRange* aRange, nsIFrame* aFrame)
       : mRange(aRange),
-        mBuilder(aFrame, nsDisplayListBuilderMode::PAINTING, false) {
+        mBuilder(aFrame, nsDisplayListBuilderMode::Painting, false) {
     MOZ_COUNT_CTOR(RangePaintInfo);
     mBuilder.BeginFrame();
   }
 
   ~RangePaintInfo() {
     mList.DeleteAll(&mBuilder);
     mBuilder.EndFrame();
     MOZ_COUNT_DTOR(RangePaintInfo);
@@ -1246,17 +1246,17 @@ void PresShell::Destroy() {
     mDelayedPaintTimer->Cancel();
     mDelayedPaintTimer = nullptr;
   }
 
   mSynthMouseMoveEvent.Revoke();
 
   mUpdateApproximateFrameVisibilityEvent.Revoke();
 
-  ClearApproximatelyVisibleFramesList(Some(OnNonvisible::DISCARD_IMAGES));
+  ClearApproximatelyVisibleFramesList(Some(OnNonvisible::DiscardImages));
 
   if (mCaret) {
     mCaret->Terminate();
     mCaret = nullptr;
   }
 
   if (mSelection) {
     RefPtr<nsFrameSelection> frameSelection = mSelection;
@@ -2266,62 +2266,62 @@ PresShell::PageMove(bool aForward, bool 
 }
 
 NS_IMETHODIMP
 PresShell::ScrollPage(bool aForward) {
   nsIScrollableFrame* scrollFrame =
       GetScrollableFrameToScroll(ScrollableDirection::Vertical);
   if (scrollFrame) {
     scrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
-                          nsIScrollableFrame::PAGES, ScrollMode::eSmooth,
+                          nsIScrollableFrame::PAGES, ScrollMode::Smooth,
                           nullptr, nullptr, nsIScrollableFrame::NOT_MOMENTUM,
                           nsIScrollableFrame::ENABLE_SNAP);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PresShell::ScrollLine(bool aForward) {
   nsIScrollableFrame* scrollFrame =
       GetScrollableFrameToScroll(ScrollableDirection::Vertical);
   if (scrollFrame) {
     int32_t lineCount =
         Preferences::GetInt("toolkit.scrollbox.verticalScrollDistance",
                             NS_DEFAULT_VERTICAL_SCROLL_DISTANCE);
     scrollFrame->ScrollBy(nsIntPoint(0, aForward ? lineCount : -lineCount),
-                          nsIScrollableFrame::LINES, ScrollMode::eSmooth,
+                          nsIScrollableFrame::LINES, ScrollMode::Smooth,
                           nullptr, nullptr, nsIScrollableFrame::NOT_MOMENTUM,
                           nsIScrollableFrame::ENABLE_SNAP);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PresShell::ScrollCharacter(bool aRight) {
   nsIScrollableFrame* scrollFrame =
       GetScrollableFrameToScroll(ScrollableDirection::Horizontal);
   if (scrollFrame) {
     int32_t h =
         Preferences::GetInt("toolkit.scrollbox.horizontalScrollDistance",
                             NS_DEFAULT_HORIZONTAL_SCROLL_DISTANCE);
     scrollFrame->ScrollBy(nsIntPoint(aRight ? h : -h, 0),
-                          nsIScrollableFrame::LINES, ScrollMode::eSmooth,
+                          nsIScrollableFrame::LINES, ScrollMode::Smooth,
                           nullptr, nullptr, nsIScrollableFrame::NOT_MOMENTUM,
                           nsIScrollableFrame::ENABLE_SNAP);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PresShell::CompleteScroll(bool aForward) {
   nsIScrollableFrame* scrollFrame =
       GetScrollableFrameToScroll(ScrollableDirection::Vertical);
   if (scrollFrame) {
     scrollFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
-                          nsIScrollableFrame::WHOLE, ScrollMode::eSmooth,
+                          nsIScrollableFrame::WHOLE, ScrollMode::Smooth,
                           nullptr, nullptr, nsIScrollableFrame::NOT_MOMENTUM,
                           nsIScrollableFrame::ENABLE_SNAP);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PresShell::CompleteMove(bool aForward, bool aExtend) {
@@ -3137,17 +3137,17 @@ nsresult PresShell::GoToAnchor(const nsA
       // Scroll to the top/left if aAnchorName is "top" and there is no element
       // with such a name or id.
       rv = NS_OK;
       nsIScrollableFrame* sf = GetRootScrollFrameAsScrollable();
       // Check |aScroll| after setting |rv| so we set |rv| to the same
       // thing whether or not |aScroll| is true.
       if (aScroll && sf) {
         // Scroll to the top of the page
-        sf->ScrollTo(nsPoint(0, 0), ScrollMode::eInstant);
+        sf->ScrollTo(nsPoint(0, 0), ScrollMode::Instant);
       }
     }
   }
 
 #ifdef ACCESSIBILITY
   if (anchorTarget) {
     nsAccessibilityService* accService = AccService();
     if (accService) accService->NotifyOfAnchorJumpTo(anchorTarget);
@@ -3366,25 +3366,25 @@ static void ScrollToShowRect(nsIScrollab
       allowedRange.width = maxWidth - allowedRange.x;
       needToScroll = true;
     }
   }
 
   // If we don't need to scroll, then don't try since it might cancel
   // a current smooth scroll operation.
   if (needToScroll) {
-    ScrollMode scrollMode = ScrollMode::eInstant;
+    ScrollMode scrollMode = ScrollMode::Instant;
     bool autoBehaviorIsSmooth =
         (aFrameAsScrollable->GetScrollStyles().mScrollBehavior ==
          NS_STYLE_SCROLL_BEHAVIOR_SMOOTH);
     bool smoothScroll = (aScrollFlags & ScrollFlags::ScrollSmooth) ||
                         ((aScrollFlags & ScrollFlags::ScrollSmoothAuto) &&
                          autoBehaviorIsSmooth);
     if (gfxPrefs::ScrollBehaviorEnabled() && smoothScroll) {
-      scrollMode = ScrollMode::eSmoothMsd;
+      scrollMode = ScrollMode::SmoothMsd;
     }
     aFrameAsScrollable->ScrollTo(scrollPt, scrollMode, &allowedRange,
                                  aScrollFlags & ScrollFlags::ScrollSnap
                                      ? nsIScrollbarMediator::ENABLE_SNAP
                                      : nsIScrollbarMediator::DISABLE_SNAP);
   }
 }
 
@@ -4471,68 +4471,67 @@ nsresult PresShell::RenderDocument(const
                         .PreTranslate(offset)
                         .PreScale(scale, scale)
                         .NudgeToIntegers();
   aThebesContext->SetMatrixDouble(newTM);
 
   AutoSaveRestoreRenderingState _(this);
 
   bool wouldFlushRetainedLayers = false;
-  PaintFrameFlags flags = PaintFrameFlags::PAINT_IGNORE_SUPPRESSION;
+  PaintFrameFlags flags = PaintFrameFlags::IgnoreSuppression;
   if (aThebesContext->CurrentMatrix().HasNonIntegerTranslation()) {
-    flags |= PaintFrameFlags::PAINT_IN_TRANSFORM;
+    flags |= PaintFrameFlags::InTransform;
   }
   if (!(aFlags & RenderDocumentFlags::AsyncDecodeImages)) {
-    flags |= PaintFrameFlags::PAINT_SYNC_DECODE_IMAGES;
+    flags |= PaintFrameFlags::SyncDecodeImages;
   }
   if (aFlags & RenderDocumentFlags::UseWidgetLayers) {
     // We only support using widget layers on display root's with widgets.
     nsView* view = rootFrame->GetView();
     if (view && view->GetWidget() &&
         nsLayoutUtils::GetDisplayRootFrame(rootFrame) == rootFrame) {
       LayerManager* layerManager = view->GetWidget()->GetLayerManager();
       // ClientLayerManagers or WebRenderLayerManagers in content processes
       // don't support taking snapshots.
       if (layerManager &&
           (!layerManager->AsKnowsCompositor() || XRE_IsParentProcess())) {
-        flags |= PaintFrameFlags::PAINT_WIDGET_LAYERS;
+        flags |= PaintFrameFlags::WidgetLayers;
       }
     }
   }
   if (!(aFlags & RenderDocumentFlags::DrawCaret)) {
     wouldFlushRetainedLayers = true;
-    flags |= PaintFrameFlags::PAINT_HIDE_CARET;
+    flags |= PaintFrameFlags::HideCaret;
   }
   if (aFlags & RenderDocumentFlags::IgnoreViewportScrolling) {
     wouldFlushRetainedLayers = !IgnoringViewportScrolling();
     mRenderFlags =
         ChangeFlag(mRenderFlags, true, STATE_IGNORING_VIEWPORT_SCROLLING);
   }
   if (aFlags & RenderDocumentFlags::DrawWindowNotFlushing) {
     mRenderFlags =
         ChangeFlag(mRenderFlags, true, STATE_DRAWWINDOW_NOT_FLUSHING);
   }
   if (aFlags & RenderDocumentFlags::DocumentRelative) {
     // XXX be smarter about this ... drawWindow might want a rect
     // that's "pretty close" to what our retained layer tree covers.
     // In that case, it wouldn't disturb normal rendering too much,
     // and we should allow it.
     wouldFlushRetainedLayers = true;
-    flags |= PaintFrameFlags::PAINT_DOCUMENT_RELATIVE;
+    flags |= PaintFrameFlags::DocumentRelative;
   }
 
   // Don't let drawWindow blow away our retained layer tree
-  if ((flags & PaintFrameFlags::PAINT_WIDGET_LAYERS) &&
-      wouldFlushRetainedLayers) {
-    flags &= ~PaintFrameFlags::PAINT_WIDGET_LAYERS;
+  if ((flags & PaintFrameFlags::WidgetLayers) && wouldFlushRetainedLayers) {
+    flags &= ~PaintFrameFlags::WidgetLayers;
   }
 
   nsLayoutUtils::PaintFrame(aThebesContext, rootFrame, nsRegion(aRect),
                             aBackgroundColor,
-                            nsDisplayListBuilderMode::PAINTING, flags);
+                            nsDisplayListBuilderMode::Painting, flags);
 
   return NS_OK;
 }
 
 /*
  * Clip the display list aList to a range. Returns the clipped
  * rectangle surrounding the range.
  */
@@ -5555,17 +5554,17 @@ void PresShell::ClearApproximatelyVisibl
 }
 
 void PresShell::MarkFramesInSubtreeApproximatelyVisible(
     nsIFrame* aFrame, const nsRect& aRect, bool aRemoveOnly /* = false */) {
   MOZ_ASSERT(aFrame->PresShell() == this, "wrong presshell");
 
   if (aFrame->TrackingVisibility() && aFrame->StyleVisibility()->IsVisible() &&
       (!aRemoveOnly ||
-       aFrame->GetVisibility() == Visibility::APPROXIMATELY_VISIBLE)) {
+       aFrame->GetVisibility() == Visibility::ApproximatelyVisible)) {
     MOZ_ASSERT(!AssumeAllFramesVisible());
     if (mApproximatelyVisibleFrames.EnsureInserted(aFrame)) {
       // The frame was added to mApproximatelyVisibleFrames, so increment its
       // visible count.
       aFrame->IncApproximateVisibleCount();
     }
   }
 
@@ -5702,17 +5701,17 @@ void PresShell::DoUpdateApproximateFrame
 
   if (mHaveShutDown || mIsDestroying) {
     return;
   }
 
   // call update on that frame
   nsIFrame* rootFrame = GetRootFrame();
   if (!rootFrame) {
-    ClearApproximatelyVisibleFramesList(Some(OnNonvisible::DISCARD_IMAGES));
+    ClearApproximatelyVisibleFramesList(Some(OnNonvisible::DiscardImages));
     return;
   }
 
   RebuildApproximateFrameVisibility(/* aRect = */ nullptr, aRemoveOnly);
   ClearApproximateFrameVisibilityVisited(rootFrame->GetView(), true);
 
 #ifdef DEBUG_FRAME_VISIBILITY_DISPLAY_LIST
   // This can be used to debug the frame walker by comparing beforeFrameList
@@ -6053,36 +6052,36 @@ void PresShell::Paint(nsView* aViewToPai
     }
     frame->RemoveStateBits(NS_FRAME_UPDATE_LAYER_TREE);
   }
   if (frame) {
     frame->ClearPresShellsFromLastPaint();
   }
 
   nscolor bgcolor = ComputeBackstopColor(aViewToPaint);
-  PaintFrameFlags flags = PaintFrameFlags::PAINT_WIDGET_LAYERS |
-                          PaintFrameFlags::PAINT_EXISTING_TRANSACTION;
+  PaintFrameFlags flags =
+      PaintFrameFlags::WidgetLayers | PaintFrameFlags::ExistingTransaction;
   if (!(aFlags & PaintFlags::PaintComposite)) {
-    flags |= PaintFrameFlags::PAINT_NO_COMPOSITE;
+    flags |= PaintFrameFlags::NoComposite;
   }
   if (aFlags & PaintFlags::PaintSyncDecodeImages) {
-    flags |= PaintFrameFlags::PAINT_SYNC_DECODE_IMAGES;
+    flags |= PaintFrameFlags::SyncDecodeImages;
   }
   if (mNextPaintCompressed) {
-    flags |= PaintFrameFlags::PAINT_COMPRESSED;
+    flags |= PaintFrameFlags::Compressed;
     mNextPaintCompressed = false;
   }
   if (layerManager->GetBackendType() == layers::LayersBackend::LAYERS_WR) {
-    flags |= PaintFrameFlags::PAINT_FOR_WEBRENDER;
+    flags |= PaintFrameFlags::ForWebRender;
   }
 
   if (frame) {
     // We can paint directly into the widget using its layer manager.
     nsLayoutUtils::PaintFrame(nullptr, frame, aDirtyRegion, bgcolor,
-                              nsDisplayListBuilderMode::PAINTING, flags);
+                              nsDisplayListBuilderMode::Painting, flags);
 
     // When recording/replaying, create a checkpoint after every paint. This
     // can cause content JS to run, so reset |nojs|.
     if (recordreplay::IsRecordingOrReplaying()) {
       nojs.reset();
       recordreplay::child::CreateCheckpoint();
     }
 
@@ -7997,43 +7996,41 @@ void PresShell::EventHandler::RecordEven
   MOZ_ASSERT(aEvent);
 
   switch (aEvent->mMessage) {
     case eKeyPress:
     case eKeyDown:
     case eKeyUp:
       if (aEvent->AsKeyboardEvent()->ShouldInteractionTimeRecorded()) {
         GetPresContext()->RecordInteractionTime(
-            nsPresContext::InteractionType::eKeyInteraction,
-            aEvent->mTimeStamp);
+            nsPresContext::InteractionType::KeyInteraction, aEvent->mTimeStamp);
       }
       Telemetry::AccumulateTimeDelta(Telemetry::INPUT_EVENT_QUEUED_KEYBOARD_MS,
                                      aEvent->mTimeStamp);
       return;
 
     case eMouseDown:
     case eMouseUp:
       Telemetry::AccumulateTimeDelta(Telemetry::INPUT_EVENT_QUEUED_CLICK_MS,
                                      aEvent->mTimeStamp);
       MOZ_FALLTHROUGH;
     case ePointerDown:
     case ePointerUp:
       GetPresContext()->RecordInteractionTime(
-          nsPresContext::InteractionType::eClickInteraction,
-          aEvent->mTimeStamp);
+          nsPresContext::InteractionType::ClickInteraction, aEvent->mTimeStamp);
       return;
 
     case eMouseMove:
       if (aEvent->mFlags.mHandledByAPZ) {
         Telemetry::AccumulateTimeDelta(
             Telemetry::INPUT_EVENT_QUEUED_APZ_MOUSE_MOVE_MS,
             aEvent->mTimeStamp);
       }
       GetPresContext()->RecordInteractionTime(
-          nsPresContext::InteractionType::eMouseMoveInteraction,
+          nsPresContext::InteractionType::MouseMoveInteraction,
           aEvent->mTimeStamp);
       return;
 
     case eWheel:
       if (aEvent->mFlags.mHandledByAPZ) {
         Telemetry::AccumulateTimeDelta(
             Telemetry::INPUT_EVENT_QUEUED_APZ_WHEEL_MS, aEvent->mTimeStamp);
       }
@@ -10618,19 +10615,19 @@ bool nsIPresShell::SetVisualViewportOffs
     }
   }
   return didChange;
 }
 
 void nsIPresShell::ScrollToVisual(
     const nsPoint& aVisualViewportOffset,
     FrameMetrics::ScrollOffsetUpdateType aUpdateType, ScrollMode aMode) {
-  MOZ_ASSERT(aMode == ScrollMode::eInstant || aMode == ScrollMode::eSmoothMsd);
-
-  if (aMode == ScrollMode::eSmoothMsd) {
+  MOZ_ASSERT(aMode == ScrollMode::Instant || aMode == ScrollMode::SmoothMsd);
+
+  if (aMode == ScrollMode::SmoothMsd) {
     if (nsIScrollableFrame* sf = GetRootScrollFrameAsScrollable()) {
       if (sf->SmoothScrollVisual(aVisualViewportOffset, aUpdateType)) {
         return;
       }
     }
   }
 
   // If the caller asked for instant scroll, or if we failed
--- a/layout/base/ScrollTypes.h
+++ b/layout/base/ScrollTypes.h
@@ -34,13 +34,13 @@ namespace mozilla {
  * If an |eInstant| scroll request happens while a |eSmooth| or async scroll is
  * already in progress, the async scroll is interrupted and we instantly
  * scroll to the destination.
  *
  * If an |eInstant| or |eSmooth| scroll request happens while a |eSmoothMsd|
  * scroll is already in progress, the |eSmoothMsd| scroll is interrupted without
  * first scrolling to the destination.
  */
-enum class ScrollMode { eInstant, eSmooth, eSmoothMsd, eNormal };
+enum class ScrollMode { Instant, Smooth, SmoothMsd, Normal };
 
 }  // namespace mozilla
 
 #endif  // mozilla_ScrollTypes_h
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -3614,17 +3614,17 @@ nsDocumentViewer::PrintPreviewNavigate(i
   nsIScrollableFrame* sf =
       mPrintJob->GetPrintPreviewPresShell()->GetRootScrollFrameAsScrollable();
   if (!sf) return NS_OK;
 
   // Check to see if we can short circut scrolling to the top
   if (aType == nsIWebBrowserPrint::PRINTPREVIEW_HOME ||
       (aType == nsIWebBrowserPrint::PRINTPREVIEW_GOTO_PAGENUM &&
        aPageNum == 1)) {
-    sf->ScrollTo(nsPoint(0, 0), ScrollMode::eInstant);
+    sf->ScrollTo(nsPoint(0, 0), ScrollMode::Instant);
     return NS_OK;
   }
 
   // Finds the SimplePageSequencer frame
   // in PP mPrtPreview->mPrintObject->mSeqFrame is null
   nsIFrame* seqFrame = nullptr;
   int32_t pageCount = 0;
   if (NS_FAILED(mPrintJob->GetSeqFrameAndCountPages(seqFrame, pageCount))) {
@@ -3680,17 +3680,17 @@ nsDocumentViewer::PrintPreviewNavigate(i
     if (aPageNum < 0 || aPageNum > pageCount) {
       return NS_OK;
     }
   }
 
   if (fndPageFrame) {
     nscoord newYPosn = nscoord(mPrintJob->GetPrintPreviewScale() *
                                fndPageFrame->GetPosition().y);
-    sf->ScrollTo(nsPoint(pt.x, newYPosn), ScrollMode::eInstant);
+    sf->ScrollTo(nsPoint(pt.x, newYPosn), ScrollMode::Instant);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocumentViewer::GetGlobalPrintSettings(
     nsIPrintSettings** aGlobalPrintSettings) {
   return nsPrintJob::GetGlobalPrintSettings(aGlobalPrintSettings);
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1090,25 +1090,25 @@ bool nsLayoutUtils::IsMissingDisplayPort
   }
 
   return false;
 }
 
 enum class MaxSizeExceededBehaviour {
   // Ask GetDisplayPortImpl to assert if the calculated displayport exceeds
   // the maximum allowed size.
-  eAssert,
+  Assert,
   // Ask GetDisplayPortImpl to pretend like there's no displayport at all, if
   // the calculated displayport exceeds the maximum allowed size.
-  eDrop,
+  Drop,
 };
 
 static bool GetDisplayPortImpl(
     nsIContent* aContent, nsRect* aResult, float aMultiplier,
-    MaxSizeExceededBehaviour aBehaviour = MaxSizeExceededBehaviour::eAssert) {
+    MaxSizeExceededBehaviour aBehaviour = MaxSizeExceededBehaviour::Assert) {
   DisplayPortPropertyData* rectData = nullptr;
   DisplayPortMarginsPropertyData* marginsData = nullptr;
 
   if (!GetDisplayPortData(aContent, &rectData, &marginsData)) {
     return false;
   }
 
   if (!aResult) {
@@ -1140,20 +1140,20 @@ static bool GetDisplayPortImpl(
   }
 
   if (!gfxPrefs::LayersTilesEnabled()) {
     // Perform the desired error handling if the displayport dimensions
     // exceeds the maximum allowed size
     nscoord maxSize = GetMaxDisplayPortSize(aContent, nullptr);
     if (result.width > maxSize || result.height > maxSize) {
       switch (aBehaviour) {
-        case MaxSizeExceededBehaviour::eAssert:
+        case MaxSizeExceededBehaviour::Assert:
           NS_ASSERTION(false, "Displayport must be a valid texture size");
           break;
-        case MaxSizeExceededBehaviour::eDrop:
+        case MaxSizeExceededBehaviour::Drop:
           return false;
       }
     }
   }
 
   *aResult = result;
   return true;
 }
@@ -1192,17 +1192,17 @@ bool nsLayoutUtils::GetDisplayPortForVis
     RelativeTo aRelativeTo /* = RelativeTo::ScrollPort */) {
   MOZ_ASSERT(aResult);
   // Since the base rect might not have been updated very recently, it's
   // possible to end up with an extra-large displayport at this point, if the
   // zoom level is changed by a lot. Instead of using the default behaviour of
   // asserting, we can just ignore the displayport if that happens, as this
   // call site is best-effort.
   bool usingDisplayPort = GetDisplayPortImpl(aContent, aResult, 1.0f,
-                                             MaxSizeExceededBehaviour::eDrop);
+                                             MaxSizeExceededBehaviour::Drop);
   if (usingDisplayPort && aRelativeTo == RelativeTo::ScrollFrame) {
     TranslateFromScrollPortToScrollFrame(aContent, aResult);
   }
   return usingDisplayPort;
 }
 
 void nsLayoutUtils::InvalidateForDisplayPortChange(
     nsIContent* aContent, bool aHadDisplayPort, const nsRect& aOldDisplayPort,
@@ -2885,17 +2885,17 @@ bool nsLayoutUtils::GetLayerTransformFor
   }
   // If the caller doesn't care about the value, early-return to skip
   // overhead below.
   if (!aTransform) {
     return true;
   }
 
   nsDisplayListBuilder builder(root,
-                               nsDisplayListBuilderMode::TRANSFORM_COMPUTATION,
+                               nsDisplayListBuilderMode::TransformComputation,
                                false /*don't build caret*/);
   builder.BeginFrame();
   nsDisplayList list;
   nsDisplayTransform* item =
       MakeDisplayItem<nsDisplayTransform>(&builder, aFrame, &list, nsRect(), 0);
   MOZ_ASSERT(item);
 
   *aTransform = item->GetTransform();
@@ -3159,17 +3159,17 @@ nsIFrame* nsLayoutUtils::GetFrameForPoin
   return outFrames.Length() ? outFrames.ElementAt(0) : nullptr;
 }
 
 nsresult nsLayoutUtils::GetFramesForArea(
     nsIFrame* aFrame, const nsRect& aRect, nsTArray<nsIFrame*>& aOutFrames,
     EnumSet<FrameForPointOption> aOptions) {
   AUTO_PROFILER_LABEL("nsLayoutUtils::GetFramesForArea", LAYOUT);
 
-  nsDisplayListBuilder builder(aFrame, nsDisplayListBuilderMode::EVENT_DELIVERY,
+  nsDisplayListBuilder builder(aFrame, nsDisplayListBuilderMode::EventDelivery,
                                false);
   builder.BeginFrame();
   nsDisplayList list;
 
   if (aOptions.contains(FrameForPointOption::IgnorePaintSuppression)) {
     builder.IgnorePaintSuppression();
   }
   if (aOptions.contains(FrameForPointOption::IgnoreRootScrollFrame)) {
@@ -3488,17 +3488,17 @@ static RetainedDisplayListBuilder* GetOr
       aFrame->GetProperty(RetainedDisplayListBuilder::Cached());
 
   if (retainedBuilder) {
     return retainedBuilder;
   }
 
   if (aRetainingEnabled) {
     retainedBuilder = new RetainedDisplayListBuilder(
-        aFrame, nsDisplayListBuilderMode::PAINTING, aBuildCaret);
+        aFrame, nsDisplayListBuilderMode::Painting, aBuildCaret);
     aFrame->SetProperty(RetainedDisplayListBuilder::Cached(), retainedBuilder);
   }
 
   return retainedBuilder;
 }
 
 // #define PRINT_HITTESTINFO_STATS
 #ifdef PRINT_HITTESTINFO_STATS
@@ -3566,36 +3566,36 @@ nsresult nsLayoutUtils::PaintFrame(gfxCo
     ClearOnShutdown(&gPaintCountStack);
 
     gPaintCountStack->AppendElement(0);
   }
   ++gPaintCountStack->LastElement();
   AutoNestedPaintCount nestedPaintCount;
 #endif
 
-  if (aFlags & PaintFrameFlags::PAINT_WIDGET_LAYERS) {
+  if (aFlags & PaintFrameFlags::WidgetLayers) {
     nsView* view = aFrame->GetView();
     if (!(view && view->GetWidget() && GetDisplayRootFrame(aFrame) == aFrame)) {
-      aFlags &= ~PaintFrameFlags::PAINT_WIDGET_LAYERS;
+      aFlags &= ~PaintFrameFlags::WidgetLayers;
       NS_ASSERTION(aRenderingContext, "need a rendering context");
     }
   }
 
   nsPresContext* presContext = aFrame->PresContext();
   PresShell* presShell = presContext->PresShell();
   nsRootPresContext* rootPresContext = presContext->GetRootPresContext();
   if (!rootPresContext) {
     return NS_OK;
   }
 
   TimeStamp startBuildDisplayList = TimeStamp::Now();
 
-  const bool buildCaret = !(aFlags & PaintFrameFlags::PAINT_HIDE_CARET);
-  const bool isForPainting = (aFlags & PaintFrameFlags::PAINT_WIDGET_LAYERS) &&
-                             aBuilderMode == nsDisplayListBuilderMode::PAINTING;
+  const bool buildCaret = !(aFlags & PaintFrameFlags::HideCaret);
+  const bool isForPainting = (aFlags & PaintFrameFlags::WidgetLayers) &&
+                             aBuilderMode == nsDisplayListBuilderMode::Painting;
 
   // Only allow retaining for painting when preffed on, and for root frames
   // (since the modified frame tracking is per-root-frame).
   const bool retainingEnabled =
       isForPainting && AreRetainedDisplayListsEnabled() && !aFrame->GetParent();
 
   RetainedDisplayListBuilder* retainedBuilder =
       GetOrCreateRetainedDisplayListBuilder(aFrame, retainingEnabled,
@@ -3630,30 +3630,29 @@ nsresult nsLayoutUtils::PaintFrame(gfxCo
     retainedBuilder->List()->DeleteAll(retainedBuilder->Builder());
   }
 
   nsDisplayListBuilder& builder = *builderPtr;
   nsDisplayList& list = *listPtr;
 
   builder.BeginFrame();
 
-  if (aFlags & PaintFrameFlags::PAINT_IN_TRANSFORM) {
+  if (aFlags & PaintFrameFlags::InTransform) {
     builder.SetInTransform(true);
   }
-  if (aFlags & PaintFrameFlags::PAINT_SYNC_DECODE_IMAGES) {
+  if (aFlags & PaintFrameFlags::SyncDecodeImages) {
     builder.SetSyncDecodeImages(true);
   }
-  if (aFlags & (PaintFrameFlags::PAINT_WIDGET_LAYERS |
-                PaintFrameFlags::PAINT_TO_WINDOW)) {
+  if (aFlags & (PaintFrameFlags::WidgetLayers | PaintFrameFlags::ToWindow)) {
     builder.SetPaintingToWindow(true);
   }
-  if (aFlags & PaintFrameFlags::PAINT_FOR_WEBRENDER) {
+  if (aFlags & PaintFrameFlags::ForWebRender) {
     builder.SetPaintingForWebRender(true);
   }
-  if (aFlags & PaintFrameFlags::PAINT_IGNORE_SUPPRESSION) {
+  if (aFlags & PaintFrameFlags::IgnoreSuppression) {
     builder.IgnorePaintSuppression();
   }
 
   if (nsIDocShell* doc = presContext->GetDocShell()) {
     bool isActive = false;
     doc->GetIsActive(&isActive);
     builder.SetInActiveDocShell(isActive);
   }
@@ -3666,47 +3665,47 @@ nsresult nsLayoutUtils::PaintFrame(gfxCo
     nsRect displayPortBase = aFrame->GetVisualOverflowRectRelativeToSelf();
     nsRect temp = displayPortBase;
     Unused << rootScrollableFrame->DecideScrollableLayer(
         &builder, &displayPortBase, &temp,
         /* aSetBase = */ true);
   }
 
   nsRegion visibleRegion;
-  if (aFlags & PaintFrameFlags::PAINT_WIDGET_LAYERS) {
+  if (aFlags & PaintFrameFlags::WidgetLayers) {
     // This layer tree will be reused, so we'll need to calculate it
     // for the whole "visible" area of the window
     //
     // |ignoreViewportScrolling| and |usingDisplayPort| are persistent
     // document-rendering state.  We rely on PresShell to flush
     // retained layers as needed when that persistent state changes.
     visibleRegion = aFrame->GetVisualOverflowRectRelativeToSelf();
   } else {
     visibleRegion = aDirtyRegion;
   }
 
   // If the root has embedded plugins, flag the builder so we know we'll need
   // to update plugin geometry after painting.
-  if ((aFlags & PaintFrameFlags::PAINT_WIDGET_LAYERS) &&
-      !(aFlags & PaintFrameFlags::PAINT_DOCUMENT_RELATIVE) &&
+  if ((aFlags & PaintFrameFlags::WidgetLayers) &&
+      !(aFlags & PaintFrameFlags::DocumentRelative) &&
       rootPresContext->NeedToComputePluginGeometryUpdates()) {
     builder.SetWillComputePluginGeometry(true);
 
     // Disable partial updates for this paint as the list we're about to
     // build has plugin-specific differences that won't trigger invalidations.
     builder.SetDisablePartialUpdates(true);
   }
 
   nsRect canvasArea(nsPoint(0, 0), aFrame->GetSize());
   bool ignoreViewportScrolling =
       aFrame->GetParent() ? false : presShell->IgnoringViewportScrolling();
   if (ignoreViewportScrolling && rootScrollFrame) {
     nsIScrollableFrame* rootScrollableFrame =
         presShell->GetRootScrollFrameAsScrollable();
-    if (aFlags & PaintFrameFlags::PAINT_DOCUMENT_RELATIVE) {
+    if (aFlags & PaintFrameFlags::DocumentRelative) {
       // Make visibleRegion and aRenderingContext relative to the
       // scrolled frame instead of the root frame.
       nsPoint pos = rootScrollableFrame->GetScrollPosition();
       visibleRegion.MoveBy(-pos);
       if (aRenderingContext) {
         gfxPoint devPixelOffset = nsLayoutUtils::PointToGfxPoint(
             pos, presContext->AppUnitsPerDevPixel());
         aRenderingContext->SetMatrixDouble(
@@ -3947,35 +3946,35 @@ nsresult nsLayoutUtils::PaintFrame(gfxCo
       // Flush stream now to avoid reordering dump output relative to
       // messages dumped by PaintRoot below.
       fprint_stderr(gfxUtils::sDumpPaintFile, *ss);
       ss = MakeUnique<std::stringstream>();
     }
   }
 
   uint32_t flags = nsDisplayList::PAINT_DEFAULT;
-  if (aFlags & PaintFrameFlags::PAINT_WIDGET_LAYERS) {
+  if (aFlags & PaintFrameFlags::WidgetLayers) {
     flags |= nsDisplayList::PAINT_USE_WIDGET_LAYERS;
-    if (!(aFlags & PaintFrameFlags::PAINT_DOCUMENT_RELATIVE)) {
+    if (!(aFlags & PaintFrameFlags::DocumentRelative)) {
       nsIWidget* widget = aFrame->GetNearestWidget();
       if (widget) {
         // If we're finished building display list items for painting of the
         // outermost pres shell, notify the widget about any toolbars we've
         // encountered.
         widget->UpdateThemeGeometries(builder.GetThemeGeometries());
       }
     }
   }
-  if (aFlags & PaintFrameFlags::PAINT_EXISTING_TRANSACTION) {
+  if (aFlags & PaintFrameFlags::ExistingTransaction) {
     flags |= nsDisplayList::PAINT_EXISTING_TRANSACTION;
   }
-  if (aFlags & PaintFrameFlags::PAINT_NO_COMPOSITE) {
+  if (aFlags & PaintFrameFlags::NoComposite) {
     flags |= nsDisplayList::PAINT_NO_COMPOSITE;
   }
-  if (aFlags & PaintFrameFlags::PAINT_COMPRESSED) {
+  if (aFlags & PaintFrameFlags::Compressed) {
     flags |= nsDisplayList::PAINT_COMPRESSED;
   }
   if (updateState == PartialUpdateResult::NoChange && !aRenderingContext) {
     flags |= nsDisplayList::PAINT_IDENTICAL_DISPLAY_LIST;
   }
 
 #ifdef PRINT_HITTESTINFO_STATS
   if (XRE_IsContentProcess()) {
@@ -4051,18 +4050,18 @@ nsresult nsLayoutUtils::PaintFrame(gfxCo
     FrameLayerBuilder::DumpRetainedLayerTree(layerManager, ss, false);
     print_stderr(ss);
   }
 #endif
 
   // Update the widget's opaque region information. This sets
   // glass boundaries on Windows. Also set up the window dragging region
   // and plugin clip regions and bounds.
-  if ((aFlags & PaintFrameFlags::PAINT_WIDGET_LAYERS) &&
-      !(aFlags & PaintFrameFlags::PAINT_DOCUMENT_RELATIVE)) {
+  if ((aFlags & PaintFrameFlags::WidgetLayers) &&
+      !(aFlags & PaintFrameFlags::DocumentRelative)) {
     nsIWidget* widget = aFrame->GetNearestWidget();
     if (widget) {
       nsRegion opaqueRegion;
       opaqueRegion.And(builder.GetWindowExcludeGlassRegion(),
                        builder.GetWindowOpaqueRegion());
       widget->UpdateOpaqueRegion(LayoutDeviceIntRegion::FromUnknownRegion(
           opaqueRegion.ToNearestPixels(presContext->AppUnitsPerDevPixel())));
 
@@ -4287,18 +4286,18 @@ struct MOZ_RAII BoxToRectAndText : publi
     // Get all the text in aFrame and child frames, while respecting
     // the content offsets in each of the nsTextFrames.
     if (aFrame->IsTextFrame()) {
       nsTextFrame* textFrame = static_cast<nsTextFrame*>(aFrame);
 
       nsIFrame::RenderedText renderedText = textFrame->GetRenderedText(
           textFrame->GetContentOffset(),
           textFrame->GetContentOffset() + textFrame->GetContentLength(),
-          nsIFrame::TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-          nsIFrame::TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
+          nsIFrame::TextOffsetType::OffsetsInContentText,
+          nsIFrame::TrailingWhitespace::DontTrim);
 
       aResult.Append(renderedText.mString);
     }
 
     for (nsIFrame* child = aFrame->PrincipalChildList().FirstChild(); child;
          child = child->GetNextSibling()) {
       AccumulateText(child, aResult);
     }
@@ -6029,17 +6028,17 @@ void nsLayoutUtils::DrawString(const nsI
                                DrawStringFlags aFlags) {
   nsresult rv = NS_ERROR_FAILURE;
 
   // If caller didn't pass a style, use the frame's.
   if (!aComputedStyle) {
     aComputedStyle = aFrame->Style();
   }
 
-  if (aFlags & DrawStringFlags::eForceHorizontal) {
+  if (aFlags & DrawStringFlags::ForceHorizontal) {
     aFontMetrics.SetVertical(false);
   } else {
     aFontMetrics.SetVertical(WritingMode(aComputedStyle).IsVertical());
   }
 
   aFontMetrics.SetTextOrientation(
       aComputedStyle->StyleVisibility()->mTextOrientation);
 
@@ -6199,17 +6198,17 @@ bool nsLayoutUtils::GetFirstLinePosition
           (fType == LayoutFrameType::FlexContainer &&
            aFrame->HasAnyStateBits(NS_STATE_FLEX_SYNTHESIZE_BASELINE)) ||
           (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);
+            aWM, BaselineSharingGroup::First);
         aResult->mBEnd = aFrame->BSize(aWM);
         return true;
       }
       aResult->mBStart = 0;
       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);
@@ -8906,17 +8905,17 @@ ScrollMetadata nsLayoutUtils::ComputeScr
     metrics.SetBaseScrollOffset(apzScrollPosition);
 
     if (aIsRootContent) {
       if (aLayerManager->GetIsFirstPaint() &&
           presShell->IsVisualViewportOffsetSet()) {
         // Restore the visual viewport offset to the copy stored on the
         // main thread.
         presShell->ScrollToVisual(presShell->GetVisualViewportOffset(),
-                                  FrameMetrics::eRestore, ScrollMode::eInstant);
+                                  FrameMetrics::eRestore, ScrollMode::Instant);
       }
 
       if (const Maybe<nsIPresShell::VisualScrollUpdate>& visualUpdate =
               presShell->GetPendingVisualScrollUpdate()) {
         metrics.SetVisualViewportOffset(
             CSSPoint::FromAppUnits(visualUpdate->mVisualScrollOffset));
         metrics.SetVisualScrollUpdateType(visualUpdate->mUpdateType);
         presShell->ClearPendingVisualScrollUpdate();
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -124,18 +124,18 @@ struct MotionPathData {
 
 }  // namespace mozilla
 
 // For GetDisplayPort
 enum class RelativeTo { ScrollPort, ScrollFrame };
 
 // Flags to customize the behavior of nsLayoutUtils::DrawString.
 enum class DrawStringFlags {
-  eDefault = 0x0,
-  eForceHorizontal = 0x1  // Forces the text to be drawn horizontally.
+  Default = 0x0,
+  ForceHorizontal = 0x1  // Forces the text to be drawn horizontally.
 };
 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(DrawStringFlags)
 
 enum class ReparentingDirection {
   Backwards,
   Forwards,
   Variable  // Could be either of the above; take most pessimistic action.
 };
@@ -1094,27 +1094,27 @@ class nsLayoutUtils {
   static bool RoundedRectIntersectsRect(const nsRect& aRoundedRect,
                                         const nscoord aRadii[8],
                                         const nsRect& aTestRect);
 
   static bool MaybeCreateDisplayPortInFirstScrollFrameEncountered(
       nsIFrame* aFrame, nsDisplayListBuilder& aBuilder);
 
   enum class PaintFrameFlags : uint32_t {
-    PAINT_IN_TRANSFORM = 0x01,
-    PAINT_SYNC_DECODE_IMAGES = 0x02,
-    PAINT_WIDGET_LAYERS = 0x04,
-    PAINT_IGNORE_SUPPRESSION = 0x08,
-    PAINT_DOCUMENT_RELATIVE = 0x10,
-    PAINT_HIDE_CARET = 0x20,
-    PAINT_TO_WINDOW = 0x40,
-    PAINT_EXISTING_TRANSACTION = 0x80,
-    PAINT_NO_COMPOSITE = 0x100,
-    PAINT_COMPRESSED = 0x200,
-    PAINT_FOR_WEBRENDER = 0x400,
+    InTransform = 0x01,
+    SyncDecodeImages = 0x02,
+    WidgetLayers = 0x04,
+    IgnoreSuppression = 0x08,
+    DocumentRelative = 0x10,
+    HideCaret = 0x20,
+    ToWindow = 0x40,
+    ExistingTransaction = 0x80,
+    NoComposite = 0x100,
+    Compressed = 0x200,
+    ForWebRender = 0x400,
   };
 
   /**
    * Given aFrame, the root frame of a stacking context, paint it and its
    * descendants to aRenderingContext.
    * @param aRenderingContext a rendering context translated so that (0,0)
    * is the origin of aFrame; for best results, (0,0) should transform
    * to pixel-aligned coordinates. This can be null, in which case
@@ -1434,19 +1434,19 @@ class nsLayoutUtils {
    *   If the basis is indefinite in a given axis, pass a size with
    *   NS_UNCONSTRAINEDSIZE in that component.
    *   If you pass Nothing() a percentage basis will be calculated from aFrame's
    *   ancestors' computed size in the relevant axis, if needed.
    * @param aMarginBoxMinSizeClamp make the result fit within this margin-box
    * size by reducing the *content size* (flooring at zero).  This is used for:
    * https://drafts.csswg.org/css-grid/#min-size-auto
    */
-  enum class IntrinsicISizeType { MIN_ISIZE, PREF_ISIZE };
-  static const auto MIN_ISIZE = IntrinsicISizeType::MIN_ISIZE;
-  static const auto PREF_ISIZE = IntrinsicISizeType::PREF_ISIZE;
+  enum class IntrinsicISizeType { MinISize, PrefISize };
+  static const auto MIN_ISIZE = IntrinsicISizeType::MinISize;
+  static const auto PREF_ISIZE = IntrinsicISizeType::PrefISize;
   enum {
     IGNORE_PADDING = 0x01,
     BAIL_IF_REFLOW_NEEDED = 0x02,  // returns NS_INTRINSIC_WIDTH_UNKNOWN if so
     MIN_INTRINSIC_ISIZE = 0x04,  // use min-width/height instead of width/height
   };
   static nscoord IntrinsicForAxis(
       mozilla::PhysicalAxis aAxis, gfxContext* aRenderingContext,
       nsIFrame* aFrame, IntrinsicISizeType aType,
@@ -1624,17 +1624,17 @@ class nsLayoutUtils {
                                                  uint32_t aLength,
                                                  nsFontMetrics& aFontMetrics,
                                                  DrawTarget* aDrawTarget);
 
   static void DrawString(const nsIFrame* aFrame, nsFontMetrics& aFontMetrics,
                          gfxContext* aContext, const char16_t* aString,
                          int32_t aLength, nsPoint aPoint,
                          ComputedStyle* aComputedStyle = nullptr,
-                         DrawStringFlags aFlags = DrawStringFlags::eDefault);
+                         DrawStringFlags aFlags = DrawStringFlags::Default);
 
   static nsPoint GetBackgroundFirstTilePos(const nsPoint& aDest,
                                            const nsPoint& aFill,
                                            const nsSize& aRepeatSize);
 
   /**
    * Supports only LTR or RTL. Bidi (mixed direction) is not supported.
    */
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -693,20 +693,20 @@ class nsPresContext : public nsISupports
   /**
    *  Check whether the content should be treated as visual.
    *
    *  @lina 05/02/2000
    */
   bool IsVisualMode() const { return mIsVisual; }
 
   enum class InteractionType : uint32_t {
-    eClickInteraction,
-    eKeyInteraction,
-    eMouseMoveInteraction,
-    eScrollInteraction
+    ClickInteraction,
+    KeyInteraction,
+    MouseMoveInteraction,
+    ScrollInteraction
   };
 
   void RecordInteractionTime(InteractionType aType,
                              const mozilla::TimeStamp& aTimeStamp);
 
   void DisableInteractionTimeRecording() { mInteractionTimeEnabled = false; }
 
   // Mohamed
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -432,17 +432,17 @@ ImgDrawResult nsButtonFrameRenderer::Pai
     gfxContext& aRenderingContext, const nsRect& aDirtyRect,
     const nsRect& aRect) {
   // we draw the -moz-focus-inner border just inside the button's
   // normal border and padding, to match Windows themes.
 
   nsRect rect;
 
   PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
-                               ? PaintBorderFlags::SYNC_DECODE_IMAGES
+                               ? PaintBorderFlags::SyncDecodeImages
                                : PaintBorderFlags();
 
   ImgDrawResult result = ImgDrawResult::SUCCESS;
 
   if (mInnerFocusStyle) {
     GetButtonInnerFocusRect(aRect, rect);
 
     result &=
@@ -477,17 +477,17 @@ ImgDrawResult nsButtonFrameRenderer::Pai
                                                  gfxContext& aRenderingContext,
                                                  const nsRect& aDirtyRect,
                                                  const nsRect& aRect) {
   // get the button rect this is inside the focus and outline rects
   nsRect buttonRect = aRect;
   ComputedStyle* context = mFrame->Style();
 
   PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages()
-                                     ? PaintBorderFlags::SYNC_DECODE_IMAGES
+                                     ? PaintBorderFlags::SyncDecodeImages
                                      : PaintBorderFlags();
 
   nsCSSRendering::PaintBoxShadowInner(aPresContext, aRenderingContext, mFrame,
                                       buttonRect);
 
   ImgDrawResult result =
       nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
                                   aDirtyRect, buttonRect, context, borderFlags);
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -274,17 +274,17 @@ image::ImgDrawResult nsFieldSetFrame::Pa
   // to be centered on the legend.  We call VisualBorderRectRelativeToSelf() to
   // compute the border positioning.
   // FIXME: This means border-radius clamping is incorrect; we should
   // override nsIFrame::GetBorderRadii.
   nsRect rect = VisualBorderRectRelativeToSelf() + aPt;
   nsPresContext* presContext = PresContext();
 
   PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages()
-                                     ? PaintBorderFlags::SYNC_DECODE_IMAGES
+                                     ? PaintBorderFlags::SyncDecodeImages
                                      : PaintBorderFlags();
 
   ImgDrawResult result = ImgDrawResult::SUCCESS;
 
   nsCSSRendering::PaintBoxShadowInner(presContext, aRenderingContext, this,
                                       rect);
 
   if (nsIFrame* legend = GetLegend()) {
@@ -690,21 +690,21 @@ a11y::AccType nsFieldSetFrame::Accessibl
 #endif
 
 nscoord nsFieldSetFrame::GetLogicalBaseline(WritingMode aWM) const {
   switch (StyleDisplay()->mDisplay) {
     case mozilla::StyleDisplay::Grid:
     case mozilla::StyleDisplay::InlineGrid:
     case mozilla::StyleDisplay::Flex:
     case mozilla::StyleDisplay::InlineFlex:
-      return BaselineBOffset(aWM, BaselineSharingGroup::eFirst,
-                             AlignmentContext::eInline);
+      return BaselineBOffset(aWM, BaselineSharingGroup::First,
+                             AlignmentContext::Inline);
     default:
-      return BSize(aWM) - BaselineBOffset(aWM, BaselineSharingGroup::eLast,
-                                          AlignmentContext::eInline);
+      return BSize(aWM) - BaselineBOffset(aWM, BaselineSharingGroup::Last,
+                                          AlignmentContext::Inline);
   }
 }
 
 bool nsFieldSetFrame::GetVerticalAlignBaseline(WritingMode aWM,
                                                nscoord* aBaseline) const {
   if (StyleDisplay()->IsContainLayout()) {
     // If we are layout-contained, our child 'inner' should not
     // affect how we calculate our baseline.
@@ -729,17 +729,17 @@ bool nsFieldSetFrame::GetNaturalBaseline
     return false;
   }
   nsIFrame* inner = GetInner();
   MOZ_ASSERT(!inner->GetWritingMode().IsOrthogonalTo(aWM));
   if (!inner->GetNaturalBaselineBOffset(aWM, aBaselineGroup, aBaseline)) {
     return false;
   }
   nscoord innerBStart = inner->BStart(aWM, GetSize());
-  if (aBaselineGroup == BaselineSharingGroup::eFirst) {
+  if (aBaselineGroup == BaselineSharingGroup::First) {
     *aBaseline += innerBStart;
   } else {
     *aBaseline += BSize(aWM) - (innerBStart + inner->BSize(aWM));
   }
   return true;
 }
 
 void nsFieldSetFrame::AppendDirectlyOwnedAnonBoxes(
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -332,17 +332,17 @@ bool nsHTMLButtonControlFrame::GetVertic
     mozilla::WritingMode aWM, nscoord* aBaseline) const {
   nsIFrame* inner = mFrames.FirstChild();
   if (MOZ_UNLIKELY(inner->GetWritingMode().IsOrthogonalTo(aWM))) {
     return false;
   }
   if (!inner->GetVerticalAlignBaseline(aWM, aBaseline)) {
     // <input type=color> has an empty block frame as inner frame
     *aBaseline = inner->SynthesizeBaselineBOffsetFromBorderBox(
-        aWM, BaselineSharingGroup::eFirst);
+        aWM, BaselineSharingGroup::First);
   }
   nscoord innerBStart = inner->BStart(aWM, GetSize());
   *aBaseline += innerBStart;
   return true;
 }
 
 bool nsHTMLButtonControlFrame::GetNaturalBaselineBOffset(
     mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup,
@@ -352,17 +352,17 @@ bool nsHTMLButtonControlFrame::GetNatura
     return false;
   }
   if (!inner->GetNaturalBaselineBOffset(aWM, aBaselineGroup, aBaseline)) {
     // <input type=color> has an empty block frame as inner frame
     *aBaseline =
         inner->SynthesizeBaselineBOffsetFromBorderBox(aWM, aBaselineGroup);
   }
   nscoord innerBStart = inner->BStart(aWM, GetSize());
-  if (aBaselineGroup == BaselineSharingGroup::eFirst) {
+  if (aBaselineGroup == BaselineSharingGroup::First) {
     *aBaseline += innerBStart;
   } else {
     *aBaseline += BSize(aWM) - (innerBStart + inner->BSize(aWM));
   }
   return true;
 }
 
 nsresult nsHTMLButtonControlFrame::SetFormProperty(nsAtom* aName,
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1793,17 +1793,17 @@ nsresult nsListControlFrame::DragMove(do
 
 //----------------------------------------------------------------------
 // Scroll helpers.
 //----------------------------------------------------------------------
 void nsListControlFrame::ScrollToIndex(int32_t aIndex) {
   if (aIndex < 0) {
     // XXX shouldn't we just do nothing if we're asked to scroll to
     // kNothingSelected?
-    ScrollTo(nsPoint(0, 0), ScrollMode::eInstant);
+    ScrollTo(nsPoint(0, 0), ScrollMode::Instant);
   } else {
     RefPtr<dom::HTMLOptionElement> option =
         GetOption(AssertedCast<uint32_t>(aIndex));
     if (option) {
       ScrollToFrame(*option);
     }
   }
 }
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -209,17 +209,17 @@ nsRect nsDisplayRangeFocusRing::GetBound
 void nsDisplayRangeFocusRing::Paint(nsDisplayListBuilder* aBuilder,
                                     gfxContext* aCtx) {
   bool unused;
   ComputedStyle* computedStyle =
       static_cast<nsRangeFrame*>(mFrame)->mOuterFocusStyle;
   MOZ_ASSERT(computedStyle, "We only exist if mOuterFocusStyle is non-null");
 
   PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
-                               ? PaintBorderFlags::SYNC_DECODE_IMAGES
+                               ? PaintBorderFlags::SyncDecodeImages
                                : PaintBorderFlags();
 
   ImgDrawResult result = nsCSSRendering::PaintBorder(
       mFrame->PresContext(), *aCtx, mFrame, GetPaintRect(),
       GetBounds(aBuilder, &unused), computedStyle, flags);
 
   nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
 }
--- a/layout/forms/nsTextControlFrame.h
+++ b/layout/forms/nsTextControlFrame.h
@@ -57,29 +57,29 @@ class nsTextControlFrame final : public 
       const mozilla::LogicalSize& aPadding, ComputeSizeFlags aFlags) override;
 
   virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
                       const ReflowInput& aReflowInput,
                       nsReflowStatus& aStatus) override;
 
   bool GetVerticalAlignBaseline(mozilla::WritingMode aWM,
                                 nscoord* aBaseline) const override {
-    return GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::eFirst,
+    return GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::First,
                                      aBaseline);
   }
 
   bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
                                  BaselineSharingGroup aBaselineGroup,
                                  nscoord* aBaseline) const override {
     if (!IsSingleLineTextControl()) {
       return false;
     }
     NS_ASSERTION(mFirstBaseline != NS_INTRINSIC_WIDTH_UNKNOWN,
                  "please call Reflow before asking for the baseline");
-    if (aBaselineGroup == BaselineSharingGroup::eFirst) {
+    if (aBaselineGroup == BaselineSharingGroup::First) {
       *aBaseline = mFirstBaseline;
     } else {
       *aBaseline = BSize(aWM) - mFirstBaseline;
     }
     return true;
   }
 
   virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
--- a/layout/generic/CSSAlignUtils.cpp
+++ b/layout/generic/CSSAlignUtils.cpp
@@ -25,18 +25,18 @@ nscoord CSSAlignUtils::AlignJustifySelf(
                                         const LogicalSize& aChildSize) {
   MOZ_ASSERT(aAlignment != NS_STYLE_ALIGN_AUTO,
              "auto values should have resolved already");
   MOZ_ASSERT(
       aAlignment != NS_STYLE_ALIGN_LEFT && aAlignment != NS_STYLE_ALIGN_RIGHT,
       "caller should map that to the corresponding START/END");
 
   // Promote aFlags to convenience bools:
-  const bool isOverflowSafe = !!(aFlags & AlignJustifyFlags::eOverflowSafe);
-  const bool isSameSide = !!(aFlags & AlignJustifyFlags::eSameSide);
+  const bool isOverflowSafe = !!(aFlags & AlignJustifyFlags::OverflowSafe);
+  const bool isSameSide = !!(aFlags & AlignJustifyFlags::SameSide);
 
   // Map some alignment values to 'start' / 'end'.
   switch (aAlignment) {
     case NS_STYLE_ALIGN_SELF_START:  // align/justify-self: self-start
       aAlignment =
           MOZ_LIKELY(isSameSide) ? NS_STYLE_ALIGN_START : NS_STYLE_ALIGN_END;
       break;
     case NS_STYLE_ALIGN_SELF_END:  // align/justify-self: self-end
@@ -77,17 +77,17 @@ nscoord CSSAlignUtils::AlignJustifySelf(
       marginStart = margin.IEnd(wm);
       marginEnd = margin.IStart(wm);
     }
   }
 
   const auto& styleMargin = aRI.mStyleMargin->mMargin;
   bool hasAutoMarginStart;
   bool hasAutoMarginEnd;
-  if (aFlags & AlignJustifyFlags::eIgnoreAutoMargins) {
+  if (aFlags & AlignJustifyFlags::IgnoreAutoMargins) {
     // (Note: ReflowInput will have treated "auto" margins as 0, so we
     // don't need to do anything special to avoid expanding them.)
     hasAutoMarginStart = hasAutoMarginEnd = false;
   } else if (aAxis == eLogicalAxisBlock) {
     hasAutoMarginStart = styleMargin.GetBStart(wm).IsAuto();
     hasAutoMarginEnd = styleMargin.GetBEnd(wm).IsAuto();
   } else { /* aAxis == eLogicalAxisInline */
     hasAutoMarginStart = styleMargin.GetIStart(wm).IsAuto();
--- a/layout/generic/CSSAlignUtils.h
+++ b/layout/generic/CSSAlignUtils.h
@@ -16,26 +16,26 @@ namespace mozilla {
 struct ReflowInput;
 
 class CSSAlignUtils {
  public:
   /**
    * Flags to customize the behavior of AlignJustifySelf:
    */
   enum class AlignJustifyFlags {
-    eNoFlags = 0,
+    NoFlags = 0,
     // Indicates that we have <overflow-position> = safe.
-    eOverflowSafe = 1 << 0,
+    OverflowSafe = 1 << 0,
     // Indicates that the container's start side in aAxis is the same
     // as the child's start side in the child's parallel axis.
-    eSameSide = 1 << 1,
+    SameSide = 1 << 1,
     // Indicates that AlignJustifySelf() shouldn't expand "auto" margins.
     // (By default, AlignJustifySelf() *will* expand such margins, to fill the
     // available space before any alignment is done.)
-    eIgnoreAutoMargins = 1 << 2,
+    IgnoreAutoMargins = 1 << 2,
   };
 
   /**
    * This computes the aligned offset of a CSS-aligned child within its
    * alignment container. The returned offset is distance between the
    * logical "start" edge of the alignment container & the logical "start" edge
    * of the aligned child (in terms of the alignment container's writing mode).
    *
--- a/layout/generic/MathMLTextRunFactory.cpp
+++ b/layout/generic/MathMLTextRunFactory.cpp
@@ -428,18 +428,18 @@ void MathMLTextRunFactory::RebuildTextRu
 
   nsAutoString convertedString;
   AutoTArray<bool, 50> charsToMergeArray;
   AutoTArray<bool, 50> deletedCharsArray;
   AutoTArray<RefPtr<nsTransformedCharStyle>, 50> styleArray;
   AutoTArray<uint8_t, 50> canBreakBeforeArray;
   bool mergeNeeded = false;
 
-  bool singleCharMI = !!(aTextRun->GetFlags2() &
-                         nsTextFrameUtils::Flags::TEXT_IS_SINGLE_CHAR_MI);
+  bool singleCharMI =
+      !!(aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSingleCharMi);
 
   uint32_t length = aTextRun->GetLength();
   const char16_t* str = aTextRun->mString.BeginReading();
   const nsTArray<RefPtr<nsTransformedCharStyle>>& styles = aTextRun->mStyles;
   nsFont font;
   if (length) {
     font = styles[0]->mFont;
 
--- a/layout/generic/ScrollAnchorContainer.cpp
+++ b/layout/generic/ScrollAnchorContainer.cpp
@@ -352,17 +352,17 @@ void ScrollAnchorContainer::ApplyAdjustm
       break;
     }
   }
 
   MOZ_ASSERT(!mApplyingAnchorAdjustment);
   // We should use AutoRestore here, but that doesn't work with bitfields
   mApplyingAnchorAdjustment = true;
   mScrollFrame->ScrollTo(mScrollFrame->GetScrollPosition() + physicalAdjustment,
-                         ScrollMode::eInstant, nsGkAtoms::relative);
+                         ScrollMode::Instant, nsGkAtoms::relative);
   mApplyingAnchorAdjustment = false;
 
   nsPresContext* pc = Frame()->PresContext();
   Document* doc = pc->Document();
   doc->UpdateForScrollAnchorAdjustment(logicalAdjustment);
 
   // The anchor position may not be in the same relative position after
   // adjustment. Update ourselves so we have consistent state.
--- a/layout/generic/ViewportFrame.cpp
+++ b/layout/generic/ViewportFrame.cpp
@@ -341,17 +341,17 @@ void ViewportFrame::Reflow(nsPresContext
       NS_ASSERTION(
           reflowInput.ComputedPhysicalBorderPadding() == nsMargin(0, 0, 0, 0),
           "Viewports can't have border/padding");
       reflowInput.SetComputedBSize(maxSize.BSize(wm));
     }
 
     nsRect rect = AdjustReflowInputAsContainingBlock(&reflowInput);
     AbsPosReflowFlags flags =
-        AbsPosReflowFlags::eCBWidthAndHeightChanged;  // XXX could be optimized
+        AbsPosReflowFlags::CBWidthAndHeightChanged;  // XXX could be optimized
     GetAbsoluteContainingBlock()->Reflow(this, aPresContext, reflowInput,
                                          aStatus, rect, flags,
                                          /* aOverflowAreas = */ nullptr);
   }
 
   if (mFrames.NotEmpty()) {
     ConsiderChildOverflow(aDesiredSize.mOverflowAreas, mFrames.FirstChild());
   }
--- a/layout/generic/Visibility.h
+++ b/layout/generic/Visibility.h
@@ -14,32 +14,32 @@
 #ifndef mozilla_layout_generic_Visibility_h
 #define mozilla_layout_generic_Visibility_h
 
 namespace mozilla {
 
 // Visibility states for frames.
 enum class Visibility : uint8_t {
   // Indicates that we're not tracking visibility for this frame.
-  UNTRACKED,
+  Untracked,
 
   // Indicates that the frame is probably nonvisible. Visible frames *may* be
-  // APPROXIMATELY_NONVISIBLE because approximate visibility is not updated
+  // ApproximatelyNonVisible because approximate visibility is not updated
   // synchronously. Some truly nonvisible frames may be marked
-  // APPROXIMATELY_VISIBLE instead if our heuristics lead us to think they may
+  // ApproximatelyVisible instead if our heuristics lead us to think they may
   // be visible soon.
-  APPROXIMATELY_NONVISIBLE,
+  ApproximatelyNonVisible,
 
   // Indicates that the frame is either visible now or is likely to be visible
-  // soon according to our heuristics. As with APPROXIMATELY_NONVISIBLE, it's
+  // soon according to our heuristics. As with ApproximatelyNonVisible , it's
   // important to note that approximately visibility is not updated
   // synchronously, so this information may be out of date.
-  APPROXIMATELY_VISIBLE
+  ApproximatelyVisible,
 };
 
 // Requested actions when frames transition to the nonvisible state.
 enum class OnNonvisible : uint8_t {
-  DISCARD_IMAGES  // Discard images associated with the frame.
+  DiscardImages  // Discard images associated with the frame.
 };
 
 }  // namespace mozilla
 
 #endif  // mozilla_layout_generic_Visibility_h
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -109,26 +109,26 @@ void nsAbsoluteContainingBlock::Reflow(n
                                        const ReflowInput& aReflowInput,
                                        nsReflowStatus& aReflowStatus,
                                        const nsRect& aContainingBlock,
                                        AbsPosReflowFlags aFlags,
                                        nsOverflowAreas* aOverflowAreas) {
   nsReflowStatus reflowStatus;
 
   const bool reflowAll = aReflowInput.ShouldReflowAllKids();
-  const bool isGrid = !!(aFlags & AbsPosReflowFlags::eIsGridContainerCB);
+  const bool isGrid = !!(aFlags & AbsPosReflowFlags::IsGridContainerCB);
   nsIFrame* kidFrame;
   nsOverflowContinuationTracker tracker(aDelegatingFrame, true);
   for (kidFrame = mAbsoluteFrames.FirstChild(); kidFrame;
        kidFrame = kidFrame->GetNextSibling()) {
     bool kidNeedsReflow =
         reflowAll || NS_SUBTREE_DIRTY(kidFrame) ||
         FrameDependsOnContainer(
-            kidFrame, !!(aFlags & AbsPosReflowFlags::eCBWidthChanged),
-            !!(aFlags & AbsPosReflowFlags::eCBHeightChanged));
+            kidFrame, !!(aFlags & AbsPosReflowFlags::CBWidthChanged),
+            !!(aFlags & AbsPosReflowFlags::CBHeightChanged));
     nscoord availBSize = aReflowInput.AvailableBSize();
     const nsRect& cb =
         isGrid ? nsGridContainerFrame::GridItemCB(kidFrame) : aContainingBlock;
     WritingMode containerWM = aReflowInput.GetWritingMode();
     if (!kidNeedsReflow && availBSize != NS_UNCONSTRAINEDSIZE) {
       // If we need to redo pagination on the kid, we need to reflow it.
       // This can happen either if the available height shrunk and the
       // kid (or its overflow that creates overflow containers) is now
@@ -477,33 +477,33 @@ static nscoord OffsetToAlignedStaticPos(
     NS_ERROR("Unsupported container for abpsos CSS Box Alignment");
     return 0;  // (leave the child at the start of its alignment container)
   }
 
   nscoord alignAreaSizeInAxis = (pcAxis == eLogicalAxisInline)
                                     ? alignAreaSize.ISize(pcWM)
                                     : alignAreaSize.BSize(pcWM);
 
-  AlignJustifyFlags flags = AlignJustifyFlags::eIgnoreAutoMargins;
+  AlignJustifyFlags flags = AlignJustifyFlags::IgnoreAutoMargins;
   uint16_t alignConst = aPlaceholderContainer->CSSAlignmentForAbsPosChild(
       aKidReflowInput, pcAxis);
   // If the safe bit in alignConst is set, set the safe flag in |flags|.
   // Note: If no <overflow-position> is specified, we behave as 'unsafe'.
   // This doesn't quite match the css-align spec, which has an [at-risk]
   // "smart default" behavior with some extra nuance about scroll containers.
   if (alignConst & NS_STYLE_ALIGN_SAFE) {
-    flags |= AlignJustifyFlags::eOverflowSafe;
+    flags |= AlignJustifyFlags::OverflowSafe;
   }
   alignConst &= ~NS_STYLE_ALIGN_FLAG_BITS;
 
   // Find out if placeholder-container & the OOF child have the same start-sides
   // in the placeholder-container's pcAxis.
   WritingMode kidWM = aKidReflowInput.GetWritingMode();
   if (pcWM.ParallelAxisStartsOnSameSide(pcAxis, kidWM)) {
-    flags |= AlignJustifyFlags::eSameSide;
+    flags |= AlignJustifyFlags::SameSide;
   }
 
   // (baselineAdjust is unused. CSSAlignmentForAbsPosChild() should've
   // converted 'baseline'/'last baseline' enums to their fallback values.)
   const nscoord baselineAdjust = nscoord(0);
 
   // AlignJustifySelf operates in the kid's writing mode, so we need to
   // represent the child's size and the desired axis in that writing mode:
@@ -648,17 +648,17 @@ void nsAbsoluteContainingBlock::ReflowAb
   if (availISize == -1) {
     NS_ASSERTION(
         aReflowInput.ComputedSize(wm).ISize(wm) != NS_UNCONSTRAINEDSIZE,
         "Must have a useful inline-size _somewhere_");
     availISize = aReflowInput.ComputedSizeWithPadding(wm).ISize(wm);
   }
 
   uint32_t rsFlags = 0;
-  if (aFlags & AbsPosReflowFlags::eIsGridContainerCB) {
+  if (aFlags & AbsPosReflowFlags::IsGridContainerCB) {
     // When a grid container generates the abs.pos. CB for a *child* then
     // the static position is determined via CSS Box Alignment within the
     // abs.pos. CB (a grid area, i.e. a piece of the grid). In this scenario,
     // due to the multiple coordinate spaces in play, we use a convenience flag
     // to simply have the child's ReflowInput give it a static position at its
     // abs.pos. CB origin, and then we'll align & offset it from there.
     nsIFrame* placeholder = aKidFrame->GetPlaceholderFrame();
     if (placeholder && placeholder->GetParent() == aDelegatingFrame) {
@@ -683,17 +683,17 @@ void nsAbsoluteContainingBlock::ReflowAb
     margin.IStart(outerWM) = margin.IEnd(outerWM) = 0;
   }
   if (kidReflowInput.mFlags.mBOffsetsNeedCSSAlign) {
     margin.BStart(outerWM) = margin.BEnd(outerWM) = 0;
   }
 
   bool constrainBSize =
       (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE) &&
-      (aFlags & AbsPosReflowFlags::eConstrainHeight) &&
+      (aFlags & AbsPosReflowFlags::ConstrainHeight) &&
       // Don't split if told not to (e.g. for fixed frames)
       !aDelegatingFrame->IsInlineFrame() &&
       // XXX we don't handle splitting frames for inline absolute containing
       // blocks yet
       (aKidFrame->GetLogicalRect(aContainingBlock.Size()).BStart(wm) <=
        aReflowInput.AvailableBSize());
   // Don't split things below the fold. (Ideally we shouldn't *have*
   // anything totally below the fold, but we can't position frames
--- a/layout/generic/nsAbsoluteContainingBlock.h
+++ b/layout/generic/nsAbsoluteContainingBlock.h
@@ -60,21 +60,21 @@ class nsAbsoluteContainingBlock {
   void AppendFrames(nsIFrame* aDelegatingFrame, ChildListID aListID,
                     nsFrameList& aFrameList);
   void InsertFrames(nsIFrame* aDelegatingFrame, ChildListID aListID,
                     nsIFrame* aPrevFrame, nsFrameList& aFrameList);
   void RemoveFrame(nsIFrame* aDelegatingFrame, ChildListID aListID,
                    nsIFrame* aOldFrame);
 
   enum class AbsPosReflowFlags {
-    eConstrainHeight = 0x1,
-    eCBWidthChanged = 0x2,
-    eCBHeightChanged = 0x4,
-    eCBWidthAndHeightChanged = eCBWidthChanged | eCBHeightChanged,
-    eIsGridContainerCB = 0x8,
+    ConstrainHeight = 0x1,
+    CBWidthChanged = 0x2,
+    CBHeightChanged = 0x4,
+    CBWidthAndHeightChanged = CBWidthChanged | CBHeightChanged,
+    IsGridContainerCB = 0x8,
   };
 
   /**
    * Called by the delegating frame after it has done its reflow first. This
    * function will reflow any absolutely positioned child frames that need to
    * be reflowed, e.g., because the absolutely positioned child frame has
    * 'auto' for an offset, or a percentage based width or height.
    *
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -457,25 +457,25 @@ void nsBlockFrame::InvalidateFrameWithRe
     GetParent()->InvalidateFrame();
     return;
   }
   nsContainerFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey,
                                             aRebuildDisplayItems);
 }
 
 nscoord nsBlockFrame::GetLogicalBaseline(WritingMode aWM) const {
-  auto lastBaseline = BaselineBOffset(aWM, BaselineSharingGroup::eLast,
-                                      AlignmentContext::eInline);
+  auto lastBaseline = BaselineBOffset(aWM, BaselineSharingGroup::Last,
+                                      AlignmentContext::Inline);
   return BSize(aWM) - lastBaseline;
 }
 
 bool nsBlockFrame::GetNaturalBaselineBOffset(
     mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup,
     nscoord* aBaseline) const {
-  if (aBaselineGroup == BaselineSharingGroup::eFirst) {
+  if (aBaselineGroup == BaselineSharingGroup::First) {
     return nsLayoutUtils::GetFirstLineBaseline(aWM, this, aBaseline);
   }
 
   if (StyleDisplay()->IsContainLayout()) {
     return false;
   }
 
   for (ConstReverseLineIterator line = LinesRBegin(), line_end = LinesREnd();
@@ -1278,17 +1278,17 @@ void nsBlockFrame::Reflow(nsPresContext*
       // We have some lines to align the ::marker with.
 
       // Doing the alignment using the baseline will also cater for
       // ::markers that are placed next to a child block (bug 92896)
 
       // Tall ::markers won't look particularly nice here...
       LogicalRect bbox =
           marker->GetLogicalRect(wm, reflowOutput.PhysicalSize());
-      const auto baselineGroup = BaselineSharingGroup::eFirst;
+      const auto baselineGroup = BaselineSharingGroup::First;
       nscoord markerBaseline;
       if (MOZ_UNLIKELY(wm.IsOrthogonalTo(marker->GetWritingMode()) ||
                        !marker->GetNaturalBaselineBOffset(wm, baselineGroup,
                                                           &markerBaseline))) {
         // ::marker has no baseline in this axis: align with its margin-box end.
         markerBaseline =
             bbox.BSize(wm) + marker->GetLogicalUsedMargin(wm).BEnd(wm);
       }
@@ -1415,22 +1415,22 @@ void nsBlockFrame::Reflow(nsPresContext*
       // viewport height, which can't change during incremental
       // reflow.
       bool cbHeightChanged =
           !(isRoot && NS_UNCONSTRAINEDSIZE == reflowInput->ComputedHeight()) &&
           aMetrics.Height() != oldSize.height;
 
       nsRect containingBlock(nsPoint(0, 0),
                              containingBlockSize.GetPhysicalSize(parentWM));
-      AbsPosReflowFlags flags = AbsPosReflowFlags::eConstrainHeight;
+      AbsPosReflowFlags flags = AbsPosReflowFlags::ConstrainHeight;
       if (cbWidthChanged) {
-        flags |= AbsPosReflowFlags::eCBWidthChanged;
+        flags |= AbsPosReflowFlags::CBWidthChanged;
       }
       if (cbHeightChanged) {
-        flags |= AbsPosReflowFlags::eCBHeightChanged;
+        flags |= AbsPosReflowFlags::CBHeightChanged;
       }
       // Setup the line cursor here to optimize line searching for
       // calculating hypothetical position of absolutely-positioned
       // frames. The line cursor is immediately cleared afterward to
       // avoid affecting the display list generation.
       AutoLineCursorSetup autoLineCursor(this);
       absoluteContainer->Reflow(this, aPresContext, *reflowInput,
                                 state.mReflowStatus, containingBlock, flags,
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -121,17 +121,17 @@ class nsBlockFrame : public nsContainerF
   void GetChildLists(nsTArray<ChildList>* aLists) const override;
   nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
   bool GetVerticalAlignBaseline(mozilla::WritingMode aWM,
                                 nscoord* aBaseline) const override {
     NS_ASSERTION(!aWM.IsOrthogonalTo(GetWritingMode()),
                  "You should only call this on frames with a WM that's "
                  "parallel to aWM");
     nscoord lastBaseline;
-    if (GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::eLast,
+    if (GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::Last,
                                   &lastBaseline)) {
       *aBaseline = BSize() - lastBaseline;
       return true;
     }
     return false;
   }
   bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
                                  BaselineSharingGroup aBaselineGroup,
--- a/layout/generic/nsBulletFrame.h
+++ b/layout/generic/nsBulletFrame.h
@@ -108,17 +108,17 @@ class nsBulletFrame final : public nsFra
 
   // XXXmats note that this method returns a non-standard baseline that includes
   // the ::marker block-start margin.  New code should probably use
   // GetNaturalBaselineBOffset instead, which returns a normal baseline offset
   // as documented in nsIFrame.h.
   virtual nscoord GetLogicalBaseline(
       mozilla::WritingMode aWritingMode) const override;
 
-  bool GetNaturalBaselineBOffset(WritingMode aWM,
+  bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
                                  BaselineSharingGroup aBaselineGroup,
                                  nscoord* aBaseline) const override;
 
   float GetFontSizeInflation() const;
   bool HasFontSizeInflation() const {
     return (GetStateBits() & BULLET_FRAME_HAS_FONT_INFLATION) != 0;
   }
   void SetFontSizeInflation(float aInflation);
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -491,17 +491,17 @@ class nsFlexContainerFrame::FlexItem : p
       // or just GetLogicalBaseline() if that fails.
       bool found =
           aUseFirstBaseline
               ? nsLayoutUtils::GetFirstLineBaseline(mWM, mFrame, &mAscent)
               : nsLayoutUtils::GetLastLineBaseline(mWM, mFrame, &mAscent);
 
       if (!found) {
         mAscent = mFrame->SynthesizeBaselineBOffsetFromBorderBox(
-            mWM, BaselineSharingGroup::eFirst);
+            mWM, BaselineSharingGroup::First);
       }
     }
     return mAscent;
   }
 
   // Convenience methods to compute the main & cross size of our *margin-box*.
   // The caller is responsible for telling us the right axis, so that we can
   // pull out the appropriate components of our margin/border/padding structs.
--- a/layout/generic/nsFlexContainerFrame.h
+++ b/layout/generic/nsFlexContainerFrame.h
@@ -130,27 +130,27 @@ class nsFlexContainerFrame final : publi
 #ifdef DEBUG_FRAME_DUMP
   nsresult GetFrameName(nsAString& aResult) const override;
 #endif
 
   nscoord GetLogicalBaseline(mozilla::WritingMode aWM) const override;
 
   bool GetVerticalAlignBaseline(mozilla::WritingMode aWM,
                                 nscoord* aBaseline) const override {
-    return GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::eFirst,
+    return GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::First,
                                      aBaseline);
   }
 
   bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
                                  BaselineSharingGroup aBaselineGroup,
                                  nscoord* aBaseline) const override {
     if (HasAnyStateBits(NS_STATE_FLEX_SYNTHESIZE_BASELINE)) {
       return false;
     }
-    *aBaseline = aBaselineGroup == BaselineSharingGroup::eFirst
+    *aBaseline = aBaselineGroup == BaselineSharingGroup::First
                      ? mBaselineFromLastReflow
                      : mLastBaselineFromLastReflow;
     return true;
   }
 
   // nsContainerFrame overrides
   uint16_t CSSAlignmentForAbsPosChild(
       const ReflowInput& aChildRI,
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -129,17 +129,17 @@ nsFlowAreaRect nsFloatManager::GetFlowAr
   }
 
   // If there are no floats at all, or we're below the last one, return
   // quickly.
   if (floatCount == 0 || (mFloats[floatCount - 1].mLeftBEnd <= blockStart &&
                           mFloats[floatCount - 1].mRightBEnd <= blockStart)) {
     return nsFlowAreaRect(aWM, aContentArea.IStart(aWM), aBCoord,
                           aContentArea.ISize(aWM), aBSize,
-                          nsFlowAreaRectFlags::NO_FLAGS);
+                          nsFlowAreaRectFlags::NoFlags);
   }
 
   nscoord blockEnd;
   if (aBSize == nscoord_MAX) {
     // This warning (and the two below) are possible to hit on pages
     // with really large objects.
     NS_WARNING_ASSERTION(aBandInfoType == BandInfoType::BandFromPoint,
                          "bad height");
@@ -239,20 +239,20 @@ nsFlowAreaRect nsFloatManager::GetFlowAr
   nscoord blockSize =
       (blockEnd == nscoord_MAX) ? nscoord_MAX : (blockEnd - blockStart);
   // convert back from LineLeft/Right to IStart
   nscoord inlineStart =
       aWM.IsBidiLTR()
           ? lineLeft - mLineLeft
           : mLineLeft - lineRight + LogicalSize(aWM, aContainerSize).ISize(aWM);
 
-  nsFlowAreaRectFlags flags = (haveFloats ? nsFlowAreaRectFlags::HAS_FLOATS
-                                          : nsFlowAreaRectFlags::NO_FLAGS) |
-                              (mayWiden ? nsFlowAreaRectFlags::MAY_WIDEN
-                                        : nsFlowAreaRectFlags::NO_FLAGS);
+  nsFlowAreaRectFlags flags =
+      (haveFloats ? nsFlowAreaRectFlags::HasFloats
+                  : nsFlowAreaRectFlags::NoFlags) |
+      (mayWiden ? nsFlowAreaRectFlags::MayWiden : nsFlowAreaRectFlags::NoFlags);
 
   return nsFlowAreaRect(aWM, inlineStart, blockStart - mBlockStart,
                         lineRight - lineLeft, blockSize, flags);
 }
 
 void nsFloatManager::AddFloat(nsIFrame* aFloatFrame,
                               const LogicalRect& aMarginRect, WritingMode aWM,
                               const nsSize& aContainerSize) {
--- a/layout/generic/nsFloatManager.h
+++ b/layout/generic/nsFloatManager.h
@@ -23,19 +23,19 @@ class nsIFrame;
 class nsPresContext;
 namespace mozilla {
 struct ReflowInput;
 class PresShell;
 class StyleBasicShape;
 }  // namespace mozilla
 
 enum class nsFlowAreaRectFlags : uint32_t {
-  NO_FLAGS = 0,
-  HAS_FLOATS = 1 << 0,
-  MAY_WIDEN = 1 << 1
+  NoFlags = 0,
+  HasFloats = 1 << 0,
+  MayWiden = 1 << 1
 };
 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsFlowAreaRectFlags)
 
 /**
  * The available space for content not occupied by floats is divided
  * into a sequence of rectangles in the block direction.  However, we
  * need to know not only the rectangle, but also whether it was reduced
  * (from the content rectangle) by floats that actually intruded into
@@ -50,20 +50,20 @@ struct nsFlowAreaRect {
 
   nsFlowAreaRect(mozilla::WritingMode aWritingMode, nscoord aICoord,
                  nscoord aBCoord, nscoord aISize, nscoord aBSize,
                  nsFlowAreaRectFlags aAreaFlags)
       : mRect(aWritingMode, aICoord, aBCoord, aISize, aBSize),
         mAreaFlags(aAreaFlags) {}
 
   bool HasFloats() const {
-    return (bool)(mAreaFlags & nsFlowAreaRectFlags::HAS_FLOATS);
+    return (bool)(mAreaFlags & nsFlowAreaRectFlags::HasFloats);
   }
   bool MayWiden() const {
-    return (bool)(mAreaFlags & nsFlowAreaRectFlags::MAY_WIDEN);
+    return (bool)(mAreaFlags & nsFlowAreaRectFlags::MayWiden);
   }
 };
 
 #define NS_FLOAT_MANAGER_CACHE_SIZE 64
 
 /**
  * nsFloatManager is responsible for implementing CSS's rules for
  * positioning floats. An nsFloatManager object is created during reflow for
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -477,17 +477,17 @@ nsFrame::nsFrame(ComputedStyle* aStyle, 
                  ClassID aID)
     : nsBox(aStyle, aPresContext, aID) {
   MOZ_COUNT_CTOR(nsFrame);
 }
 
 nsFrame::~nsFrame() {
   MOZ_COUNT_DTOR(nsFrame);
 
-  MOZ_ASSERT(GetVisibility() != Visibility::APPROXIMATELY_VISIBLE,
+  MOZ_ASSERT(GetVisibility() != Visibility::ApproximatelyVisible,
              "Visible nsFrame is being destroyed");
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsFrame)
 
 // Dummy operator delete.  Will never be called, but must be defined
 // to satisfy some C++ ABIs.
 void nsFrame::operator delete(void*, size_t) {
@@ -1959,28 +1959,28 @@ void nsIFrame::GetCrossDocChildLists(nsT
     }
   }
 
   GetChildLists(aLists);
 }
 
 Visibility nsIFrame::GetVisibility() const {
   if (!(GetStateBits() & NS_FRAME_VISIBILITY_IS_TRACKED)) {
-    return Visibility::UNTRACKED;
+    return Visibility::Untracked;
   }
 
   bool isSet = false;
   uint32_t visibleCount = GetProperty(VisibilityStateProperty(), &isSet);
 
   MOZ_ASSERT(isSet,
              "Should have a VisibilityStateProperty value "
              "if NS_FRAME_VISIBILITY_IS_TRACKED is set");
 
-  return visibleCount > 0 ? Visibility::APPROXIMATELY_VISIBLE
-                          : Visibility::APPROXIMATELY_NONVISIBLE;
+  return visibleCount > 0 ? Visibility::ApproximatelyVisible
+                          : Visibility::ApproximatelyNonVisible;
 }
 
 void nsIFrame::UpdateVisibilitySynchronously() {
   mozilla::PresShell* presShell = PresShell();
   if (!presShell) {
     return;
   }
 
@@ -2072,17 +2072,17 @@ void nsIFrame::DisableVisibilityTracking
 
   RemoveStateBits(NS_FRAME_VISIBILITY_IS_TRACKED);
 
   if (visibleCount == 0) {
     return;  // We were nonvisible.
   }
 
   // We were visible, so send an OnVisibilityChange() notification.
-  OnVisibilityChange(Visibility::APPROXIMATELY_NONVISIBLE);
+  OnVisibilityChange(Visibility::ApproximatelyNonVisible);
 }
 
 void nsIFrame::DecApproximateVisibleCount(
     const Maybe<OnNonvisible>& aNonvisibleAction
     /* = Nothing() */) {
   MOZ_ASSERT(GetStateBits() & NS_FRAME_VISIBILITY_IS_TRACKED);
 
   bool isSet = false;
@@ -2097,17 +2097,17 @@ void nsIFrame::DecApproximateVisibleCoun
 
   visibleCount--;
   SetProperty(VisibilityStateProperty(), visibleCount);
   if (visibleCount > 0) {
     return;
   }
 
   // We just became nonvisible, so send an OnVisibilityChange() notification.
-  OnVisibilityChange(Visibility::APPROXIMATELY_NONVISIBLE, aNonvisibleAction);
+  OnVisibilityChange(Visibility::ApproximatelyNonVisible, aNonvisibleAction);
 }
 
 void nsIFrame::IncApproximateVisibleCount() {
   MOZ_ASSERT(GetStateBits() & NS_FRAME_VISIBILITY_IS_TRACKED);
 
   bool isSet = false;
   uint32_t visibleCount = GetProperty(VisibilityStateProperty(), &isSet);
 
@@ -2117,17 +2117,17 @@ void nsIFrame::IncApproximateVisibleCoun
 
   visibleCount++;
   SetProperty(VisibilityStateProperty(), visibleCount);
   if (visibleCount > 1) {
     return;
   }
 
   // We just became visible, so send an OnVisibilityChange() notification.
-  OnVisibilityChange(Visibility::APPROXIMATELY_VISIBLE);
+  OnVisibilityChange(Visibility::ApproximatelyVisible);
 }
 
 void nsIFrame::OnVisibilityChange(Visibility aNewVisibility,
                                   const Maybe<OnNonvisible>& aNonvisibleAction
                                   /* = Nothing() */) {
   // XXX(seth): In bug 1218990 we'll implement visibility tracking for CSS
   // images here.
 }
@@ -3026,27 +3026,27 @@ void nsIFrame::BuildDisplayListForStacki
   nsDisplayListBuilder::AutoBuildingDisplayList buildingDisplayList(
       aBuilder, this, visibleRect, dirtyRect, isTransformed);
 
   // Depending on the effects that are applied to this frame, we can create
   // multiple container display items and wrap them around our contents.
   // This enum lists all the potential container display items, in the order
   // outside to inside.
   enum class ContainerItemType : uint8_t {
-    eNone = 0,
-    eOwnLayerIfNeeded,
-    eBlendMode,
-    eFixedPosition,
-    eOwnLayerForTransformWithRoundedClip,
-    ePerspective,
-    eTransform,
-    eSeparatorTransforms,
-    eOpacity,
-    eFilter,
-    eBlendContainer
+    None = 0,
+    OwnLayerIfNeeded,
+    BlendMode,
+    FixedPosition,
+    OwnLayerForTransformWithRoundedClip,
+    Perspective,
+    Transform,
+    SeparatorTransforms,
+    Opacity,
+    Filter,
+    BlendContainer
   };
 
   nsDisplayListBuilder::AutoContainerASRTracker contASRTracker(aBuilder);
 
   auto cssClip = GetClipPropClipRect(disp, effects, GetSize());
   auto ApplyClipProp = [&](DisplayListClipState::AutoSaveRestore& aClipState) {
     if (!cssClip) {
       return;
@@ -3068,41 +3068,41 @@ void nsIFrame::BuildDisplayListForStacki
   // If there is a current clip, then depending on the container items we
   // create, different things can happen to it. Some container items simply
   // propagate the clip to their children and aren't clipped themselves.
   // But other container items, especially those that establish a different
   // geometry for their contents (e.g. transforms), capture the clip on
   // themselves and unset the clip for their contents. If we create more than
   // one of those container items, the clip will be captured on the outermost
   // one and the inner container items will be unclipped.
-  ContainerItemType clipCapturedBy = ContainerItemType::eNone;
+  ContainerItemType clipCapturedBy = ContainerItemType::None;
   if (useFixedPosition) {
-    clipCapturedBy = ContainerItemType::eFixedPosition;
+    clipCapturedBy = ContainerItemType::FixedPosition;
   } else if (isTransformed) {
     const DisplayItemClipChain* currentClip =
         aBuilder->ClipState().GetCurrentCombinedClipChain(aBuilder);
     if ((hasPerspective || extend3DContext) &&
         (currentClip && currentClip->HasRoundedCorners())) {
       // If we're creating an nsDisplayTransform item that is going to combine
       // its transform with its children (preserve-3d or perspective), then we
       // can't have an intermediate surface. Mask layers force an intermediate
       // surface, so if we're going to need both then create a separate
       // wrapping layer for the mask.
-      clipCapturedBy = ContainerItemType::eOwnLayerForTransformWithRoundedClip;
+      clipCapturedBy = ContainerItemType::OwnLayerForTransformWithRoundedClip;
     } else if (hasPerspective) {
-      clipCapturedBy = ContainerItemType::ePerspective;
+      clipCapturedBy = ContainerItemType::Perspective;
     } else {
-      clipCapturedBy = ContainerItemType::eTransform;
+      clipCapturedBy = ContainerItemType::Transform;
     }
   } else if (usingFilter) {
-    clipCapturedBy = ContainerItemType::eFilter;
+    clipCapturedBy = ContainerItemType::Filter;
   }
 
   DisplayListClipState::AutoSaveRestore clipState(aBuilder);
-  if (clipCapturedBy != ContainerItemType::eNone) {
+  if (clipCapturedBy != ContainerItemType::None) {
     clipState.Clear();
   }
 
   DisplayListClipState::AutoSaveRestore transformedCssClip(aBuilder);
   if (isTransformed) {
     // FIXME(emilio, bug 1525159): In the case we have a both a transform _and_
     // filters, this clips the input to the filters as well, which is not
     // correct (clipping by the `clip` property is supposed to happen after
@@ -3256,17 +3256,17 @@ void nsIFrame::BuildDisplayListForStacki
    * (which also handles CSS group opacity). Note that we create an SVG effects
    * item even if resultList is empty, since a filter can produce graphical
    * output even if the element being filtered wouldn't otherwise do so.
    */
   if (usingSVGEffects) {
     MOZ_ASSERT(usingFilter || usingMask,
                "Beside filter & mask/clip-path, what else effect do we have?");
 
-    if (clipCapturedBy == ContainerItemType::eFilter) {
+    if (clipCapturedBy == ContainerItemType::Filter) {
       clipState.Restore();
     }
     // Revert to the post-filter dirty rect.
     aBuilder->SetVisibleRect(visibleRectOutsideSVGEffects);
 
     // Skip all filter effects while generating glyph mask.
     if (usingFilter && !aBuilder->IsForGenerateGlyphMask()) {
       /* List now emptied, so add the new list to the top. */
@@ -3368,17 +3368,17 @@ void nsIFrame::BuildDisplayListForStacki
       ct.TrackContainer(separator);
     }
 
     resultList.AppendToTop(&participants);
   }
 
   if (isTransformed) {
     transformedCssClip.Restore();
-    if (clipCapturedBy == ContainerItemType::eTransform) {
+    if (clipCapturedBy == ContainerItemType::Transform) {
       // Restore clip state now so nsDisplayTransform is clipped properly.
       clipState.Restore();
     }
     // Revert to the dirtyrect coming in from the parent, without our transform
     // taken into account.
     aBuilder->SetVisibleRect(visibleRectOutsideTransform);
     // Revert to the outer reference frame and offset because all display
     // items we create from now on are outside the transform.
@@ -3394,39 +3394,39 @@ void nsIFrame::BuildDisplayListForStacki
     nsDisplayTransform* transformItem = MakeDisplayItem<nsDisplayTransform>(
         aBuilder, this, &resultList, visibleRect, 0, allowAsyncAnimation);
     if (transformItem) {
       resultList.AppendToTop(transformItem);
       ct.TrackContainer(transformItem);
     }
 
     if (hasPerspective) {
-      if (clipCapturedBy == ContainerItemType::ePerspective) {
+      if (clipCapturedBy == ContainerItemType::Perspective) {
         clipState.Restore();
       }
       resultList.AppendNewToTop<nsDisplayPerspective>(aBuilder, this,
                                                       &resultList);
       ct.TrackContainer(resultList.GetTop());
     }
   }
 
   if (clipCapturedBy ==
-      ContainerItemType::eOwnLayerForTransformWithRoundedClip) {
+      ContainerItemType::OwnLayerForTransformWithRoundedClip) {
     clipState.Restore();
     resultList.AppendNewToTop<nsDisplayOwnLayer>(
         aBuilder, this, &resultList, aBuilder->CurrentActiveScrolledRoot(),
-        nsDisplayOwnLayerFlags::eNone, ScrollbarData{},
+        nsDisplayOwnLayerFlags::None, ScrollbarData{},
         /* aForceActive = */ false);
     ct.TrackContainer(resultList.GetTop());
   }
 
   /* If we have sticky positioning, wrap it in a sticky position item.
    */
   if (useFixedPosition) {
-    if (clipCapturedBy == ContainerItemType::eFixedPosition) {
+    if (clipCapturedBy == ContainerItemType::FixedPosition) {
       clipState.Restore();
     }
     // The ASR for the fixed item should be the ASR of our containing block,
     // which has been set as the builder's current ASR, unless this frame is
     // invisible and we hadn't saved display item data for it. In that case,
     // we need to take the containerItemASR since we might have fixed children.
     // For WebRender, we want to the know what |containerItemASR| is for the
     // case where the fixed-pos item is not a "real" fixed-pos item (e.g. it's
@@ -5885,26 +5885,26 @@ LogicalSize nsFrame::ComputeSizeWithIntr
   }
   nscoord boxSizingToMarginEdgeISize = aMargin.ISize(aWM) + aBorder.ISize(aWM) +
                                        aPadding.ISize(aWM) -
                                        boxSizingAdjust.ISize(aWM);
 
   nscoord iSize, minISize, maxISize, bSize, minBSize, maxBSize;
   enum class Stretch {
     // stretch to fill the CB (preserving intrinsic ratio) in the relevant axis
-    eStretchPreservingRatio,  // XXX not used yet
+    StretchPreservingRatio,  // XXX not used yet
     // stretch to fill the CB in the relevant axis
-    eStretch,
+    Stretch,
     // no stretching in the relevant axis
-    eNoStretch,
+    NoStretch,
   };
   // just to avoid having to type these out everywhere:
-  const auto eStretchPreservingRatio = Stretch::eStretchPreservingRatio;
-  const auto eStretch = Stretch::eStretch;
-  const auto eNoStretch = Stretch::eNoStretch;
+  const auto eStretchPreservingRatio = Stretch::StretchPreservingRatio;
+  const auto eStretch = Stretch::Stretch;
+  const auto eNoStretch = Stretch::NoStretch;
 
   Stretch stretchI = eNoStretch;  // stretch behavior in the inline axis
   Stretch stretchB = eNoStretch;  // stretch behavior in the block axis
 
   const bool isVertical = aWM.IsVertical();
   const auto& isizeCoord =
       isVertical ? aIntrinsicSize.height : aIntrinsicSize.width;
   const bool hasIntrinsicISize = isizeCoord.isSome();
@@ -6393,19 +6393,19 @@ void nsFrame::ReflowAbsoluteFrames(nsPre
     nscoord containingBlockHeight =
         std::max(0, aDesiredSize.Height() - usedBorder.TopBottom());
     nsContainerFrame* container = do_QueryFrame(this);
     NS_ASSERTION(container,
                  "Abs-pos children only supported on container frames for now");
 
     nsRect containingBlock(0, 0, containingBlockWidth, containingBlockHeight);
     AbsPosReflowFlags flags =
-        AbsPosReflowFlags::eCBWidthAndHeightChanged;  // XXX could be optimized
+        AbsPosReflowFlags::CBWidthAndHeightChanged;  // XXX could be optimized
     if (aConstrainBSize) {
-      flags |= AbsPosReflowFlags::eConstrainHeight;
+      flags |= AbsPosReflowFlags::ConstrainHeight;
     }
     absoluteContainer->Reflow(container, aPresContext, aReflowInput, aStatus,
                               containingBlock, flags,
                               &aDesiredSize.mOverflowAreas);
   }
 }
 
 void nsFrame::PushDirtyBitToAbsoluteFrames() {
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -1708,17 +1708,17 @@ void nsFrameSelection::CommonPageMove(bo
 
   if (!offsets.content) {
     return;
   }
 
   // Scroll one page if necessary.
   if (scrollableFrame) {
     scrollableFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1),
-                              nsIScrollableFrame::PAGES, ScrollMode::eSmooth);
+                              nsIScrollableFrame::PAGES, ScrollMode::Smooth);
   }
 
   // place the caret
   HandleClick(offsets.content, offsets.offset, offsets.offset, aExtend, false,
               CARET_ASSOCIATE_AFTER);
 }
 
 nsresult nsFrameSelection::PhysicalMove(int16_t aDirection, int16_t aAmount,
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1375,24 +1375,24 @@ static nsRect GetOnePixelRangeAroundPoin
     allowedRange.height = halfPixel * 2 - 1;
   }
   return allowedRange;
 }
 
 void ScrollFrameHelper::ScrollByPage(
     nsScrollbarFrame* aScrollbar, int32_t aDirection,
     nsIScrollbarMediator::ScrollSnapMode aSnap) {
-  ScrollByUnit(aScrollbar, ScrollMode::eSmooth, aDirection,
+  ScrollByUnit(aScrollbar, ScrollMode::Smooth, aDirection,
                nsIScrollableFrame::PAGES, aSnap);
 }
 
 void ScrollFrameHelper::ScrollByWhole(
     nsScrollbarFrame* aScrollbar, int32_t aDirection,
     nsIScrollbarMediator::ScrollSnapMode aSnap) {
-  ScrollByUnit(aScrollbar, ScrollMode::eInstant, aDirection,
+  ScrollByUnit(aScrollbar, ScrollMode::Instant, aDirection,
                nsIScrollableFrame::WHOLE, aSnap);
 }
 
 void ScrollFrameHelper::ScrollByLine(
     nsScrollbarFrame* aScrollbar, int32_t aDirection,
     nsIScrollbarMediator::ScrollSnapMode aSnap) {
   bool isHorizontal = aScrollbar->IsXULHorizontal();
   nsIntPoint delta;
@@ -1418,17 +1418,17 @@ void ScrollFrameHelper::ScrollByLine(
       // than an entire page.  Scroll by one page instead to maintain
       // context.
       ScrollByPage(aScrollbar, aDirection);
       return;
     }
   }
 
   nsIntPoint overflow;
-  ScrollBy(delta, nsIScrollableFrame::LINES, ScrollMode::eSmooth, &overflow,
+  ScrollBy(delta, nsIScrollableFrame::LINES, ScrollMode::Smooth, &overflow,
            nsGkAtoms::other, nsIScrollableFrame::NOT_MOMENTUM, aSnap);
 }
 
 void ScrollFrameHelper::RepeatButtonScroll(nsScrollbarFrame* aScrollbar) {
   aScrollbar->MoveToNewPosition();
 }
 
 void ScrollFrameHelper::ThumbMoved(nsScrollbarFrame* aScrollbar,
@@ -1446,27 +1446,27 @@ void ScrollFrameHelper::ThumbMoved(nsScr
 
   // Don't try to scroll if we're already at an acceptable place.
   // Don't call Contains here since Contains returns false when the point is
   // on the bottom or right edge of the rectangle.
   if (allowedRange.ClampPoint(current) == current) {
     return;
   }
 
-  ScrollTo(dest, ScrollMode::eInstant, nsGkAtoms::other, &allowedRange);
+  ScrollTo(dest, ScrollMode::Instant, nsGkAtoms::other, &allowedRange);
 }
 
 void ScrollFrameHelper::ScrollbarReleased(nsScrollbarFrame* aScrollbar) {
   // Scrollbar scrolling does not result in fling gestures, clear any
   // accumulated velocity
   mVelocityQueue.Reset();
 
   // Perform scroll snapping, if needed.  Scrollbar movement uses the same
   // smooth scrolling animation as keyboard scrolling.
-  ScrollSnap(mDestination, ScrollMode::eSmooth);
+  ScrollSnap(mDestination, ScrollMode::Smooth);
 }
 
 void ScrollFrameHelper::ScrollByUnit(
     nsScrollbarFrame* aScrollbar, ScrollMode aMode, int32_t aDirection,
     nsIScrollableFrame::ScrollUnit aUnit,
     nsIScrollbarMediator::ScrollSnapMode aSnap) {
   MOZ_ASSERT(aScrollbar != nullptr);
   bool isHorizontal = aScrollbar->IsXULHorizontal();
@@ -2213,17 +2213,17 @@ void ScrollFrameHelper::ScrollToCSSPixel
 }
 
 void ScrollFrameHelper::ScrollToCSSPixelsApproximate(
     const CSSPoint& aScrollPosition, nsAtom* aOrigin) {
   nsPoint pt = CSSPoint::ToAppUnits(aScrollPosition);
   nscoord halfRange = nsPresContext::CSSPixelsToAppUnits(1000);
   nsRect range(pt.x - halfRange, pt.y - halfRange, 2 * halfRange - 1,
                2 * halfRange - 1);
-  ScrollToWithOrigin(pt, ScrollMode::eInstant, aOrigin, &range);
+  ScrollToWithOrigin(pt, ScrollMode::Instant, aOrigin, &range);
   // 'this' might be destroyed here
 }
 
 CSSIntPoint ScrollFrameHelper::GetScrollPositionCSSPixels() {
   return CSSIntPoint::FromAppUnitsRounded(GetScrollPosition());
 }
 
 /*
@@ -2250,41 +2250,41 @@ void ScrollFrameHelper::ScrollToWithOrig
       GetPageLoadingState() != LoadingState::Loading) {
     // If we're doing a restore but the scroll position is clamped, promote
     // the origin from one that APZ can clobber to one that it can't clobber.
     aOrigin = nsGkAtoms::other;
   }
 
   nsRect range = aRange ? *aRange : nsRect(aScrollPosition, nsSize(0, 0));
 
-  if (aMode != ScrollMode::eSmoothMsd) {
+  if (aMode != ScrollMode::SmoothMsd) {
     // If we get a non-smooth-scroll, reset the cached APZ scroll destination,
     // so that we know to process the next smooth-scroll destined for APZ.
     mApzSmoothScrollDestination = Nothing();
   }
 
-  if (aMode == ScrollMode::eInstant) {
+  if (aMode == ScrollMode::Instant) {
     // Asynchronous scrolling is not allowed, so we'll kill any existing
     // async-scrolling process and do an instant scroll.
     CompleteAsyncScroll(range, aOrigin);
     return;
   }
 
   nsPresContext* presContext = mOuter->PresContext();
   TimeStamp now =
       presContext->RefreshDriver()->IsTestControllingRefreshesEnabled()
           ? presContext->RefreshDriver()->MostRecentRefresh()
           : TimeStamp::Now();
   bool isSmoothScroll =
-      (aMode == ScrollMode::eSmooth) && IsSmoothScrollingEnabled();
+      (aMode == ScrollMode::Smooth) && IsSmoothScrollingEnabled();
 
   nsSize currentVelocity(0, 0);
 
   if (gfxPrefs::ScrollBehaviorEnabled()) {
-    if (aMode == ScrollMode::eSmoothMsd) {
+    if (aMode == ScrollMode::SmoothMsd) {
       mIgnoreMomentumScroll = true;
       if (!mAsyncSmoothMSDScroll) {
         nsPoint sv = mVelocityQueue.GetVelocity();
         currentVelocity.width = sv.x;
         currentVelocity.height = sv.y;
         if (mAsyncScroll) {
           if (mAsyncScroll->IsSmoothScroll()) {
             currentVelocity = mAsyncScroll->VelocityAt(now);
@@ -2887,17 +2887,17 @@ void ScrollFrameHelper::ScrollToImpl(nsP
     AutoWeakFrame weakFrame(mOuter);
     UpdateScrollbarPosition();
     if (!weakFrame.IsAlive()) {
       return;
     }
   }
 
   presContext->RecordInteractionTime(
-      nsPresContext::InteractionType::eScrollInteraction, TimeStamp::Now());
+      nsPresContext::InteractionType::ScrollInteraction, TimeStamp::Now());
 
   PostScrollEvent();
   // If this is a viewport scroll, this could affect the relative offset
   // between layout and visual viewport, so we might have to fire a visual
   // viewport scroll event as well.
   if (mIsRoot) {
     if (auto* window = nsGlobalWindowInner::Cast(
             mOuter->PresContext()->Document()->GetInnerWindow())) {
@@ -2965,17 +2965,17 @@ static void AppendToTop(nsDisplayListBui
       scrollbarData = ScrollbarData::CreateForScrollbarContainer(
           aBuilder->GetCurrentScrollbarDirection(),
           aBuilder->GetCurrentScrollbarTarget());
       // Direction should be set
       MOZ_ASSERT(scrollbarData.mDirection.isSome());
     }
 
     newItem = MakeDisplayItem<nsDisplayOwnLayer>(
-        aBuilder, aSourceFrame, aSource, asr, nsDisplayOwnLayerFlags::eNone,
+        aBuilder, aSourceFrame, aSource, asr, nsDisplayOwnLayerFlags::None,
         scrollbarData);
   } else {
     // Build the wrap list with an index of 1, since the scrollbar frame itself
     // might have already built an nsDisplayWrapList.
     newItem = MakeDisplayItem<nsDisplayWrapList>(aBuilder, aSourceFrame,
                                                  aSource, asr, false, 1);
   }
   if (!newItem) {
@@ -4496,24 +4496,24 @@ void ScrollFrameHelper::ScrollToRestored
         visualScrollToPos.x -=
             (GetVisualViewportSize().width - mScrolledFrame->GetRect().width);
         layoutScrollToPos.x -=
             (GetVisualViewportSize().width - mScrolledFrame->GetRect().width);
       }
       AutoWeakFrame weakFrame(mOuter);
       // It's very important to pass nsGkAtoms::restore here, so
       // ScrollToWithOrigin won't clear out mRestorePos.
-      ScrollToWithOrigin(layoutScrollToPos, ScrollMode::eInstant,
+      ScrollToWithOrigin(layoutScrollToPos, ScrollMode::Instant,
                          nsGkAtoms::restore, nullptr);
       if (!weakFrame.IsAlive()) {
         return;
       }
       if (mIsRoot && mOuter->PresContext()->IsRootContentDocument()) {
         mOuter->PresShell()->ScrollToVisual(
-            visualScrollToPos, FrameMetrics::eRestore, ScrollMode::eInstant);
+            visualScrollToPos, FrameMetrics::eRestore, ScrollMode::Instant);
       }
       if (state == LoadingState::Loading || NS_SUBTREE_DIRTY(mOuter)) {
         // If we're trying to do a history scroll restore, then we want to
         // keep trying this until we succeed, because the page can be loading
         // incrementally. So re-get the scroll position for the next iteration,
         // it might not be exactly equal to mRestorePos due to rounding and
         // clamping.
         mLastPos = GetLogicalVisualViewportOffset();
@@ -5019,17 +5019,17 @@ void ScrollFrameHelper::CurPosAttributeC
     UpdateScrollbarPosition();
     if (!weakFrame.IsAlive()) {
       return;
     }
   }
 
   if (aDoScroll) {
     ScrollToWithOrigin(dest,
-                       isSmooth ? ScrollMode::eSmooth : ScrollMode::eInstant,
+                       isSmooth ? ScrollMode::Smooth : ScrollMode::Instant,
                        nsGkAtoms::scrollbars, &allowedRange);
   }
   // 'this' might be destroyed here
 }
 
 /* ============= Scroll events ========== */
 
 ScrollFrameHelper::ScrollEvent::ScrollEvent(ScrollFrameHelper* aHelper,
@@ -6975,17 +6975,17 @@ bool ScrollFrameHelper::DragScroll(Widge
       offset.y = margin;
       if (scrollPoint.y < rangeRect.height) {
         willScroll = true;
       }
     }
   }
 
   if (offset.x || offset.y) {
-    ScrollTo(GetScrollPosition() + offset, ScrollMode::eNormal,
+    ScrollTo(GetScrollPosition() + offset, ScrollMode::Normal,
              nsGkAtoms::other);
   }
 
   return willScroll;
 }
 
 static nsSliderFrame* GetSliderFrame(nsIFrame* aScrollbarFrame) {
   if (!aScrollbarFrame) {
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -255,19 +255,19 @@ class ScrollFrameHelper : public nsIRefl
    */
   nsPoint GetLogicalVisualViewportOffset() const {
     nsPoint pt = GetVisualViewportOffset();
     if (!IsPhysicalLTR()) {
       pt.x += GetVisualViewportSize().width - mScrolledFrame->GetRect().width;
     }
     return pt;
   }
-  void ScrollSnap(ScrollMode aMode = ScrollMode::eSmoothMsd);
+  void ScrollSnap(ScrollMode aMode = ScrollMode::SmoothMsd);
   void ScrollSnap(const nsPoint& aDestination,
-                  ScrollMode aMode = ScrollMode::eSmoothMsd);
+                  ScrollMode aMode = ScrollMode::SmoothMsd);
 
  protected:
   nsRect GetVisualScrollRange() const;
 
  public:
   static void AsyncScrollCallback(ScrollFrameHelper* aInstance,
                                   mozilla::TimeStamp aTime);
   static void AsyncSmoothMSDScrollCallback(ScrollFrameHelper* aInstance,
@@ -281,17 +281,17 @@ class ScrollFrameHelper : public nsIRefl
   void ScrollTo(nsPoint aScrollPosition, ScrollMode aMode,
                 nsAtom* aOrigin = nullptr, const nsRect* aRange = nullptr,
                 nsIScrollbarMediator::ScrollSnapMode aSnap =
                     nsIScrollbarMediator::DISABLE_SNAP);
   /**
    * @note This method might destroy the frame, pres shell and other objects.
    */
   void ScrollToCSSPixels(const CSSIntPoint& aScrollPosition,
-                         ScrollMode aMode = ScrollMode::eInstant,
+                         ScrollMode aMode = ScrollMode::Instant,
                          nsIScrollbarMediator::ScrollSnapMode aSnap =
                              nsIScrollbarMediator::DEFAULT,
                          nsAtom* aOrigin = nullptr);
   /**
    * @note This method might destroy the frame, pres shell and other objects.
    */
   void ScrollToCSSPixelsApproximate(const mozilla::CSSPoint& aScrollPosition,
                                     nsAtom* aOrigin = nullptr);
@@ -309,17 +309,17 @@ class ScrollFrameHelper : public nsIRefl
   void ScrollBy(nsIntPoint aDelta, nsIScrollableFrame::ScrollUnit aUnit,
                 ScrollMode aMode, nsIntPoint* aOverflow,
                 nsAtom* aOrigin = nullptr,
                 nsIScrollableFrame::ScrollMomentum aMomentum =
                     nsIScrollableFrame::NOT_MOMENTUM,
                 nsIScrollbarMediator::ScrollSnapMode aSnap =
                     nsIScrollbarMediator::DISABLE_SNAP);
   void ScrollByCSSPixels(const CSSIntPoint& aDelta,
-                         ScrollMode aMode = ScrollMode::eInstant,
+                         ScrollMode aMode = ScrollMode::Instant,
                          nsAtom* aOrigin = nullptr,
                          nsIScrollbarMediator::ScrollSnapMode aSnap =
                              nsIScrollbarMediator::DEFAULT);
   /**
    * @note This method might destroy the frame, pres shell and other objects.
    */
   void ScrollToRestoredPosition();
 
@@ -979,17 +979,17 @@ class nsHTMLScrollFrame : public nsConta
                         nsIScrollbarMediator::ScrollSnapMode aSnap =
                             nsIScrollbarMediator::DISABLE_SNAP) override {
     mHelper.ScrollTo(aScrollPosition, aMode, nsGkAtoms::other, aRange, aSnap);
   }
   /**
    * @note This method might destroy the frame, pres shell and other objects.
    */
   virtual void ScrollToCSSPixels(const CSSIntPoint& aScrollPosition,
-                                 ScrollMode aMode = ScrollMode::eInstant,
+                                 ScrollMode aMode = ScrollMode::Instant,
                                  nsIScrollbarMediator::ScrollSnapMode aSnap =
                                      nsIScrollbarMediator::DEFAULT,
                                  nsAtom* aOrigin = nullptr) override {
     mHelper.ScrollToCSSPixels(aScrollPosition, aMode, aSnap, aOrigin);
   }
   virtual void ScrollToCSSPixelsApproximate(
       const mozilla::CSSPoint& aScrollPosition,
       nsAtom* aOrigin = nullptr) override {
@@ -1009,17 +1009,17 @@ class nsHTMLScrollFrame : public nsConta
                         nsIScrollableFrame::ScrollMomentum aMomentum =
                             nsIScrollableFrame::NOT_MOMENTUM,
                         nsIScrollbarMediator::ScrollSnapMode aSnap =
                             nsIScrollbarMediator::DISABLE_SNAP) override {
     mHelper.ScrollBy(aDelta, aUnit, aMode, aOverflow, aOrigin, aMomentum,
                      aSnap);
   }
   virtual void ScrollByCSSPixels(const CSSIntPoint& aDelta,
-                                 ScrollMode aMode = ScrollMode::eInstant,
+                                 ScrollMode aMode = ScrollMode::Instant,
                                  nsAtom* aOrigin = nullptr,
                                  nsIScrollbarMediator::ScrollSnapMode aSnap =
                                      nsIScrollbarMediator::DEFAULT) override {
     mHelper.ScrollByCSSPixels(aDelta, aMode, aOrigin, aSnap);
   }
   virtual void ScrollSnap() override { mHelper.ScrollSnap(); }
   /**
    * @note This method might destroy the frame, pres shell and other objects.
@@ -1464,17 +1464,17 @@ class nsXULScrollFrame final : public ns
       nsPoint aScrollPosition, ScrollMode aMode, const nsRect* aRange = nullptr,
       ScrollSnapMode aSnap = nsIScrollbarMediator::DISABLE_SNAP) override {
     mHelper.ScrollTo(aScrollPosition, aMode, nsGkAtoms::other, aRange, aSnap);
   }
   /**
    * @note This method might destroy the frame, pres shell and other objects.
    */
   virtual void ScrollToCSSPixels(const CSSIntPoint& aScrollPosition,
-                                 ScrollMode aMode = ScrollMode::eInstant,
+                                 ScrollMode aMode = ScrollMode::Instant,
                                  nsIScrollbarMediator::ScrollSnapMode aSnap =
                                      nsIScrollbarMediator::DISABLE_SNAP,
                                  nsAtom* aOrigin = nullptr) override {
     mHelper.ScrollToCSSPixels(aScrollPosition, aMode, aSnap, aOrigin);
   }
   virtual void ScrollToCSSPixelsApproximate(
       const mozilla::CSSPoint& aScrollPosition,
       nsAtom* aOrigin = nullptr) override {
@@ -1491,17 +1491,17 @@ class nsXULScrollFrame final : public ns
                         nsIScrollableFrame::ScrollMomentum aMomentum =
                             nsIScrollableFrame::NOT_MOMENTUM,
                         nsIScrollbarMediator::ScrollSnapMode aSnap =
                             nsIScrollbarMediator::DISABLE_SNAP) override {
     mHelper.ScrollBy(aDelta, aUnit, aMode, aOverflow, aOrigin, aMomentum,
                      aSnap);
   }
   virtual void ScrollByCSSPixels(const CSSIntPoint& aDelta,
-                                 ScrollMode aMode = ScrollMode::eInstant,
+                                 ScrollMode aMode = ScrollMode::Instant,
                                  nsAtom* aOrigin = nullptr,
                                  nsIScrollbarMediator::ScrollSnapMode aSnap =
                                      nsIScrollbarMediator::DEFAULT) override {
     mHelper.ScrollByCSSPixels(aDelta, aMode, aOrigin, aSnap);
   }
   virtual void ScrollSnap() override { mHelper.ScrollSnap(); }
   /**
    * @note This method might destroy the frame, pres shell and other objects.
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -43,19 +43,19 @@ const uint32_t nsGridContainerFrame::kTr
     uint32_t(nsStyleGridLine::kMaxLine - nsStyleGridLine::kMinLine);
 const uint32_t nsGridContainerFrame::kAutoLine = kTranslatedMaxLine + 3457U;
 typedef nsTHashtable<nsPtrHashKey<nsIFrame>> FrameHashtable;
 typedef mozilla::CSSAlignUtils::AlignJustifyFlags AlignJustifyFlags;
 typedef nsLayoutUtils::IntrinsicISizeType IntrinsicISizeType;
 
 // https://drafts.csswg.org/css-sizing/#constraints
 enum class SizingConstraint {
-  eMinContent,   // sizing under min-content constraint
-  eMaxContent,   // sizing under max-content constraint
-  eNoConstraint  // no constraint, used during Reflow
+  MinContent,   // sizing under min-content constraint
+  MaxContent,   // sizing under max-content constraint
+  NoConstraint  // no constraint, used during Reflow
 };
 
 static void ReparentFrame(nsIFrame* aFrame, nsContainerFrame* aOldParent,
                           nsContainerFrame* aNewParent) {
   NS_ASSERTION(aOldParent == aFrame->GetParent(),
                "Parent not consistent with expectations");
 
   aFrame->SetParent(aNewParent);
@@ -123,29 +123,29 @@ static nscoord ResolveToDefiniteSize(con
 // this is the end edge of the border box.  For a central baseline it's
 // the center of the border box.
 // https://drafts.csswg.org/css-align-3/#synthesize-baselines
 // For a 'first baseline' the measure is from the border-box start edge and
 // for a 'last baseline' the measure is from the border-box end edge.
 static nscoord SynthesizeBaselineFromBorderBox(BaselineSharingGroup aGroup,
                                                WritingMode aWM,
                                                nscoord aBorderBoxSize) {
-  if (aGroup == BaselineSharingGroup::eFirst) {
+  if (aGroup == BaselineSharingGroup::First) {
     return aWM.IsAlphabeticalBaseline() ? aBorderBoxSize : aBorderBoxSize / 2;
   }
-  MOZ_ASSERT(aGroup == BaselineSharingGroup::eLast);
+  MOZ_ASSERT(aGroup == BaselineSharingGroup::Last);
   // Round up for central baseline offset, to be consistent with eFirst.
   return aWM.IsAlphabeticalBaseline()
              ? 0
              : (aBorderBoxSize / 2) + (aBorderBoxSize % 2);
 }
 
 enum class GridLineSide {
-  eBeforeGridGap,
-  eAfterGridGap,
+  BeforeGridGap,
+  AfterGridGap,
 };
 
 struct nsGridContainerFrame::TrackSize {
   enum StateBits : uint16_t {
     // clang-format off
     eAutoMinSizing =              0x1,
     eMinContentMinSizing =        0x2,
     eMaxContentMinSizing =        0x4,
@@ -254,18 +254,18 @@ TrackSize::StateBits nsGridContainerFram
       break;
     default:
       mLimit = ::ResolveToDefiniteSize(aMaxCoord, aPercentageBasis);
       if (mLimit < mBase) {
         mLimit = mBase;
       }
   }
 
-  mBaselineSubtreeSize[BaselineSharingGroup::eFirst] = nscoord(0);
-  mBaselineSubtreeSize[BaselineSharingGroup::eLast] = nscoord(0);
+  mBaselineSubtreeSize[BaselineSharingGroup::First] = nscoord(0);
+  mBaselineSubtreeSize[BaselineSharingGroup::Last] = nscoord(0);
   return mState;
 }
 
 /**
  * Is aFrame1 a prev-continuation of aFrame2?
  */
 static bool IsPrevContinuationOf(nsIFrame* aFrame1, nsIFrame* aFrame2) {
   nsIFrame* prev = aFrame2;
@@ -1029,20 +1029,20 @@ struct nsGridContainerFrame::TrackSizing
  */
 struct nsGridContainerFrame::Tracks {
   explicit Tracks(LogicalAxis aAxis)
       : mContentBoxSize(0),
         mGridGap(0),
         mStateUnion(TrackSize::StateBits(0)),
         mAxis(aAxis),
         mCanResolveLineRangeSize(false) {
-    mBaselineSubtreeAlign[BaselineSharingGroup::eFirst] = NS_STYLE_ALIGN_AUTO;
-    mBaselineSubtreeAlign[BaselineSharingGroup::eLast] = NS_STYLE_ALIGN_AUTO;
-    mBaseline[BaselineSharingGroup::eFirst] = NS_INTRINSIC_WIDTH_UNKNOWN;
-    mBaseline[BaselineSharingGroup::eLast] = NS_INTRINSIC_WIDTH_UNKNOWN;
+    mBaselineSubtreeAlign[BaselineSharingGroup::First] = NS_STYLE_ALIGN_AUTO;
+    mBaselineSubtreeAlign[BaselineSharingGroup::Last] = NS_STYLE_ALIGN_AUTO;
+    mBaseline[BaselineSharingGroup::First] = NS_INTRINSIC_WIDTH_UNKNOWN;
+    mBaseline[BaselineSharingGroup::Last] = NS_INTRINSIC_WIDTH_UNKNOWN;
   }
 
   void Initialize(const TrackSizingFunctions& aFunctions,
                   const NonNegativeLengthPercentageOrNormal& aGridGap,
                   uint32_t aNumTracks, nscoord aContentBoxSize);
 
   /**
    * Return the union of the state bits for the tracks in aRange.
@@ -1076,21 +1076,21 @@ struct nsGridContainerFrame::Tracks {
 
   /**
    * Apply the additional alignment needed to align the baseline-aligned subtree
    * the item belongs to within its baseline track.
    */
   void AlignBaselineSubtree(const GridItemInfo& aGridItem) const;
 
   enum class TrackSizingPhase {
-    eIntrinsicMinimums,
-    eContentBasedMinimums,
-    eMaxContentMinimums,
-    eIntrinsicMaximums,
-    eMaxContentMaximums,
+    IntrinsicMinimums,
+    ContentBasedMinimums,
+    MaxContentMinimums,
+    IntrinsicMaximums,
+    MaxContentMaximums,
   };
 
   // Some data we collect on each item for Step 2 of the Track Sizing Algorithm
   // in ResolveIntrinsicSize below.
   struct Step2ItemData final {
     uint32_t mSpan;
     TrackSize::StateBits mState;
     LineRange mLineRange;
@@ -1100,23 +1100,23 @@ struct nsGridContainerFrame::Tracks {
     nsIFrame* mFrame;
     static bool IsSpanLessThan(const Step2ItemData& a, const Step2ItemData& b) {
       return a.mSpan < b.mSpan;
     }
 
     template <TrackSizingPhase phase>
     nscoord SizeContributionForPhase() const {
       switch (phase) {
-        case TrackSizingPhase::eIntrinsicMinimums:
-        case TrackSizingPhase::eIntrinsicMaximums:
+        case TrackSizingPhase::IntrinsicMinimums:
+        case TrackSizingPhase::IntrinsicMaximums:
           return mMinSize;
-        case TrackSizingPhase::eContentBasedMinimums:
+        case TrackSizingPhase::ContentBasedMinimums:
           return mMinContentContribution;
-        case TrackSizingPhase::eMaxContentMinimums:
-        case TrackSizingPhase::eMaxContentMaximums:
+        case TrackSizingPhase::MaxContentMinimums:
+        case TrackSizingPhase::MaxContentMaximums:
           return mMaxContentContribution;
       }
       MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Unexpected phase");
     }
   };
 
   using FitContentClamper =
       std::function<bool(uint32_t aTrack, nscoord aMinSize, nscoord* aSize)>;
@@ -1154,22 +1154,22 @@ struct nsGridContainerFrame::Tracks {
                                  const LineRange& aRange,
                                  const GridItemInfo& aGridItem);
 
   // Helper method that returns the track size to use in ยง11.5.1.2
   // https://drafts.csswg.org/css-grid/#extra-space
   template <TrackSizingPhase phase>
   static nscoord StartSizeInDistribution(const TrackSize& aSize) {
     switch (phase) {
-      case TrackSizingPhase::eIntrinsicMinimums:
-      case TrackSizingPhase::eContentBasedMinimums:
-      case TrackSizingPhase::eMaxContentMinimums:
+      case TrackSizingPhase::IntrinsicMinimums:
+      case TrackSizingPhase::ContentBasedMinimums:
+      case TrackSizingPhase::MaxContentMinimums:
         return aSize.mBase;
-      case TrackSizingPhase::eIntrinsicMaximums:
-      case TrackSizingPhase::eMaxContentMaximums:
+      case TrackSizingPhase::IntrinsicMaximums:
+      case TrackSizingPhase::MaxContentMaximums:
         if (aSize.mLimit == NS_UNCONSTRAINEDSIZE) {
           return aSize.mBase;
         }
         return aSize.mLimit;
     }
     MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Unexpected phase");
   }
 
@@ -1212,46 +1212,46 @@ struct nsGridContainerFrame::Tracks {
   }
 
   template <TrackSizingPhase phase>
   void InitializePlan(nsTArray<TrackSize>& aPlan) const {
     for (size_t i = 0, len = aPlan.Length(); i < len; ++i) {
       auto& plan = aPlan[i];
       const auto& sz = mSizes[i];
       plan.mBase = StartSizeInDistribution<phase>(sz);
-      MOZ_ASSERT(phase == TrackSizingPhase::eMaxContentMaximums ||
+      MOZ_ASSERT(phase == TrackSizingPhase::MaxContentMaximums ||
                      !(sz.mState & TrackSize::eInfinitelyGrowable),
                  "forgot to reset the eInfinitelyGrowable bit?");
       plan.mState = sz.mState;
     }
   }
 
   template <TrackSizingPhase phase>
   void CopyPlanToSize(const nsTArray<TrackSize>& aPlan,
                       bool aNeedInfinitelyGrowableFlag = false) {
     for (size_t i = 0, len = mSizes.Length(); i < len; ++i) {
       const auto& plan = aPlan[i];
       MOZ_ASSERT(plan.mBase >= 0);
       auto& sz = mSizes[i];
       switch (phase) {
-        case TrackSizingPhase::eIntrinsicMinimums:
-        case TrackSizingPhase::eContentBasedMinimums:
-        case TrackSizingPhase::eMaxContentMinimums:
+        case TrackSizingPhase::IntrinsicMinimums:
+        case TrackSizingPhase::ContentBasedMinimums:
+        case TrackSizingPhase::MaxContentMinimums:
           sz.mBase = plan.mBase;
           break;
-        case TrackSizingPhase::eIntrinsicMaximums:
+        case TrackSizingPhase::IntrinsicMaximums:
           if (plan.mState & TrackSize::eModified) {
             if (sz.mLimit == NS_UNCONSTRAINEDSIZE &&
                 aNeedInfinitelyGrowableFlag) {
               sz.mState |= TrackSize::eInfinitelyGrowable;
             }
             sz.mLimit = plan.mBase;
           }
           break;
-        case TrackSizingPhase::eMaxContentMaximums:
+        case TrackSizingPhase::MaxContentMaximums:
           if (plan.mState & TrackSize::eModified) {
             sz.mLimit = plan.mBase;
           }
           sz.mState &= ~TrackSize::eInfinitelyGrowable;
           break;
       }
     }
   }
@@ -1352,18 +1352,18 @@ struct nsGridContainerFrame::Tracks {
    * growth limits" https://drafts.csswg.org/css-grid/#extra-space
    * Return the number of tracks that are still growable.
    */
   template <TrackSizingPhase phase>
   static uint32_t MarkExcludedTracks(nsTArray<TrackSize>& aPlan,
                                      const nsTArray<uint32_t>& aGrowableTracks,
                                      TrackSize::StateBits aSelector) {
     uint32_t numGrowable = aGrowableTracks.Length();
-    if (phase == TrackSizingPhase::eIntrinsicMaximums ||
-        phase == TrackSizingPhase::eMaxContentMaximums) {
+    if (phase == TrackSizingPhase::IntrinsicMaximums ||
+        phase == TrackSizingPhase::MaxContentMaximums) {
       // "when handling any intrinsic growth limit: all affected tracks"
       return numGrowable;
     }
     MOZ_ASSERT(aSelector == (aSelector & TrackSize::eIntrinsicMinSizing) &&
                    (aSelector & TrackSize::eMaxContentMinSizing),
                "Should only get here for track sizing steps 2.1 to 2.3");
     // Note that eMaxContentMinSizing is always included. We do those first:
     numGrowable = MarkExcludedTracks(
@@ -1553,17 +1553,17 @@ struct nsGridContainerFrame::Tracks {
   nscoord GridLineEdge(uint32_t aLine, GridLineSide aSide) const {
     if (MOZ_UNLIKELY(mSizes.IsEmpty())) {
       // https://drafts.csswg.org/css-grid/#grid-definition
       // "... the explicit grid still contains one grid line in each axis."
       MOZ_ASSERT(aLine == 0, "We should only resolve line 1 in an empty grid");
       return nscoord(0);
     }
     MOZ_ASSERT(aLine <= mSizes.Length(), "mSizes is too small");
-    if (aSide == GridLineSide::eBeforeGridGap) {
+    if (aSide == GridLineSide::BeforeGridGap) {
       if (aLine == 0) {
         return nscoord(0);
       }
       const TrackSize& sz = mSizes[aLine - 1];
       return sz.mPosition + sz.mBase;
     }
     if (aLine == mSizes.Length()) {
       return mContentBoxSize;
@@ -2343,35 +2343,35 @@ static void AlignJustifySelf(uint8_t aAl
   // NOTE: this is the resulting frame offset (border box).
   nscoord offset = CSSAlignUtils::AlignJustifySelf(
       aAlignment, aAxis, aFlags, aBaselineAdjust, aCBSize, aRI, aChildSize);
 
   // Set the position (aPos) for the requested alignment.
   if (offset != 0) {
     WritingMode wm = aRI.GetWritingMode();
     nscoord& pos = aAxis == eLogicalAxisBlock ? aPos->B(wm) : aPos->I(wm);
-    pos += MOZ_LIKELY(aFlags & AlignJustifyFlags::eSameSide) ? offset : -offset;
+    pos += MOZ_LIKELY(aFlags & AlignJustifyFlags::SameSide) ? offset : -offset;
   }
 }
 
 static void AlignSelf(const nsGridContainerFrame::GridItemInfo& aGridItem,
                       uint8_t aAlignSelf, nscoord aCBSize,
                       const WritingMode aCBWM, const ReflowInput& aRI,
                       const LogicalSize& aSize, LogicalPoint* aPos) {
   auto alignSelf = aAlignSelf;
 
-  AlignJustifyFlags flags = AlignJustifyFlags::eNoFlags;
+  AlignJustifyFlags flags = AlignJustifyFlags::NoFlags;
   if (alignSelf & NS_STYLE_ALIGN_SAFE) {
-    flags |= AlignJustifyFlags::eOverflowSafe;
+    flags |= AlignJustifyFlags::OverflowSafe;
   }
   alignSelf &= ~NS_STYLE_ALIGN_FLAG_BITS;
 
   WritingMode childWM = aRI.GetWritingMode();
   if (aCBWM.ParallelAxisStartsOnSameSide(eLogicalAxisBlock, childWM)) {
-    flags |= AlignJustifyFlags::eSameSide;
+    flags |= AlignJustifyFlags::SameSide;
   }
 
   // Grid's 'align-self' axis is never parallel to the container's inline axis.
   if (alignSelf == NS_STYLE_ALIGN_LEFT || alignSelf == NS_STYLE_ALIGN_RIGHT) {
     alignSelf = NS_STYLE_ALIGN_START;
   }
   if (MOZ_LIKELY(alignSelf == NS_STYLE_ALIGN_NORMAL)) {
     alignSelf = NS_STYLE_ALIGN_STRETCH;
@@ -2391,25 +2391,25 @@ static void AlignSelf(const nsGridContai
 }
 
 static void JustifySelf(const nsGridContainerFrame::GridItemInfo& aGridItem,
                         uint8_t aJustifySelf, nscoord aCBSize,
                         const WritingMode aCBWM, const ReflowInput& aRI,
                         const LogicalSize& aSize, LogicalPoint* aPos) {
   auto justifySelf = aJustifySelf;
 
-  AlignJustifyFlags flags = AlignJustifyFlags::eNoFlags;
+  AlignJustifyFlags flags = AlignJustifyFlags::NoFlags;
   if (justifySelf & NS_STYLE_JUSTIFY_SAFE) {
-    flags |= AlignJustifyFlags::eOverflowSafe;
+    flags |= AlignJustifyFlags::OverflowSafe;
   }
   justifySelf &= ~NS_STYLE_JUSTIFY_FLAG_BITS;
 
   WritingMode childWM = aRI.GetWritingMode();
   if (aCBWM.ParallelAxisStartsOnSameSide(eLogicalAxisInline, childWM)) {
-    flags |= AlignJustifyFlags::eSameSide;
+    flags |= AlignJustifyFlags::SameSide;
   }
 
   if (MOZ_LIKELY(justifySelf == NS_STYLE_ALIGN_NORMAL)) {
     justifySelf = NS_STYLE_ALIGN_STRETCH;
   }
 
   nscoord baselineAdjust = 0;
   // Grid's 'justify-self' axis is always parallel to the container's inline
@@ -3619,17 +3619,17 @@ void nsGridContainerFrame::Tracks::Calcu
     LineRange GridArea::*aRange, SizingConstraint aConstraint) {
   nscoord percentageBasis = aContentBoxSize;
   if (percentageBasis == NS_UNCONSTRAINEDSIZE) {
     percentageBasis = 0;
   }
   InitializeItemBaselines(aState, aGridItems);
   ResolveIntrinsicSize(aState, aGridItems, aFunctions, aRange, percentageBasis,
                        aConstraint);
-  if (aConstraint != SizingConstraint::eMinContent) {
+  if (aConstraint != SizingConstraint::MinContent) {
     nscoord freeSpace = aContentBoxSize;
     if (freeSpace != NS_UNCONSTRAINEDSIZE) {
       freeSpace -= SumOfGridGaps();
     }
     DistributeFreeSpace(freeSpace);
     StretchFlexibleTracks(aState, aGridItems, aFunctions, freeSpace);
   }
 }
@@ -3661,17 +3661,17 @@ bool nsGridContainerFrame::Tracks::Resol
       aGridItem.mState[mAxis] |= ItemState::eApplyAutoMinSize;
       // Clamp it if it's spanning a definite track max-sizing function.
       if (TrackSize::IsDefiniteMaxSizing(sz.mState)) {
         auto maxCoord = aFunctions.MaxSizingFor(aRange.mStart);
         cache.mMinSizeClamp =
             maxCoord.ComputeCoordPercentCalc(aPercentageBasis);
         aGridItem.mState[mAxis] |= ItemState::eClampMarginBoxMinSize;
       }
-      if (aConstraint != SizingConstraint::eMaxContent) {
+      if (aConstraint != SizingConstraint::MaxContent) {
         s = MinContentContribution(aGridItem, aState, rc, wm, mAxis, &cache);
       } else {
         s = MaxContentContribution(aGridItem, aState, rc, wm, mAxis, &cache);
       }
     } else {
       s = MinSize(aGridItem, aState, rc, wm, mAxis, &cache);
     }
     sz.mBase = std::max(sz.mBase, s);
@@ -3746,21 +3746,21 @@ void nsGridContainerFrame::Tracks::Calcu
       item.mGridItem->mBaselineOffset[mAxis] = maxBaseline - item.mBaseline;
       MOZ_ASSERT(item.mGridItem->mBaselineOffset[mAxis] >= 0);
     }
     if (i != 0) {
       // Store the size of this baseline-aligned subtree.
       mSizes[currentTrack].mBaselineSubtreeSize[aBaselineGroup] =
           maxBaseline + maxDescent;
       // Record the first(last) baseline for the first(last) track.
-      if (currentTrack == 0 && aBaselineGroup == BaselineSharingGroup::eFirst) {
+      if (currentTrack == 0 && aBaselineGroup == BaselineSharingGroup::First) {
         mBaseline[aBaselineGroup] = maxBaseline;
       }
       if (currentTrack == lastTrack &&
-          aBaselineGroup == BaselineSharingGroup::eLast) {
+          aBaselineGroup == BaselineSharingGroup::Last) {
         mBaseline[aBaselineGroup] = maxBaseline;
       }
     }
     if (i == len) {
       break;
     }
     // Initialize data for the next track with baseline-aligned items.
     const ItemBaselineData& item = aBaselineItems[i];
@@ -3882,19 +3882,19 @@ void nsGridContainerFrame::Tracks::Initi
       // XXX For now we just pass a zero-sized CB:
       LogicalSize cbSize(childWM, 0, 0);
       ::MeasuringReflow(child, aState.mReflowInput, rc, avail, cbSize);
       nscoord baseline;
       nsGridContainerFrame* grid = do_QueryFrame(child);
       if (state & ItemState::eFirstBaseline) {
         if (grid) {
           if (isOrthogonal == isInlineAxis) {
-            grid->GetBBaseline(BaselineSharingGroup::eFirst, &baseline);
+            grid->GetBBaseline(BaselineSharingGroup::First, &baseline);
           } else {
-            grid->GetIBaseline(BaselineSharingGroup::eFirst, &baseline);
+            grid->GetIBaseline(BaselineSharingGroup::First, &baseline);
           }
         }
         if (grid || nsLayoutUtils::GetFirstLineBaseline(wm, child, &baseline)) {
           NS_ASSERTION(baseline != NS_INTRINSIC_WIDTH_UNKNOWN,
                        "about to use an unknown baseline");
           auto frameSize = isInlineAxis ? child->ISize(wm) : child->BSize(wm);
           auto m = child->GetLogicalUsedMargin(wm);
           baseline += isInlineAxis ? m.IStart(wm) : m.BStart(wm);
@@ -3903,19 +3903,19 @@ void nsGridContainerFrame::Tracks::Initi
           firstBaselineItems.AppendElement(ItemBaselineData(
               {baselineTrack, baseline, alignSize, &gridItem}));
         } else {
           state &= ~ItemState::eAllBaselineBits;
         }
       } else {
         if (grid) {
           if (isOrthogonal == isInlineAxis) {
-            grid->GetBBaseline(BaselineSharingGroup::eLast, &baseline);
+            grid->GetBBaseline(BaselineSharingGroup::Last, &baseline);
           } else {
-            grid->GetIBaseline(BaselineSharingGroup::eLast, &baseline);
+            grid->GetIBaseline(BaselineSharingGroup::Last, &baseline);
           }
         }
         if (grid || nsLayoutUtils::GetLastLineBaseline(wm, child, &baseline)) {
           NS_ASSERTION(baseline != NS_INTRINSIC_WIDTH_UNKNOWN,
                        "about to use an unknown baseline");
           auto frameSize = isInlineAxis ? child->ISize(wm) : child->BSize(wm);
           auto m = child->GetLogicalUsedMargin(wm);
           if (!grid) {
@@ -3949,21 +3949,21 @@ void nsGridContainerFrame::Tracks::Initi
   }
 
   if (firstBaselineItems.IsEmpty() && lastBaselineItems.IsEmpty()) {
     return;
   }
 
   // TODO: CSS Align spec issue - how to align a baseline subtree in a track?
   // https://lists.w3.org/Archives/Public/www-style/2016May/0141.html
-  mBaselineSubtreeAlign[BaselineSharingGroup::eFirst] = NS_STYLE_ALIGN_START;
-  mBaselineSubtreeAlign[BaselineSharingGroup::eLast] = NS_STYLE_ALIGN_END;
-
-  CalculateItemBaselines(firstBaselineItems, BaselineSharingGroup::eFirst);
-  CalculateItemBaselines(lastBaselineItems, BaselineSharingGroup::eLast);
+  mBaselineSubtreeAlign[BaselineSharingGroup::First] = NS_STYLE_ALIGN_START;
+  mBaselineSubtreeAlign[BaselineSharingGroup::Last] = NS_STYLE_ALIGN_END;
+
+  CalculateItemBaselines(firstBaselineItems, BaselineSharingGroup::First);
+  CalculateItemBaselines(lastBaselineItems, BaselineSharingGroup::Last);
 }
 
 void nsGridContainerFrame::Tracks::AlignBaselineSubtree(
     const GridItemInfo& aGridItem) const {
   auto state = aGridItem.mState[mAxis];
   if (!(state & ItemState::eIsBaselineAligned)) {
     return;
   }
@@ -3973,18 +3973,18 @@ void nsGridContainerFrame::Tracks::Align
   if (isFirstBaseline) {
     baselineTrack =
         mAxis == eLogicalAxisBlock ? area.mRows.mStart : area.mCols.mStart;
   } else {
     baselineTrack =
         (mAxis == eLogicalAxisBlock ? area.mRows.mEnd : area.mCols.mEnd) - 1;
   }
   const TrackSize& sz = mSizes[baselineTrack];
-  auto baselineGroup = isFirstBaseline ? BaselineSharingGroup::eFirst
-                                       : BaselineSharingGroup::eLast;
+  auto baselineGroup = isFirstBaseline ? BaselineSharingGroup::First
+                                       : BaselineSharingGroup::Last;
   nscoord delta = sz.mBase - sz.mBaselineSubtreeSize[baselineGroup];
   const auto subtreeAlign = mBaselineSubtreeAlign[baselineGroup];
   switch (subtreeAlign) {
     case NS_STYLE_ALIGN_START:
       if (state & ItemState::eLastBaseline) {
         aGridItem.mBaselineOffset[mAxis] += delta;
       }
       break;
@@ -4005,18 +4005,18 @@ template <nsGridContainerFrame::Tracks::
 bool nsGridContainerFrame::Tracks::GrowSizeForSpanningItems(
     nsTArray<Step2ItemData>::iterator aIter,
     const nsTArray<Step2ItemData>::iterator aIterEnd,
     nsTArray<uint32_t>& aTracks, nsTArray<TrackSize>& aPlan,
     nsTArray<TrackSize>& aItemPlan, TrackSize::StateBits aSelector,
     const FitContentClamper& aFitContentClamper,
     bool aNeedInfinitelyGrowableFlag) {
   constexpr bool isMaxSizingPhase =
-      phase == TrackSizingPhase::eIntrinsicMaximums ||
-      phase == TrackSizingPhase::eMaxContentMaximums;
+      phase == TrackSizingPhase::IntrinsicMaximums ||
+      phase == TrackSizingPhase::MaxContentMaximums;
   bool needToUpdateSizes = false;
   InitializePlan<phase>(aPlan);
   for (; aIter != aIterEnd; ++aIter) {
     const Step2ItemData& item = *aIter;
     if (!(item.mState & aSelector)) {
       continue;
     }
     if (isMaxSizingPhase) {
@@ -4061,22 +4061,22 @@ void nsGridContainerFrame::Tracks::Resol
   };
   AutoTArray<PerSpanData, 16> perSpanData;
   nsTArray<Step2ItemData> step2Items;
   gfxContext* rc = &aState.mRenderingContext;
   WritingMode wm = aState.mWM;
   uint32_t maxSpan = 0;  // max span of the step2Items items
   // Setup track selector for step 2.2:
   const auto contentBasedMinSelector =
-      aConstraint == SizingConstraint::eMinContent
+      aConstraint == SizingConstraint::MinContent
           ? TrackSize::eIntrinsicMinSizing
           : TrackSize::eMinOrMaxContentMinSizing;
   // Setup track selector for step 2.3:
   const auto maxContentMinSelector =
-      aConstraint == SizingConstraint::eMaxContent
+      aConstraint == SizingConstraint::MaxContent
           ? (TrackSize::eMaxContentMinSizing | TrackSize::eAutoMinSizing)
           : TrackSize::eMaxContentMinSizing;
   for (auto& gridItem : aGridItems) {
     MOZ_ASSERT(!(gridItem.mState[mAxis] &
                  (ItemState::eApplyAutoMinSize | ItemState::eIsFlexing |
                   ItemState::eClampMarginBoxMinSize)),
                "Why are any of these bits set already?");
     const GridArea& area = gridItem.mArea;
@@ -4181,35 +4181,35 @@ void nsGridContainerFrame::Tracks::Resol
       const uint32_t span = spanGroupStart->mSpan;
       spanGroupEnd = spanGroupStart + perSpanData[span].mItemCountWithSameSpan;
       TrackSize::StateBits stateBitsForSpan = perSpanData[span].mStateBits;
       bool updatedBase = false;  // Did we update any mBase in step 2.1 - 2.3?
       TrackSize::StateBits selector(TrackSize::eIntrinsicMinSizing);
       if (stateBitsForSpan & selector) {
         // Step 2.1 MinSize to intrinsic min-sizing.
         updatedBase =
-            GrowSizeForSpanningItems<TrackSizingPhase::eIntrinsicMinimums>(
+            GrowSizeForSpanningItems<TrackSizingPhase::IntrinsicMinimums>(
                 spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector);
       }
 
       selector = contentBasedMinSelector;
       if (stateBitsForSpan & selector) {
         // Step 2.2 MinContentContribution to min-/max-content (and 'auto' when
         // sizing under a min-content constraint) min-sizing.
         updatedBase |=
-            GrowSizeForSpanningItems<TrackSizingPhase::eContentBasedMinimums>(
+            GrowSizeForSpanningItems<TrackSizingPhase::ContentBasedMinimums>(
                 spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector);
       }
 
       selector = maxContentMinSelector;
       if (stateBitsForSpan & selector) {
         // Step 2.3 MaxContentContribution to max-content (and 'auto' when
         // sizing under a max-content constraint) min-sizing.
         updatedBase |=
-            GrowSizeForSpanningItems<TrackSizingPhase::eMaxContentMinimums>(
+            GrowSizeForSpanningItems<TrackSizingPhase::MaxContentMinimums>(
                 spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector);
       }
 
       if (updatedBase) {
         // Step 2.4
         for (TrackSize& sz : mSizes) {
           if (sz.mBase > sz.mLimit) {
             sz.mLimit = sz.mBase;
@@ -4217,24 +4217,24 @@ void nsGridContainerFrame::Tracks::Resol
         }
       }
 
       selector = TrackSize::eIntrinsicMaxSizing;
       if (stateBitsForSpan & selector) {
         const bool willRunStep2_6 =
             stateBitsForSpan & TrackSize::eAutoOrMaxContentMaxSizing;
         // Step 2.5 MinSize to intrinsic max-sizing.
-        GrowSizeForSpanningItems<TrackSizingPhase::eIntrinsicMaximums>(
+        GrowSizeForSpanningItems<TrackSizingPhase::IntrinsicMaximums>(
             spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector,
             fitContentClamper, willRunStep2_6);
 
         if (willRunStep2_6) {
           // Step 2.6 MaxContentContribution to max-content max-sizing.
           selector = TrackSize::eAutoOrMaxContentMaxSizing;
-          GrowSizeForSpanningItems<TrackSizingPhase::eMaxContentMaximums>(
+          GrowSizeForSpanningItems<TrackSizingPhase::MaxContentMaximums>(
               spanGroupStart, spanGroupEnd, tracks, plan, itemPlan, selector,
               fitContentClamper);
         }
       }
     }
   }
 
   // Step 3.
@@ -4590,35 +4590,35 @@ void nsGridContainerFrame::LineRange::To
   // kAutoLine for abspos children contributes the corresponding edge
   // of the grid container's padding-box.
   if (mEnd == kAutoLine) {
     if (mStart == kAutoLine) {
       // done
     } else {
       const nscoord endPos = *aPos + *aLength;
       auto side = mStart == aTracks.mSizes.Length()
-                      ? GridLineSide::eBeforeGridGap
-                      : GridLineSide::eAfterGridGap;
+                      ? GridLineSide::BeforeGridGap
+                      : GridLineSide::AfterGridGap;
       nscoord startPos = aTracks.GridLineEdge(mStart, side);
       *aPos = aGridOrigin + startPos;
       *aLength = std::max(endPos - *aPos, 0);
     }
   } else {
     if (mStart == kAutoLine) {
-      auto side = mEnd == 0 ? GridLineSide::eAfterGridGap
-                            : GridLineSide::eBeforeGridGap;
+      auto side =
+          mEnd == 0 ? GridLineSide::AfterGridGap : GridLineSide::BeforeGridGap;
       nscoord endPos = aTracks.GridLineEdge(mEnd, side);
       *aLength = std::max(aGridOrigin + endPos, 0);
     } else if (MOZ_LIKELY(mStart != mEnd)) {
       nscoord pos;
       ToPositionAndLength(aTracks.mSizes, &pos, aLength);
       *aPos = aGridOrigin + pos;
     } else {
       // The grid area only covers removed 'auto-fit' tracks.
-      nscoord pos = aTracks.GridLineEdge(mStart, GridLineSide::eBeforeGridGap);
+      nscoord pos = aTracks.GridLineEdge(mStart, GridLineSide::BeforeGridGap);
       *aPos = aGridOrigin + pos;
       *aLength = nscoord(0);
     }
   }
 }
 
 LogicalSize nsGridContainerFrame::GridReflowInput::PercentageBasisFor(
     LogicalAxis aAxis, const GridItemInfo& aGridItem) const {
@@ -4700,17 +4700,17 @@ nsGridContainerFrame::GetNearestFragment
       data->mIsAutoBSize = bSize == NS_AUTOHEIGHT;
       if (data->mIsAutoBSize) {
         bSize = gridRI->ComputedMinBSize();
       } else {
         bSize = NS_CSS_MINMAX(bSize, gridRI->ComputedMinBSize(),
                               gridRI->ComputedMaxBSize());
       }
       nscoord gridEnd =
-          aState.mRows.GridLineEdge(numRows, GridLineSide::eBeforeGridGap);
+          aState.mRows.GridLineEdge(numRows, GridLineSide::BeforeGridGap);
       data->mCanBreakAtEnd = bSize > gridEnd && bSize > aState.mFragBStart;
       break;
     }
   }
   return data;
 }
 
 void nsGridContainerFrame::ReflowInFlowChild(
@@ -5035,17 +5035,17 @@ nscoord nsGridContainerFrame::ReflowInFr
   // Honor break-inside:avoid if we can't fit all rows.
   if (avoidBreakInside && endRow < numRows) {
     aStatus.SetInlineLineBreakBeforeAndReset();
     return aState.mFragBStart;
   }
 
   // Calculate the block-size including this fragment.
   nscoord bEndRow =
-      aState.mRows.GridLineEdge(endRow, GridLineSide::eBeforeGridGap);
+      aState.mRows.GridLineEdge(endRow, GridLineSide::BeforeGridGap);
   nscoord bSize;
   if (aFragmentainer.mIsAutoBSize) {
     // We only apply min-bsize once all rows are complete (when bsize is auto).
     if (endRow < numRows) {
       bSize = bEndRow;
       auto clampedBSize = ClampToCSSMaxBSize(bSize, aState.mReflowInput);
       if (MOZ_UNLIKELY(clampedBSize != bSize)) {
         // We apply max-bsize in all fragments though.
@@ -5095,17 +5095,17 @@ nscoord nsGridContainerFrame::ReflowInFr
       }
       bSize = newBSize;
     } else if (bSize <= bEndRow && startRow + 1 < endRow) {
       if (endRow == numRows) {
         // We have more than one row in this fragment, so we can break before
         // the last row instead.
         --endRow;
         bEndRow =
-            aState.mRows.GridLineEdge(endRow, GridLineSide::eBeforeGridGap);
+            aState.mRows.GridLineEdge(endRow, GridLineSide::BeforeGridGap);
         bSize = bEndRow;
         if (aFragmentainer.mIsAutoBSize) {
           bSize = ClampToCSSMaxBSize(bSize, aState.mReflowInput);
         }
       }
       aStatus.SetIncomplete();
     } else if (endRow < numRows) {
       bSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowInput, &aStatus);
@@ -5215,19 +5215,19 @@ nscoord nsGridContainerFrame::ReflowRows
     // (but without growing any row) for a InlineBreak::Before child if it spans
     // beyond the last row in this fragment.  This is to avoid fragmenting it.
     // We only restart the loop once.
     aFragmentainer.mIsTopOfPage = isRowTopOfPage && !rowCanGrow;
     nsReflowStatus childStatus;
     // Pass along how much to stretch this fragment, in case it's needed.
     nscoord bSize =
         aState.mRows.GridLineEdge(std::min(aEndRow, info->mArea.mRows.mEnd),
-                                  GridLineSide::eBeforeGridGap) -
+                                  GridLineSide::BeforeGridGap) -
         aState.mRows.GridLineEdge(std::max(aStartRow, row),
-                                  GridLineSide::eAfterGridGap);
+                                  GridLineSide::AfterGridGap);
     ReflowInFlowChild(child, info, aContainerSize, Some(bSize), &aFragmentainer,
                       aState, aContentArea, aDesiredSize, childStatus);
     MOZ_ASSERT(childStatus.IsInlineBreakBefore() ||
                    !childStatus.IsFullyComplete() || !child->GetNextInFlow(),
                "fully-complete reflow should destroy any NIFs");
 
     if (childStatus.IsInlineBreakBefore()) {
       MOZ_ASSERT(
@@ -5244,34 +5244,34 @@ nscoord nsGridContainerFrame::ReflowRows
           }
           didGrowRow = true;
           aEndRow = row + 1;  // growing this row makes the next one not fit
           i = -1;             // i == 0 after the next loop increment
           isRowTopOfPage = isStartRowTopOfPage;
           overflowIncompleteItems.Clear();
           incompleteItems.Clear();
           nscoord bEndRow =
-              aState.mRows.GridLineEdge(aEndRow, GridLineSide::eBeforeGridGap);
+              aState.mRows.GridLineEdge(aEndRow, GridLineSide::BeforeGridGap);
           aFragmentainer.mToFragmentainerEnd = bEndRow;
           if (aFragmentainer.mIsAutoBSize) {
             aBSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowInput, &aStatus);
           } else if (aStatus.IsIncomplete()) {
             aBSize = NS_CSS_MINMAX(aState.mReflowInput->ComputedBSize(),
                                    aState.mReflowInput->ComputedMinBSize(),
                                    aState.mReflowInput->ComputedMaxBSize());
             aBSize = std::min(bEndRow, aBSize);
           }
           continue;
         }
 
         if (!isRowTopOfPage) {
           // We can break before this row - restart with it as the new end row.
           aEndRow = row;
           aBSize =
-              aState.mRows.GridLineEdge(aEndRow, GridLineSide::eBeforeGridGap);
+              aState.mRows.GridLineEdge(aEndRow, GridLineSide::BeforeGridGap);
           i = -1;  // i == 0 after the next loop increment
           isRowTopOfPage = isStartRowTopOfPage;
           overflowIncompleteItems.Clear();
           incompleteItems.Clear();
           aStatus.SetIncomplete();
           continue;
         }
         NS_ERROR("got InlineBreak::Before at top-of-page");
@@ -5499,20 +5499,19 @@ nscoord nsGridContainerFrame::ReflowChil
         }
         *cb = itemCB.GetPhysicalRect(wm, gridCBPhysicalSize);
       }
       // We pass a dummy rect as CB because each child has its own CB rect.
       // The eIsGridContainerCB flag tells nsAbsoluteContainingBlock::Reflow to
       // use those instead.
       nsRect dummyRect;
       AbsPosReflowFlags flags =
-          AbsPosReflowFlags::eCBWidthAndHeightChanged;  // XXX could be
-                                                        // optimized
-      flags |= AbsPosReflowFlags::eConstrainHeight;
-      flags |= AbsPosReflowFlags::eIsGridContainerCB;
+          AbsPosReflowFlags::CBWidthAndHeightChanged;  // XXX could be optimized
+      flags |= AbsPosReflowFlags::ConstrainHeight;
+      flags |= AbsPosReflowFlags::IsGridContainerCB;
       GetAbsoluteContainingBlock()->Reflow(
           this, PresContext(), *aState.mReflowInput, aStatus, dummyRect, flags,
           &aDesiredSize.mOverflowAreas);
     }
   }
   return bSize;
 }
 
@@ -5755,17 +5754,17 @@ void nsGridContainerFrame::Reflow(nsPres
   nscoord consumedBSize = 0;
   nscoord bSize = 0;
   if (!prevInFlow) {
     Grid grid;
     grid.PlaceGridItems(gridReflowInput, aReflowInput.ComputedMinSize(),
                         computedSize, aReflowInput.ComputedMaxSize());
 
     gridReflowInput.CalculateTrackSizes(grid, computedSize,
-                                        SizingConstraint::eNoConstraint);
+                                        SizingConstraint::NoConstraint);
     // XXX Technically incorrect: We're ignoring our row sizes, when really
     // we should use them but *they* should be computed as if we had no
     // children. To be fixed in bug 1488878.
     if (!aReflowInput.mStyleDisplay->IsContainSize()) {
       // Note: we can't use GridLineEdge here since we haven't calculated
       // the rows' mPosition yet (happens in AlignJustifyContent below).
       for (const auto& sz : gridReflowInput.mRows.mSizes) {
         bSize += sz.mBase;
@@ -5776,17 +5775,17 @@ void nsGridContainerFrame::Reflow(nsPres
     consumedBSize = ConsumedBSize(wm);
     gridReflowInput.InitializeForContinuation(this, consumedBSize);
     // XXX Technically incorrect: We're ignoring our row sizes, when really
     // we should use them but *they* should be computed as if we had no
     // children. To be fixed in bug 1488878.
     if (!aReflowInput.mStyleDisplay->IsContainSize()) {
       const uint32_t numRows = gridReflowInput.mRows.mSizes.Length();
       bSize = gridReflowInput.mRows.GridLineEdge(numRows,
-                                                 GridLineSide::eAfterGridGap);
+                                                 GridLineSide::AfterGridGap);
     }
   }
   if (computedBSize == NS_AUTOHEIGHT) {
     bSize = NS_CSS_MINMAX(bSize, aReflowInput.ComputedMinBSize(),
                           aReflowInput.ComputedMaxBSize());
   } else {
     bSize = computedBSize;
   }
@@ -6196,18 +6195,18 @@ nscoord nsGridContainerFrame::IntrinsicI
   Grid grid;
   grid.PlaceGridItems(state, min, sz, max);  // XXX optimize
   if (grid.mGridColEnd == 0) {
     return 0;
   }
   state.mCols.Initialize(state.mColFunctions, state.mGridStyle->mColumnGap,
                          grid.mGridColEnd, NS_UNCONSTRAINEDSIZE);
   auto constraint = aType == nsLayoutUtils::MIN_ISIZE
-                        ? SizingConstraint::eMinContent
-                        : SizingConstraint::eMaxContent;
+                        ? SizingConstraint::MinContent
+                        : SizingConstraint::MaxContent;
   state.mCols.CalculateSizes(state, state.mGridItems, state.mColFunctions,
                              NS_UNCONSTRAINEDSIZE, &GridArea::mCols,
                              constraint);
   nscoord length = 0;
   for (const TrackSize& sz : state.mCols.mSizes) {
     length += sz.mBase;
   }
   return length + state.mCols.SumOfGridGaps();
@@ -6376,17 +6375,17 @@ nscoord nsGridContainerFrame::Synthesize
     BaselineSharingGroup aGroup, const nsSize& aCBPhysicalSize, nscoord aCBSize,
     WritingMode aCBWM) {
   if (MOZ_UNLIKELY(!aGridOrderItem.mItem)) {
     // No item in this fragment - synthesize a baseline from our border-box.
     return ::SynthesizeBaselineFromBorderBox(aGroup, aCBWM, aCBSize);
   }
   auto GetBBaseline = [](BaselineSharingGroup aGroup, WritingMode aWM,
                          const nsIFrame* aFrame, nscoord* aBaseline) {
-    return aGroup == BaselineSharingGroup::eFirst
+    return aGroup == BaselineSharingGroup::First
                ? nsLayoutUtils::GetFirstLineBaseline(aWM, aFrame, aBaseline)
                : nsLayoutUtils::GetLastLineBaseline(aWM, aFrame, aBaseline);
   };
   nsIFrame* child = aGridOrderItem.mItem->mFrame;
   nsGridContainerFrame* grid = do_QueryFrame(child);
   auto childWM = child->GetWritingMode();
   bool isOrthogonal = aCBWM.IsOrthogonalTo(childWM);
   nscoord baseline;
@@ -6395,107 +6394,106 @@ nscoord nsGridContainerFrame::Synthesize
   if (aAxis == eLogicalAxisBlock) {
     start = child->GetLogicalNormalPosition(aCBWM, aCBPhysicalSize).B(aCBWM);
     size = child->BSize(aCBWM);
     if (grid && aGridOrderItem.mIsInEdgeTrack) {
       isOrthogonal ? grid->GetIBaseline(aGroup, &baseline)
                    : grid->GetBBaseline(aGroup, &baseline);
     } else if (!isOrthogonal && aGridOrderItem.mIsInEdgeTrack) {
       baseline =
-          child->BaselineBOffset(childWM, aGroup, AlignmentContext::eGrid);
+          child->BaselineBOffset(childWM, aGroup, AlignmentContext::Grid);
     } else {
       baseline = ::SynthesizeBaselineFromBorderBox(aGroup, childWM, size);
     }
   } else {
     start = child->GetLogicalNormalPosition(aCBWM, aCBPhysicalSize).I(aCBWM);
     size = child->ISize(aCBWM);
     if (grid && aGridOrderItem.mIsInEdgeTrack) {
       isOrthogonal ? grid->GetBBaseline(aGroup, &baseline)
                    : grid->GetIBaseline(aGroup, &baseline);
     } else if (isOrthogonal && aGridOrderItem.mIsInEdgeTrack &&
                GetBBaseline(aGroup, childWM, child, &baseline)) {
-      if (aGroup == BaselineSharingGroup::eLast) {
+      if (aGroup == BaselineSharingGroup::Last) {
         baseline = size - baseline;  // convert to distance from border-box end
       }
     } else {
       baseline = ::SynthesizeBaselineFromBorderBox(aGroup, childWM, size);
     }
   }
-  return aGroup == BaselineSharingGroup::eFirst
+  return aGroup == BaselineSharingGroup::First
              ? start + baseline
              : aCBSize - start - size + baseline;
 }
 
 void nsGridContainerFrame::CalculateBaselines(
     BaselineSet aBaselineSet, CSSOrderAwareFrameIterator* aIter,
     const nsTArray<GridItemInfo>* aGridItems, const Tracks& aTracks,
     uint32_t aFragmentStartTrack, uint32_t aFirstExcludedTrack, WritingMode aWM,
     const nsSize& aCBPhysicalSize, nscoord aCBBorderPaddingStart,
     nscoord aCBBorderPaddingEnd, nscoord aCBSize) {
   const auto axis = aTracks.mAxis;
-  auto firstBaseline = aTracks.mBaseline[BaselineSharingGroup::eFirst];
+  auto firstBaseline = aTracks.mBaseline[BaselineSharingGroup::First];
   if (!(aBaselineSet & BaselineSet::eFirst)) {
-    mBaseline[axis][BaselineSharingGroup::eFirst] =
-        ::SynthesizeBaselineFromBorderBox(BaselineSharingGroup::eFirst, aWM,
+    mBaseline[axis][BaselineSharingGroup::First] =
+        ::SynthesizeBaselineFromBorderBox(BaselineSharingGroup::First, aWM,
                                           aCBSize);
   } else if (firstBaseline == NS_INTRINSIC_WIDTH_UNKNOWN) {
     FindItemInGridOrderResult gridOrderFirstItem = FindFirstItemInGridOrder(
         *aIter, *aGridItems,
         axis == eLogicalAxisBlock ? &GridArea::mRows : &GridArea::mCols,
         axis == eLogicalAxisBlock ? &GridArea::mCols : &GridArea::mRows,
         aFragmentStartTrack);
-    mBaseline[axis][BaselineSharingGroup::eFirst] = SynthesizeBaseline(
-        gridOrderFirstItem, axis, BaselineSharingGroup::eFirst, aCBPhysicalSize,
+    mBaseline[axis][BaselineSharingGroup::First] = SynthesizeBaseline(
+        gridOrderFirstItem, axis, BaselineSharingGroup::First, aCBPhysicalSize,
         aCBSize, aWM);
   } else {
     // We have a 'first baseline' group in the start track in this fragment.
     // Convert it from track to grid container border-box coordinates.
     MOZ_ASSERT(!aGridItems->IsEmpty());
     nscoord gapBeforeStartTrack =
         aFragmentStartTrack == 0
             ? aTracks.GridLineEdge(aFragmentStartTrack,
-                                   GridLineSide::eAfterGridGap)
+                                   GridLineSide::AfterGridGap)
             : nscoord(0);  // no content gap at start of fragment
-    mBaseline[axis][BaselineSharingGroup::eFirst] =
+    mBaseline[axis][BaselineSharingGroup::First] =
         aCBBorderPaddingStart + gapBeforeStartTrack + firstBaseline;
   }
 
-  auto lastBaseline = aTracks.mBaseline[BaselineSharingGroup::eLast];
+  auto lastBaseline = aTracks.mBaseline[BaselineSharingGroup::Last];
   if (!(aBaselineSet & BaselineSet::eLast)) {
-    mBaseline[axis][BaselineSharingGroup::eLast] =
-        ::SynthesizeBaselineFromBorderBox(BaselineSharingGroup::eLast, aWM,
+    mBaseline[axis][BaselineSharingGroup::Last] =
+        ::SynthesizeBaselineFromBorderBox(BaselineSharingGroup::Last, aWM,
                                           aCBSize);
   } else if (lastBaseline == NS_INTRINSIC_WIDTH_UNKNOWN) {
     // For finding items for the 'last baseline' we need to create a reverse
     // iterator ('aIter' is the forward iterator from the GridReflowInput).
     using Iter = ReverseCSSOrderAwareFrameIterator;
     auto orderState = aIter->ItemsAreAlreadyInOrder()
                           ? Iter::OrderState::eKnownOrdered
                           : Iter::OrderState::eKnownUnordered;
     Iter iter(this, kPrincipalList, Iter::ChildFilter::eSkipPlaceholders,
               orderState);
     iter.SetItemCount(aGridItems->Length());
     FindItemInGridOrderResult gridOrderLastItem = FindLastItemInGridOrder(
         iter, *aGridItems,
         axis == eLogicalAxisBlock ? &GridArea::mRows : &GridArea::mCols,
         axis == eLogicalAxisBlock ? &GridArea::mCols : &GridArea::mRows,
         aFragmentStartTrack, aFirstExcludedTrack);
-    mBaseline[axis][BaselineSharingGroup::eLast] =
-        SynthesizeBaseline(gridOrderLastItem, axis, BaselineSharingGroup::eLast,
+    mBaseline[axis][BaselineSharingGroup::Last] =
+        SynthesizeBaseline(gridOrderLastItem, axis, BaselineSharingGroup::Last,
                            aCBPhysicalSize, aCBSize, aWM);
   } else {
     // We have a 'last baseline' group in the end track in this fragment.
     // Convert it from track to grid container border-box coordinates.
     MOZ_ASSERT(!aGridItems->IsEmpty());
     auto borderBoxStartToEndOfEndTrack =
         aCBBorderPaddingStart +
-        aTracks.GridLineEdge(aFirstExcludedTrack,
-                             GridLineSide::eBeforeGridGap) -
-        aTracks.GridLineEdge(aFragmentStartTrack, GridLineSide::eBeforeGridGap);
-    mBaseline[axis][BaselineSharingGroup::eLast] =
+        aTracks.GridLineEdge(aFirstExcludedTrack, GridLineSide::BeforeGridGap) -
+        aTracks.GridLineEdge(aFragmentStartTrack, GridLineSide::BeforeGridGap);
+    mBaseline[axis][BaselineSharingGroup::Last] =
         (aCBSize - borderBoxStartToEndOfEndTrack) + lastBaseline;
   }
 }
 
 #ifdef DEBUG_FRAME_DUMP
 nsresult nsGridContainerFrame::GetFrameName(nsAString& aResult) const {
   return MakeFrameName(NS_LITERAL_STRING("GridContainer"), aResult);
 }
--- a/layout/generic/nsGridContainerFrame.h
+++ b/layout/generic/nsGridContainerFrame.h
@@ -115,23 +115,23 @@ class nsGridContainerFrame final : publi
                         const nsDisplayListSet& aLists) override;
 
   nscoord GetLogicalBaseline(mozilla::WritingMode aWM) const override {
     if (HasAnyStateBits(NS_STATE_GRID_SYNTHESIZE_BASELINE)) {
       // Return a baseline synthesized from our margin-box.
       return nsContainerFrame::GetLogicalBaseline(aWM);
     }
     nscoord b;
-    GetBBaseline(BaselineSharingGroup::eFirst, &b);
+    GetBBaseline(BaselineSharingGroup::First, &b);
     return b;
   }
 
   bool GetVerticalAlignBaseline(mozilla::WritingMode aWM,
                                 nscoord* aBaseline) const override {
-    return GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::eFirst,
+    return GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::First,
                                      aBaseline);
   }
 
   bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
                                  BaselineSharingGroup aBaselineGroup,
                                  nscoord* aBaseline) const override {
     if (HasAnyStateBits(NS_STATE_GRID_SYNTHESIZE_BASELINE)) {
       return false;
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -448,26 +448,26 @@ enum nsBidiDirection {
   NSBIDI_MIXED
 };
 
 namespace mozilla {
 
 // https://drafts.csswg.org/css-align-3/#baseline-sharing-group
 enum class BaselineSharingGroup {
   // NOTE Used as an array index so must be 0 and 1.
-  eFirst = 0,
-  eLast = 1,
+  First = 0,
+  Last = 1,
 };
 
 // Loosely: https://drafts.csswg.org/css-align-3/#shared-alignment-context
 enum class AlignmentContext {
-  eInline,
-  eTable,
-  eFlexbox,
-  eGrid,
+  Inline,
+  Table,
+  Flexbox,
+  Grid,
 };
 
 /*
  * For replaced elements only. Gets the intrinsic dimensions of this element,
  * which can be specified on a per-axis basis.
  */
 struct IntrinsicSize {
   Maybe<nscoord> width;
@@ -1462,17 +1462,17 @@ class nsIFrame : public nsQueryFrame {
                                  BaselineSharingGroup aBaselineGroup,
                                  AlignmentContext aAlignmentContext) const;
 
   /**
    * XXX: this method is taking over the role that GetLogicalBaseline has.
    * Return true if the frame has a CSS2 'vertical-align' baseline.
    * If it has, then the returned baseline is the distance from the block-
    * axis border-box start edge.
-   * @note This method should only be used in AlignmentContext::eInline
+   * @note This method should only be used in AlignmentContext::Inline
    * contexts.
    * @note The returned value is only valid when reflow is not needed.
    * @note You should only call this on frames with a WM that's parallel to aWM.
    * @param aWM the writing-mode of the alignment context
    * @param aBaseline the baseline offset, only valid if the method returns true
    */
   virtual bool GetVerticalAlignBaseline(mozilla::WritingMode aWM,
                                         nscoord* aBaseline) const {
@@ -2618,30 +2618,29 @@ class nsIFrame : public nsQueryFrame {
     nsAutoString mString;
     uint32_t mOffsetWithinNodeRenderedText;
     int32_t mOffsetWithinNodeText;
     RenderedText()
         : mOffsetWithinNodeRenderedText(0), mOffsetWithinNodeText(0) {}
   };
   enum class TextOffsetType {
     // Passed-in start and end offsets are within the content text.
-    OFFSETS_IN_CONTENT_TEXT,
+    OffsetsInContentText,
     // Passed-in start and end offsets are within the rendered text.
-    OFFSETS_IN_RENDERED_TEXT
+    OffsetsInRenderedText,
   };
   enum class TrailingWhitespace {
-    TRIM_TRAILING_WHITESPACE,
+    Trim,
     // Spaces preceding a caret at the end of a line should not be trimmed
-    DONT_TRIM_TRAILING_WHITESPACE
+    DontTrim,
   };
   virtual RenderedText GetRenderedText(
       uint32_t aStartOffset = 0, uint32_t aEndOffset = UINT32_MAX,
-      TextOffsetType aOffsetType = TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-      TrailingWhitespace aTrimTrailingWhitespace =
-          TrailingWhitespace::TRIM_TRAILING_WHITESPACE) {
+      TextOffsetType aOffsetType = TextOffsetType::OffsetsInContentText,
+      TrailingWhitespace aTrimTrailingWhitespace = TrailingWhitespace::Trim) {
     return RenderedText();
   }
 
   /**
    * Returns true if the frame contains any non-collapsed characters.
    * This method is only available for text frames, and it will return false
    * for all other frame types.
    */
--- a/layout/generic/nsIFrameInlines.h
+++ b/layout/generic/nsIFrameInlines.h
@@ -86,65 +86,65 @@ bool nsIFrame::IsColumnSpanInMulticolSub
 mozilla::StyleDisplay nsIFrame::GetDisplay() const {
   return StyleDisplay()->GetDisplay(this);
 }
 
 nscoord nsIFrame::SynthesizeBaselineBOffsetFromMarginBox(
     mozilla::WritingMode aWM, BaselineSharingGroup aGroup) const {
   MOZ_ASSERT(!aWM.IsOrthogonalTo(GetWritingMode()));
   auto margin = GetLogicalUsedMargin(aWM);
-  if (aGroup == BaselineSharingGroup::eFirst) {
+  if (aGroup == BaselineSharingGroup::First) {
     if (aWM.IsAlphabeticalBaseline()) {
       // First baseline for inverted-line content is the block-start margin
       // edge, as the frame is in effect "flipped" for alignment purposes.
       return MOZ_UNLIKELY(aWM.IsLineInverted()) ? -margin.BStart(aWM)
                                                 : BSize(aWM) + margin.BEnd(aWM);
     }
     nscoord marginBoxCenter = (BSize(aWM) + margin.BStartEnd(aWM)) / 2;
     return marginBoxCenter - margin.BStart(aWM);
   }
-  MOZ_ASSERT(aGroup == BaselineSharingGroup::eLast);
+  MOZ_ASSERT(aGroup == BaselineSharingGroup::Last);
   if (aWM.IsAlphabeticalBaseline()) {
     // Last baseline for inverted-line content is the block-start margin edge,
     // as the frame is in effect "flipped" for alignment purposes.
     return MOZ_UNLIKELY(aWM.IsLineInverted()) ? BSize(aWM) + margin.BStart(aWM)
                                               : -margin.BEnd(aWM);
   }
   // Round up for central baseline offset, to be consistent with eFirst.
   nscoord marginBoxSize = BSize(aWM) + margin.BStartEnd(aWM);
   nscoord marginBoxCenter = (marginBoxSize / 2) + (marginBoxSize % 2);
   return marginBoxCenter - margin.BEnd(aWM);
 }
 
 nscoord nsIFrame::SynthesizeBaselineBOffsetFromBorderBox(
     mozilla::WritingMode aWM, BaselineSharingGroup aGroup) const {
   MOZ_ASSERT(!aWM.IsOrthogonalTo(GetWritingMode()));
   nscoord borderBoxSize = BSize(aWM);
-  if (aGroup == BaselineSharingGroup::eFirst) {
+  if (aGroup == BaselineSharingGroup::First) {
     return MOZ_LIKELY(aWM.IsAlphabeticalBaseline()) ? borderBoxSize
                                                     : borderBoxSize / 2;
   }
-  MOZ_ASSERT(aGroup == BaselineSharingGroup::eLast);
+  MOZ_ASSERT(aGroup == BaselineSharingGroup::Last);
   // Round up for central baseline offset, to be consistent with eFirst.
   auto borderBoxCenter = (borderBoxSize / 2) + (borderBoxSize % 2);
   return MOZ_LIKELY(aWM.IsAlphabeticalBaseline()) ? 0 : borderBoxCenter;
 }
 
 nscoord nsIFrame::BaselineBOffset(mozilla::WritingMode aWM,
                                   BaselineSharingGroup aBaselineGroup,
                                   AlignmentContext aAlignmentContext) const {
   MOZ_ASSERT(!aWM.IsOrthogonalTo(GetWritingMode()));
   nscoord baseline;
   if (GetNaturalBaselineBOffset(aWM, aBaselineGroup, &baseline)) {
     return baseline;
   }
-  if (aAlignmentContext == AlignmentContext::eInline) {
+  if (aAlignmentContext == AlignmentContext::Inline) {
     return SynthesizeBaselineBOffsetFromMarginBox(aWM, aBaselineGroup);
   }
-  // XXX AlignmentContext::eTable should use content box?
+  // XXX AlignmentContext::Table should use content box?
   return SynthesizeBaselineBOffsetFromBorderBox(aWM, aBaselineGroup);
 }
 
 void nsIFrame::PropagateRootElementWritingMode(
     mozilla::WritingMode aRootElemWM) {
   MOZ_ASSERT(IsCanvasFrame());
   for (auto f = this; f; f = f->GetParent()) {
     f->mWritingMode = aRootElemWM;
--- a/layout/generic/nsIScrollableFrame.h
+++ b/layout/generic/nsIScrollableFrame.h
@@ -234,17 +234,17 @@ class nsIScrollableFrame : public nsIScr
    * range and / or moving in any direction; GetScrollPositionCSSPixels will be
    * exactly aScrollPosition at the end of the scroll animation unless the
    * SMOOTH_MSD animation is interrupted.
    *
    * FIXME: Drop |aSnap| argument once after we finished the migration to the
    * Scroll Snap Module v1. We should alway use ENABLE_SNAP.
    */
   virtual void ScrollToCSSPixels(const CSSIntPoint& aScrollPosition,
-                                 ScrollMode aMode = ScrollMode::eInstant,
+                                 ScrollMode aMode = ScrollMode::Instant,
                                  nsIScrollbarMediator::ScrollSnapMode aSnap =
                                      nsIScrollbarMediator::DEFAULT,
                                  nsAtom* aOrigin = nullptr) = 0;
   /**
    * @note This method might destroy the frame, pres shell and other objects.
    * Scrolls to a particular position in float CSS pixels.
    * This does not guarantee that GetScrollPositionCSSPixels equals
    * aScrollPosition afterward. It tries to scroll as close to
@@ -280,17 +280,17 @@ class nsIScrollableFrame : public nsIScr
                         nsIScrollbarMediator::ScrollSnapMode aSnap =
                             nsIScrollbarMediator::DISABLE_SNAP) = 0;
 
   /**
    * FIXME: Drop |aSnap| argument once after we finished the migration to the
    * Scroll Snap Module v1. We should alway use ENABLE_SNAP.
    */
   virtual void ScrollByCSSPixels(const CSSIntPoint& aDelta,
-                                 ScrollMode aMode = ScrollMode::eInstant,
+                                 ScrollMode aMode = ScrollMode::Instant,
                                  nsAtom* aOrigin = nullptr,
                                  nsIScrollbarMediator::ScrollSnapMode aSnap =
                                      nsIScrollbarMediator::DEFAULT) = 0;
 
   /**
    * Perform scroll snapping, possibly resulting in a smooth scroll to
    * maintain the scroll snap position constraints.  Velocity sampled from
    * main thread scrolling is used to determine best matching snap point
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -116,17 +116,17 @@ nsIIOService* nsImageFrame::sIOService;
 static bool HaveSpecifiedSize(const nsStylePosition* aStylePosition) {
   // check the width and height values in the reflow input's style struct
   // - if width and height are specified as either coord or percentage, then
   //   the size of the image frame is constrained
   return aStylePosition->mWidth.IsLengthPercentage() &&
          aStylePosition->mHeight.IsLengthPercentage();
 }
 
-template<typename SizeOrMaxSize>
+template <typename SizeOrMaxSize>
 static bool DependsOnIntrinsicSize(const SizeOrMaxSize& aMinOrMaxSize) {
   if (!aMinOrMaxSize.IsExtremumLength()) {
     return false;
   }
   auto keyword = aMinOrMaxSize.AsExtremumLength();
   switch (keyword) {
     case StyleExtremumLength::MinContent:
     case StyleExtremumLength::MaxContent:
@@ -836,17 +836,17 @@ void nsImageFrame::MaybeDecodeForPredict
   if (!mImage) {
     return;  // Nothing to do yet.
   }
 
   if (mComputedSize.IsEmpty()) {
     return;  // We won't draw anything, so no point in decoding.
   }
 
-  if (GetVisibility() != Visibility::APPROXIMATELY_VISIBLE) {
+  if (GetVisibility() != Visibility::ApproximatelyVisible) {
     return;  // We're not visible, so don't decode.
   }
 
   // OK, we're ready to decode. Compute the scale to the screen...
   mozilla::PresShell* presShell = PresContext()->PresShell();
   LayoutDeviceToScreenScale2D resolutionToScreen(
       presShell->GetCumulativeResolution() *
       nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(this));
@@ -1385,17 +1385,17 @@ ImgDrawResult nsImageFrame::DisplayAltFe
     // Assert that we're not drawing a border-image here; if we were, we
     // couldn't ignore the ImgDrawResult that PaintBorderWithStyleBorder
     // returns.
     MOZ_ASSERT(recessedBorder.mBorderImageSource.GetType() ==
                eStyleImageType_Null);
 
     Unused << nsCSSRendering::PaintBorderWithStyleBorder(
         PresContext(), aRenderingContext, this, inner, inner, recessedBorder,
-        mComputedStyle, PaintBorderFlags::SYNC_DECODE_IMAGES);
+        mComputedStyle, PaintBorderFlags::SyncDecodeImages);
   }
 
   // Adjust the inner rect to account for the one pixel recessed border,
   // and a six pixel padding on each edge
   inner.Deflate(
       nsPresContext::CSSPixelsToAppUnits(ICON_PADDING + ALT_BORDER_WIDTH),
       nsPresContext::CSSPixelsToAppUnits(ICON_PADDING + ALT_BORDER_WIDTH));
   if (inner.IsEmpty()) {
@@ -2344,17 +2344,17 @@ nsresult nsImageFrame::AttributeChanged(
 
 void nsImageFrame::OnVisibilityChange(
     Visibility aNewVisibility, const Maybe<OnNonvisible>& aNonvisibleAction) {
   if (mKind == Kind::ImageElement) {
     nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
     imageLoader->OnVisibilityChange(aNewVisibility, aNonvisibleAction);
   }
 
-  if (aNewVisibility == Visibility::APPROXIMATELY_VISIBLE) {
+  if (aNewVisibility == Visibility::ApproximatelyVisible) {
     MaybeDecodeForPredictedSize();
   }
 
   nsAtomicContainerFrame::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
 }
 
 #ifdef DEBUG_FRAME_DUMP
 nsresult nsImageFrame::GetFrameName(nsAString& aResult) const {
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -357,17 +357,17 @@ void nsPageFrame::DrawHeaderFooter(gfxCo
 
     // set up new clip and draw the text
     aRenderingContext.Save();
     aRenderingContext.Clip(NSRectToSnappedRect(
         aRect, PresContext()->AppUnitsPerDevPixel(), *drawTarget));
     aRenderingContext.SetColor(Color(0.f, 0.f, 0.f));
     nsLayoutUtils::DrawString(this, aFontMetrics, &aRenderingContext, str.get(),
                               str.Length(), nsPoint(x, y + aAscent), nullptr,
-                              DrawStringFlags::eForceHorizontal);
+                              DrawStringFlags::ForceHorizontal);
     aRenderingContext.Restore();
   }
 }
 
 /**
  * Remove all leaf display items that are not for descendants of
  * aBuilder->GetReferenceFrame() from aList.
  * @param aPage the page we're constructing the display list for
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -658,20 +658,20 @@ nsSimplePageSequenceFrame::PrintNextPage
         ("SeqFr::PrintNextPage -> %p PageNo: %d", currentPageFrame, mPageNum));
 
     // CreateRenderingContext can fail
     RefPtr<gfxContext> gCtx = dc->CreateRenderingContext();
     NS_ENSURE_TRUE(gCtx, NS_ERROR_OUT_OF_MEMORY);
 
     nsRect drawingRect(nsPoint(0, 0), currentPageFrame->GetSize());
     nsRegion drawingRegion(drawingRect);
-    nsLayoutUtils::PaintFrame(
-        gCtx, currentPageFrame, drawingRegion, NS_RGBA(0, 0, 0, 0),
-        nsDisplayListBuilderMode::PAINTING,
-        nsLayoutUtils::PaintFrameFlags::PAINT_SYNC_DECODE_IMAGES);
+    nsLayoutUtils::PaintFrame(gCtx, currentPageFrame, drawingRegion,
+                              NS_RGBA(0, 0, 0, 0),
+                              nsDisplayListBuilderMode::Painting,
+                              nsLayoutUtils::PaintFrameFlags::SyncDecodeImages);
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsSimplePageSequenceFrame::DoPageEnd() {
   nsresult rv = NS_OK;
   if (PresContext()->IsRootPaginatedDocument() && mPrintThisPage) {
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -535,37 +535,37 @@ void nsSubDocumentFrame::BuildDisplayLis
       aBuilder->SetIgnoreScrollFrame(savedIgnoreScrollFrame);
     }
   }
 
   // Generate a resolution and/or zoom item if needed. If one or both of those
   // is created, we don't need to create a separate nsDisplaySubDocument.
 
   nsDisplayOwnLayerFlags flags =
-      nsDisplayOwnLayerFlags::eGenerateSubdocInvalidations;
+      nsDisplayOwnLayerFlags::GenerateSubdocInvalidations;
   // If ignoreViewportScrolling is true then the top most layer we create here
   // is going to become the scrollable layer for the root scroll frame, so we
   // want to add nsDisplayOwnLayer::GENERATE_SCROLLABLE_LAYER to whatever layer
   // becomes the topmost. We do this below.
   if (constructZoomItem) {
     nsDisplayOwnLayerFlags zoomFlags = flags;
     if (ignoreViewportScrolling && !constructResolutionItem) {
-      zoomFlags |= nsDisplayOwnLayerFlags::eGenerateScrollableLayer;
+      zoomFlags |= nsDisplayOwnLayerFlags::GenerateScrollableLayer;
     }
     childItems.AppendNewToTop<nsDisplayZoom>(aBuilder, subdocRootFrame, this,
                                              &childItems, subdocAPD, parentAPD,
                                              zoomFlags);
 
     needsOwnLayer = false;
   }
   // Wrap the zoom item in the resolution item if we have both because we want
   // the resolution scale applied on top of the app units per dev pixel
   // conversion.
   if (ignoreViewportScrolling) {
-    flags |= nsDisplayOwnLayerFlags::eGenerateScrollableLayer;
+    flags |= nsDisplayOwnLayerFlags::GenerateScrollableLayer;
   }
   if (constructResolutionItem) {
     childItems.AppendNewToTop<nsDisplayResolution>(aBuilder, subdocRootFrame,
                                                    this, &childItems, flags);
 
     needsOwnLayer = false;
   }
 
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -227,33 +227,33 @@ static const nsFrameState TEXT_WHITESPAC
  *
  *   - A ComplexTextRunUserData in the case a text run maps to multiple flows,
  *   but we need to keep a list of glyph observers.
  *
  *   - A TextRunUserData in the case a text run maps multiple flows, but it
  *   doesn't have any glyph observer for changes in SVG fonts.
  *
  * You can differentiate between the four different cases with the
- * TEXT_IS_SIMPLE_FLOW and TEXT_MIGHT_HAVE_GLYPH_CHANGES flags.
+ * IsSimpleFlow and MightHaveGlyphChanges flags.
  *
  * We go to considerable effort to make sure things work even if in-flow
  * siblings have different ComputedStyles (i.e., first-letter and first-line).
  *
  * Our convention is that unsigned integer character offsets are offsets into
  * the transformed string. Signed integer character offsets are offsets into
  * the DOM string.
  *
  * XXX currently we don't handle hyphenated breaks between text frames where the
  * hyphen occurs at the end of the first text frame, e.g.
  *   <b>Kit&shy;</b>ty
  */
 
 /**
  * This is our user data for the textrun, when textRun->GetFlags2() has
- * TEXT_IS_SIMPLE_FLOW set, and also TEXT_MIGHT_HAVE_GLYPH_CHANGES.
+ * IsSimpleFlow set, and also MightHaveGlyphChanges.
  *
  * This allows having an array of observers if there are fonts whose glyphs
  * might change, but also avoid allocation in the simple case that there aren't.
  */
 struct SimpleTextRunUserData {
   nsTArray<UniquePtr<GlyphObserver>> mGlyphObservers;
   nsTextFrame* mFrame;
   explicit SimpleTextRunUserData(nsTextFrame* aFrame) : mFrame(aFrame) {}
@@ -291,17 +291,17 @@ struct TextRunUserData {
   TextRunMappedFlow* mMappedFlows;
 #endif
   uint32_t mMappedFlowCount;
   uint32_t mLastFlowIndex;
 };
 
 /**
  * This is our user data for the textrun, when textRun->GetFlags2() does not
- * have TEXT_IS_SIMPLE_FLOW set and has the TEXT_MIGHT HAVE_GLYPH_CHANGES flag.
+ * have IsSimpleFlow set and has the MightHaveGlyphChanges flag.
  */
 struct ComplexTextRunUserData : public TextRunUserData {
   nsTArray<UniquePtr<GlyphObserver>> mGlyphObservers;
 };
 
 /**
  * This helper object computes colors used for painting, and also IME
  * underline information. The data is computed lazily and cached as necessary.
@@ -474,43 +474,40 @@ static void DestroyComplexUserData(Compl
   if (aUserData) {
     aUserData->~ComplexTextRunUserData();
     free(aUserData);
   }
 }
 
 static void DestroyTextRunUserData(gfxTextRun* aTextRun) {
   MOZ_ASSERT(aTextRun->GetUserData());
-  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW) {
+  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow) {
     if (aTextRun->GetFlags2() &
-        nsTextFrameUtils::Flags::TEXT_MIGHT_HAVE_GLYPH_CHANGES) {
+        nsTextFrameUtils::Flags::MightHaveGlyphChanges) {
       delete static_cast<SimpleTextRunUserData*>(aTextRun->GetUserData());
     }
   } else {
     if (aTextRun->GetFlags2() &
-        nsTextFrameUtils::Flags::TEXT_MIGHT_HAVE_GLYPH_CHANGES) {
+        nsTextFrameUtils::Flags::MightHaveGlyphChanges) {
       DestroyComplexUserData(
           static_cast<ComplexTextRunUserData*>(aTextRun->GetUserData()));
     } else {
       DestroyUserData(static_cast<TextRunUserData*>(aTextRun->GetUserData()));
     }
   }
-  aTextRun->ClearFlagBits(
-      nsTextFrameUtils::Flags::TEXT_MIGHT_HAVE_GLYPH_CHANGES);
+  aTextRun->ClearFlagBits(nsTextFrameUtils::Flags::MightHaveGlyphChanges);
   aTextRun->SetUserData(nullptr);
 }
 
 static TextRunMappedFlow* GetMappedFlows(const gfxTextRun* aTextRun) {
   MOZ_ASSERT(aTextRun->GetUserData(), "UserData must exist.");
-  MOZ_ASSERT(
-      !(aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW),
-      "The method should not be called for simple flows.");
+  MOZ_ASSERT(!(aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow),
+             "The method should not be called for simple flows.");
   TextRunMappedFlow* flows;
-  if (aTextRun->GetFlags2() &
-      nsTextFrameUtils::Flags::TEXT_MIGHT_HAVE_GLYPH_CHANGES) {
+  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::MightHaveGlyphChanges) {
     flows = reinterpret_cast<TextRunMappedFlow*>(
         static_cast<ComplexTextRunUserData*>(aTextRun->GetUserData()) + 1);
   } else {
     flows = reinterpret_cast<TextRunMappedFlow*>(
         static_cast<TextRunUserData*>(aTextRun->GetUserData()) + 1);
   }
   MOZ_ASSERT(
       static_cast<TextRunUserData*>(aTextRun->GetUserData())->mMappedFlows ==
@@ -519,21 +516,19 @@ static TextRunMappedFlow* GetMappedFlows
   return flows;
 }
 
 /**
  * These are utility functions just for helping with the complexity related with
  * the text runs user data.
  */
 static nsTextFrame* GetFrameForSimpleFlow(const gfxTextRun* aTextRun) {
-  MOZ_ASSERT(
-      aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW,
-      "Not so simple flow?");
-  if (aTextRun->GetFlags2() &
-      nsTextFrameUtils::Flags::TEXT_MIGHT_HAVE_GLYPH_CHANGES) {
+  MOZ_ASSERT(aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow,
+             "Not so simple flow?");
+  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::MightHaveGlyphChanges) {
     return static_cast<SimpleTextRunUserData*>(aTextRun->GetUserData())->mFrame;
   }
 
   return static_cast<nsTextFrame*>(aTextRun->GetUserData());
 }
 
 /**
  * Remove |aTextRun| from the frame continuation chain starting at
@@ -587,17 +582,17 @@ static bool ClearAllTextRunReferences(ns
  * checking |aTextRun->GetUserData() == nullptr|.
  */
 static void UnhookTextRunFromFrames(gfxTextRun* aTextRun,
                                     nsTextFrame* aStartContinuation) {
   if (!aTextRun->GetUserData()) {
     return;
   }
 
-  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW) {
+  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow) {
     nsTextFrame* userDataFrame = GetFrameForSimpleFlow(aTextRun);
     nsFrameState whichTextRunState =
         userDataFrame->GetTextRun(nsTextFrame::eInflated) == aTextRun
             ? TEXT_IN_TEXTRUN_USER_DATA
             : TEXT_IN_UNINFLATED_TEXTRUN_USER_DATA;
     DebugOnly<bool> found = ClearAllTextRunReferences(
         userDataFrame, aTextRun, aStartContinuation, whichTextRunState);
     NS_ASSERTION(!aStartContinuation || found,
@@ -663,17 +658,17 @@ static void InvalidateFrameDueToGlyphsCh
       // of text frames affected and we'd like to coalesce the work. So that's
       // not easy to do well.
       presShell->FrameNeedsReflow(f, IntrinsicDirty::Resize, NS_FRAME_IS_DIRTY);
     }
   }
 }
 
 void GlyphObserver::NotifyGlyphsChanged() {
-  if (mTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW) {
+  if (mTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow) {
     InvalidateFrameDueToGlyphsChanged(GetFrameForSimpleFlow(mTextRun));
     return;
   }
 
   auto data = static_cast<TextRunUserData*>(mTextRun->GetUserData());
   TextRunMappedFlow* userMappedFlows = GetMappedFlows(mTextRun);
   for (uint32_t i = 0; i < data->mMappedFlowCount; ++i) {
     InvalidateFrameDueToGlyphsChanged(userMappedFlows[i].mStartFrame);
@@ -860,21 +855,21 @@ static bool IsAllWhitespace(const nsText
       continue;
     return false;
   }
   return true;
 }
 
 static void ClearObserversFromTextRun(gfxTextRun* aTextRun) {
   if (!(aTextRun->GetFlags2() &
-        nsTextFrameUtils::Flags::TEXT_MIGHT_HAVE_GLYPH_CHANGES)) {
+        nsTextFrameUtils::Flags::MightHaveGlyphChanges)) {
     return;
   }
 
-  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW) {
+  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow) {
     static_cast<SimpleTextRunUserData*>(aTextRun->GetUserData())
         ->mGlyphObservers.Clear();
   } else {
     static_cast<ComplexTextRunUserData*>(aTextRun->GetUserData())
         ->mGlyphObservers.Clear();
   }
 }
 
@@ -890,40 +885,40 @@ static void CreateObserversForAnimatedGl
   const gfxTextRun::GlyphRun* glyphRuns = aTextRun->GetGlyphRuns(&numGlyphRuns);
   for (uint32_t i = 0; i < numGlyphRuns; ++i) {
     gfxFont* font = glyphRuns[i].mFont;
     if (font->GlyphsMayChange() && !fontsWithAnimatedGlyphs.Contains(font)) {
       fontsWithAnimatedGlyphs.AppendElement(font);
     }
   }
   if (fontsWithAnimatedGlyphs.IsEmpty()) {
-    // NB: Theoretically, we should clear the TEXT_MIGHT_HAVE_GLYPH_CHANGES
+    // NB: Theoretically, we should clear the MightHaveGlyphChanges
     // here. That would involve de-allocating the simple user data struct if
     // present too, and resetting the pointer to the frame. In practice, I
     // don't think worth doing that work here, given the flag's only purpose is
     // to distinguish what kind of user data is there.
     return;
   }
 
   nsTArray<UniquePtr<GlyphObserver>>* observers;
 
-  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW) {
+  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow) {
     // Swap the frame pointer for a just-allocated SimpleTextRunUserData if
     // appropriate.
     if (!(aTextRun->GetFlags2() &
-          nsTextFrameUtils::Flags::TEXT_MIGHT_HAVE_GLYPH_CHANGES)) {
+          nsTextFrameUtils::Flags::MightHaveGlyphChanges)) {
       auto frame = static_cast<nsTextFrame*>(aTextRun->GetUserData());
       aTextRun->SetUserData(new SimpleTextRunUserData(frame));
     }
 
     auto data = static_cast<SimpleTextRunUserData*>(aTextRun->GetUserData());
     observers = &data->mGlyphObservers;
   } else {
     if (!(aTextRun->GetFlags2() &
-          nsTextFrameUtils::Flags::TEXT_MIGHT_HAVE_GLYPH_CHANGES)) {
+          nsTextFrameUtils::Flags::MightHaveGlyphChanges)) {
       auto oldData = static_cast<TextRunUserData*>(aTextRun->GetUserData());
       TextRunMappedFlow* oldMappedFlows = GetMappedFlows(aTextRun);
       ComplexTextRunUserData* data =
           CreateComplexUserData(oldData->mMappedFlowCount);
       TextRunMappedFlow* dataMappedFlows =
           reinterpret_cast<TextRunMappedFlow*>(data + 1);
       data->mLastFlowIndex = oldData->mLastFlowIndex;
       for (uint32_t i = 0; i < oldData->mMappedFlowCount; ++i) {
@@ -931,17 +926,17 @@ static void CreateObserversForAnimatedGl
       }
       DestroyUserData(oldData);
       aTextRun->SetUserData(data);
     }
     auto data = static_cast<ComplexTextRunUserData*>(aTextRun->GetUserData());
     observers = &data->mGlyphObservers;
   }
 
-  aTextRun->SetFlagBits(nsTextFrameUtils::Flags::TEXT_MIGHT_HAVE_GLYPH_CHANGES);
+  aTextRun->SetFlagBits(nsTextFrameUtils::Flags::MightHaveGlyphChanges);
 
   for (auto font : fontsWithAnimatedGlyphs) {
     observers->AppendElement(new GlyphObserver(font, aTextRun));
   }
 }
 
 /**
  * This class accumulates state as we scan a paragraph of text. It detects
@@ -1066,40 +1061,37 @@ class BuildTextRunsScanner {
           mOffsetIntoTextRun(aOffsetIntoTextRun) {}
 
     void SetBreaks(uint32_t aOffset, uint32_t aLength,
                    uint8_t* aBreakBefore) final {
       gfxTextRun::Range range(aOffset + mOffsetIntoTextRun,
                               aOffset + mOffsetIntoTextRun + aLength);
       if (mTextRun->SetPotentialLineBreaks(range, aBreakBefore)) {
         // Be conservative and assume that some breaks have been set
-        mTextRun->ClearFlagBits(nsTextFrameUtils::Flags::TEXT_NO_BREAKS);
+        mTextRun->ClearFlagBits(nsTextFrameUtils::Flags::NoBreaks);
       }
     }
 
     void SetCapitalization(uint32_t aOffset, uint32_t aLength,
                            bool* aCapitalize) final {
-      MOZ_ASSERT(
-          mTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_TRANSFORMED,
-          "Text run should be transformed!");
-      if (mTextRun->GetFlags2() &
-          nsTextFrameUtils::Flags::TEXT_IS_TRANSFORMED) {
+      MOZ_ASSERT(mTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsTransformed,
+                 "Text run should be transformed!");
+      if (mTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsTransformed) {
         nsTransformedTextRun* transformedTextRun =
             static_cast<nsTransformedTextRun*>(mTextRun.get());
         transformedTextRun->SetCapitalization(aOffset + mOffsetIntoTextRun,
                                               aLength, aCapitalize);
       }
     }
 
     void Finish(gfxMissingFontRecorder* aMFR) {
       MOZ_ASSERT(
-          !(mTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_UNUSED_FLAGS),
+          !(mTextRun->GetFlags2() & nsTextFrameUtils::Flags::UnusedFlags),
           "Flag set that should never be set! (memory safety error?)");
-      if (mTextRun->GetFlags2() &
-          nsTextFrameUtils::Flags::TEXT_IS_TRANSFORMED) {
+      if (mTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsTransformed) {
         nsTransformedTextRun* transformedTextRun =
             static_cast<nsTransformedTextRun*>(mTextRun.get());
         transformedTextRun->FinishSettingProperties(mDrawTarget, aMFR);
       }
       // The way nsTransformedTextRun is implemented, its glyph runs aren't
       // available until after nsTransformedTextRun::FinishSettingProperties()
       // is called. So that's why we defer checking for animated glyphs to here.
       CreateObserversForAnimatedGlyphs(mTextRun);
@@ -1582,17 +1574,17 @@ static char16_t* ExpandBuffer(char16_t* 
     ++aSrc;
     --aCount;
   }
   return aDest;
 }
 
 bool BuildTextRunsScanner::IsTextRunValidForMappedFlows(
     const gfxTextRun* aTextRun) {
-  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW) {
+  if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow) {
     return mMappedFlows.Length() == 1 &&
            mMappedFlows[0].mStartFrame == GetFrameForSimpleFlow(aTextRun) &&
            mMappedFlows[0].mEndFrame == nullptr;
   }
 
   auto userData = static_cast<TextRunUserData*>(aTextRun->GetUserData());
   TextRunMappedFlow* userMappedFlows = GetMappedFlows(aTextRun);
   if (userData->mMappedFlowCount != mMappedFlows.Length()) return false;
@@ -1611,17 +1603,17 @@ bool BuildTextRunsScanner::IsTextRunVali
  * frames.
  */
 void BuildTextRunsScanner::FlushFrames(bool aFlushLineBreaks,
                                        bool aSuppressTrailingBreak) {
   RefPtr<gfxTextRun> textRun;
   if (!mMappedFlows.IsEmpty()) {
     if (!mSkipIncompleteTextRuns && mCurrentFramesAllSameTextRun &&
         !!(mCurrentFramesAllSameTextRun->GetFlags2() &
-           nsTextFrameUtils::Flags::TEXT_INCOMING_WHITESPACE) ==
+           nsTextFrameUtils::Flags::IncomingWhitespace) ==
             !!(mCurrentRunContextInfo &
                nsTextFrameUtils::INCOMING_WHITESPACE) &&
         !!(mCurrentFramesAllSameTextRun->GetFlags() &
            gfx::ShapedTextFlags::TEXT_INCOMING_ARABICCHAR) ==
             !!(mCurrentRunContextInfo &
                nsTextFrameUtils::INCOMING_ARABICCHAR) &&
         IsTextRunValidForMappedFlows(mCurrentFramesAllSameTextRun)) {
       // Optimization: We do not need to (re)build the textrun.
@@ -1629,18 +1621,17 @@ void BuildTextRunsScanner::FlushFrames(b
 
       // Feed this run's text into the linebreaker to provide context.
       if (!SetupLineBreakerContext(textRun)) {
         return;
       }
 
       // Update mNextRunContextInfo appropriately
       mNextRunContextInfo = nsTextFrameUtils::INCOMING_NONE;
-      if (textRun->GetFlags2() &
-          nsTextFrameUtils::Flags::TEXT_TRAILING_WHITESPACE) {
+      if (textRun->GetFlags2() & nsTextFrameUtils::Flags::TrailingWhitespace) {
         mNextRunContextInfo |= nsTextFrameUtils::INCOMING_WHITESPACE;
       }
       if (textRun->GetFlags() &
           gfx::ShapedTextFlags::TEXT_TRAILING_ARABICCHAR) {
         mNextRunContextInfo |= nsTextFrameUtils::INCOMING_ARABICCHAR;
       }
     } else {
       AutoTArray<uint8_t, BIG_TEXT_NODE_SIZE> buffer;
@@ -1663,18 +1654,17 @@ void BuildTextRunsScanner::FlushFrames(b
 
 void BuildTextRunsScanner::FlushLineBreaks(gfxTextRun* aTrailingTextRun) {
   bool trailingLineBreak;
   nsresult rv = mLineBreaker.Reset(&trailingLineBreak);
   // textRun may be null for various reasons, including because we constructed
   // a partial textrun just to get the linebreaker and other state set up
   // to build the next textrun.
   if (NS_SUCCEEDED(rv) && trailingLineBreak && aTrailingTextRun) {
-    aTrailingTextRun->SetFlagBits(
-        nsTextFrameUtils::Flags::TEXT_HAS_TRAILING_BREAK);
+    aTrailingTextRun->SetFlagBits(nsTextFrameUtils::Flags::HasTrailingBreak);
   }
 
   for (uint32_t i = 0; i < mBreakSinks.Length(); ++i) {
     // TODO cause frames associated with the textrun to be reflowed, if they
     // aren't being reflowed already!
     mBreakSinks[i]->Finish(mMissingFonts);
   }
   mBreakSinks.Clear();
@@ -2086,20 +2076,20 @@ already_AddRefed<gfxTextRun> BuildTextRu
 
   const void* textPtr = aTextBuffer;
   bool anyTextTransformStyle = false;
   bool anyMathMLStyling = false;
   bool anyTextEmphasis = false;
   uint8_t sstyScriptLevel = 0;
   uint32_t mathFlags = 0;
   gfx::ShapedTextFlags flags = gfx::ShapedTextFlags();
-  nsTextFrameUtils::Flags flags2 = nsTextFrameUtils::Flags::TEXT_NO_BREAKS;
+  nsTextFrameUtils::Flags flags2 = nsTextFrameUtils::Flags::NoBreaks;
 
   if (mCurrentRunContextInfo & nsTextFrameUtils::INCOMING_WHITESPACE) {
-    flags2 |= nsTextFrameUtils::Flags::TEXT_INCOMING_WHITESPACE;
+    flags2 |= nsTextFrameUtils::Flags::IncomingWhitespace;
   }
   if (mCurrentRunContextInfo & nsTextFrameUtils::INCOMING_ARABICCHAR) {
     flags |= gfx::ShapedTextFlags::TEXT_INCOMING_ARABICCHAR;
   }
 
   AutoTArray<int32_t, 50> textBreakPoints;
   TextRunUserData dummyData;
   TextRunMappedFlow dummyMappedFlow;
@@ -2159,17 +2149,17 @@ already_AddRefed<gfxTextRun> BuildTextRu
     }
     fontStyle = f->StyleFont();
     nsIFrame* parent = mLineContainer->GetParent();
     if (NS_MATHML_MATHVARIANT_NONE != fontStyle->mMathVariant) {
       if (NS_MATHML_MATHVARIANT_NORMAL != fontStyle->mMathVariant) {
         anyMathMLStyling = true;
       }
     } else if (mLineContainer->GetStateBits() & NS_FRAME_IS_IN_SINGLE_CHAR_MI) {
-      flags2 |= nsTextFrameUtils::Flags::TEXT_IS_SINGLE_CHAR_MI;
+      flags2 |= nsTextFrameUtils::Flags::IsSingleCharMi;
       anyMathMLStyling = true;
       // Test for fontstyle attribute as StyleFont() may not be accurate
       // To be consistent in terms of ignoring CSS style changes, fontweight
       // gets checked too.
       if (parent) {
         nsIContent* content = parent->GetContent();
         if (content && content->IsElement()) {
           if (content->AsElement()->AttrValueIs(
@@ -2287,17 +2277,17 @@ already_AddRefed<gfxTextRun> BuildTextRu
             end - static_cast<const uint8_t*>(textPtr);
       }
     }
     flags2 |= analysisFlags;
   }
 
   void* finalUserData;
   if (userData == &dummyData) {
-    flags2 |= nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW;
+    flags2 |= nsTextFrameUtils::Flags::IsSimpleFlow;
     userData = nullptr;
     finalUserData = mMappedFlows[0].mStartFrame;
   } else {
     finalUserData = userData;
   }
 
   uint32_t transformedLength = currentTransformedTextOffset;
 
@@ -2313,27 +2303,27 @@ already_AddRefed<gfxTextRun> BuildTextRu
     fontGroup = GetInflatedFontGroupForFrame(firstFrame);
   }
 
   if (!fontGroup) {
     DestroyUserData(userDataToDestroy);
     return nullptr;
   }
 
-  if (flags2 & nsTextFrameUtils::Flags::TEXT_HAS_TAB) {
+  if (flags2 & nsTextFrameUtils::Flags::HasTab) {
     flags |= gfx::ShapedTextFlags::TEXT_ENABLE_SPACING;
   }
-  if (flags2 & nsTextFrameUtils::Flags::TEXT_HAS_SHY) {
+  if (flags2 & nsTextFrameUtils::Flags::HasShy) {
     flags |= gfx::ShapedTextFlags::TEXT_ENABLE_HYPHEN_BREAKS;
   }
   if (mBidiEnabled && (IS_LEVEL_RTL(firstFrame->GetEmbeddingLevel()))) {
     flags |= gfx::ShapedTextFlags::TEXT_IS_RTL;
   }
   if (mNextRunContextInfo & nsTextFrameUtils::INCOMING_WHITESPACE) {
-    flags2 |= nsTextFrameUtils::Flags::TEXT_TRAILING_WHITESPACE;
+    flags2 |= nsTextFrameUtils::Flags::TrailingWhitespace;
   }
   if (mNextRunContextInfo & nsTextFrameUtils::INCOMING_ARABICCHAR) {
     flags |= gfx::ShapedTextFlags::TEXT_TRAILING_ARABICCHAR;
   }
   // ContinueTextRunAcrossFrames guarantees that it doesn't matter which
   // frame's style is used, so we use a mixture of the first frame and
   // last frame's style
   flags |= nsLayoutUtils::GetTextRunFlagsForStyle(
@@ -2394,17 +2384,17 @@ already_AddRefed<gfxTextRun> BuildTextRu
           }
         }
         uint32_t j;
         for (j = offset; j < end; ++j) {
           styles.AppendElement(charStyle);
         }
       }
     }
-    flags2 |= nsTextFrameUtils::Flags::TEXT_IS_TRANSFORMED;
+    flags2 |= nsTextFrameUtils::Flags::IsTransformed;
     NS_ASSERTION(iter.GetSkippedOffset() == transformedLength,
                  "We didn't cover all the characters in the text run!");
   }
 
   RefPtr<gfxTextRun> textRun;
   gfxTextRunFactory::Parameters params = {
       mDrawTarget,
       finalUserData,
@@ -2625,17 +2615,17 @@ void BuildTextRunsScanner::SetupBreakSin
             initialBreakController)) {
       flags |= nsLineBreaker::BREAK_SUPPRESS_INITIAL;
     }
     nsTextFrame* startFrame = mappedFlow->mStartFrame;
     const nsStyleText* textStyle = startFrame->StyleText();
     if (!textStyle->WhiteSpaceCanWrap(startFrame)) {
       flags |= nsLineBreaker::BREAK_SUPPRESS_INSIDE;
     }
-    if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_NO_BREAKS) {
+    if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::NoBreaks) {
       flags |= nsLineBreaker::BREAK_SKIP_SETTING_NO_BREAKS;
     }
     if (textStyle->mTextTransform.case_ == StyleTextTransformCase::Capitalize) {
       flags |= nsLineBreaker::BREAK_NEED_CAPITALIZATION;
     }
     if (textStyle->mHyphens == StyleHyphens::Auto) {
       flags |= nsLineBreaker::BREAK_USE_AUTO_HYPHENATION;
     }
@@ -2765,18 +2755,17 @@ void BuildTextRunsScanner::AssignTextRun
     MappedFlow* mappedFlow = &mMappedFlows[i];
     nsTextFrame* startFrame = mappedFlow->mStartFrame;
     nsTextFrame* endFrame = mappedFlow->mEndFrame;
     nsTextFrame* f;
     for (f = startFrame; f != endFrame; f = f->GetNextContinuation()) {
 #ifdef DEBUG_roc
       if (f->GetTextRun(mWhichTextRun)) {
         gfxTextRun* textRun = f->GetTextRun(mWhichTextRun);
-        if (textRun->GetFlags2() &
-            nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW) {
+        if (textRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow) {
           if (mMappedFlows[0].mStartFrame != GetFrameForSimpleFlow(textRun)) {
             NS_WARNING("REASSIGNING SIMPLE FLOW TEXT RUN!");
           }
         } else {
           auto userData =
               static_cast<TextRunUserData*>(aTextRun->GetUserData());
           TextRunMappedFlow* userMappedFlows = GetMappedFlows(aTextRun);
           if (userData->mMappedFlowCount >= mMappedFlows.Length() ||
@@ -2787,18 +2776,17 @@ void BuildTextRunsScanner::AssignTextRun
         }
       }
 #endif
 
       gfxTextRun* oldTextRun = f->GetTextRun(mWhichTextRun);
       if (oldTextRun) {
         nsTextFrame* firstFrame = nullptr;
         uint32_t startOffset = 0;
-        if (oldTextRun->GetFlags2() &
-            nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW) {
+        if (oldTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow) {
           firstFrame = GetFrameForSimpleFlow(oldTextRun);
         } else {
           auto userData =
               static_cast<TextRunUserData*>(oldTextRun->GetUserData());
           TextRunMappedFlow* userMappedFlows = GetMappedFlows(oldTextRun);
           firstFrame = userMappedFlows[0].mStartFrame;
           if (MOZ_UNLIKELY(f != firstFrame)) {
             TextRunMappedFlow* flow =
@@ -2872,17 +2860,17 @@ gfxSkipCharsIterator nsTextFrame::Ensure
                                   0);
     }
     TabWidthStore* tabWidths = GetProperty(TabWidthProperty());
     if (tabWidths && tabWidths->mValidForContentOffset != GetContentOffset()) {
       DeleteProperty(TabWidthProperty());
     }
   }
 
-  if (textRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_SIMPLE_FLOW) {
+  if (textRun->GetFlags2() & nsTextFrameUtils::Flags::IsSimpleFlow) {
     if (aFlowEndInTextRun) {
       *aFlowEndInTextRun = textRun->GetLength();
     }
     return gfxSkipCharsIterator(textRun->GetSkipChars(), 0, mContentOffset);
   }
 
   auto userData = static_cast<TextRunUserData*>(textRun->GetUserData());
   TextRunMappedFlow* userMappedFlows = GetMappedFlows(textRun);
@@ -2924,17 +2912,17 @@ static uint32_t GetEndOfTrimmedText(cons
       return aIterator->GetSkippedOffset() + 1;
   }
   return aStart;
 }
 
 nsTextFrame::TrimmedOffsets nsTextFrame::GetTrimmedOffsets(
     const nsTextFragment* aFrag, TrimmedOffsetFlags aFlags) const {
   NS_ASSERTION(mTextRun, "Need textrun here");
-  if (!(aFlags & TrimmedOffsetFlags::kNotPostReflow)) {
+  if (!(aFlags & TrimmedOffsetFlags::NotPostReflow)) {
     // This should not be used during reflow. We need our TEXT_REFLOW_FLAGS
     // to be set correctly.  If our parent wasn't reflowed due to the frame
     // tree being too deep then the return value doesn't matter.
     NS_ASSERTION(
         !(GetStateBits() & NS_FRAME_FIRST_REFLOW) ||
             (GetParent()->GetStateBits() & NS_FRAME_TOO_DEEP_IN_FRAME_TREE),
         "Can only call this on frames that have been reflowed");
     NS_ASSERTION(!(GetStateBits() & NS_FRAME_IN_REFLOW),
@@ -2942,27 +2930,27 @@ nsTextFrame::TrimmedOffsets nsTextFrame:
   }
 
   TrimmedOffsets offsets = {GetContentOffset(), GetContentLength()};
   const nsStyleText* textStyle = StyleText();
   // Note that pre-line newlines should still allow us to trim spaces
   // for display
   if (textStyle->WhiteSpaceIsSignificant()) return offsets;
 
-  if (!(aFlags & TrimmedOffsetFlags::kNoTrimBefore) &&
-      ((aFlags & TrimmedOffsetFlags::kNotPostReflow) ||
+  if (!(aFlags & TrimmedOffsetFlags::NoTrimBefore) &&
+      ((aFlags & TrimmedOffsetFlags::NotPostReflow) ||
        (GetStateBits() & TEXT_START_OF_LINE))) {
     int32_t whitespaceCount =
         GetTrimmableWhitespaceCount(aFrag, offsets.mStart, offsets.mLength, 1);
     offsets.mStart += whitespaceCount;
     offsets.mLength -= whitespaceCount;
   }
 
-  if (!(aFlags & TrimmedOffsetFlags::kNoTrimAfter) &&
-      ((aFlags & TrimmedOffsetFlags::kNotPostReflow) ||
+  if (!(aFlags & TrimmedOffsetFlags::NoTrimAfter) &&
+      ((aFlags & TrimmedOffsetFlags::NotPostReflow) ||
        (GetStateBits() & TEXT_END_OF_LINE))) {
     // This treats a trailing 'pre-line' newline as trimmable. That's fine,
     // it's actually what we want since we want whitespace before it to
     // be trimmed.
     int32_t whitespaceCount = GetTrimmableWhitespaceCount(
         aFrag, offsets.GetEnd() - 1, offsets.mLength, -1);
     offsets.mLength -= whitespaceCount;
   }
@@ -3408,17 +3396,17 @@ JustificationInfo PropertyProvider::Comp
   }
   return info;
 }
 
 // aStart, aLength in transformed string offsets
 void PropertyProvider::GetSpacing(Range aRange, Spacing* aSpacing) const {
   GetSpacingInternal(
       aRange, aSpacing,
-      !(mTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_HAS_TAB));
+      !(mTextRun->GetFlags2() & nsTextFrameUtils::Flags::HasTab));
 }
 
 static bool CanAddSpacingAfter(const gfxTextRun* aTextRun, uint32_t aOffset) {
   if (aOffset + 1 >= aTextRun->GetLength()) return true;
   return aTextRun->IsClusterStart(aOffset + 1) &&
          aTextRun->IsLigatureGroupStart(aOffset + 1) &&
          !aTextRun->CharIsFormattingControl(aOffset);
 }
@@ -3692,26 +3680,26 @@ void PropertyProvider::GetHyphenationBre
         aBreakBefore[i] = HyphenType::AutoWithoutManualInSameWord;
       }
     }
   }
 }
 
 void PropertyProvider::InitializeForDisplay(bool aTrimAfter) {
   nsTextFrame::TrimmedOffsets trimmed = mFrame->GetTrimmedOffsets(
-      mFrag, (aTrimAfter ? nsTextFrame::TrimmedOffsetFlags::kDefaultTrimFlags
-                         : nsTextFrame::TrimmedOffsetFlags::kNoTrimAfter));
+      mFrag, (aTrimAfter ? nsTextFrame::TrimmedOffsetFlags::Default
+                         : nsTextFrame::TrimmedOffsetFlags::NoTrimAfter));
   mStart.SetOriginalOffset(trimmed.mStart);
   mLength = trimmed.mLength;
   SetupJustificationSpacing(true);
 }
 
 void PropertyProvider::InitializeForMeasure() {
   nsTextFrame::TrimmedOffsets trimmed = mFrame->GetTrimmedOffsets(
-      mFrag, nsTextFrame::TrimmedOffsetFlags::kNotPostReflow);
+      mFrag, nsTextFrame::TrimmedOffsetFlags::NotPostReflow);
   mStart.SetOriginalOffset(trimmed.mStart);
   mLength = trimmed.mLength;
   SetupJustificationSpacing(false);
 }
 
 void PropertyProvider::SetupJustificationSpacing(bool aPostReflow) {
   MOZ_ASSERT(mLength != INT32_MAX, "Can't call this with undefined length");
 
@@ -3719,18 +3707,18 @@ void PropertyProvider::SetupJustificatio
     return;
   }
 
   gfxSkipCharsIterator start(mStart), end(mStart);
   // We can't just use our mLength here; when InitializeForDisplay is
   // called with false for aTrimAfter, we still shouldn't be assigning
   // justification space to any trailing whitespace.
   nsTextFrame::TrimmedOffsets trimmed = mFrame->GetTrimmedOffsets(
-      mFrag, (aPostReflow ? nsTextFrame::TrimmedOffsetFlags::kDefaultTrimFlags
-                          : nsTextFrame::TrimmedOffsetFlags::kNotPostReflow));
+      mFrag, (aPostReflow ? nsTextFrame::TrimmedOffsetFlags::Default
+                          : nsTextFrame::TrimmedOffsetFlags::NotPostReflow));
   end.AdvanceOriginal(trimmed.mLength);
   gfxSkipCharsIterator realEnd(end);
 
   Range range(uint32_t(start.GetOriginalOffset()),
               uint32_t(end.GetOriginalOffset()));
   nsTArray<JustificationAssignment> assignments;
   JustificationInfo info = ComputeJustification(range, &assignments);
 
@@ -4280,18 +4268,18 @@ nscolor nsTextPaintStyle::GetResolvedFor
 }
 
 //-----------------------------------------------------------------------------
 
 #ifdef ACCESSIBILITY
 a11y::AccType nsTextFrame::AccessibleType() {
   if (IsEmpty()) {
     RenderedText text =
-        GetRenderedText(0, UINT32_MAX, TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-                        TrailingWhitespace::DONT_TRIM_TRAILING_WHITESPACE);
+        GetRenderedText(0, UINT32_MAX, TextOffsetType::OffsetsInContentText,
+                        TrailingWhitespace::DontTrim);
     if (text.mString.IsEmpty()) {
       return a11y::eNoType;
     }
   }
 
   return a11y::eTextLeafType;
 }
 #endif
@@ -7572,17 +7560,17 @@ nsIFrame::FrameSearchResult nsTextFrame:
       return CONTINUE_UNSELECTABLE;
     }
   }
 
   gfxSkipCharsIterator iter = EnsureTextRun(nsTextFrame::eInflated);
   if (!mTextRun) return CONTINUE_EMPTY;
 
   TrimmedOffsets trimmed =
-      GetTrimmedOffsets(mContent->GetText(), TrimmedOffsetFlags::kNoTrimAfter);
+      GetTrimmedOffsets(mContent->GetText(), TrimmedOffsetFlags::NoTrimAfter);
 
   // A negative offset means "end of frame".
   int32_t startOffset =
       GetContentOffset() + (*aOffset < 0 ? contentLength : *aOffset);
 
   if (!aForward) {
     // If at the beginning of the line, look at the previous continuation
     for (int32_t i = std::min(trimmed.GetEnd(), startOffset) - 1;
@@ -7707,19 +7695,19 @@ ClusterIterator::ClusterIterator(nsTextF
   if (!aTextFrame->GetTextRun(nsTextFrame::eInflated)) {
     mDirection = 0;  // signal failure
     return;
   }
   mIterator.SetOriginalOffset(aPosition);
 
   mFrag = aTextFrame->GetContent()->GetText();
   mTrimmed = aTextFrame->GetTrimmedOffsets(
-      mFrag, aTrimSpaces ? nsTextFrame::TrimmedOffsetFlags::kDefaultTrimFlags
-                         : nsTextFrame::TrimmedOffsetFlags::kNoTrimAfter |
-                               nsTextFrame::TrimmedOffsetFlags::kNoTrimBefore);
+      mFrag, aTrimSpaces ? nsTextFrame::TrimmedOffsetFlags::Default
+                         : nsTextFrame::TrimmedOffsetFlags::NoTrimAfter |
+                               nsTextFrame::TrimmedOffsetFlags::NoTrimBefore);
 
   int32_t textOffset = aTextFrame->GetContentOffset();
   int32_t textLen = aTextFrame->GetContentLength();
   if (!mWordBreaks.AppendElements(textLen + 1)) {
     mDirection = 0;  // signal failure
     return;
   }
   memset(mWordBreaks.Elements(), false, (textLen + 1) * sizeof(bool));
@@ -8128,17 +8116,17 @@ void nsTextFrame::AddInlineMinISizeForFl
       }
       gfxFloat afterTab = AdvanceToNextTab(aData->mCurrentLine, tabWidth,
                                            provider.MinTabAdvance());
       aData->mCurrentLine = nscoord(afterTab + spacing.mAfter);
       wordStart = i + 1;
     } else if (i < flowEndInTextRun ||
                (i == textRun->GetLength() &&
                 (textRun->GetFlags2() &
-                 nsTextFrameUtils::Flags::TEXT_HAS_TRAILING_BREAK))) {
+                 nsTextFrameUtils::Flags::HasTrailingBreak))) {
       if (preformattedNewline) {
         aData->ForceBreak();
       } else if (i < flowEndInTextRun && hyphenating &&
                  hyphBuffer[i - start] != gfxTextRun::HyphenType::None) {
         aData->OptionallyBreak(NSToCoordRound(provider.GetHyphenWidth()));
       } else {
         aData->OptionallyBreak();
       }
@@ -8427,18 +8415,17 @@ nsresult nsTextFrame::GetPrefWidthTightB
 static bool HasSoftHyphenBefore(const nsTextFragment* aFrag,
                                 const gfxTextRun* aTextRun,
                                 int32_t aStartOffset,
                                 const gfxSkipCharsIterator& aIter) {
   if (aIter.GetSkippedOffset() < aTextRun->GetLength() &&
       aTextRun->CanHyphenateBefore(aIter.GetSkippedOffset())) {
     return true;
   }
-  if (!(aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_HAS_SHY))
-    return false;
+  if (!(aTextRun->GetFlags2() & nsTextFrameUtils::Flags::HasShy)) return false;
   gfxSkipCharsIterator iter = aIter;
   while (iter.GetOriginalOffset() > aStartOffset) {
     iter.AdvanceOriginal(-1);
     if (!iter.IsOriginalCharSkipped()) break;
     if (aFrag->CharAt(iter.GetOriginalOffset()) == CH_SHY) return true;
   }
   return false;
 }
@@ -8900,17 +8887,17 @@ void nsTextFrame::ReflowText(nsLineLayou
                "Text run does not map enough text for our reflow");
 
   /////////////////////////////////////////////////////////////////////
   // See how much text should belong to this text frame, and measure it
   /////////////////////////////////////////////////////////////////////
 
   iter.SetOriginalOffset(offset);
   nscoord xOffsetForTabs =
-      (mTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_HAS_TAB)
+      (mTextRun->GetFlags2() & nsTextFrameUtils::Flags::HasTab)
           ? (aLineLayout.GetCurrentFrameInlineDistanceFromBlock() -
              lineContainer->GetUsedBorderAndPadding().left)
           : -1;
   PropertyProvider provider(mTextRun, textStyle, frag, this, iter, length,
                             lineContainer, xOffsetForTabs,
                             nsTextFrame::eInflated);
 
   uint32_t transformedOffset = provider.GetStart().GetSkippedOffset();
@@ -9195,18 +9182,17 @@ void nsTextFrame::ReflowText(nsLineLayou
       // Record a potential break after final soft hyphen
       aLineLayout.NotifyOptionalBreakPosition(this, length, fits,
                                               gfxBreakPriority::eNormalBreak);
     }
     // length == 0 means either the text is empty or it's all collapsed away
     bool emptyTextAtStartOfLine = atStartOfLine && length == 0;
     if (!breakAfter && charsFit == length && !emptyTextAtStartOfLine &&
         transformedOffset + transformedLength == mTextRun->GetLength() &&
-        (mTextRun->GetFlags2() &
-         nsTextFrameUtils::Flags::TEXT_HAS_TRAILING_BREAK)) {
+        (mTextRun->GetFlags2() & nsTextFrameUtils::Flags::HasTrailingBreak)) {
       // We placed all the text in the textrun and we have a break opportunity
       // at the end of the textrun. We need to record it because the following
       // content may not care about nsLineBreaker.
 
       // Note that because we didn't break, we can be sure that (thanks to the
       // code up above) textMetrics.mAdvanceWidth includes the width of any
       // trailing whitespace. So we need to subtract trimmableWidth here
       // because if we did break at this point, that much width would be
@@ -9437,19 +9423,18 @@ static void TransformChars(nsTextFrame* 
     if ((ch == '\n' && !aStyle->NewlineIsSignificant(aFrame)) ||
         (ch == '\t' && !aStyle->TabIsSignificant())) {
       ch = ' ';
     }
     out[i] = ch;
   }
 
   if (!aStyle->mTextTransform.IsNone()) {
-    MOZ_ASSERT(aTextRun->GetFlags2() &
-               nsTextFrameUtils::Flags::TEXT_IS_TRANSFORMED);
-    if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::TEXT_IS_TRANSFORMED) {
+    MOZ_ASSERT(aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsTransformed);
+    if (aTextRun->GetFlags2() & nsTextFrameUtils::Flags::IsTransformed) {
       // Apply text-transform according to style in the transformed run.
       auto transformedTextRun =
           static_cast<const nsTransformedTextRun*>(aTextRun);
       nsAutoString convertedString;
       AutoTArray<bool, 50> charsToMergeArray;
       AutoTArray<bool, 50> deletedCharsArray;
       nsCaseTransformTextRunFactory::TransformString(
           fragString, convertedString, /* aAllUppercase = */ false,
@@ -9474,17 +9459,17 @@ static bool LineEndsInHardLineBreak(nsTe
   return !iter.GetLine()->IsLineWrapped();
 }
 
 nsIFrame::RenderedText nsTextFrame::GetRenderedText(
     uint32_t aStartOffset, uint32_t aEndOffset, TextOffsetType aOffsetType,
     TrailingWhitespace aTrimTrailingWhitespace) {
   MOZ_ASSERT(aStartOffset <= aEndOffset, "bogus offsets");
   MOZ_ASSERT(!GetPrevContinuation() ||
-                 (aOffsetType == TextOffsetType::OFFSETS_IN_CONTENT_TEXT &&
+                 (aOffsetType == TextOffsetType::OffsetsInContentText &&
                   aStartOffset >= (uint32_t)GetContentOffset() &&
                   aEndOffset <= (uint32_t)GetContentEnd()),
              "Must be called on first-in-flow, or content offsets must be "
              "given and be within this frame.");
 
   // The handling of offsets could be more efficient...
   RenderedText result;
   nsBlockFrame* lineContainer = nullptr;
@@ -9507,18 +9492,17 @@ nsIFrame::RenderedText nsTextFrame::GetR
     if (!textFrame->mTextRun) {
       break;
     }
     gfxSkipCharsIterator tmpIter = iter;
 
     // Whether we need to trim whitespaces after the text frame.
     bool trimAfter;
     if (!textFrame->IsAtEndOfLine() ||
-        aTrimTrailingWhitespace !=
-            TrailingWhitespace::TRIM_TRAILING_WHITESPACE) {
+        aTrimTrailingWhitespace != TrailingWhitespace::Trim) {
       trimAfter = false;
     } else if (nsBlockFrame* thisLc =
                    do_QueryFrame(FindLineContainer(textFrame))) {
       if (thisLc != lineContainer) {
         // Setup line cursor when needed.
         lineContainer = thisLc;
         autoLineCursor.reset();
         autoLineCursor.emplace(lineContainer);
@@ -9527,29 +9511,29 @@ nsIFrame::RenderedText nsTextFrame::GetR
     } else {
       // Weird situation where we have a line layout without a block.
       // No soft breaks occur in this situation.
       trimAfter = true;
     }
 
     // Skip to the start of the text run, past ignored chars at start of line
     TrimmedOffsets trimmedOffsets = textFrame->GetTrimmedOffsets(
-        textFrag, (trimAfter ? TrimmedOffsetFlags::kDefaultTrimFlags
-                             : TrimmedOffsetFlags::kNoTrimAfter));
+        textFrag, (trimAfter ? TrimmedOffsetFlags::Default
+                             : TrimmedOffsetFlags::NoTrimAfter));
     bool trimmedSignificantNewline =
         trimmedOffsets.GetEnd() < GetContentEnd() &&
         HasSignificantTerminalNewline();
     uint32_t skippedToRenderedStringOffset =
         offsetInRenderedString -
         tmpIter.ConvertOriginalToSkipped(trimmedOffsets.mStart);
     uint32_t nextOffsetInRenderedString =
         tmpIter.ConvertOriginalToSkipped(trimmedOffsets.GetEnd()) +
         (trimmedSignificantNewline ? 1 : 0) + skippedToRenderedStringOffset;
 
-    if (aOffsetType == TextOffsetType::OFFSETS_IN_RENDERED_TEXT) {
+    if (aOffsetType == TextOffsetType::OffsetsInRenderedText) {
       if (nextOffsetInRenderedString <= aStartOffset) {
         offsetInRenderedString = nextOffsetInRenderedString;
         continue;
       }
       if (!haveOffsets) {
         result.mOffsetWithinNodeText = tmpIter.ConvertSkippedToOriginal(
             aStartOffset - skippedToRenderedStringOffset);
         result.mOffsetWithinNodeRenderedText = aStartOffset;
@@ -9579,17 +9563,17 @@ nsIFrame::RenderedText nsTextFrame::GetR
       }
       if (uint32_t(textFrame->mContentOffset) >= aEndOffset) {
         break;
       }
     }
 
     int32_t startOffset;
     int32_t endOffset;
-    if (aOffsetType == TextOffsetType::OFFSETS_IN_RENDERED_TEXT) {
+    if (aOffsetType == TextOffsetType::OffsetsInRenderedText) {
       startOffset = tmpIter.ConvertSkippedToOriginal(
           aStartOffset - skippedToRenderedStringOffset);
       endOffset = tmpIter.ConvertSkippedToOriginal(
           aEndOffset - skippedToRenderedStringOffset);
     } else {
       startOffset = aStartOffset;
       endOffset = std::min<uint32_t>(INT32_MAX, aEndOffset);
     }
@@ -9874,11 +9858,11 @@ bool nsTextFrame::HasNonSuppressedText()
     return true;
   }
 
   if (!GetTextRun(nsTextFrame::eInflated)) {
     return false;
   }
 
   TrimmedOffsets offsets =
-      GetTrimmedOffsets(mContent->GetText(), TrimmedOffsetFlags::kNoTrimAfter);
+      GetTrimmedOffsets(mContent->GetText(), TrimmedOffsetFlags::NoTrimAfter);
   return offsets.mLength != 0;
 }
--- a/layout/generic/nsTextFrame.h
+++ b/layout/generic/nsTextFrame.h
@@ -261,19 +261,18 @@ class nsTextFrame : public nsFrame {
     // In this case, we should call RecomputeOverflow on this frame.
     bool mChanged;
     // an amount to *subtract* from the frame's width (zero if !mChanged)
     nscoord mDeltaWidth;
   };
   TrimOutput TrimTrailingWhiteSpace(DrawTarget* aDrawTarget);
   RenderedText GetRenderedText(
       uint32_t aStartOffset = 0, uint32_t aEndOffset = UINT32_MAX,
-      TextOffsetType aOffsetType = TextOffsetType::OFFSETS_IN_CONTENT_TEXT,
-      TrailingWhitespace aTrimTrailingWhitespace =
-          TrailingWhitespace::TRIM_TRAILING_WHITESPACE) final;
+      TextOffsetType aOffsetType = TextOffsetType::OffsetsInContentText,
+      TrailingWhitespace aTrimTrailingWhitespace = TrailingWhitespace::Trim) final;
 
   nsOverflowAreas RecomputeOverflow(nsIFrame* aBlockFrame,
                                     bool aIncludeShadows = true);
 
   enum TextRunType {
     // Anything in reflow (but not intrinsic width calculation) or
     // painting should use the inflated text run (i.e., with font size
     // inflation applied).
@@ -566,24 +565,24 @@ class nsTextFrame : public nsFrame {
   // whitespace subject to start-of-line and end-of-line trimming.
   // The textrun must have been created before calling this.
   struct TrimmedOffsets {
     int32_t mStart;
     int32_t mLength;
     int32_t GetEnd() const { return mStart + mLength; }
   };
   enum class TrimmedOffsetFlags : uint8_t {
-    kDefaultTrimFlags = 0,
-    kNotPostReflow = 1 << 0,
-    kNoTrimAfter = 1 << 1,
-    kNoTrimBefore = 1 << 2
+    Default = 0,
+    NotPostReflow = 1 << 0,
+    NoTrimAfter = 1 << 1,
+    NoTrimBefore = 1 << 2
   };
   TrimmedOffsets GetTrimmedOffsets(
       const nsTextFragment* aFrag,
-      TrimmedOffsetFlags aFlags = TrimmedOffsetFlags::kDefaultTrimFlags) const;
+      TrimmedOffsetFlags aFlags = TrimmedOffsetFlags::Default) const;
 
   // Similar to Reflow(), but for use from nsLineLayout
   void ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
                   DrawTarget* aDrawTarget, ReflowOutput& aMetrics,
                   nsReflowStatus& aStatus);
 
   bool IsFloatingFirstLetterChild() const;
 
--- a/layout/generic/nsTextFrameUtils.cpp
+++ b/layout/generic/nsTextFrameUtils.cpp
@@ -26,25 +26,25 @@ bool nsTextFrameUtils::IsSpaceCombiningS
            IsSpaceCombiningSequenceTail(aChars + 1, aLength - 1)));
 }
 
 static bool IsDiscardable(char16_t ch, nsTextFrameUtils::Flags* aFlags) {
   // Unlike IS_DISCARDABLE, we don't discard \r. \r will be ignored by
   // gfxTextRun and discarding it would force us to copy text in many cases of
   // preformatted text containing \r\n.
   if (ch == CH_SHY) {
-    *aFlags |= nsTextFrameUtils::Flags::TEXT_HAS_SHY;
+    *aFlags |= nsTextFrameUtils::Flags::HasShy;
     return true;
   }
   return IsBidiControl(ch);
 }
 
 static bool IsDiscardable(uint8_t ch, nsTextFrameUtils::Flags* aFlags) {
   if (ch == CH_SHY) {
-    *aFlags |= nsTextFrameUtils::Flags::TEXT_HAS_SHY;
+    *aFlags |= nsTextFrameUtils::Flags::HasShy;
     return true;
   }
   return false;
 }
 
 static bool IsSegmentBreak(char16_t aCh) { return aCh == '\n' || aCh == '\r'; }
 
 static bool IsSpaceOrTab(char16_t aCh) { return aCh == ' ' || aCh == '\t'; }
@@ -211,17 +211,17 @@ CharT* nsTextFrameUtils::TransformText(c
           lastCharArabic = IS_ARABIC_CHAR(ch);
         } else if (aCompression == COMPRESS_NONE_TRANSFORM_TO_SPACE) {
           if (ch == '\t' || ch == '\n') {
             ch = ' ';
           }
         } else {
           // aCompression == COMPRESS_NONE
           if (ch == '\t') {
-            flags |= Flags::TEXT_HAS_TAB;
+            flags |= Flags::HasTab;
           }
         }
         *aOutput++ = ch;
       }
     }
     if (lastCharArabic) {
       *aIncomingFlags |= INCOMING_ARABICCHAR;
     } else {
--- a/layout/generic/nsTextFrameUtils.h
+++ b/layout/generic/nsTextFrameUtils.h
@@ -21,50 +21,50 @@ struct nsStyleText;
 
 class nsTextFrameUtils {
  public:
   // These constants are used as textrun flags for textframe textruns.
   enum class Flags : uint16_t {
     // The following flags are set by TransformText
 
     // the text has at least one untransformed tab character
-    TEXT_HAS_TAB = 0x01,
+    HasTab = 0x01,
     // the original text has at least one soft hyphen character
-    TEXT_HAS_SHY = 0x02,
-    TEXT_UNUSED_FLAGS = 0x0C,
+    HasShy = 0x02,
+    UnusedFlags = 0x0C,
 
     // The following flags are set by nsTextFrame
 
-    TEXT_IS_SIMPLE_FLOW = 0x10,
-    TEXT_INCOMING_WHITESPACE = 0x20,
-    TEXT_TRAILING_WHITESPACE = 0x40,
-    TEXT_COMPRESSED_LEADING_WHITESPACE = 0x80,
-    TEXT_NO_BREAKS = 0x100,
-    TEXT_IS_TRANSFORMED = 0x200,
+    IsSimpleFlow = 0x10,
+    IncomingWhitespace = 0x20,
+    TrailingWhitespace = 0x40,
+    CompressedLeadingWhitespace = 0x80,
+    NoBreaks = 0x100,
+    IsTransformed = 0x200,
     // This gets set if there's a break opportunity at the end of the textrun.
     // We normally don't use this break opportunity because the following text
     // will have a break opportunity at the start, but it's useful for line
     // layout to know about it in case the following content is not text
-    TEXT_HAS_TRAILING_BREAK = 0x400,
+    HasTrailingBreak = 0x400,
 
     // This is set if the textrun was created for a textframe whose
     // NS_FRAME_IS_IN_SINGLE_CHAR_MI flag is set.  This occurs if the textframe
     // belongs to a MathML <mi> element whose embedded text consists of a
     // single character.
-    TEXT_IS_SINGLE_CHAR_MI = 0x800,
+    IsSingleCharMi = 0x800,
 
     // This is set if the text run might be observing for glyph changes.
-    TEXT_MIGHT_HAVE_GLYPH_CHANGES = 0x1000,
+    MightHaveGlyphChanges = 0x1000,
 
     // For internal use by the memory reporter when accounting for
     // storage used by textruns.
     // Because the reporter may visit each textrun multiple times while
     // walking the frame trees and textrun cache, it needs to mark
     // textruns that have been seen so as to avoid multiple-accounting.
-    TEXT_RUN_SIZE_ACCOUNTED = 0x2000,
+    RunSizeAccounted = 0x2000,
 
     // The following are defined by gfxTextRunFactory rather than here,
     // so that it also has access to the _INCOMING and MATH_SCRIPT flags
     // for shaping purposes.
     // They live in the gfxShapedText::mFlags field rather than the
     // gfxTextRun::mFlags2 field.
     // TEXT_TRAILING_ARABICCHAR
     // TEXT_INCOMING_ARABICCHAR
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -331,18 +331,18 @@ bool InspectorUtils::IsInheritedProperty
   return Servo_Property_IsInherited(&propName);
 }
 
 /* static */
 void InspectorUtils::GetCSSPropertyNames(GlobalObject& aGlobalObject,
                                          const PropertyNamesOptions& aOptions,
                                          nsTArray<nsString>& aResult) {
   CSSEnabledState enabledState = aOptions.mIncludeExperimentals
-                                     ? CSSEnabledState::eIgnoreEnabledState
-                                     : CSSEnabledState::eForAllContent;
+                                     ? CSSEnabledState::IgnoreEnabledState
+                                     : CSSEnabledState::ForAllContent;
 
   auto appendProperty = [enabledState, &aResult](uint32_t prop) {
     nsCSSPropertyID cssProp = nsCSSPropertyID(prop);
     if (nsCSSProps::IsEnabled(cssProp, enabledState)) {
       aResult.AppendElement(
           NS_ConvertASCIItoUTF16(nsCSSProps::GetStringValue(cssProp)));
     }
   };
@@ -621,17 +621,17 @@ static EventStates GetStatesForPseudoCla
 
 /* static */
 void InspectorUtils::GetCSSPseudoElementNames(GlobalObject& aGlobalObject,
                                               nsTArray<nsString>& aResult) {
   const auto kPseudoCount =
       static_cast<size_t>(PseudoStyleType::CSSPseudoElementsEnd);
   for (size_t i = 0; i < kPseudoCount; ++i) {
     PseudoStyleType type = static_cast<PseudoStyleType>(i);
-    if (nsCSSPseudoElements::IsEnabled(type, CSSEnabledState::eForAllContent)) {
+    if (nsCSSPseudoElements::IsEnabled(type, CSSEnabledState::ForAllContent)) {
       nsAtom* atom = nsCSSPseudoElements::GetPseudoAtom(type);
       aResult.AppendElement(nsDependentAtomString(atom));
     }
   }
 }
 
 /* static */
 void InspectorUtils::AddPseudoClassLock(GlobalObject& aGlobalObject,
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -1791,17 +1791,17 @@ void nsDisplayMathMLCharDebug::Paint(nsD
                                      gfxContext* aCtx) {
   // for visual debug
   Sides skipSides;
   nsPresContext* presContext = mFrame->PresContext();
   ComputedStyle* computedStyle = mFrame->Style();
   nsRect rect = mRect + ToReferenceFrame();
 
   PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
-                               ? PaintBorderFlags::SYNC_DECODE_IMAGES
+                               ? PaintBorderFlags::SyncDecodeImages
                                : PaintBorderFlags();
 
   // Since this is used only for debugging, we don't need to worry about
   // tracking the ImgDrawResult.
   Unused << nsCSSRendering::PaintBorder(presContext, *aCtx, mFrame,
                                         GetPaintRect(), rect, computedStyle,
                                         flags, skipSides);
 
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -292,17 +292,17 @@ class nsDisplaymtdBorder final : public 
     nsMathMLmtdFrame* frame = static_cast<nsMathMLmtdFrame*>(mFrame);
     ApplyBorderToStyle(frame, styleBorder);
 
     nsRect bounds = nsRect(ToReferenceFrame(), mFrame->GetSize());
     nsMargin overflow = ComputeBorderOverflow(frame, styleBorder);
     bounds.Inflate(overflow);
 
     PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
-                                 ? PaintBorderFlags::SYNC_DECODE_IMAGES
+                                 ? PaintBorderFlags::SyncDecodeImages
                                  : PaintBorderFlags();
 
     ImgDrawResult result = nsCSSRendering::PaintBorderWithStyleBorder(
         mFrame->PresContext(), *aCtx, mFrame, GetPaintRect(), bounds,
         styleBorder, mFrame->Style(), flags, mFrame->GetSkipSides());
 
     nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
   }
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -132,27 +132,27 @@ struct DisplayItemEntry {
   nsDisplayItem* mItem;
   DisplayItemEntryType mType;
 };
 
 /**
  * Returns true if the given |aType| is an effect start marker.
  */
 static bool IsEffectStartMarker(DisplayItemEntryType aType) {
-  return aType == DisplayItemEntryType::PUSH_OPACITY ||
-         aType == DisplayItemEntryType::PUSH_OPACITY_WITH_BG ||
-         aType == DisplayItemEntryType::PUSH_TRANSFORM;
+  return aType == DisplayItemEntryType::PushOpacity ||
+         aType == DisplayItemEntryType::PushOpacityWithBg ||
+         aType == DisplayItemEntryType::PushTransform;
 }
 
 /**
  * Returns true if the given |aType| is an effect end marker.
  */
 static bool IsEffectEndMarker(DisplayItemEntryType aType) {
-  return aType == DisplayItemEntryType::POP_OPACITY ||
-         aType == DisplayItemEntryType::POP_TRANSFORM;
+  return aType == DisplayItemEntryType::PopOpacity ||
+         aType == DisplayItemEntryType::PopTransform;
 }
 
 enum class MarkerType { StartMarker, EndMarker };
 
 /**
  * Returns true if the given nsDisplayOpacity |aItem| has had opacity applied
  * to its children and can be flattened away.
  */
@@ -196,22 +196,22 @@ static bool AddMarkerIfNeeded(nsDisplayI
       if (IsOpacityAppliedToChildren(aItem)) {
         // TODO(miko): I am not a fan of this. The more correct solution would
         // be to return an enum from nsDisplayItem::ShouldFlattenAway(), so that
         // we could distinguish between different flattening methods and avoid
         // entering this function when markers are not needed.
         return false;
       }
 
-      marker = GET_MARKER(DisplayItemEntryType::PUSH_OPACITY,
-                          DisplayItemEntryType::POP_OPACITY);
+      marker = GET_MARKER(DisplayItemEntryType::PushOpacity,
+                          DisplayItemEntryType::PopOpacity);
       break;
     case DisplayItemType::TYPE_TRANSFORM:
-      marker = GET_MARKER(DisplayItemEntryType::PUSH_TRANSFORM,
-                          DisplayItemEntryType::POP_TRANSFORM);
+      marker = GET_MARKER(DisplayItemEntryType::PushTransform,
+                          DisplayItemEntryType::PopTransform);
       break;
     default:
       MOZ_ASSERT_UNREACHABLE("Invalid display item type!");
       break;
   }
 
   aMarkers.emplace_back(aItem, marker);
   return true;
@@ -1628,27 +1628,27 @@ class FLBDisplayListIterator : public Fl
 
   DisplayItemEntry GetNextEntry() {
     if (!mMarkers.empty()) {
       DisplayItemEntry entry = mMarkers.front();
       mMarkers.pop_front();
       return entry;
     }
 
-    return DisplayItemEntry{GetNextItem(), DisplayItemEntryType::ITEM};
+    return DisplayItemEntry{GetNextItem(), DisplayItemEntryType::Item};
   }
 
   bool HasNext() const override {
     return FlattenedDisplayListIterator::HasNext() || !mMarkers.empty();
   }
 
  private:
   void AddHitTestMarkerIfNeeded(nsDisplayItem* aItem) {
     if (aItem->HasHitTestInfo()) {
-      mMarkers.emplace_back(aItem, DisplayItemEntryType::HIT_TEST_INFO);
+      mMarkers.emplace_back(aItem, DisplayItemEntryType::HitTestInfo);
     }
   }
 
   bool ShouldFlattenNextItem() override {
     if (!FlattenedDisplayListIterator::ShouldFlattenNextItem()) {
       return false;
     }
 
@@ -3647,31 +3647,31 @@ static bool IsItemAreaInWindowOpaqueRegi
     return false;
   }
   return aBuilder->GetWindowOpaqueRegion().Contains(aComponentAlphaBounds);
 }
 
 void PaintedLayerData::UpdateEffectStatus(DisplayItemEntryType aType,
                                           nsTArray<size_t>& aOpacityIndices) {
   switch (aType) {
-    case DisplayItemEntryType::PUSH_OPACITY:
+    case DisplayItemEntryType::PushOpacity:
       // The index of the new assigned display item in |mAssignedDisplayItems|
       // array will be the current length of the array.
       aOpacityIndices.AppendElement(mAssignedDisplayItems.size());
       break;
-    case DisplayItemEntryType::POP_OPACITY:
+    case DisplayItemEntryType::PopOpacity:
       MOZ_ASSERT(!aOpacityIndices.IsEmpty());
       aOpacityIndices.RemoveLastElement();
       break;
 #ifdef DEBUG
-    case DisplayItemEntryType::POP_TRANSFORM:
+    case DisplayItemEntryType::PopTransform:
       MOZ_ASSERT(mTransformLevel >= 0);
       mTransformLevel--;
       break;
-    case DisplayItemEntryType::PUSH_TRANSFORM:
+    case DisplayItemEntryType::PushTransform:
       mTransformLevel++;
       break;
 #endif
     default:
       break;
   }
 }
 
@@ -3721,17 +3721,17 @@ bool PaintedLayerData::SetupComponentAlp
 void PaintedLayerData::Accumulate(ContainerState* aState, nsDisplayItem* aItem,
                                   const nsIntRect& aVisibleRect,
                                   const nsRect& aContentRect,
                                   const DisplayItemClip& aClip,
                                   LayerState aLayerState, nsDisplayList* aList,
                                   DisplayItemEntryType aType,
                                   nsTArray<size_t>& aOpacityIndices,
                                   const RefPtr<TransformClipNode>& aTransform) {
-  MOZ_ASSERT(aType != DisplayItemEntryType::HIT_TEST_INFO,
+  MOZ_ASSERT(aType != DisplayItemEntryType::HitTestInfo,
              "Should have handled hit test items earlier!");
 
   FLB_LOG_PAINTED_LAYER_DECISION(
       this, "Accumulating dp=%s(%p), f=%p against pld=%p\n", aItem->Name(),
       aItem, aItem->Frame(), this);
 
   const bool hasOpacity = aOpacityIndices.Length() > 0;
 
@@ -3772,28 +3772,28 @@ void PaintedLayerData::Accumulate(Contai
   } else {
     const bool needsComponentAlpha =
         SetupComponentAlpha(aState, aItem, aVisibleRect, aTransform);
 
     if (needsComponentAlpha) {
       // This display item needs background copy when pushing opacity group.
       for (size_t i : aOpacityIndices) {
         AssignedDisplayItem& item = mAssignedDisplayItems[i];
-        MOZ_ASSERT(item.mType == DisplayItemEntryType::PUSH_OPACITY ||
-                   item.mType == DisplayItemEntryType::PUSH_OPACITY_WITH_BG);
-        item.mType = DisplayItemEntryType::PUSH_OPACITY_WITH_BG;
+        MOZ_ASSERT(item.mType == DisplayItemEntryType::PushOpacity ||
+                   item.mType == DisplayItemEntryType::PushOpacityWithBg);
+        item.mType = DisplayItemEntryType::PushOpacityWithBg;
       }
     }
   }
 
   if (aItem->MustPaintOnContentSide()) {
     mShouldPaintOnContentSide = true;
   }
 
-  if (aTransform && aType == DisplayItemEntryType::ITEM) {
+  if (aTransform && aType == DisplayItemEntryType::Item) {
     // Bounds transformed with axis-aligned transforms could be included in the
     // opaque region calculations. For simplicity, this is currently not done.
     return;
   }
 
   if (!mIsSolidColorInVisibleRegion && mOpaqueRegion.Contains(aVisibleRect) &&
       mVisibleRegion.Contains(aVisibleRect) && !mImage) {
     // A very common case! Most pages have a PaintedLayer with the page
@@ -4339,22 +4339,22 @@ static bool IsScrollThumbLayer(nsDisplay
          static_cast<nsDisplayOwnLayer*>(aItem)->IsScrollThumbLayer();
 }
 
 template <typename ClearFn, typename SelectFn>
 static void ProcessDisplayItemMarker(DisplayItemEntryType aMarker,
                                      ClearFn ClearLayerSelectionIfNeeded,
                                      SelectFn SelectLayerIfNeeded) {
   switch (aMarker) {
-    case DisplayItemEntryType::PUSH_TRANSFORM:
-    case DisplayItemEntryType::PUSH_OPACITY:
+    case DisplayItemEntryType::PushTransform:
+    case DisplayItemEntryType::PushOpacity:
       SelectLayerIfNeeded();
       break;
-    case DisplayItemEntryType::POP_TRANSFORM:
-    case DisplayItemEntryType::POP_OPACITY:
+    case DisplayItemEntryType::PopTransform:
+    case DisplayItemEntryType::PopOpacity:
       ClearLayerSelectionIfNeeded();
       break;
     default:
       break;
   }
 }
 /*
  * Iterate through the non-clip items in aList and its descendants.
@@ -4409,48 +4409,48 @@ void ContainerState::ProcessDisplayItems
     DisplayItemEntry e = iter.GetNextEntry();
     DisplayItemEntryType marker = e.mType;
     nsDisplayItem* item = e.mItem;
     MOZ_ASSERT(item);
     DisplayItemType itemType = item->GetType();
 
     if (itemType == DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO) {
       // Override the marker for nsDisplayCompositorHitTestInfo items.
-      marker = DisplayItemEntryType::HIT_TEST_INFO;
+      marker = DisplayItemEntryType::HitTestInfo;
     }
 
     const bool inEffect = InTransform() || InOpacity();
 
     NS_ASSERTION(mAppUnitsPerDevPixel == AppUnitsPerDevPixel(item),
                  "items in a container layer should all have the same app "
                  "units per dev pixel");
 
     if (mBuilder->NeedToForceTransparentSurfaceForItem(item)) {
       aList->SetNeedsTransparentSurface();
     }
 
     LayerState layerState = LAYER_NONE;
-    if (marker == DisplayItemEntryType::ITEM) {
+    if (marker == DisplayItemEntryType::Item) {
       layerState = item->GetLayerState(mBuilder, mManager, mParameters);
 
       if (layerState == LAYER_INACTIVE && nsDisplayItem::ForceActiveLayers()) {
         layerState = LAYER_ACTIVE;
       }
     }
 
     AnimatedGeometryRoot* itemAGR = nullptr;
     const ActiveScrolledRoot* itemASR = nullptr;
     const DisplayItemClipChain* layerClipChain = nullptr;
     const DisplayItemClipChain* itemClipChain = nullptr;
     const DisplayItemClip* itemClipPtr = nullptr;
 
     bool snap = false;
     nsRect itemContent;
 
-    if (marker == DisplayItemEntryType::HIT_TEST_INFO) {
+    if (marker == DisplayItemEntryType::HitTestInfo) {
       const auto& hitTestInfo =
           static_cast<nsDisplayHitTestInfoItem*>(item)->GetHitTestInfo();
 
       // Override the layer selection hints for items that have hit test
       // information. This is needed because container items may have different
       // clipping, AGR, or ASR than the child items in them.
       itemAGR = hitTestInfo.mAGR;
       itemASR = hitTestInfo.mASR;
@@ -4472,56 +4472,56 @@ void ContainerState::ProcessDisplayItems
       } else {
         layerClipChain = itemClipChain;
       }
     } else {
       // Inside a flattened effect or inactive layer, use container AGR and ASR.
       itemAGR = inEffect ? containerAGR : mContainerAnimatedGeometryRoot;
       itemASR = inEffect ? containerASR : mContainerASR;
 
-      if (marker == DisplayItemEntryType::HIT_TEST_INFO) {
-        // Items with hit test info are processed twice, once with HIT_TEST_INFO
-        // marker and then with ITEM marker.
-        // With HIT_TEST_INFO markers, fuse the clip chain of hit test struct,
-        // and with ITEM markers, fuse the clip chain of the actual item.
+      if (marker == DisplayItemEntryType::HitTestInfo) {
+        // Items with hit test info are processed twice, once with ::HitTestInfo
+        // marker and then with ::Item marker.
+        // With ::HitTestInfo markers, fuse the clip chain of hit test struct,
+        // and with ::Item markers, fuse the clip chain of the actual item.
         itemClipChain = mBuilder->FuseClipChainUpTo(itemClipChain, itemASR);
       } else if (!IsEffectEndMarker(marker)) {
         // No need to fuse clip chain for effect end markers, since it was
         // already done for effect start markers.
         item->FuseClipChainUpTo(mBuilder, itemASR);
         itemClipChain = item->GetClipChain();
       }
 
       itemClipPtr = itemClipChain ? &itemClipChain->mClip : nullptr;
     }
 
     const DisplayItemClip& itemClip =
         itemClipPtr ? *itemClipPtr : DisplayItemClip::NoClip();
 
-    if (inEffect && marker == DisplayItemEntryType::HIT_TEST_INFO) {
+    if (inEffect && marker == DisplayItemEntryType::HitTestInfo) {
       // Fast-path for hit test items inside flattened inactive layers.
       MOZ_ASSERT(selectedLayer);
       selectedLayer->AccumulateHitTestItem(this, item, itemClip, transformNode);
       continue;
     }
 
-    if (inEffect && marker == DisplayItemEntryType::ITEM) {
+    if (inEffect && marker == DisplayItemEntryType::Item) {
       // Fast-path for items inside flattened inactive layers. This works
       // because the layer state of the item cannot be active, otherwise the
       // parent item would not have been flattened.
       MOZ_ASSERT(selectedLayer);
       selectedLayer->Accumulate(this, item, nsIntRect(), nsRect(), itemClip,
                                 layerState, aList, marker, opacityIndices,
                                 transformNode);
       continue;
     }
 
     // Items outside of flattened effects and non-item markers inside flattened
     // effects are processed here.
-    MOZ_ASSERT(!inEffect || (marker != DisplayItemEntryType::ITEM));
+    MOZ_ASSERT(!inEffect || (marker != DisplayItemEntryType::Item));
 
     if (itemAGR == lastAnimatedGeometryRoot) {
       topLeft = lastTopLeft;
     } else {
       lastTopLeft = topLeft =
           (*itemAGR)->GetOffsetToCrossDoc(mContainerReferenceFrame);
       lastAnimatedGeometryRoot = itemAGR;
     }
@@ -4544,17 +4544,17 @@ void ContainerState::ProcessDisplayItems
 
       if (!prerenderedTransform && !IsScrollThumbLayer(item)) {
         itemDrawRect.IntersectRect(itemDrawRect, clipRect.ToUnknownRect());
       }
 
       clipRect.MoveBy(ViewAs<ParentLayerPixel>(mParameters.mOffset));
     }
 
-    if (marker == DisplayItemEntryType::POP_TRANSFORM) {
+    if (marker == DisplayItemEntryType::PopTransform) {
       MOZ_ASSERT(transformNode);
       transformNode = transformNode->Parent();
     }
 
     if (transformNode) {
       // If we are within transform, transform itemContent and itemDrawRect.
       MOZ_ASSERT(transformNode);
 
@@ -4562,17 +4562,17 @@ void ContainerState::ProcessDisplayItems
           transformNode->TransformRect(itemContent, mAppUnitsPerDevPixel);
 
       itemDrawRect = transformNode->TransformRect(itemDrawRect);
     }
 
 #ifdef DEBUG
     nsRect bounds = itemContent;
 
-    if (marker == DisplayItemEntryType::HIT_TEST_INFO || inEffect) {
+    if (marker == DisplayItemEntryType::HitTestInfo || inEffect) {
       bounds.SetEmpty();
     }
 
     if (!bounds.IsEmpty() && itemASR != mContainerASR) {
       if (Maybe<nsRect> clip =
               item->GetClipWithRespectToASR(mBuilder, mContainerASR)) {
         bounds = clip.ref();
       }
@@ -4607,17 +4607,17 @@ void ContainerState::ProcessDisplayItems
     if (layerState == LAYER_ACTIVE_FORCE || treatInactiveItemAsActive ||
         (!forceInactive &&
          (layerState == LAYER_ACTIVE_EMPTY || layerState == LAYER_ACTIVE))) {
       layerCount++;
 
       // Currently we do not support flattening effects within nested inactive
       // layer trees.
       MOZ_ASSERT(selectedLayer == nullptr);
-      MOZ_ASSERT(marker == DisplayItemEntryType::ITEM);
+      MOZ_ASSERT(marker == DisplayItemEntryType::Item);
 
       // LAYER_ACTIVE_EMPTY means the layer is created just for its metadata.
       // We should never see an empty layer with any visible content!
       NS_ASSERTION(
           layerState != LAYER_ACTIVE_EMPTY || itemVisibleRect.IsEmpty(),
           "State is LAYER_ACTIVE_EMPTY but visible rect is not.");
 
       // As long as the new layer isn't going to be a PaintedLayer,
@@ -4977,32 +4977,32 @@ void ContainerState::ProcessDisplayItems
 
       // When container item hit test info is processed, we need to use the same
       // reference frame as the container children.
       const nsIFrame* referenceFrame = item == mContainerItem
                                            ? mContainerReferenceFrame
                                            : item->ReferenceFrame();
 
       MOZ_ASSERT(item != mContainerItem ||
-                 marker == DisplayItemEntryType::HIT_TEST_INFO);
+                 marker == DisplayItemEntryType::HitTestInfo);
 
       PaintedLayerData* paintedLayerData = selectedLayer;
 
       if (!paintedLayerData) {
         paintedLayerData = mPaintedLayerDataTree.FindPaintedLayerFor(
             itemAGR, itemASR, layerClipChain, itemVisibleRect, backfaceHidden,
             [&](PaintedLayerData* aData) {
               NewPaintedLayerData(aData, itemAGR, itemASR, layerClipChain,
                                   scrollMetadataASR, topLeft, referenceFrame,
                                   backfaceHidden);
             });
       }
       MOZ_ASSERT(paintedLayerData);
 
-      if (marker == DisplayItemEntryType::HIT_TEST_INFO) {
+      if (marker == DisplayItemEntryType::HitTestInfo) {
         MOZ_ASSERT(!transformNode);
         paintedLayerData->AccumulateHitTestItem(this, item, itemClip, nullptr);
       } else {
         paintedLayerData->Accumulate(this, item, itemVisibleRect, itemContent,
                                      itemClip, layerState, aList, marker,
                                      opacityIndices, transformNode);
 
         if (!paintedLayerData->mLayer) {
@@ -5039,17 +5039,17 @@ void ContainerState::ProcessDisplayItems
         if (!selectedLayer) {
           selectedLayer = paintedLayerData;
           containerAGR = itemAGR;
           containerASR = itemASR;
           containerReferenceFrame = const_cast<nsIFrame*>(referenceFrame);
         }
       };
 
-      if (marker == DisplayItemEntryType::PUSH_TRANSFORM) {
+      if (marker == DisplayItemEntryType::PushTransform) {
         nsDisplayTransform* transform = static_cast<nsDisplayTransform*>(item);
 
         const Matrix4x4Flagged& matrix = transform->GetTransformForRendering();
 
         Maybe<gfx::IntRect> clip;
         if (itemClip.HasClip()) {
           const nsRect nonRoundedClip = itemClip.NonRoundedIntersection();
           clip.emplace(nonRoundedClip.ToNearestPixels(mAppUnitsPerDevPixel));
@@ -6760,38 +6760,38 @@ static const DisplayItemClip* GetItemCli
 
   return &clip;
 }
 
 /**
  * Pushes a new opacity group for |aContext| based on |aItem|.
  */
 static void PushOpacity(gfxContext* aContext, AssignedDisplayItem& aItem) {
-  MOZ_ASSERT(aItem.mType == DisplayItemEntryType::PUSH_OPACITY ||
-             aItem.mType == DisplayItemEntryType::PUSH_OPACITY_WITH_BG);
+  MOZ_ASSERT(aItem.mType == DisplayItemEntryType::PushOpacity ||
+             aItem.mType == DisplayItemEntryType::PushOpacityWithBg);
   MOZ_ASSERT(aItem.mItem->GetType() == DisplayItemType::TYPE_OPACITY);
   nsDisplayOpacity* item = static_cast<nsDisplayOpacity*>(aItem.mItem);
 
   const float opacity = item->GetOpacity();
-  if (aItem.mType == DisplayItemEntryType::PUSH_OPACITY_WITH_BG) {
+  if (aItem.mType == DisplayItemEntryType::PushOpacityWithBg) {
     aContext->PushGroupAndCopyBackground(gfxContentType::COLOR_ALPHA, opacity);
   } else {
     aContext->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, opacity);
   }
 }
 
 /**
  * Pushes the transformation matrix of |aItem| into |aMatrixStack| and sets the
  * accumulated transform as the current transformation matrix for |aContext|.
  */
 static void PushTransform(gfxContext* aContext, AssignedDisplayItem& aItem,
                           nsDisplayListBuilder* aBuilder,
                           MatrixStack4x4& aMatrixStack,
                           const Matrix4x4Flagged& aBaseMatrix) {
-  MOZ_ASSERT(aItem.mType == DisplayItemEntryType::PUSH_TRANSFORM);
+  MOZ_ASSERT(aItem.mType == DisplayItemEntryType::PushTransform);
   MOZ_ASSERT(aItem.mItem->GetType() == DisplayItemType::TYPE_TRANSFORM);
 
   nsDisplayTransform* item = static_cast<nsDisplayTransform*>(aItem.mItem);
   if (item->ShouldSkipTransform(aBuilder)) {
     aMatrixStack.Push(Matrix4x4Flagged());
   } else {
     aMatrixStack.Push(item->GetTransformForRendering());
   }
@@ -6802,27 +6802,27 @@ static void PushTransform(gfxContext* aC
   MOZ_ASSERT(ok);
 
   aContext->SetMatrix(matrix2d);
 }
 
 static void UpdateEffectTracking(int& aOpacityLevel, int& aTransformLevel,
                                  const DisplayItemEntryType aType) {
   switch (aType) {
-    case DisplayItemEntryType::PUSH_OPACITY:
-    case DisplayItemEntryType::PUSH_OPACITY_WITH_BG:
+    case DisplayItemEntryType::PushOpacity:
+    case DisplayItemEntryType::PushOpacityWithBg:
       aOpacityLevel++;
       break;
-    case DisplayItemEntryType::POP_OPACITY:
+    case DisplayItemEntryType::PopOpacity:
       aOpacityLevel--;
       break;
-    case DisplayItemEntryType::PUSH_TRANSFORM:
+    case DisplayItemEntryType::PushTransform:
       aTransformLevel++;
       break;
-    case DisplayItemEntryType::POP_TRANSFORM:
+    case DisplayItemEntryType::PopTransform:
       aTransformLevel--;
       break;
     default:
       break;
   }
 
   MOZ_ASSERT(aOpacityLevel >= 0 && aTransformLevel >= 0);
 }
@@ -6877,17 +6877,17 @@ void FrameLayerBuilder::PaintItems(std::
     nsDisplayItem* item = cdi.mItem;
 
     const auto NextItemStartsEffect = [&]() {
       const uint32_t next = i + 1;
       return next < aItems.size() && IsEffectStartMarker(aItems[next].mType);
     };
 
     if (!item) {
-      MOZ_ASSERT(cdi.mType == DisplayItemEntryType::ITEM);
+      MOZ_ASSERT(cdi.mType == DisplayItemEntryType::Item);
       continue;
     }
 
     nsRect visibleRect = item->GetPaintRect();
 
     if (matrixStack.HasTransform()) {
       MOZ_ASSERT(transformLevel > 0);
 
@@ -6924,45 +6924,45 @@ void FrameLayerBuilder::PaintItems(std::
                         GRAPHICS_Rasterization);
 #endif
 
     MOZ_ASSERT((opacityLevel == 0 && !cdi.mHasOpacity) ||
                (opacityLevel > 0 && cdi.mHasOpacity) ||
                (transformLevel == 0 && !cdi.mHasTransform) ||
                (transformLevel > 0 && cdi.mHasTransform));
 
-    if (cdi.mType != DisplayItemEntryType::ITEM) {
+    if (cdi.mType != DisplayItemEntryType::Item) {
       // If we are processing an effect marker, remove the current item clip, if
       // there is one.
       itemClipTracker.Restore();
     }
 
-    if (cdi.mType == DisplayItemEntryType::PUSH_OPACITY ||
-        cdi.mType == DisplayItemEntryType::PUSH_OPACITY_WITH_BG) {
+    if (cdi.mType == DisplayItemEntryType::PushOpacity ||
+        cdi.mType == DisplayItemEntryType::PushOpacityWithBg) {
       // To avoid pushing large temporary surfaces, it is important to clip
       // opacity group with both the paint rect and the actual opacity clip.
       DisplayItemClip effectClip;
       effectClip.SetTo(item->GetPaintRect());
       effectClip.IntersectWith(item->GetClip());
       effectClipStack.PushClip(effectClip);
       PushOpacity(aContext, cdi);
     }
 
-    if (cdi.mType == DisplayItemEntryType::POP_OPACITY) {
+    if (cdi.mType == DisplayItemEntryType::PopOpacity) {
       MOZ_ASSERT(opacityLevel > 0);
       aContext->PopGroupAndBlend();
     }
 
-    if (cdi.mType == DisplayItemEntryType::PUSH_TRANSFORM) {
+    if (cdi.mType == DisplayItemEntryType::PushTransform) {
       effectClipStack.PushClip(item->GetClip());
       aContext->Save();
       PushTransform(aContext, cdi, aBuilder, matrixStack, base);
     }
 
-    if (cdi.mType == DisplayItemEntryType::POP_TRANSFORM) {
+    if (cdi.mType == DisplayItemEntryType::PopTransform) {
       MOZ_ASSERT(transformLevel > 0);
       matrixStack.Pop();
       aContext->Restore();
     }
 
     if (IsEffectEndMarker(cdi.mType)) {
       // Pop the clip for the effect.
       MOZ_ASSERT(effectClipStack.HasClips());
@@ -6970,17 +6970,17 @@ void FrameLayerBuilder::PaintItems(std::
       // If the next item starts an effect, defer popping the current clip, and
       // try to reuse it during the next call to |PushClip()|. Trying to reuse
       // clips between nested effects would be difficult, for example due to
       // possibly different coordinate system, so this optimization is limited
       // to consecutive effects.
       effectClipStack.PopClip(NextItemStartsEffect());
     }
 
-    if (cdi.mType != DisplayItemEntryType::ITEM) {
+    if (cdi.mType != DisplayItemEntryType::Item) {
 #ifdef DEBUG
       UpdateEffectTracking(opacityLevel, transformLevel, cdi.mType);
 #endif
       // Nothing more to do with effect markers.
       continue;
     }
 
     const DisplayItemClip* itemClip = GetItemClip(item, temporaryClip);
--- a/layout/painting/FrameLayerBuilder.h
+++ b/layout/painting/FrameLayerBuilder.h
@@ -43,23 +43,23 @@ class ImageLayer;
 
 class FrameLayerBuilder;
 class LayerManagerData;
 class PaintedLayerData;
 class ContainerState;
 class PaintedDisplayItemLayerUserData;
 
 enum class DisplayItemEntryType {
-  ITEM,
-  PUSH_OPACITY,
-  PUSH_OPACITY_WITH_BG,
-  POP_OPACITY,
-  PUSH_TRANSFORM,
-  POP_TRANSFORM,
-  HIT_TEST_INFO
+  Item,
+  PushOpacity,
+  PushOpacityWithBg,
+  PopOpacity,
+  PushTransform,
+  PopTransform,
+  HitTestInfo,
 };
 
 /**
  * Retained data storage:
  *
  * Each layer manager (widget, and inactive) stores a LayerManagerData object
  * that keeps a hash-set of DisplayItemData items that were drawn into it.
  * Each frame also keeps a list of DisplayItemData pointers that were
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -847,17 +847,17 @@ ImgDrawResult nsCSSRendering::PaintBorde
       return ImgDrawResult::SUCCESS;  // Let the theme handle it.
     }
   }
 
   if (!aStyleBorder.mBorderImageSource.IsEmpty()) {
     ImgDrawResult result = ImgDrawResult::SUCCESS;
 
     uint32_t irFlags = 0;
-    if (aFlags & PaintBorderFlags::SYNC_DECODE_IMAGES) {
+    if (aFlags & PaintBorderFlags::SyncDecodeImages) {
       irFlags |= nsImageRenderer::FLAG_SYNC_DECODE_IMAGES;
     }
 
     // Creating the border image renderer will request a decode, and we rely on
     // that happening.
     Maybe<nsCSSBorderImageRenderer> renderer =
         nsCSSBorderImageRenderer::CreateBorderImageRenderer(
             aPresContext, aForFrame, aBorderArea, aStyleBorder, aDirtyRect,
--- a/layout/painting/nsCSSRendering.h
+++ b/layout/painting/nsCSSRendering.h
@@ -40,17 +40,17 @@ class WebRenderParentCommand;
 class LayerManager;
 class RenderRootStateManager;
 }  // namespace layers
 
 namespace wr {
 class DisplayListBuilder;
 }  // namespace wr
 
-enum class PaintBorderFlags : uint8_t { SYNC_DECODE_IMAGES = 1 << 0 };
+enum class PaintBorderFlags : uint8_t { SyncDecodeImages = 1 << 0 };
 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(PaintBorderFlags)
 
 }  // namespace mozilla
 
 /**
  * A struct representing all the information needed to paint a background
  * image to some target, taking into account all CSS background-* properties.
  * See PrepareImageLayer.
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -906,17 +906,17 @@ static bool GenerateAndPushTextMask(nsIF
       gfxContext::CreatePreservingTransformOrNull(maskDT);
   MOZ_ASSERT(maskCtx);
   maskCtx->SetMatrix(Matrix::Translation(bounds.TopLeft().ToUnknownPoint()) *
                      currentMatrix * Matrix::Translation(-drawRect.TopLeft()));
 
   // Shade text shape into mask A8 surface.
   nsLayoutUtils::PaintFrame(
       maskCtx, aFrame, nsRect(nsPoint(0, 0), aFrame->GetSize()),
-      NS_RGB(255, 255, 255), nsDisplayListBuilderMode::GENERATE_GLYPH);
+      NS_RGB(255, 255, 255), nsDisplayListBuilderMode::GenerateGlyph);
 
   // Push the generated mask into aContext, so that the caller can pop and
   // blend with it.
   RefPtr<SourceSurface> maskSurface = maskDT->Snapshot();
   sourceCtx->PushGroupForBlendBack(
       gfxContentType::COLOR_ALPHA, 1.0, maskSurface,
       maskSurfaceDeviceOffsetTranslation * invCurrentMatrix);
 
@@ -5263,17 +5263,17 @@ bool nsDisplayBorder::CreateWebRenderCom
   nsDisplayBorderGeometry::UpdateDrawResult(this, drawResult);
   return true;
 };
 
 void nsDisplayBorder::Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) {
   nsPoint offset = ToReferenceFrame();
 
   PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
-                               ? PaintBorderFlags::SYNC_DECODE_IMAGES
+                               ? PaintBorderFlags::SyncDecodeImages
                                : PaintBorderFlags();
 
   ImgDrawResult result = nsCSSRendering::PaintBorder(
       mFrame->PresContext(), *aCtx, mFrame, GetPaintRect(),
       nsRect(offset, mFrame->GetSize()), mFrame->Style(), flags,
       mFrame->GetSkipSides());
 
   nsDisplayBorderGeometry::UpdateDrawResult(this, result);
@@ -6483,17 +6483,17 @@ already_AddRefed<Layer> nsDisplayOwnLaye
       aManager->GetLayerBuilder()->BuildContainerLayerFor(
           aBuilder, aManager, mFrame, this, &mList, aContainerParameters,
           nullptr, FrameLayerBuilder::CONTAINER_ALLOW_PULL_BACKGROUND_COLOR);
 
   if (IsScrollThumbLayer() || IsScrollbarContainer()) {
     layer->SetScrollbarData(mScrollbarData);
   }
 
-  if (mFlags & nsDisplayOwnLayerFlags::eGenerateSubdocInvalidations) {
+  if (mFlags & nsDisplayOwnLayerFlags::GenerateSubdocInvalidations) {
     mFrame->PresContext()->SetNotifySubDocInvalidationData(layer);
   }
   return layer.forget();
 }
 
 bool nsDisplayOwnLayer::CreateWebRenderCommands(
     mozilla::wr::DisplayListBuilder& aBuilder,
     mozilla::wr::IpcResourceUpdateQueue& aResources,
@@ -6727,17 +6727,17 @@ void nsDisplaySubDocument::Disown() {
     mSubDocFrame->RemoveDisplayItem(this);
     mSubDocFrame = nullptr;
   }
 }
 
 UniquePtr<ScrollMetadata> nsDisplaySubDocument::ComputeScrollMetadata(
     LayerManager* aLayerManager,
     const ContainerLayerParameters& aContainerParameters) {
-  if (!(mFlags & nsDisplayOwnLayerFlags::eGenerateScrollableLayer)) {
+  if (!(mFlags & nsDisplayOwnLayerFlags::GenerateScrollableLayer)) {
     return UniquePtr<ScrollMetadata>(nullptr);
   }
 
   nsPresContext* presContext = mFrame->PresContext();
   nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
   bool isRootContentDocument = presContext->IsRootContentDocument();
   PresShell* presShell = presContext->PresShell();
   ContainerLayerParameters params(
@@ -6770,30 +6770,30 @@ static bool UseDisplayPortForViewport(ns
   return aBuilder->IsPaintingToWindow() &&
          nsLayoutUtils::ViewportHasDisplayPort(aFrame->PresContext());
 }
 
 nsRect nsDisplaySubDocument::GetBounds(nsDisplayListBuilder* aBuilder,
                                        bool* aSnap) const {
   bool usingDisplayPort = UseDisplayPortForViewport(aBuilder, mFrame);
 
-  if ((mFlags & nsDisplayOwnLayerFlags::eGenerateScrollableLayer) &&
+  if ((mFlags & nsDisplayOwnLayerFlags::GenerateScrollableLayer) &&
       usingDisplayPort) {
     *aSnap = false;
     return mFrame->GetRect() + aBuilder->ToReferenceFrame(mFrame);
   }
 
   return nsDisplayOwnLayer::GetBounds(aBuilder, aSnap);
 }
 
 bool nsDisplaySubDocument::ComputeVisibility(nsDisplayListBuilder* aBuilder,
                                              nsRegion* aVisibleRegion) {
   bool usingDisplayPort = UseDisplayPortForViewport(aBuilder, mFrame);
 
-  if (!(mFlags & nsDisplayOwnLayerFlags::eGenerateScrollableLayer) ||
+  if (!(mFlags & nsDisplayOwnLayerFlags::GenerateScrollableLayer) ||
       !usingDisplayPort) {
     return nsDisplayWrapList::ComputeVisibility(aBuilder, aVisibleRegion);
   }
 
   nsRect displayport;
   nsIFrame* rootScrollFrame = mFrame->PresShell()->GetRootScrollFrame();
   MOZ_ASSERT(rootScrollFrame);
   Unused << nsLayoutUtils::GetDisplayPort(
@@ -6825,17 +6825,17 @@ bool nsDisplaySubDocument::ComputeVisibi
 
   return visible;
 }
 
 nsRegion nsDisplaySubDocument::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
                                                bool* aSnap) const {
   bool usingDisplayPort = UseDisplayPortForViewport(aBuilder, mFrame);
 
-  if ((mFlags & nsDisplayOwnLayerFlags::eGenerateScrollableLayer) &&
+  if ((mFlags & nsDisplayOwnLayerFlags::GenerateScrollableLayer) &&
       usingDisplayPort) {
     *aSnap = false;
     return nsRegion();
   }
 
   return nsDisplayOwnLayer::GetOpaqueRegion(aBuilder, aSnap);
 }
 
@@ -7005,41 +7005,41 @@ void nsDisplayFixedPosition::WriteDebugI
   aStream << nsPrintfCString(" (containerASR %s) (scrolltarget %" PRIu64 ")",
                              ActiveScrolledRoot::ToString(mContainerASR).get(),
                              GetScrollTargetId())
                  .get();
 }
 
 TableType GetTableTypeFromFrame(nsIFrame* aFrame) {
   if (aFrame->IsTableFrame()) {
-    return TableType::TABLE;
+    return TableType::Table;
   }
 
   if (aFrame->IsTableColFrame()) {
-    return TableType::TABLE_COL;
+    return TableType::TableCol;
   }
 
   if (aFrame->IsTableColGroupFrame()) {
-    return TableType::TABLE_COL_GROUP;
+    return TableType::TableColGroup;
   }
 
   if (aFrame->IsTableRowFrame()) {
-    return TableType::TABLE_ROW;
+    return TableType::TableRow;
   }
 
   if (aFrame->IsTableRowGroupFrame()) {
-    return TableType::TABLE_ROW_GROUP;
+    return TableType::TableRowGroup;
   }
 
   if (aFrame->IsTableCellFrame()) {
-    return TableType::TABLE_CELL;
+    return TableType::TableCell;
   }
 
   MOZ_ASSERT_UNREACHABLE("Invalid frame.");
-  return TableType::TABLE;
+  return TableType::Table;
 }
 
 nsDisplayTableFixedPosition::nsDisplayTableFixedPosition(
     nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsDisplayList* aList,
     uint16_t aIndex, nsIFrame* aAncestorFrame)
     : nsDisplayFixedPosition(aBuilder, aFrame, aList, aIndex),
       mAncestorFrame(aAncestorFrame),
       mTableType(GetTableTypeFromFrame(aAncestorFrame)) {
@@ -7435,17 +7435,17 @@ bool nsDisplayZoom::ComputeVisibility(ns
 
   nsRect transformedVisibleRect =
       GetPaintRect().ScaleToOtherAppUnitsRoundOut(mParentAPD, mAPD);
   bool retval;
   // If we are to generate a scrollable layer we call
   // nsDisplaySubDocument::ComputeVisibility to make the necessary adjustments
   // for ComputeVisibility, it does all it's calculations in the child APD.
   bool usingDisplayPort = UseDisplayPortForViewport(aBuilder, mFrame);
-  if (!(mFlags & nsDisplayOwnLayerFlags::eGenerateScrollableLayer) ||
+  if (!(mFlags & nsDisplayOwnLayerFlags::GenerateScrollableLayer) ||
       !usingDisplayPort) {
     retval = mList.ComputeVisibilityForSublist(aBuilder, &visibleRegion,
                                                transformedVisibleRect);
   } else {
     retval = nsDisplaySubDocument::ComputeVisibility(aBuilder, &visibleRegion);
   }
 
   nsRegion removed;
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -338,22 +338,22 @@ struct ActiveScrolledRoot {
   mutable Maybe<mozilla::layers::ScrollableLayerGuid::ViewID> mViewId;
 
   uint32_t mDepth;
   bool mRetained;
 };
 }  // namespace mozilla
 
 enum class nsDisplayListBuilderMode : uint8_t {
-  PAINTING,
-  EVENT_DELIVERY,
-  PLUGIN_GEOMETRY,
-  FRAME_VISIBILITY,
-  TRANSFORM_COMPUTATION,
-  GENERATE_GLYPH
+  Painting,
+  EventDelivery,
+  PluginGeometry,
+  FrameVisibility,
+  TransformComputation,
+  GenerateGlyph,
 };
 
 /**
  * This manages a display list and is passed as a parameter to
  * nsIFrame::BuildDisplayList.
  * It contains the parameters that don't change from frame to frame and manages
  * the display list memory using an arena. It also establishes the reference
  * coordinate system for all display list items. Some of the parameters are
@@ -447,71 +447,71 @@ class nsDisplayListBuilder {
   }
 
   void SetWillComputePluginGeometry(bool aWillComputePluginGeometry) {
     mWillComputePluginGeometry = aWillComputePluginGeometry;
   }
 
   void SetForPluginGeometry(bool aForPlugin) {
     if (aForPlugin) {
-      NS_ASSERTION(mMode == nsDisplayListBuilderMode::PAINTING,
-                   "Can only switch from PAINTING to PLUGIN_GEOMETRY");
+      NS_ASSERTION(mMode == nsDisplayListBuilderMode::Painting,
+                   "Can only switch from Painting to PluginGeometry");
       NS_ASSERTION(mWillComputePluginGeometry,
                    "Should have signalled this in advance");
-      mMode = nsDisplayListBuilderMode::PLUGIN_GEOMETRY;
+      mMode = nsDisplayListBuilderMode::PluginGeometry;
     } else {
-      NS_ASSERTION(mMode == nsDisplayListBuilderMode::PLUGIN_GEOMETRY,
-                   "Can only switch from PAINTING to PLUGIN_GEOMETRY");
-      mMode = nsDisplayListBuilderMode::PAINTING;
+      NS_ASSERTION(mMode == nsDisplayListBuilderMode::PluginGeometry,
+                   "Can only switch from Painting to PluginGeometry");
+      mMode = nsDisplayListBuilderMode::Painting;
     }
   }
 
   mozilla::layers::LayerManager* GetWidgetLayerManager(
       nsView** aView = nullptr);
 
   /**
    * @return true if the display is being built in order to determine which
    * frame is under the mouse position.
    */
   bool IsForEventDelivery() const {
-    return mMode == nsDisplayListBuilderMode::EVENT_DELIVERY;
-  }
-
-  /**
-   * Be careful with this. The display list will be built in PAINTING mode
-   * first and then switched to PLUGIN_GEOMETRY before a second call to
+    return mMode == nsDisplayListBuilderMode::EventDelivery;
+  }
+
+  /**
+   * Be careful with this. The display list will be built in Painting mode
+   * first and then switched to PluginGeometry before a second call to
    * ComputeVisibility.
    * @return true if the display list is being built to compute geometry
    * for plugins.
    */
   bool IsForPluginGeometry() const {
-    return mMode == nsDisplayListBuilderMode::PLUGIN_GEOMETRY;
+    return mMode == nsDisplayListBuilderMode::PluginGeometry;
   }
 
   /**
    * @return true if the display list is being built for painting.
    */
   bool IsForPainting() const {
-    return mMode == nsDisplayListBuilderMode::PAINTING;
+    return mMode == nsDisplayListBuilderMode::Painting;
   }
 
   /**
    * @return true if the display list is being built for determining frame
    * visibility.
    */
   bool IsForFrameVisibility() const {
-    return mMode == nsDisplayListBuilderMode::FRAME_VISIBILITY;
+    return mMode == nsDisplayListBuilderMode::FrameVisibility;
   }
 
   /**
    * @return true if the display list is being built for creating the glyph
    * mask from text items.
    */
   bool IsForGenerateGlyphMask() const {
-    return mMode == nsDisplayListBuilderMode::GENERATE_GLYPH;
+    return mMode == nsDisplayListBuilderMode::GenerateGlyph;
   }
 
   bool BuildCompositorHitTestInfo() const {
     return mBuildCompositorHitTestInfo;
   }
 
   bool WillComputePluginGeometry() const { return mWillComputePluginGeometry; }
 
@@ -599,17 +599,17 @@ class nsDisplayListBuilder {
    */
   void SetSelectedFramesOnly() { mSelectedFramesOnly = true; }
   bool GetSelectedFramesOnly() { return mSelectedFramesOnly; }
   /**
    * Calling this setter makes us compute accurate visible regions at the cost
    * of performance if regions get very complex.
    */
   bool GetAccurateVisibleRegions() {
-    return mMode == nsDisplayListBuilderMode::PLUGIN_GEOMETRY;
+    return mMode == nsDisplayListBuilderMode::PluginGeometry;
   }
   /**
    * @return Returns true if we should include the caret in any display lists
    * that we make.
    */
   bool IsBuildingCaret() const { return mBuildCaret; }
 
   bool IsRetainingDisplayList() const { return mRetainingDisplayList; }
@@ -4548,36 +4548,36 @@ class nsDisplayBackgroundImage : public 
   uint16_t mLayer;
   bool mIsRasterImage;
   /* Whether the image should be treated as fixed to the viewport. */
   bool mShouldFixToViewport;
   uint32_t mImageFlags;
 };
 
 enum class TableType : uint8_t {
-  TABLE,
-  TABLE_COL,
-  TABLE_COL_GROUP,
-  TABLE_ROW,
-  TABLE_ROW_GROUP,
-  TABLE_CELL,
-
-  TABLE_TYPE_MAX
+  Table,
+  TableCol,
+  TableColGroup,
+  TableRow,
+  TableRowGroup,
+  TableCell,
+
+  MAX,
 };
 
-enum class TableTypeBits : uint8_t { COUNT = 3 };
-
-static_assert(static_cast<uint8_t>(TableType::TABLE_TYPE_MAX) <
-                  (1 << (static_cast<uint8_t>(TableTypeBits::COUNT) + 1)),
-              "TableType cannot fit with TableTypeBits::COUNT");
+enum class TableTypeBits : uint8_t { Count = 3 };
+
+static_assert(static_cast<uint8_t>(TableType::MAX) <
+                  (1 << (static_cast<uint8_t>(TableTypeBits::Count) + 1)),
+              "TableType cannot fit with TableTypeBits::Count");
 TableType GetTableTypeFromFrame(nsIFrame* aFrame);
 
 static uint16_t CalculateTablePerFrameKey(const uint16_t aIndex,
                                           const TableType aType) {
-  const uint32_t key = (aIndex << static_cast<uint8_t>(TableTypeBits::COUNT)) |
+  const uint32_t key = (aIndex << static_cast<uint8_t>(TableTypeBits::Count)) |
                        static_cast<uint8_t>(aType);
 
   return static_cast<uint16_t>(key);
 }
 
 /**
  * A display item to paint background image for table. For table parts, such
  * as row, row group, col, col group, when drawing its background, we'll
@@ -5873,19 +5873,19 @@ class nsDisplayTableBlendContainer : pub
 };
 
 /**
  * nsDisplayOwnLayer constructor flags. If we nest this class inside
  * nsDisplayOwnLayer then we can't forward-declare it up at the top of this
  * file and that makes it hard to use in all the places that we need to use it.
  */
 enum class nsDisplayOwnLayerFlags {
-  eNone = 0,
-  eGenerateSubdocInvalidations = 1 << 0,
-  eGenerateScrollableLayer = 1 << 1,
+  None = 0,
+  GenerateSubdocInvalidations = 1 << 0,
+  GenerateScrollableLayer = 1 << 1,
 };
 
 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsDisplayOwnLayerFlags)
 
 /**
  * A display item that has no purpose but to ensure its contents get
  * their own layer.
  */
@@ -5902,17 +5902,17 @@ class nsDisplayOwnLayer : public nsDispl
    * ComputeFrameMetrics, etc.
    * @param aScrollTarget when eVerticalScrollbar or eHorizontalScrollbar
    * is set in the flags, this parameter should be the ViewID of the
    * scrollable content this scrollbar is for.
    */
   nsDisplayOwnLayer(
       nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsDisplayList* aList,
       const ActiveScrolledRoot* aActiveScrolledRoot,
-      nsDisplayOwnLayerFlags aFlags = nsDisplayOwnLayerFlags::eNone,
+      nsDisplayOwnLayerFlags aFlags = nsDisplayOwnLayerFlags::None,
       const ScrollbarData& aScrollbarData = ScrollbarData{},
       bool aForceActive = true, bool aClearClipChain = false);
 
   nsDisplayOwnLayer(nsDisplayListBuilder* aBuilder,
                     const nsDisplayOwnLayer& aOther)
       : nsDisplayWrapList(aBuilder, aOther),
         mFlags(aOther.mFlags),
         mScrollbarData(aOther.mScrollbarData),
@@ -6335,17 +6335,17 @@ class nsDisplayZoom : public nsDisplaySu
    * document.
    * @param aFlags eGenerateSubdocInvalidations :
    * Add UserData to the created ContainerLayer, so that invalidations
    * for this layer are send to our nsPresContext.
    */
   nsDisplayZoom(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
                 nsSubDocumentFrame* aSubDocFrame, nsDisplayList* aList,
                 int32_t aAPD, int32_t aParentAPD,
-                nsDisplayOwnLayerFlags aFlags = nsDisplayOwnLayerFlags::eNone);
+                nsDisplayOwnLayerFlags aFlags = nsDisplayOwnLayerFlags::None);
 
 #ifdef NS_BUILD_REFCNT_LOGGING
   ~nsDisplayZoom() override { MOZ_COUNT_DTOR(nsDisplayZoom); }
 #endif
 
   NS_DISPLAY_DECL_NAME("Zoom", TYPE_ZOOM)
 
   nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const override;
--- a/layout/style/CSSEnabledState.h
+++ b/layout/style/CSSEnabledState.h
@@ -14,25 +14,25 @@
 
 #include "mozilla/TypedEnumBits.h"
 
 namespace mozilla {
 
 enum class CSSEnabledState {
   // The default CSSEnabledState: only enable what's enabled for all
   // content, given the current values of preferences.
-  eForAllContent = 0,
+  ForAllContent = 0,
   // Enable features available in UA sheets.
-  eInUASheets = 0x01,
+  InUASheets = 0x01,
   // Enable features available in chrome code.
-  eInChrome = 0x02,
+  InChrome = 0x02,
   // Special value to unconditionally enable everything. This implies
   // all the bits above, but is strictly more than just their OR-ed
   // union. This just skips any test so a feature will be enabled even
   // if it would have been disabled with all the bits above set.
-  eIgnoreEnabledState = 0xff
+  IgnoreEnabledState = 0xff
 };
 
 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CSSEnabledState)
 
 }  // namespace mozilla
 
 #endif  // mozilla_CSSEnabledState_h
--- a/layout/style/CSSStyleRule.cpp
+++ b/layout/style/CSSStyleRule.cpp
@@ -191,18 +191,18 @@ nsresult CSSStyleRule::GetSpecificity(ui
 
 nsresult CSSStyleRule::SelectorMatchesElement(Element* aElement,
                                               uint32_t aSelectorIndex,
                                               const nsAString& aPseudo,
                                               bool* aMatches) {
   PseudoStyleType pseudoType = PseudoStyleType::NotPseudo;
   if (!aPseudo.IsEmpty()) {
     RefPtr<nsAtom> pseudoElt = NS_Atomize(aPseudo);
-    pseudoType = nsCSSPseudoElements::GetPseudoType(
-        pseudoElt, CSSEnabledState::eIgnoreEnabledState);
+    pseudoType =
+        nsCSSPseudoElements::GetPseudoType(pseudoElt, CSSEnabledState::IgnoreEnabledState);
 
     if (pseudoType == PseudoStyleType::NotPseudo) {
       *aMatches = false;
       return NS_OK;
     }
   }
 
   *aMatches = Servo_StyleRule_SelectorMatchesElement(
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -249,24 +249,24 @@ class nsCSSProps {
                "out of range");
     return gPropertyUseCounter[aProperty];
   }
 
   static bool IsEnabled(nsCSSPropertyID aProperty, EnabledState aEnabled) {
     if (IsEnabled(aProperty)) {
       return true;
     }
-    if (aEnabled == EnabledState::eIgnoreEnabledState) {
+    if (aEnabled == EnabledState::IgnoreEnabledState) {
       return true;
     }
-    if ((aEnabled & EnabledState::eInUASheets) &&
+    if ((aEnabled & EnabledState::InUASheets) &&
         PropHasFlags(aProperty, Flags::EnabledInUASheets)) {
       return true;
     }
-    if ((aEnabled & EnabledState::eInChrome) &&
+    if ((aEnabled & EnabledState::InChrome) &&
         PropHasFlags(aProperty, Flags::EnabledInChrome)) {
       return true;
     }
     return false;
   }
 
  public:
   struct PropertyPref {
--- a/layout/style/nsCSSPseudoElements.cpp
+++ b/layout/style/nsCSSPseudoElements.cpp
@@ -39,21 +39,20 @@ bool nsCSSPseudoElements::IsPseudoElemen
 bool nsCSSPseudoElements::IsCSS2PseudoElement(nsAtom* aAtom) {
   // We don't implement this using PseudoElementHasFlags because callers
   // want to pass things that could be anon boxes.
   MOZ_ASSERT(IsPseudoElement(aAtom), "must be pseudo element");
   bool result = aAtom == nsCSSPseudoElements::after() ||
                 aAtom == nsCSSPseudoElements::before() ||
                 aAtom == nsCSSPseudoElements::firstLetter() ||
                 aAtom == nsCSSPseudoElements::firstLine();
-  NS_ASSERTION(
-      result == PseudoElementHasFlags(
-                    GetPseudoType(aAtom, EnabledState::eIgnoreEnabledState),
-                    CSS_PSEUDO_ELEMENT_IS_CSS2),
-      "result doesn't match flags");
+  NS_ASSERTION(result == PseudoElementHasFlags(
+                             GetPseudoType(aAtom, EnabledState::IgnoreEnabledState),
+                             CSS_PSEUDO_ELEMENT_IS_CSS2),
+               "result doesn't match flags");
   return result;
 }
 
 /* static */
 PseudoStyleType nsCSSPseudoElements::GetPseudoType(nsAtom* aAtom,
                                                    EnabledState aEnabledState) {
   Maybe<uint32_t> index = nsStaticAtomUtils::Lookup(aAtom, GetAtomBase(),
                                                     kAtomCount_PseudoElements);
--- a/layout/style/nsCSSPseudoElements.h
+++ b/layout/style/nsCSSPseudoElements.h
@@ -118,22 +118,22 @@ class nsCSSPseudoElements {
   }
 
   static bool IsEnabled(Type aType, EnabledState aEnabledState) {
     if (!PseudoElementHasAnyFlag(
             aType, CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS_AND_CHROME)) {
       return true;
     }
 
-    if ((aEnabledState & EnabledState::eInUASheets) &&
+    if ((aEnabledState & EnabledState::InUASheets) &&
         PseudoElementHasFlags(aType, CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS)) {
       return true;
     }
 
-    if ((aEnabledState & EnabledState::eInChrome) &&
+    if ((aEnabledState & EnabledState::InChrome) &&
         PseudoElementHasFlags(aType, CSS_PSEUDO_ELEMENT_ENABLED_IN_CHROME)) {
       return true;
     }
 
     return false;
   }
 
   static nsString PseudoTypeAsString(Type aPseudoType);
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -188,17 +188,17 @@ struct ComputedStyleMap {
     ComputeMethod mGetter;
 
     bool IsLayoutFlushNeeded() const {
       return nsCSSProps::PropHasFlags(mProperty,
                                       CSSPropFlags::GetCSNeedsLayoutFlush);
     }
 
     bool IsEnabled() const {
-      return nsCSSProps::IsEnabled(mProperty, CSSEnabledState::eForAllContent);
+      return nsCSSProps::IsEnabled(mProperty, CSSEnabledState::ForAllContent);
     }
   };
 
   // This generated file includes definition of kEntries which is typed
   // Entry[] and used below, so this #include has to be put here.
 #include "nsComputedDOMStyleGenerated.cpp"
 
   /**
@@ -490,17 +490,17 @@ static bool MustReresolveStyle(const moz
   return aStyle->HasPseudoElementData() && !aStyle->IsPseudoElement();
 }
 
 static inline PseudoStyleType GetPseudoType(nsAtom* aPseudo) {
   if (!aPseudo) {
     return PseudoStyleType::NotPseudo;
   }
   return nsCSSPseudoElements::GetPseudoType(aPseudo,
-                                            CSSEnabledState::eForAllContent);
+                                            CSSEnabledState::ForAllContent);
 }
 
 already_AddRefed<ComputedStyle> nsComputedDOMStyle::DoGetComputedStyleNoFlush(
     Element* aElement, nsAtom* aPseudo, PresShell* aPresShell,
     StyleType aStyleType) {
   MOZ_ASSERT(aElement, "NULL element");
 
   // If the content has a pres shell, we must use it.  Otherwise we'd
@@ -665,17 +665,17 @@ static void AddImageURLs(const nsStyleIm
 }
 
 // FIXME(stylo-everywhere): This should be `const ComputedStyle&`.
 static void CollectImageURLsForProperty(nsCSSPropertyID aProp,
                                         ComputedStyle& aStyle,
                                         nsTArray<nsString>& aURLs) {
   if (nsCSSProps::IsShorthand(aProp)) {
     CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aProp,
-                                         CSSEnabledState::eForAllContent) {
+                                         CSSEnabledState::ForAllContent) {
       CollectImageURLsForProperty(*p, aStyle, aURLs);
     }
     return;
   }
 
   switch (aProp) {
     case eCSSProperty_cursor:
       for (auto& image : aStyle.StyleUI()->mCursorImages) {
--- a/layout/style/nsStyleTransformMatrix.cpp
+++ b/layout/style/nsStyleTransformMatrix.cpp
@@ -370,30 +370,30 @@ static Matrix4x4 OperateTransformMatrix(
 
   Matrix4x4 rotate = Operator::operateForRotate(rotate1, rotate2, aProgress);
   if (!rotate.IsIdentity()) {
     result = rotate * result;
   }
 
   // TODO: Would it be better to operate these as angles?
   //       How do we convert back to angles?
-  float yzshear = Operator::operate(shear1[ShearType::YZSHEAR],
-                                    shear2[ShearType::YZSHEAR], aProgress);
+  float yzshear = Operator::operate(shear1[ShearType::YZ],
+                                    shear2[ShearType::YZ], aProgress);
   if (yzshear != 0.0) {
     result.SkewYZ(yzshear);
   }
 
-  float xzshear = Operator::operate(shear1[ShearType::XZSHEAR],
-                                    shear2[ShearType::XZSHEAR], aProgress);
+  float xzshear = Operator::operate(shear1[ShearType::XZ],
+                                    shear2[ShearType::XZ], aProgress);
   if (xzshear != 0.0) {
     result.SkewXZ(xzshear);
   }
 
-  float xyshear = Operator::operate(shear1[ShearType::XYSHEAR],
-                                    shear2[ShearType::XYSHEAR], aProgress);
+  float xyshear = Operator::operate(shear1[ShearType::XY],
+                                    shear2[ShearType::XY], aProgress);
   if (xyshear != 0.0) {
     result.SkewXY(xyshear);
   }
 
   Point3D scale = Operator::operateForScale(scale1, scale2, aProgress);
   if (scale != Point3D(1.0, 1.0, 1.0)) {
     result.PreScale(scale.x, scale.y, scale.z);
   }
@@ -1018,17 +1018,17 @@ bool Decompose2DMatrix(const Matrix& aMa
     C = -C;
     D = -D;
     XYshear = -XYshear;
     scaleX = -scaleX;
   }
 
   float rotate = atan2f(B, A);
   aRotate = gfxQuaternion(0, 0, sin(rotate / 2), cos(rotate / 2));
-  aShear[ShearType::XYSHEAR] = XYshear;
+  aShear[ShearType::XY] = XYshear;
   aScale.x = scaleX;
   aScale.y = scaleY;
   aTranslate.x = aMatrix._31;
   aTranslate.y = aMatrix._32;
   return true;
 }
 
 /**
@@ -1090,36 +1090,36 @@ bool Decompose3DMatrix(const Matrix4x4& 
 
   /* Now get scale and shear. */
 
   /* Compute X scale factor and normalize first row. */
   aScale.x = local[0].Length();
   local[0] /= aScale.x;
 
   /* Compute XY shear factor and make 2nd local orthogonal to 1st. */
-  aShear[ShearType::XYSHEAR] = local[0].DotProduct(local[1]);
-  local[1] -= local[0] * aShear[ShearType::XYSHEAR];
+  aShear[ShearType::XY] = local[0].DotProduct(local[1]);
+  local[1] -= local[0] * aShear[ShearType::XY];
 
   /* Now, compute Y scale and normalize 2nd local. */
   aScale.y = local[1].Length();
   local[1] /= aScale.y;
-  aShear[ShearType::XYSHEAR] /= aScale.y;
+  aShear[ShearType::XY] /= aScale.y;
 
   /* Compute XZ and YZ shears, make 3rd local orthogonal */
-  aShear[ShearType::XZSHEAR] = local[0].DotProduct(local[2]);
-  local[2] -= local[0] * aShear[ShearType::XZSHEAR];
-  aShear[ShearType::YZSHEAR] = local[1].DotProduct(local[2]);
-  local[2] -= local[1] * aShear[ShearType::YZSHEAR];
+  aShear[ShearType::XZ] = local[0].DotProduct(local[2]);
+  local[2] -= local[0] * aShear[ShearType::XZ];
+  aShear[ShearType::YZ] = local[1].DotProduct(local[2]);
+  local[2] -= local[1] * aShear[ShearType::YZ];
 
   /* Next, get Z scale and normalize 3rd local. */
   aScale.z = local[2].Length();
   local[2] /= aScale.z;
 
-  aShear[ShearType::XZSHEAR] /= aScale.z;
-  aShear[ShearType::YZSHEAR] /= aScale.z;
+  aShear[ShearType::XZ] /= aScale.z;
+  aShear[ShearType::YZ] /= aScale.z;
 
   /**
    * At this point, the matrix (in locals) is orthonormal.
    * Check for a coordinate system flip.  If the determinant
    * is -1, then negate the matrix and the scaling factors.
    */
   if (local[0].DotProduct(local[1].CrossProduct(local[2])) < 0) {
     aScale *= -1;
--- a/layout/style/nsStyleTransformMatrix.h
+++ b/layout/style/nsStyleTransformMatrix.h
@@ -199,17 +199,17 @@ mozilla::CSSPoint Convert2DPosition(cons
  * TransformReferenceBox that these values describe, in device pixels.
  */
 mozilla::gfx::Point Convert2DPosition(const mozilla::LengthPercentage& aX,
                                       const mozilla::LengthPercentage& aY,
                                       TransformReferenceBox& aRefBox,
                                       int32_t aAppUnitsPerDevPixel);
 
 // Shear type for decomposition.
-enum class ShearType { XYSHEAR, XZSHEAR, YZSHEAR, Count };
+enum class ShearType { XY, XZ, YZ, Count };
 using ShearArray = mozilla::EnumeratedArray<ShearType, ShearType::Count, float>;
 
 /*
  * Implements the 2d transform matrix decomposition algorithm.
  */
 bool Decompose2DMatrix(const mozilla::gfx::Matrix& aMatrix,
                        mozilla::gfx::Point3D& aScale, ShearArray& aShear,
                        gfxQuaternion& aRotate,
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -428,26 +428,26 @@ bool nsTransitionManager::DoUpdateTransi
     // properties in question changed and are animatable.
     // FIXME: Would be good to find a way to share code between this
     // interpretation of transition-property and the one below.
     // FIXME(emilio): This should probably just use the "all" shorthand id, and
     // we should probably remove eCSSPropertyExtra_all_properties.
     if (property == eCSSPropertyExtra_all_properties) {
       for (nsCSSPropertyID p = nsCSSPropertyID(0);
            p < eCSSProperty_COUNT_no_shorthands; p = nsCSSPropertyID(p + 1)) {
-        if (!nsCSSProps::IsEnabled(p, CSSEnabledState::eForAllContent)) {
+        if (!nsCSSProps::IsEnabled(p, CSSEnabledState::ForAllContent)) {
           continue;
         }
         startedAny |= ConsiderInitiatingTransition(
             p, aDisp, i, aElement, aPseudoType, aElementTransitions, aOldStyle,
             aNewStyle, propertiesChecked);
       }
     } else if (nsCSSProps::IsShorthand(property)) {
       CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subprop, property,
-                                           CSSEnabledState::eForAllContent) {
+                                           CSSEnabledState::ForAllContent) {
         startedAny |= ConsiderInitiatingTransition(
             *subprop, aDisp, i, aElement, aPseudoType, aElementTransitions,
             aOldStyle, aNewStyle, propertiesChecked);
       }
     } else {
       startedAny |= ConsiderInitiatingTransition(
           property, aDisp, i, aElement, aPseudoType, aElementTransitions,
           aOldStyle, aNewStyle, propertiesChecked);
@@ -479,18 +479,18 @@ bool nsTransitionManager::DoUpdateTransi
         } else if (property == eCSSPropertyExtra_all_properties) {
           for (nsCSSPropertyID p = nsCSSPropertyID(0);
                p < eCSSProperty_COUNT_no_shorthands;
                p = nsCSSPropertyID(p + 1)) {
             allTransitionProperties.AddProperty(
                 nsCSSProps::Physicalize(p, aNewStyle));
           }
         } else if (nsCSSProps::IsShorthand(property)) {
-          CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(
-              subprop, property, CSSEnabledState::eForAllContent) {
+          CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subprop, property,
+                                               CSSEnabledState::ForAllContent) {
             auto p = nsCSSProps::Physicalize(*subprop, aNewStyle);
             allTransitionProperties.AddProperty(p);
           }
         } else {
           allTransitionProperties.AddProperty(
               nsCSSProps::Physicalize(property, aNewStyle));
         }
       }
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -2362,18 +2362,18 @@ bool CharIterator::IsOriginalCharTrimmed
     // Since we do a lot of trim checking, we cache the trimmed offsets and
     // lengths while we are in the same frame.
     mFrameForTrimCheck = TextFrame();
     uint32_t offset = mFrameForTrimCheck->GetContentOffset();
     uint32_t length = mFrameForTrimCheck->GetContentLength();
     nsIContent* content = mFrameForTrimCheck->GetContent();
     nsTextFrame::TrimmedOffsets trim = mFrameForTrimCheck->GetTrimmedOffsets(
         content->GetText(),
-        (mPostReflow ? nsTextFrame::TrimmedOffsetFlags::kDefaultTrimFlags
-                     : nsTextFrame::TrimmedOffsetFlags::kNotPostReflow));
+        (mPostReflow ? nsTextFrame::TrimmedOffsetFlags::Default
+                     : nsTextFrame::TrimmedOffsetFlags::NotPostReflow));
     TrimOffsets(offset, length, trim);
     mTrimmedOffset = offset;
     mTrimmedLength = length;
   }
 
   // A character is trimmed if it is outside the mTrimmedOffset/mTrimmedLength
   // range and it is not a significant newline character.
   uint32_t index = mSkipCharsIterator.GetOriginalOffset();
@@ -3790,17 +3790,17 @@ nsresult SVGTextFrame::GetSubStringLengt
     const uint32_t untrimmedOffset = frame->GetContentOffset();
     const uint32_t untrimmedLength = frame->GetContentEnd() - untrimmedOffset;
 
     // Trim the offset/length to remove any leading/trailing white space.
     uint32_t trimmedOffset = untrimmedOffset;
     uint32_t trimmedLength = untrimmedLength;
     nsTextFrame::TrimmedOffsets trimmedOffsets = frame->GetTrimmedOffsets(
         frame->GetContent()->GetText(),
-        nsTextFrame::TrimmedOffsetFlags::kNotPostReflow);
+        nsTextFrame::TrimmedOffsetFlags::NotPostReflow);
     TrimOffsets(trimmedOffset, trimmedLength, trimmedOffsets);
 
     textElementCharIndex += trimmedOffset - untrimmedOffset;
 
     if (textElementCharIndex >= charnum + nchars) {
       break;  // we're past the end of the substring
     }
 
--- a/layout/svg/nsSVGForeignObjectFrame.cpp
+++ b/layout/svg/nsSVGForeignObjectFrame.cpp
@@ -256,26 +256,26 @@ void nsSVGForeignObjectFrame::PaintSVG(g
   float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(
       PresContext()->AppUnitsPerDevPixel());
   gfxMatrix canvasTMForChildren = aTransform;
   canvasTMForChildren.PreScale(cssPxPerDevPx, cssPxPerDevPx);
 
   aContext.Multiply(canvasTMForChildren);
 
   using PaintFrameFlags = nsLayoutUtils::PaintFrameFlags;
-  PaintFrameFlags flags = PaintFrameFlags::PAINT_IN_TRANSFORM;
+  PaintFrameFlags flags = PaintFrameFlags::InTransform;
   if (SVGAutoRenderState::IsPaintingToWindow(aContext.GetDrawTarget())) {
-    flags |= PaintFrameFlags::PAINT_TO_WINDOW;
+    flags |= PaintFrameFlags::ToWindow;
   }
   if (aImgParams.imageFlags & imgIContainer::FLAG_SYNC_DECODE) {
-    flags |= PaintFrameFlags::PAINT_SYNC_DECODE_IMAGES;
+    flags |= PaintFrameFlags::SyncDecodeImages;
   }
   Unused << nsLayoutUtils::PaintFrame(
       &aContext, kid, nsRegion(kidDirtyRect), NS_RGBA(0, 0, 0, 0),
-      nsDisplayListBuilderMode::PAINTING, flags);
+      nsDisplayListBuilderMode::Painting, flags);
 
   aContext.Restore();
 }
 
 nsIFrame* nsSVGForeignObjectFrame::GetFrameForPoint(const gfxPoint& aPoint) {
   NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
                    (mState & NS_FRAME_IS_NONDISPLAY),
                "If display lists are enabled, only hit-testing of a "
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -798,18 +798,18 @@ bool nsSVGIntegrationUtils::PaintMask(co
   // Paint clip-path-basic-shape onto ctx
   gfxContextAutoSaveRestore basicShapeSR;
   if (maskUsage.shouldApplyBasicShapeOrPath) {
     matSR.SetContext(&ctx);
 
     MoveContextOriginToUserSpace(firstFrame, aParams);
 
     basicShapeSR.SetContext(&ctx);
-    nsCSSClipPathInstance::ApplyBasicShapeOrPathClip(ctx, frame,
-                                                     nsSVGUtils::GetCSSPxToDevPxMatrix(frame));
+    nsCSSClipPathInstance::ApplyBasicShapeOrPathClip(
+        ctx, frame, nsSVGUtils::GetCSSPxToDevPxMatrix(frame));
     if (!maskUsage.shouldGenerateMaskLayer) {
       // Only have basic-shape clip-path effect. Fill clipped region by
       // opaque white.
       ctx.SetColor(Color(1.0, 1.0, 1.0, 1.0));
       ctx.Fill();
 
       return true;
     }
@@ -1171,36 +1171,36 @@ bool PaintFrameCallback::operator()(gfxC
   gfxFloat scaleY = mRenderSize.height / paintServerSize.height;
   aContext->Multiply(gfxMatrix::Scaling(scaleX, scaleY));
 
   // Draw.
   nsRect dirty(-offset.x, -offset.y, mPaintServerSize.width,
                mPaintServerSize.height);
 
   using PaintFrameFlags = nsLayoutUtils::PaintFrameFlags;
-  PaintFrameFlags flags = PaintFrameFlags::PAINT_IN_TRANSFORM;
+  PaintFrameFlags flags = PaintFrameFlags::InTransform;
   if (mFlags & nsSVGIntegrationUtils::FLAG_SYNC_DECODE_IMAGES) {
-    flags |= PaintFrameFlags::PAINT_SYNC_DECODE_IMAGES;
+    flags |= PaintFrameFlags::SyncDecodeImages;
   }
   nsLayoutUtils::PaintFrame(aContext, mFrame, dirty, NS_RGBA(0, 0, 0, 0),
-                            nsDisplayListBuilderMode::PAINTING, flags);
+                            nsDisplayListBuilderMode::Painting, flags);
 
   nsIFrame* currentFrame = mFrame;
   while ((currentFrame = currentFrame->GetNextContinuation()) != nullptr) {
     offset = currentFrame->GetOffsetToCrossDoc(mFrame);
     devPxOffset = gfxPoint(offset.x, offset.y) / appUnitsPerDevPixel;
 
     aContext->Save();
     aContext->Multiply(gfxMatrix::Scaling(1 / scaleX, 1 / scaleY));
     aContext->Multiply(gfxMatrix::Translation(devPxOffset));
     aContext->Multiply(gfxMatrix::Scaling(scaleX, scaleY));
 
     nsLayoutUtils::PaintFrame(aContext, currentFrame, dirty - offset,
                               NS_RGBA(0, 0, 0, 0),
-                              nsDisplayListBuilderMode::PAINTING, flags);
+                              nsDisplayListBuilderMode::Painting, flags);
 
     aContext->Restore();
   }
 
   aContext->Restore();
 
   return true;
 }
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -3817,18 +3817,17 @@ nscoord nsTableFrame::GetRowSpacing(int3
   // Only one possible value so just multiply it out. Tables where index
   // matters will override this function
   return GetRowSpacing() * (aEndRowIndex - aStartRowIndex);
 }
 
 /* virtual */
 nscoord nsTableFrame::GetLogicalBaseline(WritingMode aWM) const {
   nscoord baseline;
-  if (!GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::eFirst,
-                                 &baseline)) {
+  if (!GetNaturalBaselineBOffset(aWM, BaselineSharingGroup::First, &baseline)) {
     baseline = BSize(aWM);
   }
   return baseline;
 }
 
 /* virtual */
 bool nsTableFrame::GetNaturalBaselineBOffset(
     WritingMode aWM, BaselineSharingGroup aBaselineGroup,
@@ -3840,17 +3839,17 @@ bool nsTableFrame::GetNaturalBaselineBOf
   auto TableBaseline = [aWM, containerSize](nsTableRowGroupFrame* aRowGroup,
                                             nsTableRowFrame* aRow) {
     nscoord rgBStart =
         LogicalRect(aWM, aRowGroup->GetNormalRect(), containerSize).BStart(aWM);
     nscoord rowBStart =
         LogicalRect(aWM, aRow->GetNormalRect(), containerSize).BStart(aWM);
     return rgBStart + rowBStart + aRow->GetRowBaseline(aWM);
   };
-  if (aBaselineGroup == BaselineSharingGroup::eFirst) {
+  if (aBaselineGroup == BaselineSharingGroup::First) {
     for (uint32_t rgIndex = 0; rgIndex < orderedRowGroups.Length(); rgIndex++) {
       nsTableRowGroupFrame* rgFrame = orderedRowGroups[rgIndex];
       nsTableRowFrame* row = rgFrame->GetFirstRow();
       if (row) {
         *aBaseline = TableBaseline(rgFrame, row);
         return true;
       }
     }
@@ -6197,36 +6196,36 @@ struct BCCreateWebRenderCommandsData {
 
   wr::DisplayListBuilder& mBuilder;
   const layers::StackingContextHelper& mSc;
   const nsPoint& mOffsetToReferenceFrame;
 };
 
 struct BCPaintBorderAction {
   explicit BCPaintBorderAction(DrawTarget& aDrawTarget)
-      : mMode(Mode::PAINT), mPaintData(aDrawTarget) {}
+      : mMode(Mode::Paint), mPaintData(aDrawTarget) {}
 
   BCPaintBorderAction(wr::DisplayListBuilder& aBuilder,
                       const layers::StackingContextHelper& aSc,
                       const nsPoint& aOffsetToReferenceFrame)
-      : mMode(Mode::CREATE_WEBRENDER_COMMANDS),
+      : mMode(Mode::CreateWebRenderCommands),
         mCreateWebRenderCommandsData(aBuilder, aSc, aOffsetToReferenceFrame) {}
 
   ~BCPaintBorderAction() {
     // mCreateWebRenderCommandsData is in a union which means the destructor
     // wouldn't be called when BCPaintBorderAction get destroyed. So call the
     // destructor here explicitly.
-    if (mMode == Mode::CREATE_WEBRENDER_COMMANDS) {
+    if (mMode == Mode::CreateWebRenderCommands) {
       mCreateWebRenderCommandsData.~BCCreateWebRenderCommandsData();
     }
   }
 
   enum class Mode {
-    PAINT,
-    CREATE_WEBRENDER_COMMANDS,
+    Paint,
+    CreateWebRenderCommands,
   };
 
   Mode mMode;
 
   union {
     BCPaintData mPaintData;
     BCCreateWebRenderCommandsData mCreateWebRenderCommandsData;
   };
@@ -7482,21 +7481,21 @@ void BCPaintBorderIterator::AccumulateOr
   }
 
   if (!IsDamageAreaIStartMost() &&
       (isSegStart || IsDamageAreaIEndMost() || BlockDirSegmentOwnsCorner())) {
     // paint the previous seg or the current one if IsDamageAreaIEndMost()
     if (mInlineSeg.mLength > 0) {
       mInlineSeg.GetIEndCorner(*this, iStartSegISize);
       if (mInlineSeg.mWidth > 0) {
-        if (aAction.mMode == BCPaintBorderAction::Mode::PAINT) {
+        if (aAction.mMode == BCPaintBorderAction::Mode::Paint) {
           mInlineSeg.Paint(*this, aAction.mPaintData.mDrawTarget);
         } else {
           MOZ_ASSERT(aAction.mMode ==
-                     BCPaintBorderAction::Mode::CREATE_WEBRENDER_COMMANDS);
+                     BCPaintBorderAction::Mode::CreateWebRenderCommands);
           mInlineSeg.CreateWebRenderCommands(
               *this, aAction.mCreateWebRenderCommandsData.mBuilder,
               aAction.mCreateWebRenderCommandsData.mSc,
               aAction.mCreateWebRenderCommandsData.mOffsetToReferenceFrame);
         }
       }
       mInlineSeg.AdvanceOffsetI();
     }
@@ -7533,22 +7532,22 @@ void BCPaintBorderIterator::AccumulateOr
 
   if (!IsDamageAreaBStartMost() &&
       (isSegStart || IsDamageAreaBEndMost() || IsAfterRepeatedHeader() ||
        StartRepeatedFooter())) {
     // paint the previous seg or the current one if IsDamageAreaBEndMost()
     if (blockDirSeg.mLength > 0) {
       blockDirSeg.GetBEndCorner(*this, inlineSegBSize);
       if (blockDirSeg.mWidth > 0) {
-        if (aAction.mMode == BCPaintBorderAction::Mode::PAINT) {
+        if (aAction.mMode == BCPaintBorderAction::Mode::Paint) {
           blockDirSeg.Paint(*this, aAction.mPaintData.mDrawTarget,
                             inlineSegBSize);
         } else {
           MOZ_ASSERT(aAction.mMode ==
-                     BCPaintBorderAction::Mode::CREATE_WEBRENDER_COMMANDS);
+                     BCPaintBorderAction::Mode::CreateWebRenderCommands);
           blockDirSeg.CreateWebRenderCommands(
               *this, inlineSegBSize,
               aAction.mCreateWebRenderCommandsData.mBuilder,
               aAction.mCreateWebRenderCommandsData.mSc,
               aAction.mCreateWebRenderCommandsData.mOffsetToReferenceFrame);
         }
       }
       blockDirSeg.AdvanceOffsetB();
--- a/layout/tables/nsTableWrapperFrame.h
+++ b/layout/tables/nsTableWrapperFrame.h
@@ -69,17 +69,17 @@ class nsTableWrapperFrame : public nsCon
 
   bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
                                  BaselineSharingGroup aBaselineGroup,
                                  nscoord* aBaseline) const override {
     auto innerTable = InnerTableFrame();
     nscoord offset;
     if (innerTable->GetNaturalBaselineBOffset(aWM, aBaselineGroup, &offset)) {
       auto bStart = innerTable->BStart(aWM, mRect.Size());
-      if (aBaselineGroup == BaselineSharingGroup::eFirst) {
+      if (aBaselineGroup == BaselineSharingGroup::First) {
         *aBaseline = offset + bStart;
       } else {
         auto bEnd = bStart + innerTable->BSize(aWM);
         *aBaseline = BSize(aWM) - (bEnd - offset);
       }
       return true;
     }
     return false;
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -1101,17 +1101,17 @@ void nsBoxFrame::BuildDisplayList(nsDisp
     const ActiveScrolledRoot* ownLayerASR = contASRTracker->GetContainerASR();
     DisplayListClipState::AutoSaveRestore ownLayerClipState(aBuilder);
 
     if (forceLayer) {
       MOZ_ASSERT(renderRoot == wr::RenderRoot::Default);
       // Wrap the list to make it its own layer
       aLists.Content()->AppendNewToTop<nsDisplayOwnLayer>(
           aBuilder, this, &masterList, ownLayerASR,
-          nsDisplayOwnLayerFlags::eNone, mozilla::layers::ScrollbarData{}, true,
+          nsDisplayOwnLayerFlags::None, mozilla::layers::ScrollbarData{}, true,
           true);
     } else {
       MOZ_ASSERT(!XRE_IsContentProcess());
       aLists.Content()->AppendNewToTop<nsDisplayRenderRoot>(
           aBuilder, this, &masterList, ownLayerASR, renderRoot);
     }
   }
 }
--- a/layout/xul/nsGroupBoxFrame.cpp
+++ b/layout/xul/nsGroupBoxFrame.cpp
@@ -223,52 +223,52 @@ ImgDrawResult nsGroupBoxFrame::PaintBord
     clipRect.width = groupRect.x - rect.x;
     clipRect.height = border.top;
 
     aRenderingContext.Save();
     aRenderingContext.Clip(
         NSRectToSnappedRect(clipRect, appUnitsPerDevPixel, *drawTarget));
     result &= nsCSSRendering::PaintBorder(
         presContext, aRenderingContext, this, aDirtyRect, rect, mComputedStyle,
-        PaintBorderFlags::SYNC_DECODE_IMAGES, skipSides);
+        PaintBorderFlags::SyncDecodeImages, skipSides);
     aRenderingContext.Restore();
 
     // draw right side
     clipRect = rect;
     clipRect.x = groupRect.XMost();
     clipRect.width = rect.XMost() - groupRect.XMost();
     clipRect.height = border.top;
 
     aRenderingContext.Save();
     aRenderingContext.Clip(
         NSRectToSnappedRect(clipRect, appUnitsPerDevPixel, *drawTarget));
     result &= nsCSSRendering::PaintBorder(
         presContext, aRenderingContext, this, aDirtyRect, rect, mComputedStyle,
-        PaintBorderFlags::SYNC_DECODE_IMAGES, skipSides);
+        PaintBorderFlags::SyncDecodeImages, skipSides);
 
     aRenderingContext.Restore();
     // draw bottom
 
     clipRect = rect;
     clipRect.y += border.top;
     clipRect.height = mRect.height - (yoff + border.top);
 
     aRenderingContext.Save();
     aRenderingContext.Clip(
         NSRectToSnappedRect(clipRect, appUnitsPerDevPixel, *drawTarget));
     result &= nsCSSRendering::PaintBorder(
         presContext, aRenderingContext, this, aDirtyRect, rect, mComputedStyle,
-        PaintBorderFlags::SYNC_DECODE_IMAGES, skipSides);
+        PaintBorderFlags::SyncDecodeImages, skipSides);
 
     aRenderingContext.Restore();
   } else {
     result &= nsCSSRendering::PaintBorder(
         presContext, aRenderingContext, this, aDirtyRect,
         nsRect(aPt, GetSize()), mComputedStyle,
-        PaintBorderFlags::SYNC_DECODE_IMAGES, skipSides);
+        PaintBorderFlags::SyncDecodeImages, skipSides);
   }
 
   return result;
 }
 
 nsIFrame* nsGroupBoxFrame::GetCaptionBox(nsRect& aCaptionRect) {
   // first child is our grouped area
   nsIFrame* box = nsBox::GetChildXULBox(this);
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -480,17 +480,17 @@ void nsMenuPopupFrame::LayoutPopup(nsBox
   // if the popup has just been opened, make sure the scrolled window is at 0,0
   // Don't scroll menulists as they will scroll to their selected item on their
   // own.
   if (mIsOpenChanged && !IsMenuList()) {
     nsIScrollableFrame* scrollframe =
         do_QueryFrame(nsBox::GetChildXULBox(this));
     if (scrollframe) {
       AutoWeakFrame weakFrame(this);
-      scrollframe->ScrollTo(nsPoint(0, 0), ScrollMode::eInstant);
+      scrollframe->ScrollTo(nsPoint(0, 0), ScrollMode::Instant);
       if (!weakFrame.IsAlive()) {
         return;
       }
     }
   }
 
   // get the preferred, minimum and maximum size. If the menu is sized to the
   // popup, then the popup's width is the menu's width.
@@ -2480,18 +2480,17 @@ void nsMenuPopupFrame::CheckForAnchorCha
 
   // If the rectangles are different, move the popup.
   if (!anchorRect.IsEqualEdges(aRect)) {
     aRect = anchorRect;
     SetPopupPosition(nullptr, true, false, true);
   }
 }
 
-nsIWidget* nsMenuPopupFrame::GetParentMenuWidget()
-{
+nsIWidget* nsMenuPopupFrame::GetParentMenuWidget() {
   nsMenuFrame* menuFrame = do_QueryFrame(GetParent());
   if (menuFrame) {
     nsMenuParent* parentPopup = menuFrame->GetMenuParent();
     if (parentPopup && parentPopup->IsMenu()) {
       return static_cast<nsMenuPopupFrame*>(parentPopup)->GetWidget();
     }
   }
   return nullptr;
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -358,17 +358,17 @@ void nsSliderFrame::BuildDisplayListForC
 
       // Restore the saved clip so it applies to the thumb container layer.
       thumbContentsClipState.Restore();
 
       // Wrap the list to make it its own layer.
       const ActiveScrolledRoot* ownLayerASR = contASRTracker.GetContainerASR();
       aLists.Content()->AppendNewToTop<nsDisplayOwnLayer>(
           aBuilder, this, &masterList, ownLayerASR,
-          nsDisplayOwnLayerFlags::eNone,
+          nsDisplayOwnLayerFlags::None,
           ScrollbarData::CreateForThumb(*scrollDirection, GetThumbRatio(),
                                         thumbStart, thumbLength,
                                         isAsyncDraggable, sliderTrackStart,
                                         sliderTrackLength, scrollTargetId));
 
       return;
     }
   }
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -3679,17 +3679,17 @@ ImgDrawResult nsTreeBodyFrame::PaintBack
       nsCSSRendering::PaintBGParams::ForAllLayers(
           *aPresContext, aDirtyRect, aRect, this,
           nsCSSRendering::PAINTBG_SYNC_DECODE_IMAGES);
   ImgDrawResult result = nsCSSRendering::PaintStyleImageLayerWithSC(
       params, aRenderingContext, aComputedStyle, *myBorder);
 
   result &= nsCSSRendering::PaintBorderWithStyleBorder(
       aPresContext, aRenderingContext, this, aDirtyRect, aRect, *myBorder,
-      mComputedStyle, PaintBorderFlags::SYNC_DECODE_IMAGES);
+      mComputedStyle, PaintBorderFlags::SyncDecodeImages);
 
   nsCSSRendering::PaintOutline(aPresContext, aRenderingContext, this,
                                aDirtyRect, aRect, aComputedStyle);
 
   return result;
 }
 
 // Scrolling
@@ -3820,17 +3820,17 @@ nsresult nsTreeBodyFrame::ScrollHorzInte
 
   mHorzPosition = aPosition;
 
   Invalidate();
 
   // Update the column scroll view
   AutoWeakFrame weakFrame(this);
   aParts.mColumnsScrollFrame->ScrollTo(nsPoint(mHorzPosition, 0),
-                                       ScrollMode::eInstant);
+                                       ScrollMode::Instant);
   if (!weakFrame.IsAlive()) {
     return NS_ERROR_FAILURE;
   }
   // And fire off an event about it all
   PostScrollEvent();
   return NS_OK;
 }
 
--- a/toolkit/components/sessionstore/SessionStoreUtils.cpp
+++ b/toolkit/components/sessionstore/SessionStoreUtils.cpp
@@ -295,17 +295,17 @@ void SessionStoreUtils::RestoreScrollPos
 
   if (nsCOMPtr<Document> doc = aWindow.GetExtantDoc()) {
     if (nsPresContext* presContext = doc->GetPresContext()) {
       if (presContext->IsRootContentDocument()) {
         // Use eMainThread so this takes precedence over session history
         // (ScrollFrameHelper::ScrollToRestoredPosition()).
         presContext->PresShell()->ScrollToVisual(
             CSSPoint::ToAppUnits(CSSPoint(pos_X, pos_Y)),
-            layers::FrameMetrics::eMainThread, ScrollMode::eInstant);
+            layers::FrameMetrics::eMainThread, ScrollMode::Instant);
       }
     }
   }
 }
 
 // Implements the Luhn checksum algorithm as described at
 // http://wikipedia.org/wiki/Luhn_algorithm
 // Number digit lengths vary with network, but should fall within 12-19 range.