Bug 1574101 - Use the right parent frame for `block ruby` if it's out of flow. r=mats
☠☠ backed out by 791d6cda0ddd ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 15 Aug 2019 21:14:34 +0000
changeset 488353 4d8eb840fc2eaa37f6e75e5a5f2e8863beeccf19
parent 488352 fcd0d5ef39e121dbe55ae4e854f37b7f571a90bb
child 488354 9417714d5e347ebef4150d28c18a6cd4e1d2a96c
push id113906
push userncsoregi@mozilla.com
push dateFri, 16 Aug 2019 04:07:24 +0000
treeherdermozilla-inbound@d887276421d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1574101
milestone70.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 1574101 - Use the right parent frame for `block ruby` if it's out of flow. r=mats I should've caught this when reviewing, in fairness. Differential Revision: https://phabricator.services.mozilla.com/D42163
layout/base/crashtests/1574101-1.html
layout/base/crashtests/1574101-2.html
layout/base/crashtests/crashtests.list
layout/base/nsCSSFrameConstructor.cpp
new file mode 100644
--- /dev/null
+++ b/layout/base/crashtests/1574101-1.html
@@ -0,0 +1,16 @@
+<script>
+function start() {
+    document.documentElement.style.transform='scale(0.00001)';
+	o219=document.createElement('hr');
+	o219.style.display='ruby';
+	o637=document.createElement('summary');
+	o637.appendChild(o219);
+	o663=document.createElement('details');
+	o663.appendChild(o637);
+	document.documentElement.appendChild(o663);
+	o219.style.position='absolute';
+	o866=document.documentElement.getBoxQuads();
+	o663.style.position='fixed';
+}
+</script>
+<body onload="start()"></body>
new file mode 100644
--- /dev/null
+++ b/layout/base/crashtests/1574101-2.html
@@ -0,0 +1,10 @@
+<script>
+function go() {
+  a.replaceChild(b, b)
+}
+</script>
+<body onload=go()>
+<p id="a">
+<menuitem id="b">
+<ruby style="position: absolute">
+a
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -571,8 +571,10 @@ load 1539303.html
 pref(layout.css.column-span.enabled,true) load 1541679.html
 load 1547261.html
 pref(layout.css.column-span.enabled,true) load 1547391.html
 pref(layout.css.resizeobserver.enabled,true) load 1548057.html
 pref(layout.css.column-span.enabled,true) load 1549867.html
 load 1553874.html
 load 1560328.html
 asserts(1-1) pref(layout.css.column-span.enabled,true) load 1566672.html # bug 1573759
+load 1574101-1.html
+load 1574101-2.html
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2357,19 +2357,18 @@ nsIFrame* nsCSSFrameConstructor::Constru
     // FrameConstructionData/Item, then we'd need the right function
     // here... but would probably be able to get away with less code in this
     // function in general.
     // Use a null PendingBinding, since our binding is not in fact pending.
     static const FrameConstructionData rootSVGData = FCDATA_DECL(0, nullptr);
     AutoFrameConstructionItem item(this, &rootSVGData, aDocElement, nullptr,
                                    do_AddRef(computedStyle), true);
 
-    contentFrame = static_cast<nsContainerFrame*>(
-        ConstructOuterSVG(state, item, mDocElementContainingBlock,
-                          display, frameList));
+    contentFrame = static_cast<nsContainerFrame*>(ConstructOuterSVG(
+        state, item, mDocElementContainingBlock, display, frameList));
   } else if (display->mDisplay == StyleDisplay::Flex ||
              display->mDisplay == StyleDisplay::WebkitBox ||
              display->mDisplay == StyleDisplay::Grid ||
              (StaticPrefs::layout_css_emulate_moz_box_with_flex() &&
               display->mDisplay == StyleDisplay::MozBox)) {
     auto func = display->mDisplay == StyleDisplay::Grid
                     ? NS_NewGridContainerFrame
                     : NS_NewFlexContainerFrame;
@@ -2393,28 +2392,27 @@ nsIFrame* nsCSSFrameConstructor::Constru
     // here... but would probably be able to get away with less code in this
     // function in general.
     // Use a null PendingBinding, since our binding is not in fact pending.
     static const FrameConstructionData rootTableData = FCDATA_DECL(0, nullptr);
     AutoFrameConstructionItem item(this, &rootTableData, aDocElement, nullptr,
                                    do_AddRef(computedStyle), true);
 
     // if the document is a table then just populate it.
-    contentFrame = static_cast<nsContainerFrame*>(
-        ConstructTable(state, item, mDocElementContainingBlock,
-                       display, frameList));
+    contentFrame = static_cast<nsContainerFrame*>(ConstructTable(
+        state, item, mDocElementContainingBlock, display, frameList));
   } else if (display->DisplayInside() == StyleDisplayInside::Ruby) {
     static const FrameConstructionData data =
         FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructBlockRubyFrame);
     AutoFrameConstructionItem item(this, &data, aDocElement, nullptr,
                                    do_AddRef(computedStyle), true);
