Backed out changeset 31c43a9ffa8b (bug 1379474) for bustage
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 10 Jul 2017 08:06:30 +0200
changeset 419113 d0e7d5dcc8ad791e5762768859ba7d5fff1f7d57
parent 419112 31c43a9ffa8bf9fdbde36a96886540de397c0988
child 419114 91c943f7373722ad4e122d98a2ddd6c79708b732
child 419176 fd4a832c33eceb4d642e4c38b26eeefa3dea5a24
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1379474
milestone56.0a1
backs out31c43a9ffa8bf9fdbde36a96886540de397c0988
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
Backed out changeset 31c43a9ffa8b (bug 1379474) for bustage
layout/forms/nsDateTimeControlFrame.h
layout/generic/ReflowInput.cpp
layout/generic/ReflowInput.h
layout/generic/ReflowOutput.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockReflowContext.cpp
layout/generic/nsBlockReflowContext.h
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsPageContentFrame.h
layout/generic/nsPageFrame.h
layout/generic/nsSimplePageSequenceFrame.h
layout/tables/nsTableFrame.cpp
--- a/layout/forms/nsDateTimeControlFrame.h
+++ b/layout/forms/nsDateTimeControlFrame.h
@@ -57,17 +57,17 @@ public:
 
   // Reflow
   nscoord GetMinISize(gfxContext* aRenderingContext) override;
 
   nscoord GetPrefISize(gfxContext* aRenderingContext) override;
 
   void Reflow(nsPresContext* aPresContext,
               ReflowOutput& aDesiredSize,
-              const ReflowInput& aReflowInput,
+              const ReflowInput& aReflowState,
               nsReflowStatus& aStatus) override;
 
   // nsIAnonymousContentCreator
   nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
   void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
                                 uint32_t aFilter) override;
 
   nsresult AttributeChanged(int32_t aNameSpaceID, nsIAtom* aAttribute,
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -769,19 +769,18 @@ ReflowInput::InitResizeFlags(nsPresConte
     const ReflowInput *rs = this;
     bool hitCBReflowInput = false;
     do {
       rs = rs->mParentReflowInput;
       if (!rs) {
         break;
       }
 
-      if (rs->mFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE) {
+      if (rs->mFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)
         break; // no need to go further
-      }
       rs->mFrame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
 
       // Keep track of whether we've hit the containing block, because
       // we need to go at least that far.
       if (rs == mCBReflowInput) {
         hitCBReflowInput = true;
       }
 
@@ -1083,35 +1082,34 @@ ReflowInput::GetHypotheticalBoxContainer
                                                LogicalSize& aCBSize) const
 {
   aFrame = aFrame->GetContainingBlock();
   NS_ASSERTION(aFrame != mFrame, "How did that happen?");
 
   /* Now aFrame is the containing block we want */
 
   /* Check whether the containing block is currently being reflowed.
-     If so, use the info from the reflow input. */
-  const ReflowInput* reflowInput;
+     If so, use the info from the reflow state. */
+  const ReflowInput* state;
   if (aFrame->GetStateBits() & NS_FRAME_IN_REFLOW) {
-    for (reflowInput = mParentReflowInput;
-         reflowInput && reflowInput->mFrame != aFrame;
-         reflowInput = reflowInput->mParentReflowInput) {
+    for (state = mParentReflowInput; state && state->mFrame != aFrame;
+         state = state->mParentReflowInput) {
       /* do nothing */
     }
   } else {
-    reflowInput = nullptr;
+    state = nullptr;
   }
 
-  if (reflowInput) {
-    WritingMode wm = reflowInput->GetWritingMode();
+  if (state) {
+    WritingMode wm = state->GetWritingMode();
     NS_ASSERTION(wm == aFrame->GetWritingMode(), "unexpected writing mode");
-    aCBIStartEdge = reflowInput->ComputedLogicalBorderPadding().IStart(wm);
-    aCBSize = reflowInput->ComputedSize(wm);
+    aCBIStartEdge = state->ComputedLogicalBorderPadding().IStart(wm);
+    aCBSize = state->ComputedSize(wm);
   } else {
-    /* Didn't find a reflow reflowInput for aFrame.  Just compute the information we
+    /* Didn't find a reflow state for aFrame.  Just compute the information we
        want, on the assumption that aFrame already knows its size.  This really
        ought to be true by now. */
     NS_ASSERTION(!(aFrame->GetStateBits() & NS_FRAME_IN_REFLOW),
                  "aFrame shouldn't be in reflow; we'll lie if it is");
     WritingMode wm = aFrame->GetWritingMode();
     LogicalMargin borderPadding = aFrame->GetLogicalUsedBorderAndPadding(wm);
     aCBIStartEdge = borderPadding.IStart(wm);
     aCBSize = aFrame->GetLogicalSize(wm) - borderPadding.Size(wm);
@@ -1263,36 +1261,36 @@ AreAllEarlierInFlowFramesEmpty(nsIFrame*
 }
 
 // Calculate the position of the hypothetical box that the element would have
 // if it were in the flow.
 // The values returned are relative to the padding edge of the absolute
 // containing block. The writing-mode of the hypothetical box position will
 // have the same block direction as the absolute containing block, but may
 // differ in inline-bidi direction.
-// In the code below, |aReflowInput->frame| is the absolute containing block, while
+// In the code below, |cbrs->frame| is the absolute containing block, while
 // |containingBlock| is the nearest block container of the placeholder frame,
 // which may be different from the absolute containing block.
 void
 ReflowInput::CalculateHypotheticalPosition(
   nsPresContext* aPresContext,
   nsPlaceholderFrame* aPlaceholderFrame,
-  const ReflowInput* aReflowInput,
+  const ReflowInput* cbrs,
   nsHypotheticalPosition& aHypotheticalPos,
   LayoutFrameType aFrameType) const
 {
   NS_ASSERTION(mStyleDisplay->mOriginalDisplay != StyleDisplay::None,
                "mOriginalDisplay has not been properly initialized");
 
   // Find the nearest containing block frame to the placeholder frame,
   // and its inline-start edge and width.
   nscoord blockIStartContentEdge;
   // Dummy writing mode for blockContentSize, will be changed as needed by
   // GetHypotheticalBoxContainer.
-  WritingMode cbwm = aReflowInput->GetWritingMode();
+  WritingMode cbwm = cbrs->GetWritingMode();
   LogicalSize blockContentSize(cbwm);
   nsIFrame* containingBlock =
     GetHypotheticalBoxContainer(aPlaceholderFrame, blockIStartContentEdge,
                                 blockContentSize);
   // Now blockContentSize is in containingBlock's writing mode.
 
   // If it's a replaced element and it has a 'auto' value for
   //'inline size', see if we can get the intrinsic size. This will allow
@@ -1356,17 +1354,17 @@ ReflowInput::CalculateHypotheticalPositi
     }
   }
 
   // Get the placeholder x-offset and y-offset in the coordinate
   // space of its containing block
   // XXXbz the placeholder is not fully reflowed yet if our containing block is
   // relatively positioned...
   nsSize containerSize = containingBlock->GetStateBits() & NS_FRAME_IN_REFLOW
-    ? aReflowInput->ComputedSizeAsContainerIfConstrained()
+    ? cbrs->ComputedSizeAsContainerIfConstrained()
     : containingBlock->GetSize();
   LogicalPoint
     placeholderOffset(wm, aPlaceholderFrame->GetOffsetTo(containingBlock),
                       containerSize);
 
   // First, determine the hypothetical box's mBStart.  We want to check the
   // content insertion frame of containingBlock for block-ness, but make
   // sure to compute all coordinates in the coordinate system of
@@ -1477,56 +1475,55 @@ ReflowInput::CalculateHypotheticalPositi
   // Convert to the coordinate space of the absolute containing block
   // One weird thing here is that for fixed-positioned elements we want to do
   // the conversion incorrectly; specifically we want to ignore any scrolling
   // that may have happened;
   nsPoint cbOffset;
   if (mStyleDisplay->mPosition == NS_STYLE_POSITION_FIXED &&
       // Exclude cases inside -moz-transform where fixed is like absolute.
       nsLayoutUtils::IsReallyFixedPos(mFrame)) {
-    // In this case, aReflowInput->frame will likely be an ancestor of
+    // In this case, cbrs->frame will likely be an ancestor of
     // containingBlock, so can just walk our way up the frame tree.
     // Make sure to not add positions of frames whose parent is a
     // scrollFrame, since we're doing fixed positioning, which assumes
     // everything is scrolled to (0,0).
     cbOffset.MoveTo(0, 0);
     do {
       cbOffset += containingBlock->GetPositionIgnoringScrolling();
       nsContainerFrame* parent = containingBlock->GetParent();
       if (!parent) {
         // Oops, our absolute containing block isn't an ancestor of the
         // placeholder's containing block. This can happen if the placeholder
         // is pushed to a different page in a printing context.  'cbOffset' is
         // currently relative to the root frame (containingBlock) - so just
         // subtract the offset to the absolute containing block to make it
         // relative to that.
-        cbOffset -= containingBlock->GetOffsetTo(aReflowInput->mFrame);
+        cbOffset -= containingBlock->GetOffsetTo(cbrs->mFrame);
         break;
       }
       containingBlock = parent;
-    } while (containingBlock != aReflowInput->mFrame);
+    } while (containingBlock != cbrs->mFrame);
   } else {
     // XXXldb We need to either ignore scrolling for the absolute
     // positioning case too (and take the incompatibility) or figure out
     // how to make these positioned elements actually *move* when we
     // scroll, and thus avoid the resulting incremental reflow bugs.
-    cbOffset = containingBlock->GetOffsetTo(aReflowInput->mFrame);
+    cbOffset = containingBlock->GetOffsetTo(cbrs->mFrame);
   }
-  nsSize reflowSize = aReflowInput->ComputedSizeAsContainerIfConstrained();
-  LogicalPoint logCBOffs(wm, cbOffset, reflowSize - containerSize);
+  nsSize cbrsSize = cbrs->ComputedSizeAsContainerIfConstrained();
+  LogicalPoint logCBOffs(wm, cbOffset, cbrsSize - containerSize);
   aHypotheticalPos.mIStart += logCBOffs.I(wm);
   aHypotheticalPos.mBStart += logCBOffs.B(wm);
 
   // The specified offsets are relative to the absolute containing block's
   // padding edge and our current values are relative to the border edge, so
   // translate.
   LogicalMargin border =
-    aReflowInput->ComputedLogicalBorderPadding() -
-    aReflowInput->ComputedLogicalPadding();
-  border = border.ConvertTo(wm, aReflowInput->GetWritingMode());
+    cbrs->ComputedLogicalBorderPadding() - cbrs->ComputedLogicalPadding();
+  border = border.ConvertTo(wm, cbrs->GetWritingMode());
   aHypotheticalPos.mIStart -= border.IStart(wm);
   aHypotheticalPos.mBStart -= border.BStart(wm);
 
   // At this point, we have computed aHypotheticalPos using the writing mode
   // of the placeholder's containing block.
 
   if (cbwm.GetBlockDir() != wm.GetBlockDir()) {
     // If the block direction we used in calculating aHypotheticalPos does not
@@ -1573,35 +1570,35 @@ ReflowInput::CalculateHypotheticalPositi
                                                   insideBoxSizing, styleBSize) +
                  insideBoxSizing + outsideBoxSizing;
     }
 
     LogicalSize boxSize(wm, knowBoxISize ? boxISize : 0, boxBSize);
 
     LogicalPoint origin(wm, aHypotheticalPos.mIStart,
                         aHypotheticalPos.mBStart);
-    origin = origin.ConvertTo(cbwm, wm, reflowSize -
+    origin = origin.ConvertTo(cbwm, wm, cbrsSize -
                               boxSize.GetPhysicalSize(wm));
 
     aHypotheticalPos.mIStart = origin.I(cbwm);
     aHypotheticalPos.mBStart = origin.B(cbwm);
     aHypotheticalPos.mWritingMode = cbwm;
   } else {
     aHypotheticalPos.mWritingMode = wm;
   }
 }
 
 void
 ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext,
-                                     const ReflowInput* aReflowInput,
+                                     const ReflowInput* cbrs,
                                      const LogicalSize& aCBSize,
                                      LayoutFrameType aFrameType)
 {
   WritingMode wm = GetWritingMode();
-  WritingMode cbwm = aReflowInput->GetWritingMode();
+  WritingMode cbwm = cbrs->GetWritingMode();
   NS_PRECONDITION(aCBSize.BSize(cbwm) != NS_AUTOHEIGHT,
                   "containing block bsize must be constrained");
 
   NS_ASSERTION(aFrameType != LayoutFrameType::Table,
                "InitAbsoluteConstraints should not be called on table frames");
   NS_ASSERTION(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
                "Why are we here?");
 
@@ -1633,18 +1630,18 @@ ReflowInput::InitAbsoluteConstraints(nsP
       mFlags.mBOffsetsNeedCSSAlign = (bStartIsAuto && bEndIsAuto);
     }
 
     if (mFlags.mStaticPosIsCBOrigin) {
       hypotheticalPos.mWritingMode = cbwm;
       hypotheticalPos.mIStart = nscoord(0);
       hypotheticalPos.mBStart = nscoord(0);
     } else {
-      CalculateHypotheticalPosition(aPresContext, placeholderFrame,
-                                    aReflowInput, hypotheticalPos, aFrameType);
+      CalculateHypotheticalPosition(aPresContext, placeholderFrame, cbrs,
+                                    hypotheticalPos, aFrameType);
     }
   }
 
   // Initialize the 'left' and 'right' computed offsets
   // XXX Handle new 'static-position' value...
 
   // Size of the containing block in its writing mode
   LogicalSize cbSize = aCBSize;
@@ -2062,18 +2059,18 @@ CalcQuirkContainingBlockHeight(const Ref
           NS_ASSERTION(frameContent->IsHTMLElement(nsGkAtoms::body),
                        "Second ancestor is not BODY");
         }
       }
 #endif
 
     }
     // if we got to the html frame (a block child of the canvas) ...
-    else if (LayoutFrameType::Block == frameType && ri->mParentReflowInput &&
-             ri->mParentReflowInput->mFrame->IsCanvasFrame()) {
+    else if (LayoutFrameType::Block == frameType && rs->mParentReflowInput &&
+             rs->mParentReflowInput->mFrame->IsCanvasFrame()) {
       // ... then subtract out margin/border/padding for the BODY element
       result -= GetBlockMarginBorderPadding(secondAncestorRI);
     }
     break;
   }
 
   // Make sure not to return a negative height here!
   return std::max(result, 0);
@@ -2229,48 +2226,48 @@ ReflowInput::InitConstraints(nsPresConte
     } else {
       ComputedBSize() = NS_UNCONSTRAINEDSIZE;
     }
 
     ComputedMinWidth() = ComputedMinHeight() = 0;
     ComputedMaxWidth() = ComputedMaxHeight() = NS_UNCONSTRAINEDSIZE;
   } else {
     // Get the containing block reflow state
-    const ReflowInput* cbri = mCBReflowInput;
-    MOZ_ASSERT(cbri, "no containing block");
+    const ReflowInput* cbrs = mCBReflowInput;
+    MOZ_ASSERT(cbrs, "no containing block");
     MOZ_ASSERT(mFrame->GetParent());
 
     // If we weren't given a containing block width and height, then
     // compute one
     LogicalSize cbSize = (aContainingBlockSize == LogicalSize(wm, -1, -1))
-      ? ComputeContainingBlockRectangle(aPresContext, cbri)
+      ? ComputeContainingBlockRectangle(aPresContext, cbrs)
       : aContainingBlockSize;
 
     // See if the containing block height is based on the size of its
     // content
     LayoutFrameType fType;
     if (NS_AUTOHEIGHT == cbSize.BSize(wm)) {
       // See if the containing block is a cell frame which needs
       // to use the mComputedHeight of the cell instead of what the cell block passed in.
       // XXX It seems like this could lead to bugs with min-height and friends
-      if (cbri->mParentReflowInput) {
-        fType = cbri->mFrame->Type();
+      if (cbrs->mParentReflowInput) {
+        fType = cbrs->mFrame->Type();
         if (IS_TABLE_CELL(fType)) {
           // use the cell's computed block size
-          cbSize.BSize(wm) = cbri->ComputedSize(wm).BSize(wm);
+          cbSize.BSize(wm) = cbrs->ComputedSize(wm).BSize(wm);
         }
       }
     }
 
     // XXX Might need to also pass the CB height (not width) for page boxes,
     // too, if we implement them.
 
     // For calculating positioning offsets, margins, borders and
     // padding, we use the writing mode of the containing block
-    WritingMode cbwm = cbri->GetWritingMode();
+    WritingMode cbwm = cbrs->GetWritingMode();
     InitOffsets(cbwm, OffsetPercentBasis(mFrame, cbwm,
                                          cbSize.ConvertTo(cbwm, wm)),
                 aFrameType, mFlags, aBorder, aPadding, mStyleDisplay);
 
     // For calculating the size of this box, we use its own writing mode
     const nsStyleCoord &blockSize = mStylePosition->BSize(wm);
     nsStyleUnit blockSizeUnit = blockSize.GetUnit();
 
@@ -2282,36 +2279,36 @@ ReflowInput::InitConstraints(nsPresConte
       if (NS_AUTOHEIGHT == cbSize.BSize(wm)) {
         // this if clause enables %-blockSize on replaced inline frames,
         // such as images.  See bug 54119.  The else clause "blockSizeUnit = eStyleUnit_Auto;"
         // used to be called exclusively.
         if (NS_FRAME_REPLACED(NS_CSS_FRAME_TYPE_INLINE) == mFrameType ||
             NS_FRAME_REPLACED_CONTAINS_BLOCK(
                 NS_CSS_FRAME_TYPE_INLINE) == mFrameType) {
           // Get the containing block reflow state
-          NS_ASSERTION(nullptr != cbri, "no containing block");
+          NS_ASSERTION(nullptr != cbrs, "no containing block");
           // in quirks mode, get the cb height using the special quirk method
           if (!wm.IsVertical() &&
               eCompatibility_NavQuirks == aPresContext->CompatibilityMode()) {
             if (!IS_TABLE_CELL(fType)) {
-              cbSize.BSize(wm) = CalcQuirkContainingBlockHeight(cbri);
+              cbSize.BSize(wm) = CalcQuirkContainingBlockHeight(cbrs);
               if (cbSize.BSize(wm) == NS_AUTOHEIGHT) {
                 blockSizeUnit = eStyleUnit_Auto;
               }
             }
             else {
               blockSizeUnit = eStyleUnit_Auto;
             }
           }
           // in standard mode, use the cb block size.  if it's "auto",
           // as will be the case by default in BODY, use auto block size
           // as per CSS2 spec.
           else
           {
-            nscoord computedBSize = cbri->ComputedSize(wm).BSize(wm);
+            nscoord computedBSize = cbrs->ComputedSize(wm).BSize(wm);
             if (NS_AUTOHEIGHT != computedBSize) {
               cbSize.BSize(wm) = computedBSize;
             }
             else {
               blockSizeUnit = eStyleUnit_Auto;
             }
           }
         }
@@ -2398,19 +2395,17 @@ ReflowInput::InitConstraints(nsPresConte
       }
 
       // Doesn't apply to table elements
       ComputedMinWidth() = ComputedMinHeight() = 0;
       ComputedMaxWidth() = ComputedMaxHeight() = NS_UNCONSTRAINEDSIZE;
 
     } else if (NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) {
       // XXX not sure if this belongs here or somewhere else - cwk
-      InitAbsoluteConstraints(aPresContext, cbri,
-                              cbSize.ConvertTo(cbri->GetWritingMode(), wm),
-                              aFrameType);
+      InitAbsoluteConstraints(aPresContext, cbrs, cbSize.ConvertTo(cbrs->GetWritingMode(), wm), aFrameType);
     } else {
       AutoMaybeDisableFontInflation an(mFrame);
 
       bool isBlock = NS_CSS_FRAME_TYPE_BLOCK == NS_FRAME_GET_TYPE(mFrameType);
       typedef nsIFrame::ComputeSizeFlags ComputeSizeFlags;
       ComputeSizeFlags computeSizeFlags =
         isBlock ? ComputeSizeFlags::eDefault : ComputeSizeFlags::eShrinkWrap;
       if (mFlags.mIClampMarginBoxMinSize) {
@@ -2739,38 +2734,38 @@ ReflowInput::CalculateBlockSideMargins(L
   const nsStyleSides& styleSides = mStyleMargin->mMargin;
   bool isAutoStartMargin = eStyleUnit_Auto == styleSides.GetIStartUnit(cbWM);
   bool isAutoEndMargin = eStyleUnit_Auto == styleSides.GetIEndUnit(cbWM);
   if (!isAutoStartMargin && !isAutoEndMargin) {
     // Neither margin is 'auto' so we're over constrained. Use the
     // 'direction' property of the parent to tell which margin to
     // ignore
     // First check if there is an HTML alignment that we should honor
-    const ReflowInput* pri = mParentReflowInput;
+    const ReflowInput* prs = mParentReflowInput;
     if (aFrameType == LayoutFrameType::Table) {
-      NS_ASSERTION(pri->mFrame->IsTableWrapperFrame(),
+      NS_ASSERTION(prs->mFrame->IsTableWrapperFrame(),
                    "table not inside table wrapper");
       // Center the table within the table wrapper based on the alignment
       // of the table wrapper's parent.
-      pri = pri->mParentReflowInput;
+      prs = prs->mParentReflowInput;
     }
-    if (pri &&
-        (pri->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_LEFT ||
-         pri->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER ||
-         pri->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_RIGHT)) {
-      if (pri->mWritingMode.IsBidiLTR()) {
+    if (prs &&
+        (prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_LEFT ||
+         prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER ||
+         prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_RIGHT)) {
+      if (prs->mWritingMode.IsBidiLTR()) {
         isAutoStartMargin =
-          pri->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_LEFT;
+          prs->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_LEFT;
         isAutoEndMargin =
-          pri->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_RIGHT;
+          prs->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_RIGHT;
       } else {
         isAutoStartMargin =
-          pri->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_RIGHT;
+          prs->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_RIGHT;
         isAutoEndMargin =
-          pri->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_LEFT;
+          prs->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_LEFT;
       }
     }
     // Otherwise apply the CSS rules, and ignore one margin by forcing
     // it to 'auto', depending on 'direction'.
     else {
       isAutoEndMargin = true;
     }
   }
--- a/layout/generic/ReflowInput.h
+++ b/layout/generic/ReflowInput.h
@@ -987,25 +987,25 @@ protected:
   nsIFrame* GetHypotheticalBoxContainer(nsIFrame* aFrame,
                                         nscoord& aCBIStartEdge,
                                         mozilla::LogicalSize& aCBSize) const;
 
   // Calculate a "hypothetical box" position where the placeholder frame
   // (for a position:fixed/absolute element) would have been placed if it were
   // positioned statically. The hypothetical box position will have a writing
   // mode with the same block direction as the absolute containing block
-  // (aReflowInput->frame), though it may differ in inline direction.
+  // (cbrs->frame), though it may differ in inline direction.
   void CalculateHypotheticalPosition(nsPresContext* aPresContext,
                                      nsPlaceholderFrame* aPlaceholderFrame,
-                                     const ReflowInput* aReflowInput,
+                                     const ReflowInput* cbrs,
                                      nsHypotheticalPosition& aHypotheticalPos,
                                      mozilla::LayoutFrameType aFrameType) const;
 
   void InitAbsoluteConstraints(nsPresContext* aPresContext,
-                               const ReflowInput* aReflowInput,
+                               const ReflowInput* cbrs,
                                const mozilla::LogicalSize& aContainingBlockSize,
                                mozilla::LayoutFrameType aFrameType);
 
   // Calculates the computed values for the 'min-Width', 'max-Width',
   // 'min-Height', and 'max-Height' properties, and stores them in the assorted
   // data members
   void ComputeMinMaxValues(const mozilla::LogicalSize& aContainingBlockSize);
 
--- a/layout/generic/ReflowOutput.cpp
+++ b/layout/generic/ReflowOutput.cpp
@@ -33,23 +33,23 @@ nsOverflowAreas::SetAllTo(const nsRect& 
 {
   NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
     mRects[otype] = aRect;
   }
 }
 
 namespace mozilla {
 
-ReflowOutput::ReflowOutput(const ReflowInput& aReflowInput,
+ReflowOutput::ReflowOutput(const ReflowInput& aState,
                                          uint32_t aFlags)
   : mISize(0)
   , mBSize(0)
   , mBlockStartAscent(ASK_FOR_BASELINE)
   , mFlags(aFlags)
-  , mWritingMode(aReflowInput.GetWritingMode())
+  , mWritingMode(aState.GetWritingMode())
 {
 }
 
 void
 ReflowOutput::SetOverflowAreasToDesiredBounds()
 {
   NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
     mOverflowAreas.Overflow(otype).SetRect(0, 0, Width(), Height());
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -7216,29 +7216,29 @@ nsBlockFrame::RenumberChildFrames(int32_
 }
 
 void
 nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
                            BlockReflowInput& aState,
                            ReflowOutput& aMetrics,
                            nscoord aLineTop)
 {
-  const ReflowInput &ri = aState.mReflowInput;
+  const ReflowInput &rs = aState.mReflowInput;
 
   // Reflow the bullet now
   WritingMode bulletWM = aBulletFrame->GetWritingMode();
   LogicalSize availSize(bulletWM);
   // Make up an inline-size since it doesn't really matter (XXX).
   availSize.ISize(bulletWM) = aState.ContentISize();
   availSize.BSize(bulletWM) = NS_UNCONSTRAINEDSIZE;
 
   // Get the reason right.
   // XXXwaterson Should this look just like the logic in
   // nsBlockReflowContext::ReflowBlock and nsLineLayout::ReflowFrame?
-  ReflowInput reflowInput(aState.mPresContext, ri,
+  ReflowInput reflowInput(aState.mPresContext, rs,
                                 aBulletFrame, availSize);
   nsReflowStatus  status;
   aBulletFrame->Reflow(aState.mPresContext, aMetrics, reflowInput, status);
 
   // Get the float available space using our saved state from before we
   // started reflowing the block, so that we ignore any floats inside
   // the block.
   // FIXME: aLineTop isn't actually set correctly by some callers, since
@@ -7257,23 +7257,23 @@ nsBlockFrame::ReflowBullet(nsIFrame* aBu
   // want to displace it by the same amount.  That is, we act as though
   // the edge of the floats is the content-edge of the block, and place
   // the bullet at a position offset from there by the block's padding,
   // the block's border, and the bullet frame's margin.
 
   // IStart from floatAvailSpace gives us the content/float start edge
   // in the current writing mode. Then we subtract out the start
   // border/padding and the bullet's width and margin to offset the position.
-  WritingMode wm = ri.GetWritingMode();
+  WritingMode wm = rs.GetWritingMode();
   // Get the bullet's margin, converted to our writing mode so that we can
   // combine it with other logical values here.
   LogicalMargin bulletMargin =
     reflowInput.ComputedLogicalMargin().ConvertTo(wm, bulletWM);
   nscoord iStart = floatAvailSpace.IStart(wm) -
-                   ri.ComputedLogicalBorderPadding().IStart(wm) -
+                   rs.ComputedLogicalBorderPadding().IStart(wm) -
                    bulletMargin.IEnd(wm) -
                    aMetrics.ISize(wm);
 
   // Approximate the bullets position; vertical alignment will provide
   // the final vertical location. We pass our writing-mode here, because
   // it may be different from the bullet frame's mode.
   nscoord bStart = floatAvailSpace.BStart(wm);
   aBulletFrame->SetRect(wm, LogicalRect(wm, iStart, bStart,
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -23,21 +23,21 @@ using namespace mozilla;
 #undef  NOISY_BLOCK_DIR_MARGINS
 #else
 #undef  NOISY_MAX_ELEMENT_SIZE
 #undef   REALLY_NOISY_MAX_ELEMENT_SIZE
 #undef  NOISY_BLOCK_DIR_MARGINS
 #endif
 
 nsBlockReflowContext::nsBlockReflowContext(nsPresContext* aPresContext,
-                                           const ReflowInput& aParentRI)
+                                           const ReflowInput& aParentRS)
   : mPresContext(aPresContext),
-    mOuterReflowInput(aParentRI),
-    mSpace(aParentRI.GetWritingMode()),
-    mMetrics(aParentRI)
+    mOuterReflowInput(aParentRS),
+    mSpace(aParentRS.GetWritingMode()),
+    mMetrics(aParentRS)
 {
 }
 
 static nsIFrame* DescendIntoBlockLevelFrame(nsIFrame* aFrame)
 {
   LayoutFrameType type = aFrame->Type();
   if (type == LayoutFrameType::ColumnSet) {
     static_cast<nsColumnSetFrame*>(aFrame)->DrainOverflowColumns();
--- a/layout/generic/nsBlockReflowContext.h
+++ b/layout/generic/nsBlockReflowContext.h
@@ -23,17 +23,17 @@ class BlockReflowInput;
  */
 class nsBlockReflowContext {
   using BlockReflowInput = mozilla::BlockReflowInput;
   using ReflowInput = mozilla::ReflowInput;
   using ReflowOutput = mozilla::ReflowOutput;
 
 public:
   nsBlockReflowContext(nsPresContext* aPresContext,
-                       const ReflowInput& aParentRI);
+                       const ReflowInput& aParentRS);
   ~nsBlockReflowContext() { }
 
   void ReflowBlock(const mozilla::LogicalRect& aSpace,
                    bool                        aApplyBStartMargin,
                    nsCollapsingMargin&         aPrevMargin,
                    nscoord                     aClearance,
                    bool                        aIsAdjacentWithBStart,
                    nsLineBox*                  aLine,
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -226,21 +226,21 @@ struct MOZ_STACK_CLASS ScrollReflowInput
   // Whether we decided to show the horizontal scrollbar
   MOZ_INIT_OUTSIDE_CTOR
   bool mShowHScrollbar;
   // Whether we decided to show the vertical scrollbar
   MOZ_INIT_OUTSIDE_CTOR
   bool mShowVScrollbar;
 
   ScrollReflowInput(nsIScrollableFrame* aFrame,
-                    const ReflowInput& aReflowInput) :
-    mReflowInput(aReflowInput),
+                    const ReflowInput& aState) :
+    mReflowInput(aState),
     // mBoxState is just used for scrollbars so we don't need to
     // worry about the reflow depth here
-    mBoxState(aReflowInput.mFrame->PresContext(), aReflowInput.mRenderingContext, 0),
+    mBoxState(aState.mFrame->PresContext(), aState.mRenderingContext, 0),
     mStyles(aFrame->GetScrollbarStyles()) {
   }
 };
 
 } // namespace mozilla
 
 // XXXldb Can this go away?
 static nsSize ComputeInsideBorderSize(ScrollReflowInput* aState,
--- a/layout/generic/nsPageContentFrame.h
+++ b/layout/generic/nsPageContentFrame.h
@@ -19,17 +19,17 @@ public:
 
   friend nsPageContentFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell,
                                                     nsStyleContext* aContext);
   friend class nsPageFrame;
 
   // nsIFrame
   virtual void Reflow(nsPresContext*      aPresContext,
                       ReflowOutput& aDesiredSize,
-                      const ReflowInput& aReflowInput,
+                      const ReflowInput& aMaxSize,
                       nsReflowStatus&      aStatus) override;
 
   virtual bool IsFrameOfType(uint32_t aFlags) const override
   {
     return ViewportFrame::IsFrameOfType(aFlags &
              ~(nsIFrame::eCanContainOverflowContainers));
   }
 
--- a/layout/generic/nsPageFrame.h
+++ b/layout/generic/nsPageFrame.h
@@ -19,17 +19,17 @@ public:
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS(nsPageFrame)
 
   friend nsPageFrame* NS_NewPageFrame(nsIPresShell* aPresShell,
                                       nsStyleContext* aContext);
 
   virtual void Reflow(nsPresContext*      aPresContext,
                       ReflowOutput& aDesiredSize,
-                      const ReflowInput& aReflowInput,
+                      const ReflowInput& aMaxSize,
                       nsReflowStatus&      aStatus) override;
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists) override;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult  GetFrameName(nsAString& aResult) const override;
--- a/layout/generic/nsSimplePageSequenceFrame.h
+++ b/layout/generic/nsSimplePageSequenceFrame.h
@@ -60,17 +60,17 @@ public:
                                                                   nsStyleContext* aContext);
 
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS(nsSimplePageSequenceFrame)
 
   // nsIFrame
   void Reflow(nsPresContext* aPresContext,
               ReflowOutput& aDesiredSize,
-              const ReflowInput& aReflowInput,
+              const ReflowInput& aMaxSize,
               nsReflowStatus& aStatus) override;
 
   void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                         const nsRect&           aDirtyRect,
                         const nsDisplayListSet& aLists) override;
 
   // nsIPageSequenceFrame
   NS_IMETHOD SetPageNo(int32_t aPageNo) { return NS_OK;}
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -4108,22 +4108,22 @@ nsTableFrame::IsAutoBSize(WritingMode aW
   const nsStyleCoord &bsize = StylePosition()->BSize(aWM);
   // Don't consider calc() here like this quirk for percent.
   return bsize.GetUnit() == eStyleUnit_Auto ||
          (bsize.GetUnit() == eStyleUnit_Percent &&
           bsize.GetPercentValue() <= 0.0f);
 }
 
 nscoord
-nsTableFrame::CalcBorderBoxBSize(const ReflowInput& aReflowInput)
-{
-  nscoord bSize = aReflowInput.ComputedBSize();
+nsTableFrame::CalcBorderBoxBSize(const ReflowInput& aState)
+{
+  nscoord bSize = aState.ComputedBSize();
   if (NS_AUTOHEIGHT != bSize) {
-    WritingMode wm = aReflowInput.GetWritingMode();
-    LogicalMargin borderPadding = GetChildAreaOffset(wm, &aReflowInput);
+    WritingMode wm = aState.GetWritingMode();
+    LogicalMargin borderPadding = GetChildAreaOffset(wm, &aState);
     bSize += borderPadding.BStartEnd(wm);
   }
   bSize = std::max(0, bSize);
 
   return bSize;
 }
 
 bool