-    contentFrame = static_cast<nsContainerFrame*>(
-        ConstructBlockRubyFrame(state, item,
-            state.GetGeometricParent(*display, mDocElementContainingBlock),
-            display, frameList));
+    contentFrame = static_cast<nsContainerFrame*>(ConstructBlockRubyFrame(
+        state, item,
+        state.GetGeometricParent(*display, mDocElementContainingBlock), display,
+        frameList));
   } else {
     MOZ_ASSERT(display->mDisplay == StyleDisplay::Block ||
                    display->mDisplay == StyleDisplay::FlowRoot,
                "Unhandled display type for root element");
     contentFrame = NS_NewBlockFormattingContext(mPresShell, computedStyle);
     // Use a null PendingBinding, since our binding is not in fact pending.
     ConstructBlock(
         state, aDocElement,
@@ -3172,26 +3170,26 @@ nsIFrame* nsCSSFrameConstructor::Constru
     nsFrameConstructorState& aState, FrameConstructionItem& aItem,
     nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay,
     nsFrameList& aFrameList) {
   nsIContent* const content = aItem.mContent;
   ComputedStyle* const computedStyle = aItem.mComputedStyle;
 
   nsBlockFrame* blockFrame = NS_NewBlockFrame(mPresShell, computedStyle);
   nsContainerFrame* newFrame = blockFrame;
+  nsContainerFrame* geometricParent =
+      aState.GetGeometricParent(*aStyleDisplay, aParentFrame);
   if ((aItem.mFCData->mBits & FCDATA_MAY_NEED_SCROLLFRAME) &&
       aStyleDisplay->IsScrollableOverflow()) {
-    nsContainerFrame* geometricParent =
-        aState.GetGeometricParent(*aStyleDisplay, aParentFrame);
     nsContainerFrame* scrollframe = nullptr;
     BuildScrollFrame(aState, content, computedStyle, blockFrame,
                      geometricParent, scrollframe);
     newFrame = scrollframe;
   } else {
-    InitAndRestoreFrame(aState, content, aParentFrame, blockFrame);
+    InitAndRestoreFrame(aState, content, geometricParent, blockFrame);
   }
 
   RefPtr<ComputedStyle> rubyStyle =
       mPresShell->StyleSet()->ResolveInheritingAnonymousBoxStyle(
           PseudoStyleType::blockRubyContent, computedStyle);
   nsContainerFrame* rubyFrame = NS_NewRubyFrame(mPresShell, rubyStyle);
   InitAndRestoreFrame(aState, content, blockFrame, rubyFrame);
   SetInitialSingleChild(blockFrame, rubyFrame);
@@ -3200,18 +3198,18 @@ nsIFrame* nsCSSFrameConstructor::Constru
   aState.AddChild(newFrame, aFrameList, content, aParentFrame);
 
   if (!mRootElementFrame) {
     // The frame we're constructing will be the root element frame.
     SetRootElementFrameAndConstructCanvasAnonContent(newFrame, aState,
                                                      aFrameList);
   }
   nsFrameList childList;
-  ProcessChildren(aState, content, rubyStyle, rubyFrame, true, childList,
-                  false, nullptr);
+  ProcessChildren(aState, content, rubyStyle, rubyFrame, true, childList, false,
+                  nullptr);
   rubyFrame->SetInitialChildList(kPrincipalList, childList);
 
   return newFrame;
 }
 
 static nsIFrame* FindAncestorWithGeneratedContentPseudo(nsIFrame* aFrame) {
   for (nsIFrame* f = aFrame->GetParent(); f; f = f->GetParent()) {
     NS_ASSERTION(f->IsGeneratedContentFrame(),
@@ -4367,240 +4365,236 @@ nsCSSFrameConstructor::FindDisplayData(c
                      !mPresShell->GetPresContext()->IsPaginated(),
                  "Shouldn't propagate scroll in paginated contexts");
     }
   }
 
   switch (aDisplay.DisplayInside()) {
     case StyleDisplayInside::Block:
     case StyleDisplayInside::FlowRoot: {
-      // If the frame is a block-level frame and is scrollable, then wrap it in a
-      // scroll frame.  Except we don't want to do that for paginated contexts for
-      // frames that are block-outside and aren't frames for native anonymous
-      // stuff.
+      // If the frame is a block-level frame and is scrollable, then wrap it in
+      // a scroll frame.  Except we don't want to do that for paginated contexts
+      // for frames that are block-outside and aren't frames for native
+      // anonymous stuff.
       // XXX Ignore tables for the time being (except caption)
       const uint32_t kCaptionCtorFlags =
           FCDATA_IS_TABLE_PART | FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable);
       bool caption = aDisplay.mDisplay == StyleDisplay::TableCaption;
       bool suppressScrollFrame = false;
       bool needScrollFrame =
           aDisplay.IsScrollableOverflow() && !propagatedScrollToViewport;
       if (needScrollFrame) {
         suppressScrollFrame = mPresShell->GetPresContext()->IsPaginated() &&
                               aDisplay.IsBlockOutsideStyle() &&
                               !aElement.IsInNativeAnonymousSubtree();
         if (!suppressScrollFrame) {
           static const FrameConstructionData sScrollableBlockData[2] = {
-              FULL_CTOR_FCDATA(0,
-                               &nsCSSFrameConstructor::ConstructScrollableBlock),
-              FULL_CTOR_FCDATA(kCaptionCtorFlags,
-                               &nsCSSFrameConstructor::ConstructScrollableBlock)};
+              FULL_CTOR_FCDATA(
+                  0, &nsCSSFrameConstructor::ConstructScrollableBlock),
+              FULL_CTOR_FCDATA(
+                  kCaptionCtorFlags,
+                  &nsCSSFrameConstructor::ConstructScrollableBlock)};
           return &sScrollableBlockData[caption];
         }
 
         // If the scrollable frame would have propagated its scrolling to the
         // viewport, we still want to construct a regular block rather than a
         // scrollframe so that it paginates correctly, but we don't want to set
         // the bit on the block that tells it to clip at paint time.
         if (mPresShell->GetPresContext()->ElementWouldPropagateScrollStyles(
                 aElement)) {
           suppressScrollFrame = false;
         }
       }
 
       // Handle various non-scrollable blocks.
       static const FrameConstructionData sNonScrollableBlockData[2][2] = {
-          {FULL_CTOR_FCDATA(0,
-                            &nsCSSFrameConstructor::ConstructNonScrollableBlock),
-           FULL_CTOR_FCDATA(kCaptionCtorFlags,
-                            &nsCSSFrameConstructor::ConstructNonScrollableBlock)},
-          {FULL_CTOR_FCDATA(FCDATA_FORCED_NON_SCROLLABLE_BLOCK,
-                            &nsCSSFrameConstructor::ConstructNonScrollableBlock),
+          {FULL_CTOR_FCDATA(
+               0, &nsCSSFrameConstructor::ConstructNonScrollableBlock),
+           FULL_CTOR_FCDATA(
+               kCaptionCtorFlags,
+               &nsCSSFrameConstructor::ConstructNonScrollableBlock)},
+          {FULL_CTOR_FCDATA(
+               FCDATA_FORCED_NON_SCROLLABLE_BLOCK,
+               &nsCSSFrameConstructor::ConstructNonScrollableBlock),
            FULL_CTOR_FCDATA(
                FCDATA_FORCED_NON_SCROLLABLE_BLOCK | kCaptionCtorFlags,
                &nsCSSFrameConstructor::ConstructNonScrollableBlock)}};
       return &sNonScrollableBlockData[suppressScrollFrame][caption];
     }
     case StyleDisplayInside::Inline: {
       static const FrameConstructionData data =
-        FULL_CTOR_FCDATA(FCDATA_IS_INLINE | FCDATA_IS_LINE_PARTICIPANT,
-                         &nsCSSFrameConstructor::ConstructInline);
+          FULL_CTOR_FCDATA(FCDATA_IS_INLINE | FCDATA_IS_LINE_PARTICIPANT,
+                           &nsCSSFrameConstructor::ConstructInline);
       return &data;
     }
     case StyleDisplayInside::Table: {
       static const FrameConstructionData data =
-        FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructTable);
+          FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructTable);
       return &data;
     }
     // NOTE: In the unlikely event that we add another table-part here that
     // has a desired-parent-type (& hence triggers table fixup), we'll need to
     // also update the flexbox chunk in ComputedStyle::ApplyStyleFixups().
     case StyleDisplayInside::TableRowGroup: {
-      static const FrameConstructionData data =
-        FULL_CTOR_FCDATA(
-            FCDATA_IS_TABLE_PART |
-                FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
-            &nsCSSFrameConstructor::ConstructTableRowOrRowGroup);
+      static const FrameConstructionData data = FULL_CTOR_FCDATA(
+          FCDATA_IS_TABLE_PART | FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
+          &nsCSSFrameConstructor::ConstructTableRowOrRowGroup);
       return &data;
     }
     case StyleDisplayInside::TableColumn: {
-      static const FrameConstructionData data =
-        FULL_CTOR_FCDATA(
-            FCDATA_IS_TABLE_PART |
-                FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeColGroup),
-            &nsCSSFrameConstructor::ConstructTableCol);
+      static const FrameConstructionData data = FULL_CTOR_FCDATA(
+          FCDATA_IS_TABLE_PART |
+              FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeColGroup),
+          &nsCSSFrameConstructor::ConstructTableCol);
       return &data;
     }
     case StyleDisplayInside::TableColumnGroup: {
       static const FrameConstructionData data =
-        FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
-                        FCDATA_SKIP_ABSPOS_PUSH |
-                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
-                    NS_NewTableColGroupFrame);
+          FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
+                          FCDATA_SKIP_ABSPOS_PUSH |
+                          FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
+                      NS_NewTableColGroupFrame);
       return &data;
     }
     case StyleDisplayInside::TableHeaderGroup: {
-      static const FrameConstructionData data =
-        FULL_CTOR_FCDATA(
-            FCDATA_IS_TABLE_PART |
-                FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
-            &nsCSSFrameConstructor::ConstructTableRowOrRowGroup);
+      static const FrameConstructionData data = FULL_CTOR_FCDATA(
+          FCDATA_IS_TABLE_PART | FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
+          &nsCSSFrameConstructor::ConstructTableRowOrRowGroup);
       return &data;
     }
     case StyleDisplayInside::TableFooterGroup: {
-      static const FrameConstructionData data =
-        FULL_CTOR_FCDATA(
-            FCDATA_IS_TABLE_PART |
-                FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
-            &nsCSSFrameConstructor::ConstructTableRowOrRowGroup);
+      static const FrameConstructionData data = FULL_CTOR_FCDATA(
+          FCDATA_IS_TABLE_PART | FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
+          &nsCSSFrameConstructor::ConstructTableRowOrRowGroup);
       return &data;
     }
     case StyleDisplayInside::TableRow: {
-      static const FrameConstructionData data =
-        FULL_CTOR_FCDATA(
-            FCDATA_IS_TABLE_PART |
-                FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRowGroup),
-            &nsCSSFrameConstructor::ConstructTableRowOrRowGroup);
+      static const FrameConstructionData data = FULL_CTOR_FCDATA(
+          FCDATA_IS_TABLE_PART |
+              FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRowGroup),
+          &nsCSSFrameConstructor::ConstructTableRowOrRowGroup);
       return &data;
     }
     case StyleDisplayInside::TableCell: {
-      static const FrameConstructionData data =
-        FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
-                             FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRow),
-                         &nsCSSFrameConstructor::ConstructTableCell);
+      static const FrameConstructionData data = FULL_CTOR_FCDATA(
+          FCDATA_IS_TABLE_PART | FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRow),
+          &nsCSSFrameConstructor::ConstructTableCell);
       return &data;
     }
     case StyleDisplayInside::MozBox:
     case StyleDisplayInside::MozInlineBox: {
       if (!aElement.IsInNativeAnonymousSubtree() &&
           aElement.OwnerDoc()->IsContentDocument()) {
         aElement.OwnerDoc()->WarnOnceAbout(Document::eMozBoxOrInlineBoxDisplay);
       }
 
       // If we're emulating -moz-box with flexbox, then treat it as non-XUL and
-      // fall through (except for scrollcorners which have to be XUL becuase their
-      // parent reflows them with BoxReflow() which means they have to get
+      // fall through (except for scrollcorners which have to be XUL becuase
+      // their parent reflows them with BoxReflow() which means they have to get
       // actual-XUL frames).
       if (!StaticPrefs::layout_css_emulate_moz_box_with_flex() ||
           aElement.IsXULElement(nsGkAtoms::scrollcorner)) {
         static const FrameConstructionData data =
-          SCROLLABLE_ABSPOS_CONTAINER_XUL_FCDATA(NS_NewBoxFrame);
+            SCROLLABLE_ABSPOS_CONTAINER_XUL_FCDATA(NS_NewBoxFrame);
         return &data;
       }
       MOZ_FALLTHROUGH;
     }
     case StyleDisplayInside::Flex:
     case StyleDisplayInside::WebkitBox: {
       static const FrameConstructionData nonScrollableData =
-        FCDATA_DECL(0, NS_NewFlexContainerFrame);
+          FCDATA_DECL(0, NS_NewFlexContainerFrame);
       static const FrameConstructionData data =
-        FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewFlexContainerFrame);
-      return MOZ_UNLIKELY(propagatedScrollToViewport) ? &nonScrollableData : &data;
+          FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewFlexContainerFrame);
+      return MOZ_UNLIKELY(propagatedScrollToViewport) ? &nonScrollableData
+                                                      : &data;
     }
     case StyleDisplayInside::Grid: {
       static const FrameConstructionData nonScrollableData =
-        FCDATA_DECL(0, NS_NewGridContainerFrame);
+          FCDATA_DECL(0, NS_NewGridContainerFrame);
       static const FrameConstructionData data =
-        FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewGridContainerFrame);
-      return MOZ_UNLIKELY(propagatedScrollToViewport) ? &nonScrollableData : &data;
+          FCDATA_DECL(FCDATA_MAY_NEED_SCROLLFRAME, NS_NewGridContainerFrame);
+      return MOZ_UNLIKELY(propagatedScrollToViewport) ? &nonScrollableData
+                                                      : &data;
     }
     case StyleDisplayInside::Ruby: {
       static const FrameConstructionData data[] = {
-        FULL_CTOR_FCDATA(FCDATA_MAY_NEED_SCROLLFRAME,
-                         &nsCSSFrameConstructor::ConstructBlockRubyFrame),
-        FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT, NS_NewRubyFrame),
+          FULL_CTOR_FCDATA(FCDATA_MAY_NEED_SCROLLFRAME,
+                           &nsCSSFrameConstructor::ConstructBlockRubyFrame),
+          FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT, NS_NewRubyFrame),
       };
       bool isInline = aDisplay.DisplayOutside() == StyleDisplayOutside::Inline;
       return &data[isInline];
     }
     case StyleDisplayInside::RubyBase: {
-      static const FrameConstructionData data =
-        FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT |
-                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyBaseContainer),
-                    NS_NewRubyBaseFrame);
+      static const FrameConstructionData data = FCDATA_DECL(
+          FCDATA_IS_LINE_PARTICIPANT |
+              FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyBaseContainer),
+          NS_NewRubyBaseFrame);
       return &data;
     }
     case StyleDisplayInside::RubyBaseContainer: {
       static const FrameConstructionData data =
-        FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT |
-                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby),
-                    NS_NewRubyBaseContainerFrame);
+          FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT |
+                          FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby),
+                      NS_NewRubyBaseContainerFrame);
       return &data;
     }
     case StyleDisplayInside::RubyText: {
-      static const FrameConstructionData data =
-        FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT |
-                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyTextContainer),
-                    NS_NewRubyTextFrame);
+      static const FrameConstructionData data = FCDATA_DECL(
+          FCDATA_IS_LINE_PARTICIPANT |
+              FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyTextContainer),
+          NS_NewRubyTextFrame);
       return &data;
     }
     case StyleDisplayInside::RubyTextContainer: {
       static const FrameConstructionData data =
-        FCDATA_DECL(FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby),
-                    NS_NewRubyTextContainerFrame);
+          FCDATA_DECL(FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby),
+                      NS_NewRubyTextContainerFrame);
       return &data;
     }
 #ifdef MOZ_XUL
     case StyleDisplayInside::MozGrid:
     case StyleDisplayInside::MozInlineGrid: {
       static const FrameConstructionData data =
-        SCROLLABLE_XUL_FCDATA(NS_NewGridBoxFrame);
+          SCROLLABLE_XUL_FCDATA(NS_NewGridBoxFrame);
       return &data;
     }
     case StyleDisplayInside::MozGridGroup: {
       static const FrameConstructionData data =
-        SCROLLABLE_XUL_FCDATA(NS_NewGridRowGroupFrame);
+          SCROLLABLE_XUL_FCDATA(NS_NewGridRowGroupFrame);
       return &data;
     }
     case StyleDisplayInside::MozGridLine: {
       static const FrameConstructionData data =
-        SCROLLABLE_XUL_FCDATA(NS_NewGridRowLeafFrame);
+          SCROLLABLE_XUL_FCDATA(NS_NewGridRowLeafFrame);
       return &data;
     }
     case StyleDisplayInside::MozStack:
     case StyleDisplayInside::MozInlineStack: {
       static const FrameConstructionData data =
-        SCROLLABLE_XUL_FCDATA(NS_NewStackFrame);
+          SCROLLABLE_XUL_FCDATA(NS_NewStackFrame);
       return &data;
     }
     case StyleDisplayInside::MozDeck: {
       static const FrameConstructionData data =
-        SIMPLE_XUL_FCDATA(NS_NewDeckFrame);
+          SIMPLE_XUL_FCDATA(NS_NewDeckFrame);
       return &data;
     }
     case StyleDisplayInside::MozGroupbox: {
       static const FrameConstructionData data =
-        SCROLLABLE_XUL_FCDATA(NS_NewGroupBoxFrame);
+          SCROLLABLE_XUL_FCDATA(NS_NewGroupBoxFrame);
       return &data;
     }
     case StyleDisplayInside::MozPopup: {
       static const FrameConstructionData data =
-        FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_IS_POPUP |
-                        FCDATA_SKIP_ABSPOS_PUSH,
-                    NS_NewMenuPopupFrame);
+          FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_IS_POPUP |
+                          FCDATA_SKIP_ABSPOS_PUSH,
+                      NS_NewMenuPopupFrame);
       return &data;
     }
 #endif /* MOZ_XUL */
     default:
       MOZ_ASSERT_UNREACHABLE("unknown 'display' value");
       return nullptr;
   }
 }
@@ -7207,17 +7201,17 @@ void nsCSSFrameConstructor::ContentRange
   bool haveFirstLetterStyle = false;
   bool haveFirstLineStyle = false;
 
   // In order to shave off some cycles, we only dig up the
   // containing block haveFirst* flags if the parent frame where
   // the insertion/append is occurring is an inline or block
   // container. For other types of containers this isn't relevant.
   StyleDisplayInside parentDisplayInside =
-    insertion.mParentFrame->StyleDisplay()->DisplayInside();
+      insertion.mParentFrame->StyleDisplay()->DisplayInside();
 
   // Examine the insertion.mParentFrame where the insertion is taking
   // place. If it's a certain kind of container then some special
   // processing is done.
   if (StyleDisplayInside::Block == parentDisplayInside ||
       StyleDisplayInside::Inline == parentDisplayInside) {
     // Recover the special style flags for the containing block
     if (containingBlock) {