Bug 1277129 Part 7b - Rename various ReflowState variables to ReflowInput. r=dbaron
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 21 Jul 2016 18:36:39 +0800
changeset 346108 d1a449efbe4446e696311b21f7bdfcd709b82a26
parent 346107 60b14e06c561d772eb8153c6cd414be8a7e94b9a
child 346109 ec9c3a2f2c091f2159edd5753a1b17b4b77189ec
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1277129
milestone50.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 1277129 Part 7b - Rename various ReflowState variables to ReflowInput. r=dbaron This patch is generated by the following script: function rename() { find .\ -type f\ ! -path "./obj*"\ ! -path "./.git"\ ! -path "./.hg"\ \( -name "*.cpp" -or\ -name "*.h" \)\ -exec sed -i -r "s/$1/$2/g" "{}" \; } rename "([[:alpha:]]*)([rR])eflowState(s?)" "\1\2eflowInput\3" MozReview-Commit-ID: ITFO7uMTkSb
layout/base/RestyleManager.cpp
layout/base/nsIPercentBSizeObserver.h
layout/base/nsPresShell.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsComboboxControlFrame.h
layout/forms/nsFieldSetFrame.cpp
layout/forms/nsFieldSetFrame.h
layout/forms/nsFormControlFrame.cpp
layout/forms/nsFormControlFrame.h
layout/forms/nsHTMLButtonControlFrame.cpp
layout/forms/nsHTMLButtonControlFrame.h
layout/forms/nsImageControlFrame.cpp
layout/forms/nsLegendFrame.cpp
layout/forms/nsLegendFrame.h
layout/forms/nsListControlFrame.cpp
layout/forms/nsListControlFrame.h
layout/forms/nsMeterFrame.cpp
layout/forms/nsMeterFrame.h
layout/forms/nsNumberControlFrame.cpp
layout/forms/nsNumberControlFrame.h
layout/forms/nsProgressFrame.cpp
layout/forms/nsProgressFrame.h
layout/forms/nsRangeFrame.cpp
layout/forms/nsRangeFrame.h
layout/forms/nsSelectsAreaFrame.cpp
layout/forms/nsSelectsAreaFrame.h
layout/forms/nsTextControlFrame.cpp
layout/forms/nsTextControlFrame.h
layout/generic/BlockReflowInput.cpp
layout/generic/BlockReflowInput.h
layout/generic/ReflowInput.cpp
layout/generic/ReflowInput.h
layout/generic/nsAbsoluteContainingBlock.cpp
layout/generic/nsAbsoluteContainingBlock.h
layout/generic/nsBRFrame.cpp
layout/generic/nsBackdropFrame.cpp
layout/generic/nsBackdropFrame.h
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockFrame.h
layout/generic/nsBlockReflowContext.cpp
layout/generic/nsBlockReflowContext.h
layout/generic/nsBulletFrame.cpp
layout/generic/nsBulletFrame.h
layout/generic/nsCanvasFrame.cpp
layout/generic/nsCanvasFrame.h
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsColumnSetFrame.h
layout/generic/nsContainerFrame.cpp
layout/generic/nsContainerFrame.h
layout/generic/nsFirstLetterFrame.cpp
layout/generic/nsFirstLetterFrame.h
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFlexContainerFrame.h
layout/generic/nsFloatManager.cpp
layout/generic/nsFloatManager.h
layout/generic/nsFontInflationData.cpp
layout/generic/nsFontInflationData.h
layout/generic/nsFrame.cpp
layout/generic/nsFrame.h
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsFrameSetFrame.h
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGfxScrollFrame.h
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsGridContainerFrame.h
layout/generic/nsHTMLCanvasFrame.cpp
layout/generic/nsHTMLCanvasFrame.h
layout/generic/nsIFrame.h
layout/generic/nsImageFrame.cpp
layout/generic/nsImageFrame.h
layout/generic/nsInlineFrame.cpp
layout/generic/nsInlineFrame.h
layout/generic/nsLeafFrame.cpp
layout/generic/nsLeafFrame.h
layout/generic/nsLineLayout.cpp
layout/generic/nsLineLayout.h
layout/generic/nsPageContentFrame.cpp
layout/generic/nsPageFrame.cpp
layout/generic/nsPageFrame.h
layout/generic/nsPlaceholderFrame.cpp
layout/generic/nsPlaceholderFrame.h
layout/generic/nsPluginFrame.cpp
layout/generic/nsPluginFrame.h
layout/generic/nsRubyBaseContainerFrame.cpp
layout/generic/nsRubyBaseContainerFrame.h
layout/generic/nsRubyFrame.cpp
layout/generic/nsRubyFrame.h
layout/generic/nsRubyTextContainerFrame.cpp
layout/generic/nsRubyTextContainerFrame.h
layout/generic/nsRubyTextFrame.cpp
layout/generic/nsRubyTextFrame.h
layout/generic/nsSimplePageSequenceFrame.cpp
layout/generic/nsSimplePageSequenceFrame.h
layout/generic/nsSplittableFrame.cpp
layout/generic/nsSplittableFrame.h
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsSubDocumentFrame.h
layout/generic/nsTextFrame.cpp
layout/generic/nsTextFrame.h
layout/generic/nsVideoFrame.cpp
layout/generic/nsVideoFrame.h
layout/generic/nsViewportFrame.cpp
layout/generic/nsViewportFrame.h
layout/mathml/nsMathMLContainerFrame.cpp
layout/mathml/nsMathMLContainerFrame.h
layout/mathml/nsMathMLSelectedFrame.cpp
layout/mathml/nsMathMLSelectedFrame.h
layout/mathml/nsMathMLTokenFrame.cpp
layout/mathml/nsMathMLTokenFrame.h
layout/mathml/nsMathMLmfencedFrame.cpp
layout/mathml/nsMathMLmfencedFrame.h
layout/mathml/nsMathMLmoFrame.cpp
layout/mathml/nsMathMLmoFrame.h
layout/mathml/nsMathMLmpaddedFrame.cpp
layout/mathml/nsMathMLmpaddedFrame.h
layout/mathml/nsMathMLmrootFrame.cpp
layout/mathml/nsMathMLmrootFrame.h
layout/mathml/nsMathMLmspaceFrame.cpp
layout/mathml/nsMathMLmspaceFrame.h
layout/mathml/nsMathMLmtableFrame.cpp
layout/mathml/nsMathMLmtableFrame.h
layout/svg/SVGTextFrame.cpp
layout/svg/nsSVGForeignObjectFrame.cpp
layout/svg/nsSVGForeignObjectFrame.h
layout/svg/nsSVGOuterSVGFrame.cpp
layout/svg/nsSVGOuterSVGFrame.h
layout/tables/BasicTableLayoutStrategy.cpp
layout/tables/BasicTableLayoutStrategy.h
layout/tables/FixedTableLayoutStrategy.cpp
layout/tables/FixedTableLayoutStrategy.h
layout/tables/nsITableLayoutStrategy.h
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableCellFrame.h
layout/tables/nsTableColFrame.cpp
layout/tables/nsTableColFrame.h
layout/tables/nsTableColGroupFrame.cpp
layout/tables/nsTableColGroupFrame.h
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowFrame.h
layout/tables/nsTableRowGroupFrame.cpp
layout/tables/nsTableRowGroupFrame.h
layout/tables/nsTableWrapperFrame.cpp
layout/tables/nsTableWrapperFrame.h
layout/xul/nsBoxFrame.cpp
layout/xul/nsBoxFrame.h
layout/xul/nsBoxLayoutState.cpp
layout/xul/nsBoxLayoutState.h
layout/xul/nsLeafBoxFrame.cpp
layout/xul/nsLeafBoxFrame.h
layout/xul/nsRootBoxFrame.cpp
layout/xul/nsScrollbarFrame.cpp
layout/xul/nsScrollbarFrame.h
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -484,98 +484,98 @@ RestyleManager::RecomputePosition(nsIFra
   // Construct a bogus parent reflow state so that there's a usable
   // containing block reflow state.
   nsIFrame* parentFrame = aFrame->GetParent();
   WritingMode parentWM = parentFrame->GetWritingMode();
   WritingMode frameWM = aFrame->GetWritingMode();
   LogicalSize parentSize = parentFrame->GetLogicalSize();
 
   nsFrameState savedState = parentFrame->GetStateBits();
-  ReflowInput parentReflowState(aFrame->PresContext(), parentFrame,
+  ReflowInput parentReflowInput(aFrame->PresContext(), parentFrame,
                                       &rc, parentSize);
   parentFrame->RemoveStateBits(~nsFrameState(0));
   parentFrame->AddStateBits(savedState);
 
   // The bogus parent state here was created with no parent state of its own,
-  // and therefore it won't have an mCBReflowState set up.
-  // But we may need one (for InitCBReflowState in a child state), so let's
+  // and therefore it won't have an mCBReflowInput set up.
+  // But we may need one (for InitCBReflowInput in a child state), so let's
   // try to create one here for the cases where it will be needed.
-  Maybe<ReflowInput> cbReflowState;
+  Maybe<ReflowInput> cbReflowInput;
   nsIFrame* cbFrame = parentFrame->GetContainingBlock();
   if (cbFrame && (aFrame->GetContainingBlock() != parentFrame ||
                   parentFrame->GetType() == nsGkAtoms::tableFrame)) {
     LogicalSize cbSize = cbFrame->GetLogicalSize();
-    cbReflowState.emplace(cbFrame->PresContext(), cbFrame, &rc, cbSize);
-    cbReflowState->ComputedPhysicalMargin() = cbFrame->GetUsedMargin();
-    cbReflowState->ComputedPhysicalPadding() = cbFrame->GetUsedPadding();
-    cbReflowState->ComputedPhysicalBorderPadding() =
+    cbReflowInput.emplace(cbFrame->PresContext(), cbFrame, &rc, cbSize);
+    cbReflowInput->ComputedPhysicalMargin() = cbFrame->GetUsedMargin();
+    cbReflowInput->ComputedPhysicalPadding() = cbFrame->GetUsedPadding();
+    cbReflowInput->ComputedPhysicalBorderPadding() =
       cbFrame->GetUsedBorderAndPadding();
-    parentReflowState.mCBReflowState = cbReflowState.ptr();
+    parentReflowInput.mCBReflowInput = cbReflowInput.ptr();
   }
 
   NS_WARN_IF_FALSE(parentSize.ISize(parentWM) != NS_INTRINSICSIZE &&
                    parentSize.BSize(parentWM) != NS_INTRINSICSIZE,
                    "parentSize should be valid");
-  parentReflowState.SetComputedISize(std::max(parentSize.ISize(parentWM), 0));
-  parentReflowState.SetComputedBSize(std::max(parentSize.BSize(parentWM), 0));
-  parentReflowState.ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
-
-  parentReflowState.ComputedPhysicalPadding() = parentFrame->GetUsedPadding();
-  parentReflowState.ComputedPhysicalBorderPadding() =
+  parentReflowInput.SetComputedISize(std::max(parentSize.ISize(parentWM), 0));
+  parentReflowInput.SetComputedBSize(std::max(parentSize.BSize(parentWM), 0));
+  parentReflowInput.ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
+
+  parentReflowInput.ComputedPhysicalPadding() = parentFrame->GetUsedPadding();
+  parentReflowInput.ComputedPhysicalBorderPadding() =
     parentFrame->GetUsedBorderAndPadding();
   LogicalSize availSize = parentSize.ConvertTo(frameWM, parentWM);
   availSize.BSize(frameWM) = NS_INTRINSICSIZE;
 
   ViewportFrame* viewport = do_QueryFrame(parentFrame);
   nsSize cbSize = viewport ?
-    viewport->AdjustReflowStateAsContainingBlock(&parentReflowState).Size()
+    viewport->AdjustReflowInputAsContainingBlock(&parentReflowInput).Size()
     : aFrame->GetContainingBlock()->GetSize();
   const nsMargin& parentBorder =
-    parentReflowState.mStyleBorder->GetComputedBorder();
+    parentReflowInput.mStyleBorder->GetComputedBorder();
   cbSize -= nsSize(parentBorder.LeftRight(), parentBorder.TopBottom());
   LogicalSize lcbSize(frameWM, cbSize);
-  ReflowInput reflowState(aFrame->PresContext(), parentReflowState,
+  ReflowInput reflowInput(aFrame->PresContext(), parentReflowInput,
                                 aFrame, availSize, &lcbSize);
-  nsSize computedSize(reflowState.ComputedWidth(), reflowState.ComputedHeight());
-  computedSize.width += reflowState.ComputedPhysicalBorderPadding().LeftRight();
+  nsSize computedSize(reflowInput.ComputedWidth(), reflowInput.ComputedHeight());
+  computedSize.width += reflowInput.ComputedPhysicalBorderPadding().LeftRight();
   if (computedSize.height != NS_INTRINSICSIZE) {
-    computedSize.height += reflowState.ComputedPhysicalBorderPadding().TopBottom();
+    computedSize.height += reflowInput.ComputedPhysicalBorderPadding().TopBottom();
   }
   nsSize size = aFrame->GetSize();
   // The RecomputePosition hint is not used if any offset changed between auto
   // and non-auto. If computedSize.height == NS_INTRINSICSIZE then the new
   // element height will be its intrinsic height, and since 'top' and 'bottom''s
   // auto-ness hasn't changed, the old height must also be its intrinsic
   // height, which we can assume hasn't changed (or reflow would have
   // been triggered).
   if (computedSize.width == size.width &&
       (computedSize.height == NS_INTRINSICSIZE || computedSize.height == size.height)) {
     // If we're solving for 'left' or 'top', then compute it here, in order to
     // match the reflow code path.
-    if (NS_AUTOOFFSET == reflowState.ComputedPhysicalOffsets().left) {
-      reflowState.ComputedPhysicalOffsets().left = cbSize.width -
-                                          reflowState.ComputedPhysicalOffsets().right -
-                                          reflowState.ComputedPhysicalMargin().right -
+    if (NS_AUTOOFFSET == reflowInput.ComputedPhysicalOffsets().left) {
+      reflowInput.ComputedPhysicalOffsets().left = cbSize.width -
+                                          reflowInput.ComputedPhysicalOffsets().right -
+                                          reflowInput.ComputedPhysicalMargin().right -
                                           size.width -
-                                          reflowState.ComputedPhysicalMargin().left;
+                                          reflowInput.ComputedPhysicalMargin().left;
     }
 
-    if (NS_AUTOOFFSET == reflowState.ComputedPhysicalOffsets().top) {
-      reflowState.ComputedPhysicalOffsets().top = cbSize.height -
-                                         reflowState.ComputedPhysicalOffsets().bottom -
-                                         reflowState.ComputedPhysicalMargin().bottom -
+    if (NS_AUTOOFFSET == reflowInput.ComputedPhysicalOffsets().top) {
+      reflowInput.ComputedPhysicalOffsets().top = cbSize.height -
+                                         reflowInput.ComputedPhysicalOffsets().bottom -
+                                         reflowInput.ComputedPhysicalMargin().bottom -
                                          size.height -
-                                         reflowState.ComputedPhysicalMargin().top;
+                                         reflowInput.ComputedPhysicalMargin().top;
     }
 
     // Move the frame
-    nsPoint pos(parentBorder.left + reflowState.ComputedPhysicalOffsets().left +
-                reflowState.ComputedPhysicalMargin().left,
-                parentBorder.top + reflowState.ComputedPhysicalOffsets().top +
-                reflowState.ComputedPhysicalMargin().top);
+    nsPoint pos(parentBorder.left + reflowInput.ComputedPhysicalOffsets().left +
+                reflowInput.ComputedPhysicalMargin().left,
+                parentBorder.top + reflowInput.ComputedPhysicalOffsets().top +
+                reflowInput.ComputedPhysicalMargin().top);
     aFrame->SetPosition(pos);
 
     return true;
   }
 
   // Fall back to a reflow
   StyleChangeReflow(aFrame, nsChangeHint_NeedReflow);
   return false;
--- a/layout/base/nsIPercentBSizeObserver.h
+++ b/layout/base/nsIPercentBSizeObserver.h
@@ -17,17 +17,17 @@ struct ReflowInput;
  * values to children during reflow which would otherwise not happen. Currently
  * only table cells support this.
  */
 class nsIPercentBSizeObserver
 {
 public:
   NS_DECL_QUERYFRAME_TARGET(nsIPercentBSizeObserver)
 
-  // Notify the observer that aReflowState has no computed bsize,
+  // Notify the observer that aReflowInput has no computed bsize,
   // but it has a percent bsize
-  virtual void NotifyPercentBSize(const mozilla::ReflowInput& aReflowState) = 0;
+  virtual void NotifyPercentBSize(const mozilla::ReflowInput& aReflowInput) = 0;
 
-  // Ask the observer if it should observe aReflowState.frame
-  virtual bool NeedsToObserve(const mozilla::ReflowInput& aReflowState) = 0;
+  // Ask the observer if it should observe aReflowInput.frame
+  virtual bool NeedsToObserve(const mozilla::ReflowInput& aReflowInput) = 0;
 };
 
 #endif // nsIPercentBSizeObserver_h___ 
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -9540,66 +9540,66 @@ PresShell::DoReflow(nsIFrame* target, bo
   }
 
   NS_ASSERTION(!target->GetNextInFlow() && !target->GetPrevInFlow(),
                "reflow roots should never split");
 
   // Don't pass size directly to the reflow state, since a
   // constrained height implies page/column breaking.
   LogicalSize reflowSize(wm, size.ISize(wm), NS_UNCONSTRAINEDSIZE);
-  ReflowInput reflowState(mPresContext, target, &rcx, reflowSize,
+  ReflowInput reflowInput(mPresContext, target, &rcx, reflowSize,
                                 ReflowInput::CALLER_WILL_INIT);
-  reflowState.mOrthogonalLimit = size.BSize(wm);
+  reflowInput.mOrthogonalLimit = size.BSize(wm);
 
   if (rootFrame == target) {
-    reflowState.Init(mPresContext);
+    reflowInput.Init(mPresContext);
 
     // When the root frame is being reflowed with unconstrained block-size
     // (which happens when we're called from
     // nsDocumentViewer::SizeToContent), we're effectively doing a
     // resize in the block direction, since it changes the meaning of
     // percentage block-sizes even if no block-sizes actually changed.
     // The same applies when we reflow again after that computation. This is
     // an unusual case, and isn't caught by ReflowInput::InitResizeFlags.
     bool hasUnconstrainedBSize = size.BSize(wm) == NS_UNCONSTRAINEDSIZE;
 
     if (hasUnconstrainedBSize || mLastRootReflowHadUnconstrainedBSize) {
-      reflowState.SetBResize(true);
+      reflowInput.SetBResize(true);
     }
 
     mLastRootReflowHadUnconstrainedBSize = hasUnconstrainedBSize;
   } else {
     // Initialize reflow state with current used border and padding,
     // in case this was set specially by the parent frame when the reflow root
     // was reflowed by its parent.
     nsMargin currentBorder = target->GetUsedBorder();
     nsMargin currentPadding = target->GetUsedPadding();
-    reflowState.Init(mPresContext, nullptr, &currentBorder, &currentPadding);
+    reflowInput.Init(mPresContext, nullptr, &currentBorder, &currentPadding);
   }
 
   // fix the computed height
-  NS_ASSERTION(reflowState.ComputedPhysicalMargin() == nsMargin(0, 0, 0, 0),
+  NS_ASSERTION(reflowInput.ComputedPhysicalMargin() == nsMargin(0, 0, 0, 0),
                "reflow state should not set margin for reflow roots");
   if (size.BSize(wm) != NS_UNCONSTRAINEDSIZE) {
     nscoord computedBSize =
-      size.BSize(wm) - reflowState.ComputedLogicalBorderPadding().BStartEnd(wm);
+      size.BSize(wm) - reflowInput.ComputedLogicalBorderPadding().BStartEnd(wm);
     computedBSize = std::max(computedBSize, 0);
-    reflowState.SetComputedBSize(computedBSize);
-  }
-  NS_ASSERTION(reflowState.ComputedISize() ==
+    reflowInput.SetComputedBSize(computedBSize);
+  }
+  NS_ASSERTION(reflowInput.ComputedISize() ==
                size.ISize(wm) -
-                   reflowState.ComputedLogicalBorderPadding().IStartEnd(wm),
+                   reflowInput.ComputedLogicalBorderPadding().IStartEnd(wm),
                "reflow state computed incorrect inline size");
 
   mPresContext->ReflowStarted(aInterruptible);
   mIsReflowing = true;
 
   nsReflowStatus status;
-  ReflowOutput desiredSize(reflowState);
-  target->Reflow(mPresContext, desiredSize, reflowState, status);
+  ReflowOutput desiredSize(reflowInput);
+  target->Reflow(mPresContext, desiredSize, reflowInput, status);
 
   // If an incremental reflow is initiated at a frame other than the
   // root frame, then its desired size had better not change!  If it's
   // initiated at the root, then the size better not change unless its
   // height was unconstrained to start with.
   nsRect boundsRelativeToTarget = nsRect(0, 0, desiredSize.Width(), desiredSize.Height());
   NS_ASSERTION((target == rootFrame &&
                 size.BSize(wm) == NS_UNCONSTRAINEDSIZE) ||
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -413,43 +413,43 @@ public:
     return NS_OK;
   }
 
   nsWeakFrame mFrame;
 };
 
 void
 nsComboboxControlFrame::ReflowDropdown(nsPresContext*  aPresContext,
-                                       const ReflowInput& aReflowState)
+                                       const ReflowInput& aReflowInput)
 {
   // All we want out of it later on, really, is the block size of a row, so we
   // don't even need to cache mDropdownFrame's ascent or anything.  If we don't
   // need to reflow it, just bail out here.
-  if (!aReflowState.ShouldReflowAllKids() &&
+  if (!aReflowInput.ShouldReflowAllKids() &&
       !NS_SUBTREE_DIRTY(mDropdownFrame)) {
     return;
   }
 
   // XXXbz this will, for small-block-size dropdowns, have extra space
   // on the appropriate edge for the scrollbar we don't show... but
   // that's the best we can do here for now.
   WritingMode wm = mDropdownFrame->GetWritingMode();
-  LogicalSize availSize = aReflowState.AvailableSize(wm);
+  LogicalSize availSize = aReflowInput.AvailableSize(wm);
   availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
-  ReflowInput kidReflowState(aPresContext, aReflowState, mDropdownFrame,
+  ReflowInput kidReflowInput(aPresContext, aReflowInput, mDropdownFrame,
                                    availSize);
 
   // If the dropdown's intrinsic inline size is narrower than our
   // specified inline size, then expand it out.  We want our border-box
   // inline size to end up the same as the dropdown's so account for
   // both sets of mComputedBorderPadding.
-  nscoord forcedISize = aReflowState.ComputedISize() +
-    aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm) -
-    kidReflowState.ComputedLogicalBorderPadding().IStartEnd(wm);
-  kidReflowState.SetComputedISize(std::max(kidReflowState.ComputedISize(),
+  nscoord forcedISize = aReflowInput.ComputedISize() +
+    aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm) -
+    kidReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm);
+  kidReflowInput.SetComputedISize(std::max(kidReflowInput.ComputedISize(),
                                          forcedISize));
 
   // ensure we start off hidden
   if (!mDroppedDown && GetStateBits() & NS_FRAME_FIRST_REFLOW) {
     nsView* view = mDropdownFrame->GetView();
     nsViewManager* viewManager = view->GetViewManager();
     viewManager->SetViewVisibility(view, nsViewVisibility_kHide);
     nsRect emptyRect(0, 0, 0, 0);
@@ -465,24 +465,24 @@ nsComboboxControlFrame::ReflowDropdown(n
 
   //XXX Can this be different from the dropdown's writing mode?
   // That would be odd!
   // Note that we don't need to pass the true frame position or container size
   // to ReflowChild or FinishReflowChild here; it will be positioned as needed
   // by AbsolutelyPositionDropDown().
   WritingMode outerWM = GetWritingMode();
   const nsSize dummyContainerSize;
-  ReflowOutput desiredSize(aReflowState);
+  ReflowOutput desiredSize(aReflowInput);
   nsReflowStatus ignoredStatus;
   ReflowChild(mDropdownFrame, aPresContext, desiredSize,
-              kidReflowState, outerWM, LogicalPoint(outerWM),
+              kidReflowInput, outerWM, LogicalPoint(outerWM),
               dummyContainerSize, flags, ignoredStatus);
 
    // Set the child's width and height to its desired size
-  FinishReflowChild(mDropdownFrame, aPresContext, desiredSize, &kidReflowState,
+  FinishReflowChild(mDropdownFrame, aPresContext, desiredSize, &kidReflowInput,
                     outerWM, LogicalPoint(outerWM), dummyContainerSize, flags);
 }
 
 nsPoint
 nsComboboxControlFrame::GetCSSTransformTranslation()
 {
   nsIFrame* frame = this;
   bool is3DTransform = false;
@@ -804,17 +804,17 @@ nsComboboxControlFrame::GetPrefISize(nsR
   DISPLAY_PREF_WIDTH(this, prefISize);
   prefISize = GetIntrinsicISize(aRenderingContext, nsLayoutUtils::PREF_ISIZE);
   return prefISize;
 }
 
 void
 nsComboboxControlFrame::Reflow(nsPresContext*          aPresContext,
                                ReflowOutput&     aDesiredSize,
-                               const ReflowInput& aReflowState,
+                               const ReflowInput& aReflowInput,
                                nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   // Constraints we try to satisfy:
 
   // 1) Default inline size of button is the vertical scrollbar size
   // 2) If the inline size of button is bigger than our inline size, set
   //    inline size of button to 0.
@@ -843,57 +843,57 @@ nsComboboxControlFrame::Reflow(nsPresCon
   if (selectedIndex != -1) {
     mListControlFrame->GetOptionText(selectedIndex, selectedOptionText);
   }
   if (mDisplayedOptionText != selectedOptionText) {
     RedisplayText(selectedIndex);
   }
 
   // First reflow our dropdown so that we know how tall we should be.
-  ReflowDropdown(aPresContext, aReflowState);
+  ReflowDropdown(aPresContext, aReflowInput);
   RefPtr<nsResizeDropdownAtFinalPosition> resize =
     new nsResizeDropdownAtFinalPosition(this);
   if (NS_SUCCEEDED(aPresContext->PresShell()->PostReflowCallback(resize))) {
     // The reflow callback queue doesn't AddRef so we keep it alive until
     // it's released in its ReflowFinished / ReflowCallbackCanceled.
     Unused << resize.forget();
   }
 
   // Get the width of the vertical scrollbar.  That will be the inline
   // size of the dropdown button.
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
   nscoord buttonISize;
   const nsStyleDisplay *disp = StyleDisplay();
   if ((IsThemed(disp) && !aPresContext->GetTheme()->ThemeNeedsComboboxDropmarker()) ||
       StyleDisplay()->mAppearance == NS_THEME_NONE) {
     buttonISize = 0;
   }
   else {
     nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
     NS_ASSERTION(scrollable, "List must be a scrollable frame");
     buttonISize = scrollable->GetNondisappearingScrollbarWidth(
-      PresContext(), aReflowState.mRenderingContext, wm);
-    if (buttonISize > aReflowState.ComputedISize()) {
+      PresContext(), aReflowInput.mRenderingContext, wm);
+    if (buttonISize > aReflowInput.ComputedISize()) {
       buttonISize = 0;
     }
   }
 
-  mDisplayISize = aReflowState.ComputedISize() - buttonISize;
+  mDisplayISize = aReflowInput.ComputedISize() - buttonISize;
 
-  nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
+  nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
 
   // The button should occupy the same space as a scrollbar
   nsSize containerSize = aDesiredSize.PhysicalSize();
   LogicalRect buttonRect = mButtonFrame->GetLogicalRect(containerSize);
 
   buttonRect.IStart(wm) =
-    aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm) +
+    aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm) +
     mDisplayISize -
-    (aReflowState.ComputedLogicalBorderPadding().IEnd(wm) -
-     aReflowState.ComputedLogicalPadding().IEnd(wm));
+    (aReflowInput.ComputedLogicalBorderPadding().IEnd(wm) -
+     aReflowInput.ComputedLogicalPadding().IEnd(wm));
   buttonRect.ISize(wm) = buttonISize;
 
   buttonRect.BStart(wm) = this->GetLogicalUsedBorder(wm).BStart(wm);
   buttonRect.BSize(wm) = mDisplayFrame->BSize(wm) +
                          this->GetLogicalUsedPadding(wm).BStartEnd(wm);
 
   mButtonFrame->SetRect(buttonRect, containerSize);
 
@@ -1282,17 +1282,17 @@ public:
   virtual bool IsFrameOfType(uint32_t aFlags) const override
   {
     return nsBlockFrame::IsFrameOfType(aFlags &
       ~(nsIFrame::eReplacedContainsBlock));
   }
 
   virtual void Reflow(nsPresContext*           aPresContext,
                           ReflowOutput&     aDesiredSize,
-                          const ReflowInput& aReflowState,
+                          const ReflowInput& aReflowInput,
                           nsReflowStatus&          aStatus) override;
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists) override;
 
 protected:
   nsComboboxControlFrame* mComboBox;
@@ -1304,27 +1304,27 @@ nsIAtom*
 nsComboboxDisplayFrame::GetType() const
 {
   return nsGkAtoms::comboboxDisplayFrame;
 }
 
 void
 nsComboboxDisplayFrame::Reflow(nsPresContext*           aPresContext,
                                ReflowOutput&     aDesiredSize,
-                               const ReflowInput& aReflowState,
+                               const ReflowInput& aReflowInput,
                                nsReflowStatus&          aStatus)
 {
-  ReflowInput state(aReflowState);
+  ReflowInput state(aReflowInput);
   if (state.ComputedBSize() == NS_INTRINSICSIZE) {
     // Note that the only way we can have a computed block size here is
     // if the combobox had a specified block size.  If it didn't, size
     // based on what our rows look like, for lack of anything better.
     state.SetComputedBSize(mComboBox->mListControlFrame->GetBSizeOfARow());
   }
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
   nscoord computedISize = mComboBox->mDisplayISize -
     state.ComputedLogicalBorderPadding().IStartEnd(wm);
   if (computedISize < 0) {
     computedISize = 0;
   }
   state.SetComputedISize(computedISize);
   nsBlockFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
   aStatus = NS_FRAME_COMPLETE; // this type of frame can't be split
--- a/layout/forms/nsComboboxControlFrame.h
+++ b/layout/forms/nsComboboxControlFrame.h
@@ -76,17 +76,17 @@ public:
 #endif
 
   virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
 
   virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
 
   virtual void Reflow(nsPresContext*           aCX,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual nsresult HandleEvent(nsPresContext* aPresContext,
                                mozilla::WidgetGUIEvent* aEvent,
                                nsEventStatus* aEventStatus) override;
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
@@ -212,17 +212,17 @@ public:
 
 protected:
   friend class RedisplayTextEvent;
   friend class nsAsyncResize;
   friend class nsResizeDropdownAtFinalPosition;
 
   // Utilities
   void ReflowDropdown(nsPresContext*          aPresContext, 
-                      const ReflowInput& aReflowState);
+                      const ReflowInput& aReflowInput);
 
   enum DropDownPositionState {
     // can't show the dropdown at its current position
     eDropDownPositionSuppressed,
     // a resize reflow is pending, don't show it yet
     eDropDownPositionPendingResize,
     // the dropdown has its final size and position and can be displayed here
     eDropDownPositionFinal
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -379,93 +379,93 @@ nsFieldSetFrame::ComputeSize(nsRendering
   }
 
   return result;
 }
 
 void
 nsFieldSetFrame::Reflow(nsPresContext*           aPresContext,
                         ReflowOutput&     aDesiredSize,
-                        const ReflowInput& aReflowState,
+                        const ReflowInput& aReflowInput,
                         nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsFieldSetFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
 
-  NS_PRECONDITION(aReflowState.ComputedISize() != NS_INTRINSICSIZE,
+  NS_PRECONDITION(aReflowInput.ComputedISize() != NS_INTRINSICSIZE,
                   "Should have a precomputed inline-size!");
 
   // Initialize OUT parameter
   aStatus = NS_FRAME_COMPLETE;
 
   nsOverflowAreas ocBounds;
   nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
   if (GetPrevInFlow()) {
-    ReflowOverflowContainerChildren(aPresContext, aReflowState, ocBounds, 0,
+    ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
                                     ocStatus);
   }
 
   //------------ Handle Incremental Reflow -----------------
   bool reflowInner;
   bool reflowLegend;
   nsIFrame* legend = GetLegend();
   nsIFrame* inner = GetInner();
-  if (aReflowState.ShouldReflowAllKids()) {
+  if (aReflowInput.ShouldReflowAllKids()) {
     reflowInner = inner != nullptr;
     reflowLegend = legend != nullptr;
   } else {
     reflowInner = inner && NS_SUBTREE_DIRTY(inner);
     reflowLegend = legend && NS_SUBTREE_DIRTY(legend);
   }
 
   // We don't allow fieldsets to break vertically. If we did, we'd
   // need logic here to push and pull overflow frames.
   // Since we're not applying our padding in this frame, we need to add it here
   // to compute the available width for our children.
   WritingMode wm = GetWritingMode();
   WritingMode innerWM = inner ? inner->GetWritingMode() : wm;
   WritingMode legendWM = legend ? legend->GetWritingMode() : wm;
-  LogicalSize innerAvailSize = aReflowState.ComputedSizeWithPadding(innerWM);
-  LogicalSize legendAvailSize = aReflowState.ComputedSizeWithPadding(legendWM);
+  LogicalSize innerAvailSize = aReflowInput.ComputedSizeWithPadding(innerWM);
+  LogicalSize legendAvailSize = aReflowInput.ComputedSizeWithPadding(legendWM);
   innerAvailSize.BSize(innerWM) = legendAvailSize.BSize(legendWM) =
     NS_UNCONSTRAINEDSIZE;
   NS_ASSERTION(!inner ||
-      nsLayoutUtils::IntrinsicForContainer(aReflowState.mRenderingContext,
+      nsLayoutUtils::IntrinsicForContainer(aReflowInput.mRenderingContext,
                                            inner,
                                            nsLayoutUtils::MIN_ISIZE) <=
                innerAvailSize.ISize(innerWM),
                "Bogus availSize.ISize; should be bigger");
   NS_ASSERTION(!legend ||
-      nsLayoutUtils::IntrinsicForContainer(aReflowState.mRenderingContext,
+      nsLayoutUtils::IntrinsicForContainer(aReflowInput.mRenderingContext,
                                            legend,
                                            nsLayoutUtils::MIN_ISIZE) <=
                legendAvailSize.ISize(legendWM),
                "Bogus availSize.ISize; should be bigger");
 
   // get our border and padding
-  LogicalMargin border = aReflowState.ComputedLogicalBorderPadding() -
-                         aReflowState.ComputedLogicalPadding();
+  LogicalMargin border = aReflowInput.ComputedLogicalBorderPadding() -
+                         aReflowInput.ComputedLogicalPadding();
 
   // Figure out how big the legend is if there is one.
   // get the legend's margin
   LogicalMargin legendMargin(wm);
   // reflow the legend only if needed
-  Maybe<ReflowInput> legendReflowState;
+  Maybe<ReflowInput> legendReflowInput;
   if (legend) {
-    legendReflowState.emplace(aPresContext, aReflowState, legend,
+    legendReflowInput.emplace(aPresContext, aReflowInput, legend,
                                 legendAvailSize);
   }
   if (reflowLegend) {
-    ReflowOutput legendDesiredSize(aReflowState);
+    ReflowOutput legendDesiredSize(aReflowInput);
 
     // We'll move the legend to its proper place later, so the position
     // and containerSize passed here are unimportant.
     const nsSize dummyContainerSize;
-    ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowState,
+    ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowInput,
                 wm, LogicalPoint(wm), dummyContainerSize,
                 NS_FRAME_NO_MOVE_FRAME, aStatus);
 #ifdef NOISY_REFLOW
     printf("  returned (%d, %d)\n",
            legendDesiredSize.Width(), legendDesiredSize.Height());
 #endif
     // figure out the legend's rectangle
     legendMargin = legend->GetLogicalUsedMargin(wm);
@@ -485,102 +485,102 @@ nsFieldSetFrame::Reflow(nsPresContext*  
 
     // if the legend space changes then we need to reflow the
     // content area as well.
     if (mLegendSpace != oldSpace && inner) {
       reflowInner = true;
     }
 
     FinishReflowChild(legend, aPresContext, legendDesiredSize,
-                      legendReflowState.ptr(), wm, LogicalPoint(wm),
+                      legendReflowInput.ptr(), wm, LogicalPoint(wm),
                       dummyContainerSize, NS_FRAME_NO_MOVE_FRAME);
   } else if (!legend) {
     mLegendRect.SetEmpty();
     mLegendSpace = 0;
   } else {
     // mLegendSpace and mLegendRect haven't changed, but we need
     // the used margin when placing the legend.
     legendMargin = legend->GetLogicalUsedMargin(wm);
   }
 
   // This containerSize is incomplete as yet: it does not include the size
   // of the |inner| frame itself.
   nsSize containerSize = (LogicalSize(wm, 0, mLegendSpace) +
                           border.Size(wm)).GetPhysicalSize(wm);
   // reflow the content frame only if needed
   if (reflowInner) {
-    ReflowInput kidReflowState(aPresContext, aReflowState, inner,
+    ReflowInput kidReflowInput(aPresContext, aReflowInput, inner,
                                      innerAvailSize, nullptr,
                                      ReflowInput::CALLER_WILL_INIT);
     // Override computed padding, in case it's percentage padding
-    kidReflowState.Init(aPresContext, nullptr, nullptr,
-                        &aReflowState.ComputedPhysicalPadding());
+    kidReflowInput.Init(aPresContext, nullptr, nullptr,
+                        &aReflowInput.ComputedPhysicalPadding());
     // Our child is "height:100%" but we actually want its height to be reduced
     // by the amount of content-height the legend is eating up, unless our
     // height is unconstrained (in which case the child's will be too).
-    if (aReflowState.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
-      kidReflowState.SetComputedBSize(
-         std::max(0, aReflowState.ComputedBSize() - mLegendSpace));
+    if (aReflowInput.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
+      kidReflowInput.SetComputedBSize(
+         std::max(0, aReflowInput.ComputedBSize() - mLegendSpace));
     }
 
-    if (aReflowState.ComputedMinBSize() > 0) {
-      kidReflowState.ComputedMinBSize() =
-        std::max(0, aReflowState.ComputedMinBSize() - mLegendSpace);
+    if (aReflowInput.ComputedMinBSize() > 0) {
+      kidReflowInput.ComputedMinBSize() =
+        std::max(0, aReflowInput.ComputedMinBSize() - mLegendSpace);
     }
 
-    if (aReflowState.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE) {
-      kidReflowState.ComputedMaxBSize() =
-        std::max(0, aReflowState.ComputedMaxBSize() - mLegendSpace);
+    if (aReflowInput.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE) {
+      kidReflowInput.ComputedMaxBSize() =
+        std::max(0, aReflowInput.ComputedMaxBSize() - mLegendSpace);
     }
 
-    ReflowOutput kidDesiredSize(kidReflowState,
+    ReflowOutput kidDesiredSize(kidReflowInput,
                                        aDesiredSize.mFlags);
     // Reflow the frame
-    NS_ASSERTION(kidReflowState.ComputedPhysicalMargin() == nsMargin(0,0,0,0),
+    NS_ASSERTION(kidReflowInput.ComputedPhysicalMargin() == nsMargin(0,0,0,0),
                  "Margins on anonymous fieldset child not supported!");
     LogicalPoint pt(wm, border.IStart(wm), border.BStart(wm) + mLegendSpace);
 
     // We don't know the correct containerSize until we have reflowed |inner|,
     // so we use a dummy value for now; FinishReflowChild will fix the position
     // if necessary.
     const nsSize dummyContainerSize;
-    ReflowChild(inner, aPresContext, kidDesiredSize, kidReflowState,
+    ReflowChild(inner, aPresContext, kidDesiredSize, kidReflowInput,
                 wm, pt, dummyContainerSize, 0, aStatus);
 
     // Update containerSize to account for size of the inner frame, so that
     // FinishReflowChild can position it correctly.
     containerSize += kidDesiredSize.PhysicalSize();
     FinishReflowChild(inner, aPresContext, kidDesiredSize,
-                      &kidReflowState, wm, pt, containerSize, 0);
+                      &kidReflowInput, wm, pt, containerSize, 0);
     NS_FRAME_TRACE_REFLOW_OUT("FieldSet::Reflow", aStatus);
   } else if (inner) {
     // |inner| didn't need to be reflowed but we do need to include its size
     // in containerSize.
     containerSize += inner->GetSize();
   }
 
   LogicalRect contentRect(wm);
   if (inner) {
     // We don't support margins on inner, so our content rect is just the
     // inner's border-box. (We don't really care about container size at this
     // point, as we'll figure out the actual positioning later.)
     contentRect = inner->GetLogicalRect(wm, containerSize);
   }
 
   // Our content rect must fill up the available width
-  LogicalSize availSize = aReflowState.ComputedSizeWithPadding(wm);
+  LogicalSize availSize = aReflowInput.ComputedSizeWithPadding(wm);
   if (availSize.ISize(wm) > contentRect.ISize(wm)) {
     contentRect.ISize(wm) = innerAvailSize.ISize(wm);
   }
 
   if (legend) {
     // The legend is positioned inline-wards within the inner's content rect
     // (so that padding on the fieldset affects the legend position).
     LogicalRect innerContentRect = contentRect;
-    innerContentRect.Deflate(wm, aReflowState.ComputedLogicalPadding());
+    innerContentRect.Deflate(wm, aReflowInput.ComputedLogicalPadding());
     // If the inner content rect is larger than the legend, we can align the
     // legend.
     if (innerContentRect.ISize(wm) > mLegendRect.ISize(wm)) {
       // NOTE legend @align values are: left/right/center/top/bottom.
       // GetLogicalAlign converts left/right to start/end for the given WM.
       // @see HTMLLegendElement::ParseAttribute, nsLegendFrame::GetLogicalAlign
       int32_t align = static_cast<nsLegendFrame*>
         (legend->GetContentInsertionFrame())->GetLogicalAlign(wm);
@@ -602,29 +602,29 @@ nsFieldSetFrame::Reflow(nsPresContext*  
         default:
           MOZ_ASSERT_UNREACHABLE("unexpected GetLogicalAlign value");
       }
     } else {
       // otherwise make place for the legend
       mLegendRect.IStart(wm) = innerContentRect.IStart(wm);
       innerContentRect.ISize(wm) = mLegendRect.ISize(wm);
       contentRect.ISize(wm) = mLegendRect.ISize(wm) +
-        aReflowState.ComputedLogicalPadding().IStartEnd(wm);
+        aReflowInput.ComputedLogicalPadding().IStartEnd(wm);
     }
 
     // place the legend
     LogicalRect actualLegendRect = mLegendRect;
     actualLegendRect.Deflate(wm, legendMargin);
     LogicalPoint actualLegendPos(actualLegendRect.Origin(wm));
 
     // Note that legend's writing mode may be different from the fieldset's,
     // so we need to convert offsets before applying them to it (bug 1134534).
     LogicalMargin offsets =
-      legendReflowState->ComputedLogicalOffsets().
-        ConvertTo(wm, legendReflowState->GetWritingMode());
+      legendReflowInput->ComputedLogicalOffsets().
+        ConvertTo(wm, legendReflowInput->GetWritingMode());
     ReflowInput::ApplyRelativePositioning(legend, wm, offsets,
                                                 &actualLegendPos,
                                                 containerSize);
 
     legend->SetPosition(wm, actualLegendPos, containerSize);
     nsContainerFrame::PositionFrameView(legend);
     nsContainerFrame::PositionChildViews(legend);
   }
@@ -642,21 +642,21 @@ nsFieldSetFrame::Reflow(nsPresContext*  
   if (inner) {
     ConsiderChildOverflow(aDesiredSize.mOverflowAreas, inner);
   }
 
   // Merge overflow container bounds and status.
   aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
   NS_MergeReflowStatusInto(&aStatus, ocStatus);
 
-  FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
+  FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
 
   InvalidateFrame();
 
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 #ifdef DEBUG
 void
 nsFieldSetFrame::SetInitialChildList(ChildListID    aListID,
                                      nsFrameList&   aChildList)
 {
   nsContainerFrame::SetInitialChildList(aListID, aChildList);
--- a/layout/forms/nsFieldSetFrame.h
+++ b/layout/forms/nsFieldSetFrame.h
@@ -38,17 +38,17 @@ public:
   /**
    * The area to paint box-shadows around.  It's the border rect except
    * when there's a <legend> we offset the y-position to the center of it.
    */
   virtual nsRect VisualBorderRectRelativeToSelf() const override;
 
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
                                
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists) override;
 
   DrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
                          nsRenderingContext& aRenderingContext,
--- a/layout/forms/nsFormControlFrame.cpp
+++ b/layout/forms/nsFormControlFrame.cpp
@@ -110,44 +110,44 @@ nsFormControlFrame::GetLogicalBaseline(W
     ? GetLogicalUsedBorderAndPadding(aWritingMode).BStart(aWritingMode)
     : BSize(aWritingMode) -
          GetLogicalUsedBorderAndPadding(aWritingMode).BEnd(aWritingMode);
 }
 
 void
 nsFormControlFrame::Reflow(nsPresContext*          aPresContext,
                            ReflowOutput&     aDesiredSize,
-                           const ReflowInput& aReflowState,
+                           const ReflowInput& aReflowInput,
                            nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsFormControlFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
   NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
                  ("enter nsFormControlFrame::Reflow: aMaxSize=%d,%d",
-                  aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
+                  aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
 
   if (mState & NS_FRAME_FIRST_REFLOW) {
     RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
   }
 
   aStatus = NS_FRAME_COMPLETE;
-  aDesiredSize.SetSize(aReflowState.GetWritingMode(),
-                       aReflowState.ComputedSizeWithBorderPadding());
+  aDesiredSize.SetSize(aReflowInput.GetWritingMode(),
+                       aReflowInput.ComputedSizeWithBorderPadding());
 
   if (nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) {
     float inflation = nsLayoutUtils::FontSizeInflationFor(this);
     aDesiredSize.Width() *= inflation;
     aDesiredSize.Height() *= inflation;
   }
 
   NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
                  ("exit nsFormControlFrame::Reflow: size=%d,%d",
                   aDesiredSize.Width(), aDesiredSize.Height()));
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 
   aDesiredSize.SetOverflowAreasToDesiredBounds();
   FinishAndStoreOverflow(&aDesiredSize);
 }
 
 nsresult
 nsFormControlFrame::RegUnRegAccessKey(nsIFrame * aFrame, bool aDoReg)
 {
--- a/layout/forms/nsFormControlFrame.h
+++ b/layout/forms/nsFormControlFrame.h
@@ -78,17 +78,17 @@ public:
     const override;
 
   /**
     * Respond to the request to resize and/or reflow
     * @see nsIFrame::Reflow
     */
   virtual void Reflow(nsPresContext*      aCX,
                       ReflowOutput& aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&      aStatus) override;
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   // new behavior
 
   virtual void SetFocus(bool aOn = true, bool aRepaint = false) override;
 
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -180,24 +180,24 @@ nsHTMLButtonControlFrame::GetPrefISize(n
     : mRenderer.GetAddedButtonBorderAndPadding().LeftRight();
 
   return result;
 }
 
 void
 nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
                                  ReflowOutput& aDesiredSize,
-                                 const ReflowInput& aReflowState,
+                                 const ReflowInput& aReflowInput,
                                  nsReflowStatus& aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsHTMLButtonControlFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
 
-  NS_PRECONDITION(aReflowState.ComputedISize() != NS_INTRINSICSIZE,
+  NS_PRECONDITION(aReflowInput.ComputedISize() != NS_INTRINSICSIZE,
                   "Should have real computed inline-size by now");
 
   if (mState & NS_FRAME_FIRST_REFLOW) {
     nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
   }
 
   // Reflow the child
   nsIFrame* firstKid = mFrames.FirstChild();
@@ -205,174 +205,174 @@ nsHTMLButtonControlFrame::Reflow(nsPresC
   MOZ_ASSERT(firstKid, "Button should have a child frame for its contents");
   MOZ_ASSERT(!firstKid->GetNextSibling(),
              "Button should have exactly one child frame");
   MOZ_ASSERT(firstKid->StyleContext()->GetPseudo() ==
              nsCSSAnonBoxes::buttonContent,
              "Button's child frame has unexpected pseudo type!");
 
   // XXXbz Eventually we may want to check-and-bail if
-  // !aReflowState.ShouldReflowAllKids() &&
+  // !aReflowInput.ShouldReflowAllKids() &&
   // !NS_SUBTREE_DIRTY(firstKid).
   // We'd need to cache our ascent for that, of course.
 
   // Reflow the contents of the button.
   // (This populates our aDesiredSize, too.)
   ReflowButtonContents(aPresContext, aDesiredSize,
-                       aReflowState, firstKid);
+                       aReflowInput, firstKid);
 
   if (!ShouldClipPaintingToBorderBox()) {
     ConsiderChildOverflow(aDesiredSize.mOverflowAreas, firstKid);
   }
   // else, we ignore child overflow -- anything that overflows beyond our
   // own border-box will get clipped when painting.
 
   aStatus = NS_FRAME_COMPLETE;
   FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize,
-                                 aReflowState, aStatus);
+                                 aReflowInput, aStatus);
 
   // We're always complete and we don't support overflow containers
   // so we shouldn't have a next-in-flow ever.
   aStatus = NS_FRAME_COMPLETE;
   MOZ_ASSERT(!GetNextInFlow());
 
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 // Helper-function that lets us clone the button's reflow state, but with its
 // ComputedWidth and ComputedHeight reduced by the amount of renderer-specific
 // focus border and padding that we're using. (This lets us provide a more
 // appropriate content-box size for descendents' percent sizes to resolve
 // against.)
 static ReflowInput
-CloneReflowStateWithReducedContentBox(
-  const ReflowInput& aButtonReflowState,
+CloneReflowInputWithReducedContentBox(
+  const ReflowInput& aButtonReflowInput,
   const nsMargin& aFocusPadding)
 {
   nscoord adjustedWidth =
-    aButtonReflowState.ComputedWidth() - aFocusPadding.LeftRight();
+    aButtonReflowInput.ComputedWidth() - aFocusPadding.LeftRight();
   adjustedWidth = std::max(0, adjustedWidth);
 
   // (Only adjust height if it's an actual length.)
-  nscoord adjustedHeight = aButtonReflowState.ComputedHeight();
+  nscoord adjustedHeight = aButtonReflowInput.ComputedHeight();
   if (adjustedHeight != NS_INTRINSICSIZE) {
     adjustedHeight -= aFocusPadding.TopBottom();
     adjustedHeight = std::max(0, adjustedHeight);
   }
 
-  ReflowInput clone(aButtonReflowState);
+  ReflowInput clone(aButtonReflowInput);
   clone.SetComputedWidth(adjustedWidth);
   clone.SetComputedHeight(adjustedHeight);
 
   return clone;
 }
 
 void
 nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
                                                ReflowOutput& aButtonDesiredSize,
-                                               const ReflowInput& aButtonReflowState,
+                                               const ReflowInput& aButtonReflowInput,
                                                nsIFrame* aFirstKid)
 {
   WritingMode wm = GetWritingMode();
-  LogicalSize availSize = aButtonReflowState.ComputedSize(wm);
+  LogicalSize availSize = aButtonReflowInput.ComputedSize(wm);
   availSize.BSize(wm) = NS_INTRINSICSIZE;
 
   // Buttons have some bonus renderer-determined border/padding,
   // which occupies part of the button's content-box area:
   LogicalMargin focusPadding =
     LogicalMargin(wm, mRenderer.GetAddedButtonBorderAndPadding());
 
   // See whether out availSize's inline-size is big enough.  If it's
   // smaller than our intrinsic min iSize, that means that the kid
   // wouldn't really fit.  In that case, we overflow into our internal
   // focuspadding (which other browsers don't have) so that there's a
   // little more space for it.
   // Note that GetMinISize includes the focusPadding.
-  nscoord IOverflow = GetMinISize(aButtonReflowState.mRenderingContext) -
-                      aButtonReflowState.ComputedISize();
+  nscoord IOverflow = GetMinISize(aButtonReflowInput.mRenderingContext) -
+                      aButtonReflowInput.ComputedISize();
   nscoord IFocusPadding = focusPadding.IStartEnd(wm);
   nscoord focusPaddingReduction = std::min(IFocusPadding,
                                            std::max(IOverflow, 0));
   if (focusPaddingReduction > 0) {
     nscoord startReduction = focusPadding.IStart(wm);
     if (focusPaddingReduction != IFocusPadding) {
       startReduction = NSToCoordRound(startReduction *
                                       (float(focusPaddingReduction) /
                                        float(IFocusPadding)));
     }
     focusPadding.IStart(wm) -= startReduction;
     focusPadding.IEnd(wm) -= focusPaddingReduction - startReduction;
   }
 
   // shorthand for a value we need to use in a bunch of places
-  const LogicalMargin& clbp = aButtonReflowState.ComputedLogicalBorderPadding();
+  const LogicalMargin& clbp = aButtonReflowInput.ComputedLogicalBorderPadding();
 
   // Indent the child inside us by the focus border. We must do this separate
   // from the regular border.
   availSize.ISize(wm) -= focusPadding.IStartEnd(wm);
 
   LogicalPoint childPos(wm);
   childPos.I(wm) = focusPadding.IStart(wm) + clbp.IStart(wm);
   availSize.ISize(wm) = std::max(availSize.ISize(wm), 0);
 
   // Give child a clone of the button's reflow state, with height/width reduced
   // by focusPadding, so that descendants with height:100% don't protrude.
-  ReflowInput adjustedButtonReflowState =
-    CloneReflowStateWithReducedContentBox(aButtonReflowState,
+  ReflowInput adjustedButtonReflowInput =
+    CloneReflowInputWithReducedContentBox(aButtonReflowInput,
                                           focusPadding.GetPhysicalMargin(wm));
 
-  ReflowInput contentsReflowState(aPresContext,
-                                        adjustedButtonReflowState,
+  ReflowInput contentsReflowInput(aPresContext,
+                                        adjustedButtonReflowInput,
                                         aFirstKid, availSize);
 
   nsReflowStatus contentsReflowStatus;
-  ReflowOutput contentsDesiredSize(aButtonReflowState);
+  ReflowOutput contentsDesiredSize(aButtonReflowInput);
   childPos.B(wm) = 0; // This will be set properly later, after reflowing the
                       // child to determine its size.
 
   // We just pass a dummy containerSize here, as the child will be
   // repositioned later by FinishReflowChild.
   nsSize dummyContainerSize;
   ReflowChild(aFirstKid, aPresContext,
-              contentsDesiredSize, contentsReflowState,
+              contentsDesiredSize, contentsReflowInput,
               wm, childPos, dummyContainerSize, 0, contentsReflowStatus);
   MOZ_ASSERT(NS_FRAME_IS_COMPLETE(contentsReflowStatus),
              "We gave button-contents frame unconstrained available height, "
              "so it should be complete");
 
   // Compute the button's content-box size:
   LogicalSize buttonContentBox(wm);
-  if (aButtonReflowState.ComputedBSize() != NS_INTRINSICSIZE) {
+  if (aButtonReflowInput.ComputedBSize() != NS_INTRINSICSIZE) {
     // Button has a fixed block-size -- that's its content-box bSize.
-    buttonContentBox.BSize(wm) = aButtonReflowState.ComputedBSize();
+    buttonContentBox.BSize(wm) = aButtonReflowInput.ComputedBSize();
   } else {
     // Button is intrinsically sized -- it should shrinkwrap the
     // button-contents' bSize, plus any focus-padding space:
     buttonContentBox.BSize(wm) =
       contentsDesiredSize.BSize(wm) + focusPadding.BStartEnd(wm);
 
     // Make sure we obey min/max-bSize in the case when we're doing intrinsic
     // sizing (we get it for free when we have a non-intrinsic
-    // aButtonReflowState.ComputedBSize()).  Note that we do this before
+    // aButtonReflowInput.ComputedBSize()).  Note that we do this before
     // adjusting for borderpadding, since mComputedMaxBSize and
     // mComputedMinBSize are content bSizes.
     buttonContentBox.BSize(wm) =
       NS_CSS_MINMAX(buttonContentBox.BSize(wm),
-                    aButtonReflowState.ComputedMinBSize(),
-                    aButtonReflowState.ComputedMaxBSize());
+                    aButtonReflowInput.ComputedMinBSize(),
+                    aButtonReflowInput.ComputedMaxBSize());
   }
-  if (aButtonReflowState.ComputedISize() != NS_INTRINSICSIZE) {
-    buttonContentBox.ISize(wm) = aButtonReflowState.ComputedISize();
+  if (aButtonReflowInput.ComputedISize() != NS_INTRINSICSIZE) {
+    buttonContentBox.ISize(wm) = aButtonReflowInput.ComputedISize();
   } else {
     buttonContentBox.ISize(wm) =
       contentsDesiredSize.ISize(wm) + focusPadding.IStartEnd(wm);
     buttonContentBox.ISize(wm) =
       NS_CSS_MINMAX(buttonContentBox.ISize(wm),
-                    aButtonReflowState.ComputedMinISize(),
-                    aButtonReflowState.ComputedMaxISize());
+                    aButtonReflowInput.ComputedMinISize(),
+                    aButtonReflowInput.ComputedMaxISize());
   }
 
   // Center child in the block-direction in the button
   // (technically, inside of the button's focus-padding area)
   nscoord extraSpace =
     buttonContentBox.BSize(wm) - focusPadding.BStartEnd(wm) -
     contentsDesiredSize.BSize(wm);
 
@@ -382,31 +382,31 @@ nsHTMLButtonControlFrame::ReflowButtonCo
   // its focus-padding rect:
   childPos.B(wm) += focusPadding.BStart(wm) + clbp.BStart(wm);
 
   nsSize containerSize =
     (buttonContentBox + clbp.Size(wm)).GetPhysicalSize(wm);
 
   // Place the child
   FinishReflowChild(aFirstKid, aPresContext,
-                    contentsDesiredSize, &contentsReflowState,
+                    contentsDesiredSize, &contentsReflowInput,
                     wm, childPos, containerSize, 0);
 
   // Make sure we have a useful 'ascent' value for the child
   if (contentsDesiredSize.BlockStartAscent() ==
       ReflowOutput::ASK_FOR_BASELINE) {
-    WritingMode wm = aButtonReflowState.GetWritingMode();
+    WritingMode wm = aButtonReflowInput.GetWritingMode();
     contentsDesiredSize.SetBlockStartAscent(aFirstKid->GetLogicalBaseline(wm));
   }
 
   // OK, we're done with the child frame.
   // Use what we learned to populate the button frame's reflow metrics.
   //  * Button's height & width are content-box size + border-box contribution:
   aButtonDesiredSize.SetSize(wm,
-    LogicalSize(wm, aButtonReflowState.ComputedISize() + clbp.IStartEnd(wm),
+    LogicalSize(wm, aButtonReflowInput.ComputedISize() + clbp.IStartEnd(wm),
                     buttonContentBox.BSize(wm) + clbp.BStartEnd(wm)));
 
   //  * Button's ascent is its child's ascent, plus the child's block-offset
   // within our frame... unless it's orthogonal, in which case we'll use the
   // contents inline-size as an approximation for now.
   // XXX is there a better strategy? should we include border-padding?
   if (aButtonDesiredSize.GetWritingMode().IsOrthogonalTo(wm)) {
     aButtonDesiredSize.SetBlockStartAscent(contentsDesiredSize.ISize(wm));
--- a/layout/forms/nsHTMLButtonControlFrame.h
+++ b/layout/forms/nsHTMLButtonControlFrame.h
@@ -31,17 +31,17 @@ public:
                                 const nsDisplayListSet& aLists) override;
 
   virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
 
   virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
 
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual nsresult HandleEvent(nsPresContext* aPresContext, 
                                mozilla::WidgetGUIEvent* aEvent,
                                nsEventStatus* aEventStatus) override;
 
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
@@ -97,17 +97,17 @@ protected:
   // border-box (either because of "overflow" or because of legacy reasons
   // about how <input>-flavored buttons work).
   bool ShouldClipPaintingToBorderBox();
 
   // Reflows the button's sole child frame, and computes the desired size
   // of the button itself from the results.
   void ReflowButtonContents(nsPresContext* aPresContext,
                             ReflowOutput& aButtonDesiredSize,
-                            const ReflowInput& aButtonReflowState,
+                            const ReflowInput& aButtonReflowInput,
                             nsIFrame* aFirstKid);
 
   nsButtonFrameRenderer mRenderer;
 };
 
 #endif
 
 
--- a/layout/forms/nsImageControlFrame.cpp
+++ b/layout/forms/nsImageControlFrame.cpp
@@ -27,17 +27,17 @@ public:
                     nsContainerFrame* aParent,
                     nsIFrame*         aPrevInFlow) override;
 
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   virtual void Reflow(nsPresContext*           aPresContext,
                           ReflowOutput&     aDesiredSize,
-                          const ReflowInput& aReflowState,
+                          const ReflowInput& aReflowInput,
                           nsReflowStatus&          aStatus) override;
 
   virtual nsresult HandleEvent(nsPresContext* aPresContext,
                                WidgetGUIEvent* aEvent,
                                nsEventStatus* aEventStatus) override;
 
   virtual nsIAtom* GetType() const override;
 
@@ -122,25 +122,25 @@ nsIAtom*
 nsImageControlFrame::GetType() const
 {
   return nsGkAtoms::imageControlFrame;
 }
 
 void
 nsImageControlFrame::Reflow(nsPresContext*           aPresContext,
                             ReflowOutput&     aDesiredSize,
-                            const ReflowInput& aReflowState,
+                            const ReflowInput& aReflowInput,
                             nsReflowStatus&          aStatus)
 {
   DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
   if (!GetPrevInFlow() && (mState & NS_FRAME_FIRST_REFLOW)) {
     nsFormControlFrame::RegUnRegAccessKey(this, true);
   }
-  return nsImageFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
+  return nsImageFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
 }
 
 nsresult
 nsImageControlFrame::HandleEvent(nsPresContext* aPresContext,
                                  WidgetGUIEvent* aEvent,
                                  nsEventStatus* aEventStatus)
 {
   NS_ENSURE_ARG_POINTER(aEventStatus);
--- a/layout/forms/nsLegendFrame.cpp
+++ b/layout/forms/nsLegendFrame.cpp
@@ -45,25 +45,25 @@ nsLegendFrame::DestroyFrom(nsIFrame* aDe
 
 NS_QUERYFRAME_HEAD(nsLegendFrame)
   NS_QUERYFRAME_ENTRY(nsLegendFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
 
 void
 nsLegendFrame::Reflow(nsPresContext*          aPresContext,
                      ReflowOutput&     aDesiredSize,
-                     const ReflowInput& aReflowState,
+                     const ReflowInput& aReflowInput,
                      nsReflowStatus&          aStatus)
 {
   DO_GLOBAL_REFLOW_COUNT("nsLegendFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
   if (mState & NS_FRAME_FIRST_REFLOW) {
     nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
   }
-  return nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
+  return nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
 }
 
 int32_t
 nsLegendFrame::GetLogicalAlign(WritingMode aCBWM)
 {
   int32_t intValue = NS_STYLE_TEXT_ALIGN_START;
   nsGenericHTMLElement* content = nsGenericHTMLElement::FromContent(mContent);
   if (content) {
--- a/layout/forms/nsLegendFrame.h
+++ b/layout/forms/nsLegendFrame.h
@@ -14,17 +14,17 @@ public:
   NS_DECL_QUERYFRAME_TARGET(nsLegendFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit nsLegendFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
 
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   virtual nsIAtom* GetType() const override;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -351,20 +351,20 @@ nsListControlFrame::GetMinISize(nsRender
   result += scrollbarSize.IStartEnd(wm);
 
   return result;
 }
 
 void
 nsListControlFrame::Reflow(nsPresContext*           aPresContext,
                            ReflowOutput&     aDesiredSize,
-                           const ReflowInput& aReflowState,
+                           const ReflowInput& aReflowInput,
                            nsReflowStatus&          aStatus)
 {
-  NS_PRECONDITION(aReflowState.ComputedISize() != NS_UNCONSTRAINEDSIZE,
+  NS_PRECONDITION(aReflowInput.ComputedISize() != NS_UNCONSTRAINEDSIZE,
                   "Must have a computed inline size");
 
   SchedulePaint();
 
   mHasPendingInterruptAtStartOfReflow = aPresContext->HasPendingInterrupt();
 
   // If all the content and frames are here
   // then initialize it before reflow
@@ -377,17 +377,17 @@ nsListControlFrame::Reflow(nsPresContext
     }
   }
 
   if (GetStateBits() & NS_FRAME_FIRST_REFLOW) {
     nsFormControlFrame::RegUnRegAccessKey(this, true);
   }
 
   if (IsInDropDownMode()) {
-    ReflowAsDropdown(aPresContext, aDesiredSize, aReflowState, aStatus);
+    ReflowAsDropdown(aPresContext, aDesiredSize, aReflowInput, aStatus);
     return;
   }
 
   MarkInReflow();
   /*
    * Due to the fact that our intrinsic block size depends on the block
    * sizes of our kids, we end up having to do two-pass reflow, in
    * general -- the first pass to find the intrinsic block size and a
@@ -404,22 +404,22 @@ nsListControlFrame::Reflow(nsPresContext
    * - We're not dirty and have no dirty kids and shouldn't be reflowing
    *   all kids.  In this case, our cached max block size of a child is
    *   not going to change.
    * - We do our first reflow using our cached max block size of a
    *   child, then compute the new max block size and it's the same as
    *   the old one.
    */
 
-  bool autoBSize = (aReflowState.ComputedBSize() == NS_UNCONSTRAINEDSIZE);
+  bool autoBSize = (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE);
 
   mMightNeedSecondPass = autoBSize &&
-    (NS_SUBTREE_DIRTY(this) || aReflowState.ShouldReflowAllKids());
+    (NS_SUBTREE_DIRTY(this) || aReflowInput.ShouldReflowAllKids());
 
-  ReflowInput state(aReflowState);
+  ReflowInput state(aReflowInput);
   int32_t length = GetNumberOfRows();
 
   nscoord oldBSizeOfARow = BSizeOfARow();
 
   if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW) && autoBSize) {
     // When not doing an initial reflow, and when the block size is
     // auto, start off with our computed block size set to what we'd
     // expect our block size to be.
@@ -489,33 +489,33 @@ nsListControlFrame::Reflow(nsPresContext
   // mComputedPadding.top to it (and subtract it from descent).  Need that
   // because nsGfxScrollFrame just adds in the border....
   nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
 }
 
 void
 nsListControlFrame::ReflowAsDropdown(nsPresContext*           aPresContext,
                                      ReflowOutput&     aDesiredSize,
-                                     const ReflowInput& aReflowState,
+                                     const ReflowInput& aReflowInput,
                                      nsReflowStatus&          aStatus)
 {
-  NS_PRECONDITION(aReflowState.ComputedBSize() == NS_UNCONSTRAINEDSIZE,
+  NS_PRECONDITION(aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE,
                   "We should not have a computed block size here!");
 
   mMightNeedSecondPass = NS_SUBTREE_DIRTY(this) ||
-    aReflowState.ShouldReflowAllKids();
+    aReflowInput.ShouldReflowAllKids();
 
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
 #ifdef DEBUG
   nscoord oldBSizeOfARow = BSizeOfARow();
   nscoord oldVisibleBSize = (GetStateBits() & NS_FRAME_FIRST_REFLOW) ?
     NS_UNCONSTRAINEDSIZE : GetScrolledFrame()->BSize(wm);
 #endif
 
-  ReflowInput state(aReflowState);
+  ReflowInput state(aReflowInput);
 
   if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
     // When not doing an initial reflow, and when the block size is
     // auto, start off with our computed block size set to what we'd
     // expect our block size to be.
     // Note: At this point, mLastDropdownComputedBSize can be
     // NS_UNCONSTRAINEDSIZE in cases when last time we didn't have to
     // constrain the block size.  That's fine; just do the same thing as
@@ -578,17 +578,17 @@ nsListControlFrame::ReflowAsDropdown(nsP
     LogicalPoint translation(wm);
     nscoord before, after;
     combobox->GetAvailableDropdownSpace(wm, &before, &after, &translation);
     if (before <= 0 && after <= 0) {
       state.SetComputedBSize(blockSizeOfARow);
       mNumDisplayRows = 1;
       mDropdownCanGrow = GetNumberOfRows() > 1;
     } else {
-      nscoord bp = aReflowState.ComputedLogicalBorderPadding().BStartEnd(wm);
+      nscoord bp = aReflowInput.ComputedLogicalBorderPadding().BStartEnd(wm);
       nscoord availableBSize = std::max(before, after) - bp;
       nscoord newBSize;
       uint32_t rows;
       if (visibleBSize <= availableBSize) {
         // The dropdown fits in the available block size.
         rows = GetNumberOfRows();
         mNumDisplayRows = clamped<uint32_t>(rows, 1, kMaxDropDownRows);
         if (mNumDisplayRows == rows) {
@@ -1489,23 +1489,23 @@ nsListControlFrame::AboutToRollup()
 
   if (IsInDropDownMode()) {
     ComboboxFinish(mComboboxFrame->GetIndexOfDisplayArea()); // might destroy us
   }
 }
 
 void
 nsListControlFrame::DidReflow(nsPresContext*           aPresContext,
-                              const ReflowInput* aReflowState,
+                              const ReflowInput* aReflowInput,
                               nsDidReflowStatus        aStatus)
 {
   bool wasInterrupted = !mHasPendingInterruptAtStartOfReflow &&
                           aPresContext->HasPendingInterrupt();
 
-  nsHTMLScrollFrame::DidReflow(aPresContext, aReflowState, aStatus);
+  nsHTMLScrollFrame::DidReflow(aPresContext, aReflowInput, aStatus);
 
   if (mNeedToReset && !wasInterrupted) {
     mNeedToReset = false;
     // Suppress scrolling to the selected element if we restored
     // scroll history state AND the list contents have not changed
     // since we loaded all the children AND nothing else forced us
     // to scroll by calling ResetList(true). The latter two conditions
     // are folded into mPostChildrenLoadedReset.
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -63,25 +63,25 @@ public:
   virtual void SetInitialChildList(ChildListID     aListID,
                                    nsFrameList&    aChildList) override;
 
   virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
   virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
 
   virtual void Reflow(nsPresContext*           aCX,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
                     nsIFrame*         aPrevInFlow) override;
 
   virtual void DidReflow(nsPresContext*            aPresContext,
-                         const ReflowInput*  aReflowState,
+                         const ReflowInput*  aReflowInput,
                          nsDidReflowStatus         aStatus) override;
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists) override;
 
   virtual nsContainerFrame* GetContentInsertionFrame() override;
@@ -341,17 +341,17 @@ protected:
 
   /**
    * Method to reflow ourselves as a dropdown list.  This differs from
    * reflow as a listbox because the criteria for needing a second
    * pass are different.  This will be called from Reflow() as needed.
    */
   void ReflowAsDropdown(nsPresContext*           aPresContext,
                         ReflowOutput&     aDesiredSize,
-                        const ReflowInput& aReflowState,
+                        const ReflowInput& aReflowInput,
                         nsReflowStatus&          aStatus);
 
   // Selection
   bool     SetOptionsSelectedFromFrame(int32_t aStartIndex,
                                        int32_t aEndIndex,
                                        bool aValue,
                                        bool aClearAll);
   bool     ToggleOptionSelectedFromFrame(int32_t aIndex);
--- a/layout/forms/nsMeterFrame.cpp
+++ b/layout/forms/nsMeterFrame.cpp
@@ -100,105 +100,105 @@ NS_QUERYFRAME_HEAD(nsMeterFrame)
   NS_QUERYFRAME_ENTRY(nsMeterFrame)
   NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
 NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
 
 
 void
 nsMeterFrame::Reflow(nsPresContext*           aPresContext,
                      ReflowOutput&     aDesiredSize,
-                     const ReflowInput& aReflowState,
+                     const ReflowInput& aReflowInput,
                      nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsMeterFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
 
   NS_ASSERTION(mBarDiv, "Meter bar div must exist!");
   NS_ASSERTION(!GetPrevContinuation(),
                "nsMeterFrame should not have continuations; if it does we "
                "need to call RegUnregAccessKey only for the first.");
 
   if (mState & NS_FRAME_FIRST_REFLOW) {
     nsFormControlFrame::RegUnRegAccessKey(this, true);
   }
 
   nsIFrame* barFrame = mBarDiv->GetPrimaryFrame();
   NS_ASSERTION(barFrame, "The meter frame should have a child with a frame!");
 
-  ReflowBarFrame(barFrame, aPresContext, aReflowState, aStatus);
+  ReflowBarFrame(barFrame, aPresContext, aReflowInput, aStatus);
 
-  aDesiredSize.SetSize(aReflowState.GetWritingMode(),
-                       aReflowState.ComputedSizeWithBorderPadding());
+  aDesiredSize.SetSize(aReflowInput.GetWritingMode(),
+                       aReflowInput.ComputedSizeWithBorderPadding());
 
   aDesiredSize.SetOverflowAreasToDesiredBounds();
   ConsiderChildOverflow(aDesiredSize.mOverflowAreas, barFrame);
   FinishAndStoreOverflow(&aDesiredSize);
 
   aStatus = NS_FRAME_COMPLETE;
 
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 void
 nsMeterFrame::ReflowBarFrame(nsIFrame*                aBarFrame,
                              nsPresContext*           aPresContext,
-                             const ReflowInput& aReflowState,
+                             const ReflowInput& aReflowInput,
                              nsReflowStatus&          aStatus)
 {
   bool vertical = ResolvedOrientationIsVertical();
   WritingMode wm = aBarFrame->GetWritingMode();
-  LogicalSize availSize = aReflowState.ComputedSize(wm);
+  LogicalSize availSize = aReflowInput.ComputedSize(wm);
   availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
-  ReflowInput reflowState(aPresContext, aReflowState,
+  ReflowInput reflowInput(aPresContext, aReflowInput,
                                 aBarFrame, availSize);
-  nscoord size = vertical ? aReflowState.ComputedHeight()
-                          : aReflowState.ComputedWidth();
-  nscoord xoffset = aReflowState.ComputedPhysicalBorderPadding().left;
-  nscoord yoffset = aReflowState.ComputedPhysicalBorderPadding().top;
+  nscoord size = vertical ? aReflowInput.ComputedHeight()
+                          : aReflowInput.ComputedWidth();
+  nscoord xoffset = aReflowInput.ComputedPhysicalBorderPadding().left;
+  nscoord yoffset = aReflowInput.ComputedPhysicalBorderPadding().top;
 
   // NOTE: Introduce a new function getPosition in the content part ?
   HTMLMeterElement* meterElement = static_cast<HTMLMeterElement*>(mContent);
 
   double max = meterElement->Max();
   double min = meterElement->Min();
   double value = meterElement->Value();
 
   double position = max - min;
   position = position != 0 ? (value - min) / position : 1;
 
   size = NSToCoordRound(size * position);
 
   if (!vertical && (wm.IsVertical() ? wm.IsVerticalRL() : !wm.IsBidiLTR())) {
-    xoffset += aReflowState.ComputedWidth() - size;
+    xoffset += aReflowInput.ComputedWidth() - size;
   }
 
   // The bar position is *always* constrained.
   if (vertical) {
     // We want the bar to begin at the bottom.
-    yoffset += aReflowState.ComputedHeight() - size;
+    yoffset += aReflowInput.ComputedHeight() - size;
 
-    size -= reflowState.ComputedPhysicalMargin().TopBottom() +
-            reflowState.ComputedPhysicalBorderPadding().TopBottom();
+    size -= reflowInput.ComputedPhysicalMargin().TopBottom() +
+            reflowInput.ComputedPhysicalBorderPadding().TopBottom();
     size = std::max(size, 0);
-    reflowState.SetComputedHeight(size);
+    reflowInput.SetComputedHeight(size);
   } else {
-    size -= reflowState.ComputedPhysicalMargin().LeftRight() +
-            reflowState.ComputedPhysicalBorderPadding().LeftRight();
+    size -= reflowInput.ComputedPhysicalMargin().LeftRight() +
+            reflowInput.ComputedPhysicalBorderPadding().LeftRight();
     size = std::max(size, 0);
-    reflowState.SetComputedWidth(size);
+    reflowInput.SetComputedWidth(size);
   }
 
-  xoffset += reflowState.ComputedPhysicalMargin().left;
-  yoffset += reflowState.ComputedPhysicalMargin().top;
+  xoffset += reflowInput.ComputedPhysicalMargin().left;
+  yoffset += reflowInput.ComputedPhysicalMargin().top;
 
-  ReflowOutput barDesiredSize(reflowState);
-  ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowState, xoffset,
+  ReflowOutput barDesiredSize(reflowInput);
+  ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowInput, xoffset,
               yoffset, 0, aStatus);
-  FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowState,
+  FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowInput,
                     xoffset, yoffset, 0);
 }
 
 nsresult
 nsMeterFrame::AttributeChanged(int32_t  aNameSpaceID,
                                nsIAtom* aAttribute,
                                int32_t  aModType)
 {
--- a/layout/forms/nsMeterFrame.h
+++ b/layout/forms/nsMeterFrame.h
@@ -25,17 +25,17 @@ public:
 
   explicit nsMeterFrame(nsStyleContext* aContext);
   virtual ~nsMeterFrame();
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   virtual void Reflow(nsPresContext*           aCX,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual nsIAtom* GetType() const override;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override {
     return MakeFrameName(NS_LITERAL_STRING("Meter"), aResult);
   }
@@ -77,17 +77,17 @@ public:
   bool ShouldUseNativeStyle() const;
 
   virtual Element* GetPseudoElement(mozilla::CSSPseudoElementType aType) override;
 
 protected:
   // Helper function which reflow the anonymous div frame.
   void ReflowBarFrame(nsIFrame*                aBarFrame,
                       nsPresContext*           aPresContext,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus);
   /**
    * The div used to show the meter bar.
    * @see nsMeterFrame::CreateAnonymousContent
    */
   nsCOMPtr<Element> mBarDiv;
 };
 
--- a/layout/forms/nsNumberControlFrame.cpp
+++ b/layout/forms/nsNumberControlFrame.cpp
@@ -101,156 +101,156 @@ nsNumberControlFrame::GetPrefISize(nsRen
   }
 
   return result;
 }
 
 void
 nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
                              ReflowOutput& aDesiredSize,
-                             const ReflowInput& aReflowState,
+                             const ReflowInput& aReflowInput,
                              nsReflowStatus& aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsNumberControlFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
 
   NS_ASSERTION(mOuterWrapper, "Outer wrapper div must exist!");
 
   NS_ASSERTION(!GetPrevContinuation() && !GetNextContinuation(),
                "nsNumberControlFrame should not have continuations; if it does we "
                "need to call RegUnregAccessKey only for the first");
 
   NS_ASSERTION(!mFrames.FirstChild() ||
                !mFrames.FirstChild()->GetNextSibling(),
                "We expect at most one direct child frame");
 
   if (mState & NS_FRAME_FIRST_REFLOW) {
     nsFormControlFrame::RegUnRegAccessKey(this, true);
   }
 
-  const WritingMode myWM = aReflowState.GetWritingMode();
+  const WritingMode myWM = aReflowInput.GetWritingMode();
 
   // The ISize of our content box, which is the available ISize
   // for our anonymous content:
-  const nscoord contentBoxISize = aReflowState.ComputedISize();
-  nscoord contentBoxBSize = aReflowState.ComputedBSize();
+  const nscoord contentBoxISize = aReflowInput.ComputedISize();
+  nscoord contentBoxBSize = aReflowInput.ComputedBSize();
 
   // Figure out our border-box sizes as well (by adding borderPadding to
   // content-box sizes):
   const nscoord borderBoxISize = contentBoxISize +
-    aReflowState.ComputedLogicalBorderPadding().IStartEnd(myWM);
+    aReflowInput.ComputedLogicalBorderPadding().IStartEnd(myWM);
 
   nscoord borderBoxBSize;
   if (contentBoxBSize != NS_INTRINSICSIZE) {
     borderBoxBSize = contentBoxBSize +
-      aReflowState.ComputedLogicalBorderPadding().BStartEnd(myWM);
+      aReflowInput.ComputedLogicalBorderPadding().BStartEnd(myWM);
   } // else, we'll figure out borderBoxBSize after we resolve contentBoxBSize.
 
   nsIFrame* outerWrapperFrame = mOuterWrapper->GetPrimaryFrame();
 
   if (!outerWrapperFrame) { // display:none?
     if (contentBoxBSize == NS_INTRINSICSIZE) {
       contentBoxBSize = 0;
       borderBoxBSize =
-        aReflowState.ComputedLogicalBorderPadding().BStartEnd(myWM);
+        aReflowInput.ComputedLogicalBorderPadding().BStartEnd(myWM);
     }
   } else {
     NS_ASSERTION(outerWrapperFrame == mFrames.FirstChild(), "huh?");
 
-    ReflowOutput wrappersDesiredSize(aReflowState);
+    ReflowOutput wrappersDesiredSize(aReflowInput);
 
     WritingMode wrapperWM = outerWrapperFrame->GetWritingMode();
-    LogicalSize availSize = aReflowState.ComputedSize(wrapperWM);
+    LogicalSize availSize = aReflowInput.ComputedSize(wrapperWM);
     availSize.BSize(wrapperWM) = NS_UNCONSTRAINEDSIZE;
 
-    ReflowInput wrapperReflowState(aPresContext, aReflowState,
+    ReflowInput wrapperReflowInput(aPresContext, aReflowInput,
                                          outerWrapperFrame, availSize);
 
     // Convert wrapper margin into my own writing-mode (in case it differs):
     LogicalMargin wrapperMargin =
-      wrapperReflowState.ComputedLogicalMargin().ConvertTo(myWM, wrapperWM);
+      wrapperReflowInput.ComputedLogicalMargin().ConvertTo(myWM, wrapperWM);
 
     // offsets of wrapper frame within this frame:
     LogicalPoint
       wrapperOffset(myWM,
-                    aReflowState.ComputedLogicalBorderPadding().IStart(myWM) +
+                    aReflowInput.ComputedLogicalBorderPadding().IStart(myWM) +
                     wrapperMargin.IStart(myWM),
-                    aReflowState.ComputedLogicalBorderPadding().BStart(myWM) +
+                    aReflowInput.ComputedLogicalBorderPadding().BStart(myWM) +
                     wrapperMargin.BStart(myWM));
 
     nsReflowStatus childStatus;
     // We initially reflow the child with a dummy containerSize; positioning
     // will be fixed later.
     const nsSize dummyContainerSize;
     ReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
-                wrapperReflowState, myWM, wrapperOffset, dummyContainerSize, 0,
+                wrapperReflowInput, myWM, wrapperOffset, dummyContainerSize, 0,
                 childStatus);
     MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
                "We gave our child unconstrained available block-size, "
                "so it should be complete");
 
     nscoord wrappersMarginBoxBSize =
       wrappersDesiredSize.BSize(myWM) + wrapperMargin.BStartEnd(myWM);
 
     if (contentBoxBSize == NS_INTRINSICSIZE) {
       // We are intrinsically sized -- we should shrinkwrap the outer wrapper's
       // block-size:
       contentBoxBSize = wrappersMarginBoxBSize;
 
       // Make sure we obey min/max-bsize in the case when we're doing intrinsic
       // sizing (we get it for free when we have a non-intrinsic
-      // aReflowState.ComputedBSize()).  Note that we do this before
+      // aReflowInput.ComputedBSize()).  Note that we do this before
       // adjusting for borderpadding, since ComputedMaxBSize and
       // ComputedMinBSize are content heights.
       contentBoxBSize =
         NS_CSS_MINMAX(contentBoxBSize,
-                      aReflowState.ComputedMinBSize(),
-                      aReflowState.ComputedMaxBSize());
+                      aReflowInput.ComputedMinBSize(),
+                      aReflowInput.ComputedMaxBSize());
 
       borderBoxBSize = contentBoxBSize +
-        aReflowState.ComputedLogicalBorderPadding().BStartEnd(myWM);
+        aReflowInput.ComputedLogicalBorderPadding().BStartEnd(myWM);
     }
 
     // Center child in block axis
     nscoord extraSpace = contentBoxBSize - wrappersMarginBoxBSize;
     wrapperOffset.B(myWM) += std::max(0, extraSpace / 2);
 
     // Needed in FinishReflowChild, for logical-to-physical conversion:
     nsSize borderBoxSize = LogicalSize(myWM, borderBoxISize, borderBoxBSize).
                            GetPhysicalSize(myWM);
 
     // Place the child
     FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
-                      &wrapperReflowState, myWM, wrapperOffset,
+                      &wrapperReflowInput, myWM, wrapperOffset,
                       borderBoxSize, 0);
 
     nsSize contentBoxSize =
       LogicalSize(myWM, contentBoxISize, contentBoxBSize).
         GetPhysicalSize(myWM);
     aDesiredSize.SetBlockStartAscent(
        wrappersDesiredSize.BlockStartAscent() +
-       outerWrapperFrame->BStart(aReflowState.GetWritingMode(),
+       outerWrapperFrame->BStart(aReflowInput.GetWritingMode(),
                                  contentBoxSize));
   }
 
   LogicalSize logicalDesiredSize(myWM, borderBoxISize, borderBoxBSize);
   aDesiredSize.SetSize(myWM, logicalDesiredSize);
 
   aDesiredSize.SetOverflowAreasToDesiredBounds();
 
   if (outerWrapperFrame) {
     ConsiderChildOverflow(aDesiredSize.mOverflowAreas, outerWrapperFrame);
   }
 
   FinishAndStoreOverflow(&aDesiredSize);
 
   aStatus = NS_FRAME_COMPLETE;
 
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 void
 nsNumberControlFrame::SyncDisabledState()
 {
   EventStates eventStates = mContent->AsElement()->State();
   if (eventStates.HasState(NS_EVENT_STATE_DISABLED)) {
     mTextField->SetAttr(kNameSpaceID_None, nsGkAtoms::disabled, EmptyString(),
--- a/layout/forms/nsNumberControlFrame.h
+++ b/layout/forms/nsNumberControlFrame.h
@@ -56,17 +56,17 @@ public:
 #endif
 
   virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
 
   virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override;
 
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual nsresult AttributeChanged(int32_t  aNameSpaceID,
                                     nsIAtom* aAttribute,
                                     int32_t  aModType) override;
 
   // nsIAnonymousContentCreator
   virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
--- a/layout/forms/nsProgressFrame.cpp
+++ b/layout/forms/nsProgressFrame.cpp
@@ -105,113 +105,113 @@ nsProgressFrame::BuildDisplayList(nsDisp
                                   const nsDisplayListSet& aLists)
 {
   BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
 }
 
 void
 nsProgressFrame::Reflow(nsPresContext*           aPresContext,
                         ReflowOutput&     aDesiredSize,
-                        const ReflowInput& aReflowState,
+                        const ReflowInput& aReflowInput,
                         nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsProgressFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
 
   NS_ASSERTION(mBarDiv, "Progress bar div must exist!");
   NS_ASSERTION(!GetPrevContinuation(),
                "nsProgressFrame should not have continuations; if it does we "
                "need to call RegUnregAccessKey only for the first.");
 
   if (mState & NS_FRAME_FIRST_REFLOW) {
     nsFormControlFrame::RegUnRegAccessKey(this, true);
   }
 
   nsIFrame* barFrame = mBarDiv->GetPrimaryFrame();
   NS_ASSERTION(barFrame, "The progress frame should have a child with a frame!");
 
-  ReflowBarFrame(barFrame, aPresContext, aReflowState, aStatus);
+  ReflowBarFrame(barFrame, aPresContext, aReflowInput, aStatus);
 
-  aDesiredSize.SetSize(aReflowState.GetWritingMode(),
-                       aReflowState.ComputedSizeWithBorderPadding());
+  aDesiredSize.SetSize(aReflowInput.GetWritingMode(),
+                       aReflowInput.ComputedSizeWithBorderPadding());
   aDesiredSize.SetOverflowAreasToDesiredBounds();
   ConsiderChildOverflow(aDesiredSize.mOverflowAreas, barFrame);
   FinishAndStoreOverflow(&aDesiredSize);
 
   aStatus = NS_FRAME_COMPLETE;
 
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 void
 nsProgressFrame::ReflowBarFrame(nsIFrame*                aBarFrame,
                                 nsPresContext*           aPresContext,
-                                const ReflowInput& aReflowState,
+                                const ReflowInput& aReflowInput,
                                 nsReflowStatus&          aStatus)
 {
   bool vertical = ResolvedOrientationIsVertical();
   WritingMode wm = aBarFrame->GetWritingMode();
-  LogicalSize availSize = aReflowState.ComputedSize(wm);
+  LogicalSize availSize = aReflowInput.ComputedSize(wm);
   availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
-  ReflowInput reflowState(aPresContext, aReflowState,
+  ReflowInput reflowInput(aPresContext, aReflowInput,
                                 aBarFrame, availSize);
-  nscoord size = vertical ? aReflowState.ComputedHeight()
-                          : aReflowState.ComputedWidth();
-  nscoord xoffset = aReflowState.ComputedPhysicalBorderPadding().left;
-  nscoord yoffset = aReflowState.ComputedPhysicalBorderPadding().top;
+  nscoord size = vertical ? aReflowInput.ComputedHeight()
+                          : aReflowInput.ComputedWidth();
+  nscoord xoffset = aReflowInput.ComputedPhysicalBorderPadding().left;
+  nscoord yoffset = aReflowInput.ComputedPhysicalBorderPadding().top;
 
   double position = static_cast<HTMLProgressElement*>(mContent)->Position();
 
   // Force the bar's size to match the current progress.
   // When indeterminate, the progress' size will be 100%.
   if (position >= 0.0) {
     size *= position;
   }
 
   if (!vertical && (wm.IsVertical() ? wm.IsVerticalRL() : !wm.IsBidiLTR())) {
-    xoffset += aReflowState.ComputedWidth() - size;
+    xoffset += aReflowInput.ComputedWidth() - size;
   }
 
   // The bar size is fixed in these cases:
   // - the progress position is determined: the bar size is fixed according
   //   to it's value.
   // - the progress position is indeterminate and the bar appearance should be
   //   shown as native: the bar size is forced to 100%.
   // Otherwise (when the progress is indeterminate and the bar appearance isn't
   // native), the bar size isn't fixed and can be set by the author.
   if (position != -1 || ShouldUseNativeStyle()) {
     if (vertical) {
       // We want the bar to begin at the bottom.
-      yoffset += aReflowState.ComputedHeight() - size;
+      yoffset += aReflowInput.ComputedHeight() - size;
 
-      size -= reflowState.ComputedPhysicalMargin().TopBottom() +
-              reflowState.ComputedPhysicalBorderPadding().TopBottom();
+      size -= reflowInput.ComputedPhysicalMargin().TopBottom() +
+              reflowInput.ComputedPhysicalBorderPadding().TopBottom();
       size = std::max(size, 0);
-      reflowState.SetComputedHeight(size);
+      reflowInput.SetComputedHeight(size);
     } else {
-      size -= reflowState.ComputedPhysicalMargin().LeftRight() +
-              reflowState.ComputedPhysicalBorderPadding().LeftRight();
+      size -= reflowInput.ComputedPhysicalMargin().LeftRight() +
+              reflowInput.ComputedPhysicalBorderPadding().LeftRight();
       size = std::max(size, 0);
-      reflowState.SetComputedWidth(size);
+      reflowInput.SetComputedWidth(size);
     }
   } else if (vertical) {
     // For vertical progress bars, we need to position the bar specificly when
     // the width isn't constrained (position == -1 and !ShouldUseNativeStyle())
-    // because aReflowState.ComputedHeight() - size == 0.
-    yoffset += aReflowState.ComputedHeight() - reflowState.ComputedHeight();
+    // because aReflowInput.ComputedHeight() - size == 0.
+    yoffset += aReflowInput.ComputedHeight() - reflowInput.ComputedHeight();
   }
 
-  xoffset += reflowState.ComputedPhysicalMargin().left;
-  yoffset += reflowState.ComputedPhysicalMargin().top;
+  xoffset += reflowInput.ComputedPhysicalMargin().left;
+  yoffset += reflowInput.ComputedPhysicalMargin().top;
 
-  ReflowOutput barDesiredSize(aReflowState);
-  ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowState, xoffset,
+  ReflowOutput barDesiredSize(aReflowInput);
+  ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowInput, xoffset,
               yoffset, 0, aStatus);
-  FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowState,
+  FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowInput,
                     xoffset, yoffset, 0);
 }
 
 nsresult
 nsProgressFrame::AttributeChanged(int32_t  aNameSpaceID,
                                   nsIAtom* aAttribute,
                                   int32_t  aModType)
 {
--- a/layout/forms/nsProgressFrame.h
+++ b/layout/forms/nsProgressFrame.h
@@ -32,17 +32,17 @@ public:
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists) override;
 
   virtual void Reflow(nsPresContext*           aCX,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual nsIAtom* GetType() const override;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override {
     return MakeFrameName(NS_LITERAL_STRING("Progress"), aResult);
   }
@@ -84,17 +84,17 @@ public:
   bool ShouldUseNativeStyle() const;
 
   virtual Element* GetPseudoElement(CSSPseudoElementType aType) override;
 
 protected:
   // Helper function which reflow the anonymous div frame.
   void ReflowBarFrame(nsIFrame*                aBarFrame,
                       nsPresContext*           aPresContext,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus);
 
   /**
    * The div used to show the progress bar.
    * @see nsProgressFrame::CreateAnonymousContent
    */
   nsCOMPtr<Element> mBarDiv;
 };
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -310,48 +310,48 @@ nsRangeFrame::BuildDisplayList(nsDisplay
 
   aLists.Content()->AppendNewToTop(
     new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
 }
 
 void
 nsRangeFrame::Reflow(nsPresContext*           aPresContext,
                      ReflowOutput&     aDesiredSize,
-                     const ReflowInput& aReflowState,
+                     const ReflowInput& aReflowInput,
                      nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsRangeFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
 
   NS_ASSERTION(mTrackDiv, "::-moz-range-track div must exist!");
   NS_ASSERTION(mProgressDiv, "::-moz-range-progress div must exist!");
   NS_ASSERTION(mThumbDiv, "::-moz-range-thumb div must exist!");
   NS_ASSERTION(!GetPrevContinuation() && !GetNextContinuation(),
                "nsRangeFrame should not have continuations; if it does we "
                "need to call RegUnregAccessKey only for the first.");
 
   if (mState & NS_FRAME_FIRST_REFLOW) {
     nsFormControlFrame::RegUnRegAccessKey(this, true);
   }
 
-  WritingMode wm = aReflowState.GetWritingMode();
-  nscoord computedBSize = aReflowState.ComputedBSize();
+  WritingMode wm = aReflowInput.GetWritingMode();
+  nscoord computedBSize = aReflowInput.ComputedBSize();
   if (computedBSize == NS_AUTOHEIGHT) {
     computedBSize = 0;
   }
   LogicalSize
     finalSize(wm,
-              aReflowState.ComputedISize() +
-              aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm),
+              aReflowInput.ComputedISize() +
+              aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm),
               computedBSize +
-              aReflowState.ComputedLogicalBorderPadding().BStartEnd(wm));
+              aReflowInput.ComputedLogicalBorderPadding().BStartEnd(wm));
   aDesiredSize.SetSize(wm, finalSize);
 
-  ReflowAnonymousContent(aPresContext, aDesiredSize, aReflowState);
+  ReflowAnonymousContent(aPresContext, aDesiredSize, aReflowInput);
 
   aDesiredSize.SetOverflowAreasToDesiredBounds();
 
   nsIFrame* trackFrame = mTrackDiv->GetPrimaryFrame();
   if (trackFrame) {
     ConsiderChildOverflow(aDesiredSize.mOverflowAreas, trackFrame);
   }
 
@@ -364,121 +364,121 @@ nsRangeFrame::Reflow(nsPresContext*     
   if (thumbFrame) {
     ConsiderChildOverflow(aDesiredSize.mOverflowAreas, thumbFrame);
   }
 
   FinishAndStoreOverflow(&aDesiredSize);
 
   aStatus = NS_FRAME_COMPLETE;
 
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 void
 nsRangeFrame::ReflowAnonymousContent(nsPresContext*           aPresContext,
                                      ReflowOutput&     aDesiredSize,
-                                     const ReflowInput& aReflowState)
+                                     const ReflowInput& aReflowInput)
 {
   // The width/height of our content box, which is the available width/height
   // for our anonymous content:
-  nscoord rangeFrameContentBoxWidth = aReflowState.ComputedWidth();
-  nscoord rangeFrameContentBoxHeight = aReflowState.ComputedHeight();
+  nscoord rangeFrameContentBoxWidth = aReflowInput.ComputedWidth();
+  nscoord rangeFrameContentBoxHeight = aReflowInput.ComputedHeight();
   if (rangeFrameContentBoxHeight == NS_AUTOHEIGHT) {
     rangeFrameContentBoxHeight = 0;
   }
 
   nsIFrame* trackFrame = mTrackDiv->GetPrimaryFrame();
 
   if (trackFrame) { // display:none?
 
     // Position the track:
     // The idea here is that we allow content authors to style the width,
     // height, border and padding of the track, but we ignore margin and
     // positioning properties and do the positioning ourself to keep the center
     // of the track's border box on the center of the nsRangeFrame's content
     // box.
 
     WritingMode wm = trackFrame->GetWritingMode();
-    LogicalSize availSize = aReflowState.ComputedSize(wm);
+    LogicalSize availSize = aReflowInput.ComputedSize(wm);
     availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
-    ReflowInput trackReflowState(aPresContext, aReflowState,
+    ReflowInput trackReflowInput(aPresContext, aReflowInput,
                                        trackFrame, availSize);
 
     // Find the x/y position of the track frame such that it will be positioned
     // as described above. These coordinates are with respect to the
     // nsRangeFrame's border-box.
     nscoord trackX = rangeFrameContentBoxWidth / 2;
     nscoord trackY = rangeFrameContentBoxHeight / 2;
 
     // Account for the track's border and padding (we ignore its margin):
-    trackX -= trackReflowState.ComputedPhysicalBorderPadding().left +
-                trackReflowState.ComputedWidth() / 2;
-    trackY -= trackReflowState.ComputedPhysicalBorderPadding().top +
-                trackReflowState.ComputedHeight() / 2;
+    trackX -= trackReflowInput.ComputedPhysicalBorderPadding().left +
+                trackReflowInput.ComputedWidth() / 2;
+    trackY -= trackReflowInput.ComputedPhysicalBorderPadding().top +
+                trackReflowInput.ComputedHeight() / 2;
 
     // Make relative to our border box instead of our content box:
-    trackX += aReflowState.ComputedPhysicalBorderPadding().left;
-    trackY += aReflowState.ComputedPhysicalBorderPadding().top;
+    trackX += aReflowInput.ComputedPhysicalBorderPadding().left;
+    trackY += aReflowInput.ComputedPhysicalBorderPadding().top;
 
     nsReflowStatus frameStatus;
-    ReflowOutput trackDesiredSize(aReflowState);
+    ReflowOutput trackDesiredSize(aReflowInput);
     ReflowChild(trackFrame, aPresContext, trackDesiredSize,
-                trackReflowState, trackX, trackY, 0, frameStatus);
+                trackReflowInput, trackX, trackY, 0, frameStatus);
     MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
                "We gave our child unconstrained height, so it should be complete");
     FinishReflowChild(trackFrame, aPresContext, trackDesiredSize,
-                      &trackReflowState, trackX, trackY, 0);
+                      &trackReflowInput, trackX, trackY, 0);
   }
 
   nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame();
 
   if (thumbFrame) { // display:none?
     WritingMode wm = thumbFrame->GetWritingMode();
-    LogicalSize availSize = aReflowState.ComputedSize(wm);
+    LogicalSize availSize = aReflowInput.ComputedSize(wm);
     availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
-    ReflowInput thumbReflowState(aPresContext, aReflowState,
+    ReflowInput thumbReflowInput(aPresContext, aReflowInput,
                                        thumbFrame, availSize);
 
     // Where we position the thumb depends on its size, so we first reflow
     // the thumb at {0,0} to obtain its size, then position it afterwards.
 
     nsReflowStatus frameStatus;
-    ReflowOutput thumbDesiredSize(aReflowState);
+    ReflowOutput thumbDesiredSize(aReflowInput);
     ReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
-                thumbReflowState, 0, 0, 0, frameStatus);
+                thumbReflowInput, 0, 0, 0, frameStatus);
     MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
                "We gave our child unconstrained height, so it should be complete");
     FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
-                      &thumbReflowState, 0, 0, 0);
+                      &thumbReflowInput, 0, 0, 0);
     DoUpdateThumbPosition(thumbFrame, nsSize(aDesiredSize.Width(),
                                              aDesiredSize.Height()));
   }
 
   nsIFrame* rangeProgressFrame = mProgressDiv->GetPrimaryFrame();
 
   if (rangeProgressFrame) { // display:none?
     WritingMode wm = rangeProgressFrame->GetWritingMode();
-    LogicalSize availSize = aReflowState.ComputedSize(wm);
+    LogicalSize availSize = aReflowInput.ComputedSize(wm);
     availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
-    ReflowInput progressReflowState(aPresContext, aReflowState,
+    ReflowInput progressReflowInput(aPresContext, aReflowInput,
                                           rangeProgressFrame, availSize);
 
     // We first reflow the range-progress frame at {0,0} to obtain its
     // unadjusted dimensions, then we adjust it to so that the appropriate edge
     // ends at the thumb.
 
     nsReflowStatus frameStatus;
-    ReflowOutput progressDesiredSize(aReflowState);
+    ReflowOutput progressDesiredSize(aReflowInput);
     ReflowChild(rangeProgressFrame, aPresContext,
-                progressDesiredSize, progressReflowState, 0, 0,
+                progressDesiredSize, progressReflowInput, 0, 0,
                 0, frameStatus);
     MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
                "We gave our child unconstrained height, so it should be complete");
     FinishReflowChild(rangeProgressFrame, aPresContext,
-                      progressDesiredSize, &progressReflowState, 0, 0, 0);
+                      progressDesiredSize, &progressReflowInput, 0, 0, 0);
     DoUpdateRangeProgressFrame(rangeProgressFrame, nsSize(aDesiredSize.Width(),
                                                           aDesiredSize.Height()));
   }
 }
 
 #ifdef ACCESSIBILITY
 a11y::AccType
 nsRangeFrame::AccessibleType()
--- a/layout/forms/nsRangeFrame.h
+++ b/layout/forms/nsRangeFrame.h
@@ -43,17 +43,17 @@ public:
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                         const nsRect&           aDirtyRect,
                         const nsDisplayListSet& aLists) override;
 
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override {
     return MakeFrameName(NS_LITERAL_STRING("Range"), aResult);
   }
 #endif
 
@@ -154,17 +154,17 @@ private:
 
   nsresult MakeAnonymousDiv(Element** aResult,
                             CSSPseudoElementType aPseudoType,
                             nsTArray<ContentInfo>& aElements);
 
   // Helper function which reflows the anonymous div frames.
   void ReflowAnonymousContent(nsPresContext*           aPresContext,
                               ReflowOutput&     aDesiredSize,
-                              const ReflowInput& aReflowState);
+                              const ReflowInput& aReflowInput);
 
   void DoUpdateThumbPosition(nsIFrame* aThumbFrame,
                              const nsSize& aRangeSize);
 
   void DoUpdateRangeProgressFrame(nsIFrame* aProgressFrame,
                                   const nsSize& aRangeSize);
 
   /**
--- a/layout/forms/nsSelectsAreaFrame.cpp
+++ b/layout/forms/nsSelectsAreaFrame.cpp
@@ -156,41 +156,41 @@ nsSelectsAreaFrame::BuildDisplayListInte
     aLists.Outlines()->AppendNewToTop(new (aBuilder)
       nsDisplayListFocus(aBuilder, this));
   }
 }
 
 void
 nsSelectsAreaFrame::Reflow(nsPresContext*           aPresContext, 
                            ReflowOutput&     aDesiredSize,
-                           const ReflowInput& aReflowState, 
+                           const ReflowInput& aReflowInput, 
                            nsReflowStatus&          aStatus)
 {
   nsListControlFrame* list = GetEnclosingListFrame(this);
   NS_ASSERTION(list,
                "Must have an nsListControlFrame!  Frame constructor is "
                "broken");
 
   bool isInDropdownMode = list->IsInDropDownMode();
 
   // See similar logic in nsListControlFrame::Reflow and
   // nsListControlFrame::ReflowAsDropdown.  We need to match it here.
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
   nscoord oldBSize;
   if (isInDropdownMode) {
     // Store the block size now in case it changes during
     // nsBlockFrame::Reflow for some odd reason.
     if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
       oldBSize = BSize(wm);
     } else {
       oldBSize = NS_UNCONSTRAINEDSIZE;
     }
   }
 
-  nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
+  nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
 
   // Check whether we need to suppress scrollbar updates.  We want to do
   // that if we're in a possible first pass and our block size of a row
   // has changed.
   if (list->MightNeedSecondPass()) {
     nscoord newBSizeOfARow = list->CalcBSizeOfARow();
     // We'll need a second pass if our block size of a row changed.  For
     // comboboxes, we'll also need it if our block size changed.  If
--- a/layout/forms/nsSelectsAreaFrame.h
+++ b/layout/forms/nsSelectsAreaFrame.h
@@ -22,17 +22,17 @@ public:
                                 const nsDisplayListSet& aLists) override;
 
   void BuildDisplayListInternal(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists);
 
   virtual void Reflow(nsPresContext*           aCX,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   nscoord BSizeOfARow() const { return mBSizeOfARow; }
   
 protected:
   explicit nsSelectsAreaFrame(nsStyleContext* aContext) :
     nsBlockFrame(aContext),
     mBSizeOfARow(0)
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -481,105 +481,105 @@ nsTextControlFrame::ComputeAutoSize(nsRe
 #endif
 
   return autoSize;
 }
 
 void
 nsTextControlFrame::Reflow(nsPresContext*   aPresContext,
                            ReflowOutput&     aDesiredSize,
-                           const ReflowInput& aReflowState,
+                           const ReflowInput& aReflowInput,
                            nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsTextControlFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
 
   // make sure that the form registers itself on the initial/first reflow
   if (mState & NS_FRAME_FIRST_REFLOW) {
     nsFormControlFrame::RegUnRegAccessKey(this, true);
   }
 
   // set values of reflow's out parameters
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
   LogicalSize
     finalSize(wm,
-              aReflowState.ComputedISize() +
-              aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm),
-              aReflowState.ComputedBSize() +
-              aReflowState.ComputedLogicalBorderPadding().BStartEnd(wm));
+              aReflowInput.ComputedISize() +
+              aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm),
+              aReflowInput.ComputedBSize() +
+              aReflowInput.ComputedLogicalBorderPadding().BStartEnd(wm));
   aDesiredSize.SetSize(wm, finalSize);
 
   // computation of the ascent wrt the input height
-  nscoord lineHeight = aReflowState.ComputedBSize();
+  nscoord lineHeight = aReflowInput.ComputedBSize();
   float inflation = nsLayoutUtils::FontSizeInflationFor(this);
   if (!IsSingleLineTextControl()) {
     lineHeight = ReflowInput::CalcLineHeight(GetContent(), StyleContext(),
                                                    NS_AUTOHEIGHT, inflation);
   }
   RefPtr<nsFontMetrics> fontMet =
     nsLayoutUtils::GetFontMetricsForFrame(this, inflation);
   // now adjust for our borders and padding
   aDesiredSize.SetBlockStartAscent(
     nsLayoutUtils::GetCenteredFontBaseline(fontMet, lineHeight,
                                            wm.IsLineInverted()) +
-    aReflowState.ComputedLogicalBorderPadding().BStart(wm));
+    aReflowInput.ComputedLogicalBorderPadding().BStart(wm));
 
   // overflow handling
   aDesiredSize.SetOverflowAreasToDesiredBounds();
   // perform reflow on all kids
   nsIFrame* kid = mFrames.FirstChild();
   while (kid) {
-    ReflowTextControlChild(kid, aPresContext, aReflowState, aStatus, aDesiredSize);
+    ReflowTextControlChild(kid, aPresContext, aReflowInput, aStatus, aDesiredSize);
     kid = kid->GetNextSibling();
   }
 
   // take into account css properties that affect overflow handling
   FinishAndStoreOverflow(&aDesiredSize);
 
   aStatus = NS_FRAME_COMPLETE;
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 void
 nsTextControlFrame::ReflowTextControlChild(nsIFrame*                aKid,
                                            nsPresContext*           aPresContext,
-                                           const ReflowInput& aReflowState,
+                                           const ReflowInput& aReflowInput,
                                            nsReflowStatus&          aStatus,
                                            ReflowOutput& aParentDesiredSize)
 {
   // compute available size and frame offsets for child
   WritingMode wm = aKid->GetWritingMode();
-  LogicalSize availSize = aReflowState.ComputedSizeWithPadding(wm);
+  LogicalSize availSize = aReflowInput.ComputedSizeWithPadding(wm);
   availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
 
-  ReflowInput kidReflowState(aPresContext, aReflowState, 
+  ReflowInput kidReflowInput(aPresContext, aReflowInput, 
                                    aKid, availSize, nullptr,
                                    ReflowInput::CALLER_WILL_INIT);
   // Override padding with our computed padding in case we got it from theming or percentage
-  kidReflowState.Init(aPresContext, nullptr, nullptr, &aReflowState.ComputedPhysicalPadding());
+  kidReflowInput.Init(aPresContext, nullptr, nullptr, &aReflowInput.ComputedPhysicalPadding());
 
   // Set computed width and computed height for the child
-  kidReflowState.SetComputedWidth(aReflowState.ComputedWidth());
-  kidReflowState.SetComputedHeight(aReflowState.ComputedHeight());
+  kidReflowInput.SetComputedWidth(aReflowInput.ComputedWidth());
+  kidReflowInput.SetComputedHeight(aReflowInput.ComputedHeight());
 
   // Offset the frame by the size of the parent's border
-  nscoord xOffset = aReflowState.ComputedPhysicalBorderPadding().left -
-                    aReflowState.ComputedPhysicalPadding().left;
-  nscoord yOffset = aReflowState.ComputedPhysicalBorderPadding().top -
-                    aReflowState.ComputedPhysicalPadding().top;
+  nscoord xOffset = aReflowInput.ComputedPhysicalBorderPadding().left -
+                    aReflowInput.ComputedPhysicalPadding().left;
+  nscoord yOffset = aReflowInput.ComputedPhysicalBorderPadding().top -
+                    aReflowInput.ComputedPhysicalPadding().top;
 
   // reflow the child
-  ReflowOutput desiredSize(aReflowState);
-  ReflowChild(aKid, aPresContext, desiredSize, kidReflowState, 
+  ReflowOutput desiredSize(aReflowInput);
+  ReflowChild(aKid, aPresContext, desiredSize, kidReflowInput, 
               xOffset, yOffset, 0, aStatus);
 
   // place the child
   FinishReflowChild(aKid, aPresContext, desiredSize,
-                    &kidReflowState, xOffset, yOffset, 0);
+                    &kidReflowInput, xOffset, yOffset, 0);
 
   // consider the overflow
   aParentDesiredSize.mOverflowAreas.UnionWith(desiredSize.mOverflowAreas);
 }
 
 nsSize
 nsTextControlFrame::GetXULMinSize(nsBoxLayoutState& aState)
 {
--- a/layout/forms/nsTextControlFrame.h
+++ b/layout/forms/nsTextControlFrame.h
@@ -54,17 +54,17 @@ public:
                   nscoord aAvailableISize,
                   const mozilla::LogicalSize& aMargin,
                   const mozilla::LogicalSize& aBorder,
                   const mozilla::LogicalSize& aPadding,
                   bool aShrinkWrap) override;
 
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual bool IsXULCollapsed() override;
 
   virtual bool IsLeaf() const override;
   
 #ifdef ACCESSIBILITY
@@ -155,17 +155,17 @@ public:
   NS_DECL_QUERYFRAME
 
 protected:
   /**
    * Launch the reflow on the child frames - see nsTextControlFrame::Reflow()
    */
   void ReflowTextControlChild(nsIFrame*                aFrame,
                               nsPresContext*           aPresContext,
-                              const ReflowInput& aReflowState,
+                              const ReflowInput& aReflowInput,
                               nsReflowStatus&          aStatus,
                               ReflowOutput& aParentDesiredSize);
 
 public: //for methods who access nsTextControlFrame directly
   void SetValueChanged(bool aValueChanged);
   
   // called by the focus listener
   nsresult MaybeBeginSecureKeyboardInput();
--- a/layout/generic/BlockReflowInput.cpp
+++ b/layout/generic/BlockReflowInput.cpp
@@ -23,132 +23,132 @@
 #endif
 
 using namespace mozilla;
 using namespace mozilla::layout;
 
 static bool sFloatFragmentsInsideColumnEnabled;
 static bool sFloatFragmentsInsideColumnPrefCached;
 
-BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowState,
+BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowInput,
                                        nsPresContext* aPresContext,
                                        nsBlockFrame* aFrame,
                                        bool aBStartMarginRoot,
                                        bool aBEndMarginRoot,
                                        bool aBlockNeedsFloatManager,
                                        nscoord aConsumedBSize)
   : mBlock(aFrame),
     mPresContext(aPresContext),
-    mReflowState(aReflowState),
-    mContentArea(aReflowState.GetWritingMode()),
+    mReflowInput(aReflowInput),
+    mContentArea(aReflowInput.GetWritingMode()),
     mPushedFloats(nullptr),
     mOverflowTracker(nullptr),
-    mBorderPadding(mReflowState.ComputedLogicalBorderPadding()),
+    mBorderPadding(mReflowInput.ComputedLogicalBorderPadding()),
     mPrevBEndMargin(),
     mLineNumber(0),
     mFlags(0),
     mFloatBreakType(NS_STYLE_CLEAR_NONE),
     mConsumedBSize(aConsumedBSize)
 {
   if (!sFloatFragmentsInsideColumnPrefCached) {
     sFloatFragmentsInsideColumnPrefCached = true;
     Preferences::AddBoolVarCache(&sFloatFragmentsInsideColumnEnabled,
                                  "layout.float-fragments-inside-column.enabled");
   }
   SetFlag(BRS_FLOAT_FRAGMENTS_INSIDE_COLUMN_ENABLED, sFloatFragmentsInsideColumnEnabled);
   
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
   SetFlag(BRS_ISFIRSTINFLOW, aFrame->GetPrevInFlow() == nullptr);
   SetFlag(BRS_ISOVERFLOWCONTAINER, IS_TRUE_OVERFLOW_CONTAINER(aFrame));
 
   nsIFrame::LogicalSides logicalSkipSides =
-    aFrame->GetLogicalSkipSides(&aReflowState);
+    aFrame->GetLogicalSkipSides(&aReflowInput);
   mBorderPadding.ApplySkipSides(logicalSkipSides);
 
   // Note that mContainerSize is the physical size, needed to
   // convert logical block-coordinates in vertical-rl writing mode
   // (measured from a RHS origin) to physical coordinates within the
   // containing block.
-  // If aReflowState doesn't have a constrained ComputedWidth(), we set
+  // If aReflowInput doesn't have a constrained ComputedWidth(), we set
   // mContainerSize.width to zero, which means lines will be positioned
   // (physically) incorrectly; we will fix them up at the end of
   // nsBlockFrame::Reflow, after we know the total block-size of the
   // frame.
-  mContainerSize.width = aReflowState.ComputedWidth();
+  mContainerSize.width = aReflowInput.ComputedWidth();
   if (mContainerSize.width == NS_UNCONSTRAINEDSIZE) {
     mContainerSize.width = 0;
   }
 
   mContainerSize.width += mBorderPadding.LeftRight(wm);
 
   // For now at least, we don't do that fix-up for mContainerHeight.
   // It's only used in nsBidiUtils::ReorderFrames for vertical rtl
   // writing modes, which aren't fully supported for the time being.
-  mContainerSize.height = aReflowState.ComputedHeight() +
+  mContainerSize.height = aReflowInput.ComputedHeight() +
                           mBorderPadding.TopBottom(wm);
 
   if ((aBStartMarginRoot && !logicalSkipSides.BStart()) ||
       0 != mBorderPadding.BStart(wm)) {
     SetFlag(BRS_ISBSTARTMARGINROOT, true);
     SetFlag(BRS_APPLYBSTARTMARGIN, true);
   }
   if ((aBEndMarginRoot && !logicalSkipSides.BEnd()) ||
       0 != mBorderPadding.BEnd(wm)) {
     SetFlag(BRS_ISBENDMARGINROOT, true);
   }
   if (aBlockNeedsFloatManager) {
     SetFlag(BRS_FLOAT_MGR, true);
   }
   
-  mFloatManager = aReflowState.mFloatManager;
+  mFloatManager = aReflowInput.mFloatManager;
 
   NS_ASSERTION(mFloatManager,
                "FloatManager should be set in BlockReflowInput" );
   if (mFloatManager) {
     // Save the coordinate system origin for later.
     mFloatManager->GetTranslation(mFloatManagerI, mFloatManagerB);
     mFloatManager->PushState(&mFloatManagerStateBefore); // never popped
   }
 
   mReflowStatus = NS_FRAME_COMPLETE;
 
   mNextInFlow = static_cast<nsBlockFrame*>(mBlock->GetNextInFlow());
 
-  LAYOUT_WARN_IF_FALSE(NS_UNCONSTRAINEDSIZE != aReflowState.ComputedISize(),
+  LAYOUT_WARN_IF_FALSE(NS_UNCONSTRAINEDSIZE != aReflowInput.ComputedISize(),
                        "have unconstrained width; this should only result "
                        "from very large sizes, not attempts at intrinsic "
                        "width calculation");
-  mContentArea.ISize(wm) = aReflowState.ComputedISize();
+  mContentArea.ISize(wm) = aReflowInput.ComputedISize();
 
   // Compute content area height. Unlike the width, if we have a
   // specified style height we ignore it since extra content is
   // managed by the "overflow" property. When we don't have a
   // specified style height then we may end up limiting our height if
   // the availableHeight is constrained (this situation occurs when we
   // are paginated).
-  if (NS_UNCONSTRAINEDSIZE != aReflowState.AvailableBSize()) {
+  if (NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableBSize()) {
     // We are in a paginated situation. The bottom edge is just inside
     // the bottom border and padding. The content area height doesn't
     // include either border or padding edge.
-    mBEndEdge = aReflowState.AvailableBSize() - mBorderPadding.BEnd(wm);
+    mBEndEdge = aReflowInput.AvailableBSize() - mBorderPadding.BEnd(wm);
     mContentArea.BSize(wm) = std::max(0, mBEndEdge - mBorderPadding.BStart(wm));
   }
   else {
     // When we are not in a paginated situation then we always use
     // an constrained height.
     SetFlag(BRS_UNCONSTRAINEDBSIZE, true);
     mContentArea.BSize(wm) = mBEndEdge = NS_UNCONSTRAINEDSIZE;
   }
   mContentArea.IStart(wm) = mBorderPadding.IStart(wm);
   mBCoord = mContentArea.BStart(wm) = mBorderPadding.BStart(wm);
 
   mPrevChild = nullptr;
   mCurrentLine = aFrame->end_lines();
 
-  mMinLineHeight = aReflowState.CalcLineHeight();
+  mMinLineHeight = aReflowInput.CalcLineHeight();
 }
 
 nscoord
 BlockReflowInput::GetConsumedBSize()
 {
   if (mConsumedBSize == NS_INTRINSICSIZE) {
     mConsumedBSize = mBlock->GetConsumedBSize();
   }
@@ -158,17 +158,17 @@ BlockReflowInput::GetConsumedBSize()
 
 void
 BlockReflowInput::ComputeReplacedBlockOffsetsForFloats(
                       nsIFrame* aFrame,
                       const LogicalRect& aFloatAvailableSpace,
                       nscoord& aIStartResult,
                       nscoord& aIEndResult) const
 {
-  WritingMode wm = mReflowState.GetWritingMode();
+  WritingMode wm = mReflowInput.GetWritingMode();
   // The frame is clueless about the float manager and therefore we
   // only give it free space. An example is a table frame - the
   // tables do not flow around floats.
   // However, we can let its margins intersect floats.
   NS_ASSERTION(aFloatAvailableSpace.IStart(wm) >= mContentArea.IStart(wm),
                "bad avail space rect inline-coord");
   NS_ASSERTION(aFloatAvailableSpace.ISize(wm) == 0 ||
                aFloatAvailableSpace.IEnd(wm) <= mContentArea.IEnd(wm),
@@ -176,17 +176,17 @@ BlockReflowInput::ComputeReplacedBlockOf
 
   nscoord iStartOffset, iEndOffset;
   if (aFloatAvailableSpace.ISize(wm) == mContentArea.ISize(wm)) {
     // We don't need to compute margins when there are no floats around.
     iStartOffset = 0;
     iEndOffset = 0;
   } else {
     LogicalMargin frameMargin(wm);
-    SizeComputationInput os(aFrame, mReflowState.mRenderingContext,
+    SizeComputationInput os(aFrame, mReflowInput.mRenderingContext,
                         wm, mContentArea.ISize(wm));
     frameMargin =
       os.ComputedLogicalMargin().ConvertTo(wm, aFrame->GetWritingMode());
 
     nscoord iStartFloatIOffset =
       aFloatAvailableSpace.IStart(wm) - mContentArea.IStart(wm);
     iStartOffset = std::max(iStartFloatIOffset, frameMargin.IStart(wm)) -
                    frameMargin.IStart(wm);
@@ -227,22 +227,22 @@ BlockReflowInput::ComputeBlockAvailSpace
                                            const nsFlowAreaRect& aFloatAvailableSpace,
                                            bool aBlockAvoidsFloats,
                                            LogicalRect& aResult)
 {
 #ifdef REALLY_NOISY_REFLOW
   printf("CBAS frame=%p has floats %d\n",
          aFrame, aFloatAvailableSpace.mHasFloats);
 #endif
-  WritingMode wm = mReflowState.GetWritingMode();
+  WritingMode wm = mReflowInput.GetWritingMode();
   aResult.BStart(wm) = mBCoord;
   aResult.BSize(wm) = GetFlag(BRS_UNCONSTRAINEDBSIZE)
     ? NS_UNCONSTRAINEDSIZE
-    : mReflowState.AvailableBSize() - mBCoord
-      - GetBEndMarginClone(aFrame, mReflowState.mRenderingContext, mContentArea, wm);
+    : mReflowInput.AvailableBSize() - mBCoord
+      - GetBEndMarginClone(aFrame, mReflowInput.mRenderingContext, mContentArea, wm);
   // mBCoord might be greater than mBEndEdge if the block's top margin pushes
   // it off the page/column. Negative available height can confuse other code
   // and is nonsense in principle.
 
   // XXX Do we really want this condition to be this restrictive (i.e.,
   // more restrictive than it used to be)?  The |else| here is allowed
   // by the CSS spec, but only out of desperation given implementations,
   // and the behavior it leads to is quite undesirable (it can cause
@@ -307,17 +307,17 @@ BlockReflowInput::ReplacedBlockFitsInAva
                             const nsFlowAreaRect& aFloatAvailableSpace) const
 {
   if (!aFloatAvailableSpace.mHasFloats) {
     // If there aren't any floats here, then we always fit.
     // We check this before calling ISizeToClearPastFloats, which is
     // somewhat expensive.
     return true;
   }
-  WritingMode wm = mReflowState.GetWritingMode();
+  WritingMode wm = mReflowInput.GetWritingMode();
   nsBlockFrame::ReplacedElementISizeToClear replacedISize =
     nsBlockFrame::ISizeToClearPastFloats(*this, aFloatAvailableSpace.mRect,
                                          aReplacedBlock);
   // The inline-start side of the replaced element should be offset by
   // the larger of the float intrusion or the replaced element's own
   // start margin.  The inline-end side is similar, except for Web
   // compatibility we ignore the margin.
   return std::max(aFloatAvailableSpace.mRect.IStart(wm) -
@@ -329,17 +329,17 @@ BlockReflowInput::ReplacedBlockFitsInAva
          mContentArea.ISize(wm);
 }
 
 nsFlowAreaRect
 BlockReflowInput::GetFloatAvailableSpaceWithState(
                       nscoord aBCoord,
                       nsFloatManager::SavedState *aState) const
 {
-  WritingMode wm = mReflowState.GetWritingMode();
+  WritingMode wm = mReflowInput.GetWritingMode();
 #ifdef DEBUG
   // Verify that the caller setup the coordinate system properly
   nscoord wI, wB;
   mFloatManager->GetTranslation(wI, wB);
 
   NS_ASSERTION((wI == mFloatManagerI) && (wB == mFloatManagerB),
                "bad coord system");
 #endif
@@ -366,17 +366,17 @@ BlockReflowInput::GetFloatAvailableSpace
   return result;
 }
 
 nsFlowAreaRect
 BlockReflowInput::GetFloatAvailableSpaceForBSize(
                       nscoord aBCoord, nscoord aBSize,
                       nsFloatManager::SavedState *aState) const
 {
-  WritingMode wm = mReflowState.GetWritingMode();
+  WritingMode wm = mReflowInput.GetWritingMode();
 #ifdef DEBUG
   // Verify that the caller setup the coordinate system properly
   nscoord wI, wB;
   mFloatManager->GetTranslation(wI, wB);
 
   NS_ASSERTION((wI == mFloatManagerI) && (wB == mFloatManagerB),
                "bad coord system");
 #endif
@@ -480,17 +480,17 @@ BlockReflowInput::AppendPushedFloatChain
  * parent.  The recovery of state is one of the things that makes
  * incremental reflow O(N^2) and this state should really be kept
  * around, attached to the frame tree.
  */
 void
 BlockReflowInput::RecoverFloats(nsLineList::iterator aLine,
                                   nscoord aDeltaBCoord)
 {
-  WritingMode wm = mReflowState.GetWritingMode();
+  WritingMode wm = mReflowInput.GetWritingMode();
   if (aLine->HasFloats()) {
     // Place the floats into the space-manager again. Also slide
     // them, just like the regular frames on the line.
     nsFloatCache* fc = aLine->GetFirstFloat();
     while (fc) {
       nsIFrame* floatFrame = fc->mFloat;
       if (aDeltaBCoord != 0) {
         floatFrame->MovePositionBy(nsPoint(0, aDeltaBCoord));
@@ -624,17 +624,17 @@ BlockReflowInput::AddFloat(nsLineLayout*
   if (mBelowCurrentLineFloats.IsEmpty() &&
       (aLineLayout->LineIsEmpty() ||
        mBlock->ComputeFloatISize(*this, floatAvailableSpace, aFloat)
        <= aAvailableISize)) {
     // And then place it
     placed = FlowAndPlaceFloat(aFloat);
     if (placed) {
       // Pass on updated available space to the current inline reflow engine
-      WritingMode wm = mReflowState.GetWritingMode();
+      WritingMode wm = mReflowInput.GetWritingMode();
       nsFlowAreaRect floatAvailSpace = GetFloatAvailableSpace(mBCoord);
       LogicalRect availSpace(wm, floatAvailSpace.mRect.IStart(wm), mBCoord,
                              floatAvailSpace.mRect.ISize(wm),
                              floatAvailSpace.mRect.BSize(wm));
       aLineLayout->UpdateBand(wm, availSpace, aFloat);
       // Record this float in the current-line list
       mCurrentLineFloats.Append(mFloatCacheFreeList.Alloc(aFloat));
     } else {
@@ -661,63 +661,63 @@ BlockReflowInput::CanPlaceFloat(nscoord 
                                   const nsFlowAreaRect& aFloatAvailableSpace)
 {
   // A float fits at a given block-dir position if there are no floats
   // at its inline-dir position (no matter what its inline size) or if
   // its inline size fits in the space remaining after prior floats have
   // been placed.
   // FIXME: We should allow overflow by up to half a pixel here (bug 21193).
   return !aFloatAvailableSpace.mHasFloats ||
-    aFloatAvailableSpace.mRect.ISize(mReflowState.GetWritingMode()) >=
+    aFloatAvailableSpace.mRect.ISize(mReflowInput.GetWritingMode()) >=
       aFloatISize;
 }
 
 // Return the inline-size that the float (including margins) will take up
 // in the writing mode of the containing block. If this returns
 // NS_UNCONSTRAINEDSIZE, we're dealing with an orthogonal block that
 // has block-size:auto, and we'll need to actually reflow it to find out
 // how much inline-size it will occupy in the containing block's mode.
 static nscoord
-FloatMarginISize(const ReflowInput& aCBReflowState,
+FloatMarginISize(const ReflowInput& aCBReflowInput,
                  nscoord aFloatAvailableISize,
                  nsIFrame *aFloat,
                  const SizeComputationInput& aFloatOffsetState)
 {
   AutoMaybeDisableFontInflation an(aFloat);
   WritingMode wm = aFloatOffsetState.GetWritingMode();
 
   LogicalSize floatSize =
     aFloat->ComputeSize(
-              aCBReflowState.mRenderingContext,
+              aCBReflowInput.mRenderingContext,
               wm,
-              aCBReflowState.ComputedSize(wm),
+              aCBReflowInput.ComputedSize(wm),
               aFloatAvailableISize,
               aFloatOffsetState.ComputedLogicalMargin().Size(wm),
               aFloatOffsetState.ComputedLogicalBorderPadding().Size(wm) -
                 aFloatOffsetState.ComputedLogicalPadding().Size(wm),
               aFloatOffsetState.ComputedLogicalPadding().Size(wm),
               nsIFrame::ComputeSizeFlags::eShrinkWrap);
 
-  WritingMode cbwm = aCBReflowState.GetWritingMode();
+  WritingMode cbwm = aCBReflowInput.GetWritingMode();
   nscoord floatISize = floatSize.ConvertTo(cbwm, wm).ISize(cbwm);
   if (floatISize == NS_UNCONSTRAINEDSIZE) {
     return NS_UNCONSTRAINEDSIZE; // reflow is needed to get the true size
   }
 
   return floatISize +
          aFloatOffsetState.ComputedLogicalMargin().Size(wm).
            ConvertTo(cbwm, wm).ISize(cbwm) +
          aFloatOffsetState.ComputedLogicalBorderPadding().Size(wm).
            ConvertTo(cbwm, wm).ISize(cbwm);
 }
 
 bool
 BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
 {
-  WritingMode wm = mReflowState.GetWritingMode();
+  WritingMode wm = mReflowInput.GetWritingMode();
   // Save away the Y coordinate before placing the float. We will
   // restore mBCoord at the end after placing the float. This is
   // necessary because any adjustments to mBCoord during the float
   // placement are for the float only, not for any non-floating
   // content.
   AutoRestore<nscoord> restoreBCoord(mBCoord);
 
   // Grab the float's display information
@@ -741,20 +741,20 @@ BlockReflowInput::FlowAndPlaceFloat(nsIF
     // Get the band of available space
   nsFlowAreaRect floatAvailableSpace = GetFloatAvailableSpace(mBCoord);
   LogicalRect adjustedAvailableSpace =
     mBlock->AdjustFloatAvailableSpace(*this, floatAvailableSpace.mRect, aFloat);
 
   NS_ASSERTION(aFloat->GetParent() == mBlock,
                "Float frame has wrong parent");
 
-  SizeComputationInput offsets(aFloat, mReflowState.mRenderingContext,
-                           wm, mReflowState.ComputedISize());
+  SizeComputationInput offsets(aFloat, mReflowInput.mRenderingContext,
+                           wm, mReflowInput.ComputedISize());
 
-  nscoord floatMarginISize = FloatMarginISize(mReflowState,
+  nscoord floatMarginISize = FloatMarginISize(mReflowInput,
                                               adjustedAvailableSpace.ISize(wm),
                                               aFloat, offsets);
 
   LogicalMargin floatMargin(wm); // computed margin
   LogicalMargin floatOffsets(wm);
   nsReflowStatus reflowStatus;
 
   // If it's a floating first-letter, we need to reflow it before we
@@ -786,20 +786,20 @@ BlockReflowInput::FlowAndPlaceFloat(nsIF
 
   // Can the float fit here?
   bool keepFloatOnSameLine = false;
 
   // Are we required to place at least part of the float because we're
   // at the top of the page (to avoid an infinite loop of pushing and
   // breaking).
   bool mustPlaceFloat =
-    mReflowState.mFlags.mIsTopOfPage && IsAdjacentWithTop();
+    mReflowInput.mFlags.mIsTopOfPage && IsAdjacentWithTop();
 
   for (;;) {
-    if (mReflowState.AvailableHeight() != NS_UNCONSTRAINEDSIZE &&
+    if (mReflowInput.AvailableHeight() != NS_UNCONSTRAINEDSIZE &&
         floatAvailableSpace.mRect.BSize(wm) <= 0 &&
         !mustPlaceFloat) {
       // No space, nowhere to put anything.
       PushFloatPastBreak(aFloat);
       return false;
     }
 
     if (CanPlaceFloat(floatMarginISize, floatAvailableSpace)) {
@@ -854,17 +854,17 @@ BlockReflowInput::FlowAndPlaceFloat(nsIF
 
       // the table does not fit anymore in this line so advance to next band 
       mBCoord += floatAvailableSpace.mRect.BSize(wm);
       // To match nsBlockFrame::AdjustFloatAvailableSpace, we have to
       // get a new width for the new band.
       floatAvailableSpace = GetFloatAvailableSpace(mBCoord);
       adjustedAvailableSpace = mBlock->AdjustFloatAvailableSpace(*this,
                                  floatAvailableSpace.mRect, aFloat);
-      floatMarginISize = FloatMarginISize(mReflowState,
+      floatMarginISize = FloatMarginISize(mReflowInput,
                                           adjustedAvailableSpace.ISize(wm),
                                           aFloat, offsets);
     }
 
     mustPlaceFloat = false;
   }
 
   // If the float is continued, it will get the same absolute x value as its prev-in-flow
@@ -925,22 +925,22 @@ BlockReflowInput::FlowAndPlaceFloat(nsIF
        aFloat->BSize(wm) + floatMargin.BStartEnd(wm) >
        ContentBEnd() - floatPos.B(wm)) ||
       NS_FRAME_IS_TRUNCATED(reflowStatus) ||
       NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
     PushFloatPastBreak(aFloat);
     return false;
   }
 
-  // We can't use aFloat->ShouldAvoidBreakInside(mReflowState) here since
+  // We can't use aFloat->ShouldAvoidBreakInside(mReflowInput) here since
   // its mIsTopOfPage may be true even though the float isn't at the
   // top when floatPos.B(wm) > 0.
   if (ContentBSize() != NS_UNCONSTRAINEDSIZE &&
       !mustPlaceFloat &&
-      (!mReflowState.mFlags.mIsTopOfPage || floatPos.B(wm) > 0) &&
+      (!mReflowInput.mFlags.mIsTopOfPage || floatPos.B(wm) > 0) &&
       NS_STYLE_PAGE_BREAK_AVOID == aFloat->StyleDisplay()->mBreakInside &&
       (!NS_FRAME_IS_FULLY_COMPLETE(reflowStatus) ||
        aFloat->BSize(wm) + floatMargin.BStartEnd(wm) >
        ContentBEnd() - floatPos.B(wm)) &&
       !aFloat->GetPrevInFlow()) {
     PushFloatPastBreak(aFloat);
     return false;
   }
@@ -1032,17 +1032,17 @@ void
 BlockReflowInput::PushFloatPastBreak(nsIFrame *aFloat)
 {
   // This ensures that we:
   //  * don't try to place later but smaller floats (which CSS says
   //    must have their tops below the top of this float)
   //  * don't waste much time trying to reflow this float again until
   //    after the break
   uint8_t floatStyle =
-    aFloat->StyleDisplay()->PhysicalFloats(mReflowState.GetWritingMode());
+    aFloat->StyleDisplay()->PhysicalFloats(mReflowInput.GetWritingMode());
   if (floatStyle == NS_STYLE_FLOAT_LEFT) {
     mFloatManager->SetPushedLeftFloatPastBreak();
   } else {
     MOZ_ASSERT(floatStyle == NS_STYLE_FLOAT_RIGHT, "unexpected float value");
     mFloatManager->SetPushedRightFloatPastBreak();
   }
 
   // Put the float on the pushed floats list, even though it
--- a/layout/generic/BlockReflowInput.h
+++ b/layout/generic/BlockReflowInput.h
@@ -75,17 +75,17 @@ namespace mozilla {
 
 // BlockReflowInput contains additional reflow state information that the
 // block frame uses along with ReflowInput. Like ReflowInput, this
 // is read-only data that is passed down from a parent frame to its children.
 class BlockReflowInput {
   using ReflowInput = mozilla::ReflowInput;
 
 public:
-  BlockReflowInput(const ReflowInput& aReflowState,
+  BlockReflowInput(const ReflowInput& aReflowInput,
                      nsPresContext* aPresContext,
                      nsBlockFrame* aFrame,
                      bool aBStartMarginRoot, bool aBEndMarginRoot,
                      bool aBlockNeedsFloatManager,
                      nscoord aConsumedBSize = NS_INTRINSICSIZE);
 
   /**
    * Get the available reflow space (the area not occupied by floats)
@@ -132,37 +132,37 @@ public:
 
   // Advances to the next band, i.e., the next horizontal stripe in
   // which there is a different set of floats.
   // Return false if it did not advance, which only happens for
   // constrained heights (and means that we should get pushed to the
   // next column/page).
   bool AdvanceToNextBand(const mozilla::LogicalRect& aFloatAvailableSpace,
                          nscoord *aBCoord) const {
-    mozilla::WritingMode wm = mReflowState.GetWritingMode();
+    mozilla::WritingMode wm = mReflowInput.GetWritingMode();
     if (aFloatAvailableSpace.BSize(wm) > 0) {
       // See if there's room in the next band.
       *aBCoord += aFloatAvailableSpace.BSize(wm);
     } else {
-      if (mReflowState.AvailableHeight() != NS_UNCONSTRAINEDSIZE) {
+      if (mReflowInput.AvailableHeight() != NS_UNCONSTRAINEDSIZE) {
         // Stop trying to clear here; we'll just get pushed to the
         // next column or page and try again there.
         return false;
       }
       NS_NOTREACHED("avail space rect with zero height!");
       *aBCoord += 1;
     }
     return true;
   }
 
   bool ReplacedBlockFitsInAvailSpace(nsIFrame* aReplacedBlock,
                             const nsFlowAreaRect& aFloatAvailableSpace) const;
 
   bool IsAdjacentWithTop() const {
-    return mBCoord == mBorderPadding.BStart(mReflowState.GetWritingMode());
+    return mBCoord == mBorderPadding.BStart(mReflowInput.GetWritingMode());
   }
 
   /**
    * Return mBlock's computed physical border+padding with GetSkipSides applied.
    */
   const mozilla::LogicalMargin& BorderPadding() const {
     return mBorderPadding;
   }
@@ -204,17 +204,17 @@ public:
   // This state is the "global" state computed once for the reflow of
   // the block.
 
   // The block frame that is using this object
   nsBlockFrame* mBlock;
 
   nsPresContext* mPresContext;
 
-  const ReflowInput& mReflowState;
+  const ReflowInput& mReflowInput;
 
   nsFloatManager* mFloatManager;
 
   // The coordinates within the float manager where the block is being
   // placed <b>after</b> taking into account the blocks border and
   // padding. This, therefore, represents the inner "content area" (in
   // spacemanager coordinates) where child frames will be placed,
   // including child blocks and floats.
@@ -237,35 +237,35 @@ public:
   // mContentArea.BStart == BorderPadding().BStart.
   // The block size may be NS_UNCONSTRAINEDSIZE, which indicates that there
   // is no page/column boundary below (the common case).
   // mContentArea.BEnd() should only be called after checking that
   // mContentArea.BSize is not NS_UNCONSTRAINEDSIZE; otherwise
   // coordinate overflow may occur.
   mozilla::LogicalRect mContentArea;
   nscoord ContentIStart() const {
-    return mContentArea.IStart(mReflowState.GetWritingMode());
+    return mContentArea.IStart(mReflowInput.GetWritingMode());
   }
   nscoord ContentISize() const {
-    return mContentArea.ISize(mReflowState.GetWritingMode());
+    return mContentArea.ISize(mReflowInput.GetWritingMode());
   }
   nscoord ContentIEnd() const {
-    return mContentArea.IEnd(mReflowState.GetWritingMode());
+    return mContentArea.IEnd(mReflowInput.GetWritingMode());
   }
   nscoord ContentBStart() const {
-    return mContentArea.BStart(mReflowState.GetWritingMode());
+    return mContentArea.BStart(mReflowInput.GetWritingMode());
   }
   nscoord ContentBSize() const {
-    return mContentArea.BSize(mReflowState.GetWritingMode());
+    return mContentArea.BSize(mReflowInput.GetWritingMode());
   }
   nscoord ContentBEnd() const {
-    return mContentArea.BEnd(mReflowState.GetWritingMode());
+    return mContentArea.BEnd(mReflowInput.GetWritingMode());
   }
   mozilla::LogicalSize ContentSize(mozilla::WritingMode aWM) const {
-    mozilla::WritingMode wm = mReflowState.GetWritingMode();
+    mozilla::WritingMode wm = mReflowInput.GetWritingMode();
     return mContentArea.Size(wm).ConvertTo(aWM, wm);
   }
 
   // Physical size. Use only for physical <-> logical coordinate conversion.
   nsSize mContainerSize;
   const nsSize& ContainerSize() const { return mContainerSize; }
 
   // Continuation out-of-flow float frames that need to move to our
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -62,26 +62,26 @@ ReflowInput::ReflowInput(nsPresContext* 
   , mBlockDelta(0)
   , mOrthogonalLimit(NS_UNCONSTRAINEDSIZE)
   , mReflowDepth(0)
 {
   NS_PRECONDITION(aRenderingContext, "no rendering context");
   MOZ_ASSERT(aPresContext, "no pres context");
   MOZ_ASSERT(aFrame, "no frame");
   MOZ_ASSERT(aPresContext == aFrame->PresContext(), "wrong pres context");
-  mParentReflowState = nullptr;
+  mParentReflowInput = nullptr;
   AvailableISize() = aAvailableSpace.ISize(mWritingMode);
   AvailableBSize() = aAvailableSpace.BSize(mWritingMode);
   mFloatManager = nullptr;
   mLineLayout = nullptr;
   mDiscoveredClearance = nullptr;
   mPercentBSizeObserver = nullptr;
 
   if (aFlags & DUMMY_PARENT_REFLOW_STATE) {
-    mFlags.mDummyParentReflowState = true;
+    mFlags.mDummyParentReflowInput = true;
   }
   if (aFlags & COMPUTE_SIZE_SHRINK_WRAP) {
     mFlags.mShrinkWrap = true;
   }
   if (aFlags & COMPUTE_SIZE_USE_AUTO_BSIZE) {
     mFlags.mUseAutoBSize = true;
   }
   if (aFlags & STATIC_POS_IS_CB_ORIGIN) {
@@ -161,93 +161,93 @@ SizeComputationInput::SizeComputationInp
   MOZ_ASSERT(!aFrame->IsFlexOrGridItem(),
              "We're about to resolve percent margin & padding "
              "values against CB inline size, which is incorrect for "
              "flex/grid items. "
              "Additionally for grid items, this path doesn't handle baseline "
              "padding contribution - see SizeComputationInput::InitOffsets");
   LogicalSize cbSize(aContainingBlockWritingMode, aContainingBlockISize,
                      aContainingBlockISize);
-  ReflowStateFlags flags;
+  ReflowInputFlags flags;
   InitOffsets(aContainingBlockWritingMode, cbSize, mFrame->GetType(), flags);
 }
 
 // Initialize a reflow state for a child frame's reflow. Some state
 // is copied from the parent reflow state; the remaining state is
 // computed.
 ReflowInput::ReflowInput(
                      nsPresContext*           aPresContext,
-                     const ReflowInput& aParentReflowState,
+                     const ReflowInput& aParentReflowInput,
                      nsIFrame*                aFrame,
                      const LogicalSize&       aAvailableSpace,
                      const LogicalSize*       aContainingBlockSize,
                      uint32_t                 aFlags)
-  : SizeComputationInput(aFrame, aParentReflowState.mRenderingContext)
+  : SizeComputationInput(aFrame, aParentReflowInput.mRenderingContext)
   , mBlockDelta(0)
   , mOrthogonalLimit(NS_UNCONSTRAINEDSIZE)
-  , mReflowDepth(aParentReflowState.mReflowDepth + 1)
-  , mFlags(aParentReflowState.mFlags)
+  , mReflowDepth(aParentReflowInput.mReflowDepth + 1)
+  , mFlags(aParentReflowInput.mFlags)
 {
   MOZ_ASSERT(aPresContext, "no pres context");
   MOZ_ASSERT(aFrame, "no frame");
   MOZ_ASSERT(aPresContext == aFrame->PresContext(), "wrong pres context");
   NS_PRECONDITION(!mFlags.mSpecialBSizeReflow ||
                   !NS_SUBTREE_DIRTY(aFrame),
                   "frame should be clean when getting special bsize reflow");
 
-  mParentReflowState = &aParentReflowState;
+  mParentReflowInput = &aParentReflowInput;
 
   // If the parent is dirty, then the child is as well.
   // XXX Are the other cases where the parent reflows a child a second
   // time, as a resize?
   if (!mFlags.mSpecialBSizeReflow)
-    mFrame->AddStateBits(mParentReflowState->mFrame->GetStateBits() &
+    mFrame->AddStateBits(mParentReflowInput->mFrame->GetStateBits() &
                         NS_FRAME_IS_DIRTY);
 
   AvailableISize() = aAvailableSpace.ISize(mWritingMode);
   AvailableBSize() = aAvailableSpace.BSize(mWritingMode);
 
-  if (mWritingMode.IsOrthogonalTo(aParentReflowState.GetWritingMode())) {
+  if (mWritingMode.IsOrthogonalTo(aParentReflowInput.GetWritingMode())) {
     // If we're setting up for an orthogonal flow, and the parent reflow state
     // had a constrained ComputedBSize, we can use that as our AvailableISize
     // in preference to leaving it unconstrained.
     if (AvailableISize() == NS_UNCONSTRAINEDSIZE &&
-        aParentReflowState.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
-      AvailableISize() = aParentReflowState.ComputedBSize();
+        aParentReflowInput.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
+      AvailableISize() = aParentReflowInput.ComputedBSize();
     }
   }
 
-  mFloatManager = aParentReflowState.mFloatManager;
+  mFloatManager = aParentReflowInput.mFloatManager;
   if (mFrame->IsFrameOfType(nsIFrame::eLineParticipant))
-    mLineLayout = aParentReflowState.mLineLayout;
+    mLineLayout = aParentReflowInput.mLineLayout;
   else
     mLineLayout = nullptr;
 
-  // Note: mFlags was initialized as a copy of aParentReflowState.mFlags up in
+  // Note: mFlags was initialized as a copy of aParentReflowInput.mFlags up in
   // this constructor's init list, so the only flags that we need to explicitly
   // initialize here are those that may need a value other than our parent's.
-  mFlags.mNextInFlowUntouched = aParentReflowState.mFlags.mNextInFlowUntouched &&
-    CheckNextInFlowParenthood(aFrame, aParentReflowState.mFrame);
+  mFlags.mNextInFlowUntouched = aParentReflowInput.mFlags.mNextInFlowUntouched &&
+    CheckNextInFlowParenthood(aFrame, aParentReflowInput.mFrame);
   mFlags.mAssumingHScrollbar = mFlags.mAssumingVScrollbar = false;
   mFlags.mIsColumnBalancing = false;
   mFlags.mIsFlexContainerMeasuringHeight = false;
-  mFlags.mDummyParentReflowState = false;
+  mFlags.mDummyParentReflowInput = false;
   mFlags.mShrinkWrap = !!(aFlags & COMPUTE_SIZE_SHRINK_WRAP);
   mFlags.mUseAutoBSize = !!(aFlags & COMPUTE_SIZE_USE_AUTO_BSIZE);
   mFlags.mStaticPosIsCBOrigin = !!(aFlags & STATIC_POS_IS_CB_ORIGIN);
 
   mDiscoveredClearance = nullptr;
-  mPercentBSizeObserver = (aParentReflowState.mPercentBSizeObserver &&
-                            aParentReflowState.mPercentBSizeObserver->NeedsToObserve(*this))
-                           ? aParentReflowState.mPercentBSizeObserver : nullptr;
+  mPercentBSizeObserver = (aParentReflowInput.mPercentBSizeObserver &&
+                            aParentReflowInput.mPercentBSizeObserver->NeedsToObserve(*this))
+                           ? aParentReflowInput.mPercentBSizeObserver : nullptr;
 
   if ((aFlags & DUMMY_PARENT_REFLOW_STATE) ||
-      (mParentReflowState->mFlags.mDummyParentReflowState &&
+      (mParentReflowInput->mFlags.mDummyParentReflowInput &&
        mFrame->GetType() == nsGkAtoms::tableFrame)) {
-    mFlags.mDummyParentReflowState = true;
+    mFlags.mDummyParentReflowInput = true;
   }
 
   if (!(aFlags & CALLER_WILL_INIT)) {
     Init(aPresContext, aContainingBlockSize);
   }
 }
 
 inline nscoord
@@ -349,18 +349,18 @@ void
 ReflowInput::Init(nsPresContext*     aPresContext,
                         const LogicalSize* aContainingBlockSize,
                         const nsMargin*    aBorder,
                         const nsMargin*    aPadding)
 {
   if (AvailableISize() == NS_UNCONSTRAINEDSIZE) {
     // Look up the parent chain for an orthogonal inline limit,
     // and reset AvailableISize() if found.
-    for (const ReflowInput *parent = mParentReflowState;
-         parent != nullptr; parent = parent->mParentReflowState) {
+    for (const ReflowInput *parent = mParentReflowInput;
+         parent != nullptr; parent = parent->mParentReflowInput) {
       if (parent->GetWritingMode().IsOrthogonalTo(mWritingMode) &&
           parent->mOrthogonalLimit != NS_UNCONSTRAINEDSIZE) {
         AvailableISize() = parent->mOrthogonalLimit;
         break;
       }
     }
   }
 
@@ -375,17 +375,17 @@ ReflowInput::Init(nsPresContext*     aPr
   mStyleBorder = mFrame->StyleBorder();
   mStyleMargin = mFrame->StyleMargin();
   mStylePadding = mFrame->StylePadding();
   mStyleText = mFrame->StyleText();
 
   nsIAtom* type = mFrame->GetType();
 
   InitFrameType(type);
-  InitCBReflowState();
+  InitCBReflowInput();
 
   LogicalSize cbSize(mWritingMode, -1, -1);
   if (aContainingBlockSize) {
     cbSize = *aContainingBlockSize;
   }
 
   InitConstraints(aPresContext, cbSize, aBorder, aPadding, type);
 
@@ -441,18 +441,18 @@ ReflowInput::Init(nsPresContext*     aPr
           break;
         }
       }
     } else {
       mFrame->RemoveStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
     }
   }
 
-  if (mParentReflowState &&
-      mParentReflowState->GetWritingMode().IsOrthogonalTo(mWritingMode)) {
+  if (mParentReflowInput &&
+      mParentReflowInput->GetWritingMode().IsOrthogonalTo(mWritingMode)) {
     // Orthogonal frames are always reflowed with an unconstrained
     // dimension to avoid incomplete reflow across an orthogonal
     // boundary. Normally this is the block-size, but for column sets
     // with auto-height it's the inline-size, so that they can add
     // columns in the container's block direction
     if (type == nsGkAtoms::columnSetFrame &&
         eStyleUnit_Auto == mStylePosition->ISize(mWritingMode).GetUnit()) {
       ComputedISize() = NS_UNCONSTRAINEDSIZE;
@@ -465,33 +465,33 @@ ReflowInput::Init(nsPresContext*     aPr
                         !mFrame->IsFrameOfType(nsIFrame::eReplaced)) ||
                        type == nsGkAtoms::textFrame ||
                        ComputedISize() != NS_UNCONSTRAINEDSIZE,
                        "have unconstrained inline-size; this should only "
                        "result from very large sizes, not attempts at "
                        "intrinsic inline-size calculation");
 }
 
-void ReflowInput::InitCBReflowState()
+void ReflowInput::InitCBReflowInput()
 {
-  if (!mParentReflowState) {
-    mCBReflowState = nullptr;
+  if (!mParentReflowInput) {
+    mCBReflowInput = nullptr;
     return;
   }
 
-  if (mParentReflowState->mFrame == mFrame->GetContainingBlock()) {
+  if (mParentReflowInput->mFrame == mFrame->GetContainingBlock()) {
     // Inner table frames need to use the containing block of the outer
     // table frame.
     if (mFrame->GetType() == nsGkAtoms::tableFrame) {
-      mCBReflowState = mParentReflowState->mCBReflowState;
+      mCBReflowInput = mParentReflowInput->mCBReflowInput;
     } else {
-      mCBReflowState = mParentReflowState;
+      mCBReflowInput = mParentReflowInput;
     }
   } else {
-    mCBReflowState = mParentReflowState->mCBReflowState;
+    mCBReflowInput = mParentReflowInput->mCBReflowInput;
   }
 }
 
 /* Check whether CalcQuirkContainingBlockHeight would stop on the
  * given reflow state, using its block as a height.  (essentially 
  * returns false for any case in which CalcQuirkContainingBlockHeight 
  * has a "continue" in its main loop.)
  *
@@ -530,17 +530,17 @@ ReflowInput::InitResizeFlags(nsPresConte
       nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) {
     // Create our font inflation data if we don't have it already, and
     // give it our current width information.
     bool dirty = nsFontInflationData::UpdateFontInflationDataISizeFor(*this) &&
                  // Avoid running this at the box-to-block interface
                  // (where we shouldn't be inflating anyway, and where
                  // reflow state construction is probably to construct a
                  // dummy parent reflow state anyway).
-                 !mFlags.mDummyParentReflowState;
+                 !mFlags.mDummyParentReflowInput;
 
     if (dirty || (!mFrame->GetParent() && isIResize)) {
       // When font size inflation is enabled, a change in either:
       //  * the effective width of a font inflation flow root
       //  * the width of the frame
       // needs to cause a dirty reflow since they change the font size
       // inflation calculations, which in turn change the size of text,
       // line-heights, etc.  This is relatively similar to a classic
@@ -610,34 +610,34 @@ ReflowInput::InitResizeFlags(nsPresConte
         }
       } while (stack.Length() != 0);
     }
   }
 
   SetIResize(!(mFrame->GetStateBits() & NS_FRAME_IS_DIRTY) &&
              isIResize);
 
-  // XXX Should we really need to null check mCBReflowState?  (We do for
+  // XXX Should we really need to null check mCBReflowInput?  (We do for
   // at least nsBoxFrame).
   if (IS_TABLE_CELL(aFrameType) &&
       (mFlags.mSpecialBSizeReflow ||
        (mFrame->FirstInFlow()->GetStateBits() &
          NS_TABLE_CELL_HAD_SPECIAL_REFLOW)) &&
       (mFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
     // Need to set the bit on the cell so that
-    // mCBReflowState->IsBResize() is set correctly below when
+    // mCBReflowInput->IsBResize() is set correctly below when
     // reflowing descendant.
     SetBResize(true);
-  } else if (mCBReflowState && mFrame->IsBlockWrapper()) {
+  } else if (mCBReflowInput && mFrame->IsBlockWrapper()) {
     // XXX Is this problematic for relatively positioned inlines acting
     // as containing block for absolutely positioned elements?
     // Possibly; in that case we should at least be checking
     // NS_SUBTREE_DIRTY, I'd think.
-    SetBResize(mCBReflowState->IsBResizeForWM(wm));
-  } else if (mCBReflowState && !nsLayoutUtils::GetAsBlock(mFrame)) {
+    SetBResize(mCBReflowInput->IsBResizeForWM(wm));
+  } else if (mCBReflowInput && !nsLayoutUtils::GetAsBlock(mFrame)) {
     // Some non-block frames (e.g. table frames) aggressively optimize out their
     // BSize recomputation when they don't have the BResize flag set.  This
     // means that if they go from having a computed non-auto height to having an
     // auto height and don't have that flag set, they will not actually compute
     // their auto height and will just remain at whatever size they already
     // were.  We can end up in that situation if the child has a percentage
     // specified height and the parent changes from non-auto height to auto
     // height.  When that happens, the parent will typically have the BResize
@@ -646,24 +646,24 @@ ReflowInput::InitResizeFlags(nsPresConte
     // Ideally it seems like we'd do this for blocks too, of course... but we'd
     // really want to restrict it to the percentage height case or something, to
     // avoid extra reflows in common cases.  Maybe we should be examining
     // mStylePosition->BSize(wm).GetUnit() for that purpose?
     //
     // Note that we _also_ need to set the BResize flag if we have auto
     // ComputedBSize() and a dirty subtree, since that might require us to
     // change BSize due to kids having been added or removed.
-    SetBResize(mCBReflowState->IsBResizeForWM(wm));
+    SetBResize(mCBReflowInput->IsBResizeForWM(wm));
     if (ComputedBSize() == NS_AUTOHEIGHT) {
       SetBResize(IsBResize() || NS_SUBTREE_DIRTY(mFrame));
     }
   } else if (ComputedBSize() == NS_AUTOHEIGHT) {
     if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
-        mCBReflowState) {
-      SetBResize(mCBReflowState->IsBResizeForWM(wm));
+        mCBReflowInput) {
+      SetBResize(mCBReflowInput->IsBResizeForWM(wm));
     } else {
       SetBResize(IsIResize());
     }
     SetBResize(IsBResize() || NS_SUBTREE_DIRTY(mFrame));
   } else {
     // not 'auto' block-size
     SetBResize(mFrame->BSize(wm) !=
                ComputedBSize() + ComputedLogicalBorderPadding().BStartEnd(wm));
@@ -691,57 +691,57 @@ ReflowInput::InitResizeFlags(nsPresConte
   }
 
   // If we're the descendant of a table cell that performs special bsize
   // reflows and we could be the child that requires them, always set
   // the block-axis resize in case this is the first pass before the
   // special bsize reflow.  However, don't do this if it actually is
   // the special bsize reflow, since in that case it will already be
   // set correctly above if we need it set.
-  if (!IsBResize() && mCBReflowState &&
-      (IS_TABLE_CELL(mCBReflowState->mFrame->GetType()) || 
-       mCBReflowState->mFlags.mHeightDependsOnAncestorCell) &&
-      !mCBReflowState->mFlags.mSpecialBSizeReflow && 
+  if (!IsBResize() && mCBReflowInput &&
+      (IS_TABLE_CELL(mCBReflowInput->mFrame->GetType()) || 
+       mCBReflowInput->mFlags.mHeightDependsOnAncestorCell) &&
+      !mCBReflowInput->mFlags.mSpecialBSizeReflow && 
       dependsOnCBBSize) {
     SetBResize(true);
     mFlags.mHeightDependsOnAncestorCell = true;
   }
 
   // Set NS_FRAME_CONTAINS_RELATIVE_BSIZE if it's needed.
 
   // It would be nice to check that |ComputedBSize != NS_AUTOHEIGHT|
   // &&ed with the percentage bsize check.  However, this doesn't get
   // along with table special bsize reflows, since a special bsize
   // reflow (a quirk that makes such percentage height work on children
   // of table cells) can cause not just a single percentage height to
   // become fixed, but an entire descendant chain of percentage height
   // to become fixed.
-  if (dependsOnCBBSize && mCBReflowState) {
+  if (dependsOnCBBSize && mCBReflowInput) {
     const ReflowInput *rs = this;
-    bool hitCBReflowState = false;
+    bool hitCBReflowInput = false;
     do {
-      rs = rs->mParentReflowState;
+      rs = rs->mParentReflowInput;
       if (!rs) {
         break;
       }
         
       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 == mCBReflowState) {
-        hitCBReflowState = true;
+      if (rs == mCBReflowInput) {
+        hitCBReflowInput = true;
       }
 
       // XXX What about orthogonal flows? It doesn't make sense to
       // keep propagating this bit across an orthogonal boundary,
       // where the meaning of BSize changes. Bug 1175517.
-    } while (!hitCBReflowState ||
+    } while (!hitCBReflowInput ||
              (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
               !IsQuirkContainingBlockHeight(rs, rs->mFrame->GetType())));
     // Note: We actually don't need to set the
     // NS_FRAME_CONTAINS_RELATIVE_BSIZE bit for the cases
     // where we hit the early break statements in
     // CalcQuirkContainingBlockHeight. But it doesn't hurt
     // us to set the bit in these cases.
     
@@ -751,22 +751,22 @@ ReflowInput::InitResizeFlags(nsPresConte
     // to re-set this.
     mFrame->RemoveStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
   }
 }
 
 nscoord
 ReflowInput::GetContainingBlockContentISize(WritingMode aWritingMode) const
 {
-  if (!mCBReflowState) {
+  if (!mCBReflowInput) {
     return 0;
   }
-  return mCBReflowState->GetWritingMode().IsOrthogonalTo(aWritingMode)
-    ? mCBReflowState->ComputedBSize()
-    : mCBReflowState->ComputedISize();
+  return mCBReflowInput->GetWritingMode().IsOrthogonalTo(aWritingMode)
+    ? mCBReflowInput->ComputedBSize()
+    : mCBReflowInput->ComputedISize();
 }
 
 void
 ReflowInput::InitFrameType(nsIAtom* aFrameType)
 {
   const nsStyleDisplay *disp = mStyleDisplay;
   nsCSSFrameType frameType;
 
@@ -1032,18 +1032,18 @@ ReflowInput::GetHypotheticalBoxContainer
   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 state. */
   const ReflowInput* state;
   if (aFrame->GetStateBits() & NS_FRAME_IN_REFLOW) {
-    for (state = mParentReflowState; state && state->mFrame != aFrame;
-         state = state->mParentReflowState) {
+    for (state = mParentReflowInput; state && state->mFrame != aFrame;
+         state = state->mParentReflowInput) {
       /* do nothing */
     }
   } else {
     state = nullptr;
   }
 
   if (state) {
     WritingMode wm = state->GetWritingMode();
@@ -1837,59 +1837,59 @@ ReflowInput::InitAbsoluteConstraints(nsP
 
   SetComputedLogicalOffsets(offsets.ConvertTo(wm, cbwm));
   SetComputedLogicalMargin(margin.ConvertTo(wm, cbwm));
 }
 
 // This will not be converted to abstract coordinates because it's only
 // used in CalcQuirkContainingBlockHeight
 nscoord
-GetBlockMarginBorderPadding(const ReflowInput* aReflowState)
+GetBlockMarginBorderPadding(const ReflowInput* aReflowInput)
 {
   nscoord result = 0;
-  if (!aReflowState) return result;
+  if (!aReflowInput) return result;
 
   // zero auto margins
-  nsMargin margin = aReflowState->ComputedPhysicalMargin();
+  nsMargin margin = aReflowInput->ComputedPhysicalMargin();
   if (NS_AUTOMARGIN == margin.top) 
     margin.top = 0;
   if (NS_AUTOMARGIN == margin.bottom) 
     margin.bottom = 0;
 
   result += margin.top + margin.bottom;
-  result += aReflowState->ComputedPhysicalBorderPadding().top + 
-            aReflowState->ComputedPhysicalBorderPadding().bottom;
+  result += aReflowInput->ComputedPhysicalBorderPadding().top + 
+            aReflowInput->ComputedPhysicalBorderPadding().bottom;
 
   return result;
 }
 
 /* Get the height based on the viewport of the containing block specified 
- * in aReflowState when the containing block has mComputedHeight == NS_AUTOHEIGHT
+ * in aReflowInput when the containing block has mComputedHeight == NS_AUTOHEIGHT
  * This will walk up the chain of containing blocks looking for a computed height
  * until it finds the canvas frame, or it encounters a frame that is not a block,
  * area, or scroll frame. This handles compatibility with IE (see bug 85016 and bug 219693)
  *
  * When we encounter scrolledContent block frames, we skip over them,
  * since they are guaranteed to not be useful for computing the containing block.
  *
  * See also IsQuirkContainingBlockHeight.
  */
 static nscoord
-CalcQuirkContainingBlockHeight(const ReflowInput* aCBReflowState)
+CalcQuirkContainingBlockHeight(const ReflowInput* aCBReflowInput)
 {
   const ReflowInput* firstAncestorRS = nullptr; // a candidate for html frame
   const ReflowInput* secondAncestorRS = nullptr; // a candidate for body frame
   
   // initialize the default to NS_AUTOHEIGHT as this is the containings block
   // computed height when this function is called. It is possible that we 
   // don't alter this height especially if we are restricted to one level
   nscoord result = NS_AUTOHEIGHT; 
                              
-  const ReflowInput* rs = aCBReflowState;
-  for (; rs; rs = rs->mParentReflowState) {
+  const ReflowInput* rs = aCBReflowInput;
+  for (; rs; rs = rs->mParentReflowInput) {
     nsIAtom* frameType = rs->mFrame->GetType();
     // if the ancestor is auto height then skip it and continue up if it 
     // is the first block frame and possibly the body/html
     if (nsGkAtoms::blockFrame == frameType ||
 #ifdef MOZ_XUL
         nsGkAtoms::XULLabelFrame == frameType ||
 #endif
         nsGkAtoms::scrollFrame == frameType) {
@@ -1953,19 +1953,19 @@ CalcQuirkContainingBlockHeight(const Ref
                        "Second ancestor is not BODY");
         }
       }
 #endif
       
     }
     // if we got to the html frame (a block child of the canvas) ...
     else if (nsGkAtoms::blockFrame == frameType &&
-             rs->mParentReflowState &&
+             rs->mParentReflowInput &&
              nsGkAtoms::canvasFrame ==
-               rs->mParentReflowState->mFrame->GetType()) {
+               rs->mParentReflowInput->mFrame->GetType()) {
       // ... then subtract out margin/border/padding for the BODY element
       result -= GetBlockMarginBorderPadding(secondAncestorRS);
     }
     break;
   }
 
   // Make sure not to return a negative height here!
   return std::max(result, 0);
@@ -2094,17 +2094,17 @@ ReflowInput::InitConstraints(nsPresConte
   WritingMode wm = GetWritingMode();
   DISPLAY_INIT_CONSTRAINTS(mFrame, this,
                            aContainingBlockSize.ISize(wm),
                            aContainingBlockSize.BSize(wm),
                            aBorder, aPadding);
 
   // If this is a reflow root, then set the computed width and
   // height equal to the available space
-  if (nullptr == mParentReflowState || mFlags.mDummyParentReflowState) {
+  if (nullptr == mParentReflowInput || mFlags.mDummyParentReflowInput) {
     // XXXldb This doesn't mean what it used to!
     InitOffsets(wm, OffsetPercentBasis(mFrame, wm, aContainingBlockSize),
                 aFrameType, mFlags, aBorder, aPadding);
     // Override mComputedMargin since reflow roots start from the
     // frame's boundary, which is inside the margin.
     ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
     ComputedPhysicalOffsets().SizeTo(0, 0, 0, 0);
 
@@ -2122,33 +2122,33 @@ ReflowInput::InitConstraints(nsPresConte
     } else {
       ComputedBSize() = NS_UNCONSTRAINEDSIZE;
     }
 
     ComputedMinWidth() = ComputedMinHeight() = 0;
     ComputedMaxWidth() = ComputedMaxHeight() = NS_UNCONSTRAINEDSIZE;
   } else {
     // Get the containing block reflow state
-    const ReflowInput* cbrs = mCBReflowState;
+    const ReflowInput* cbrs = mCBReflowInput;
     NS_ASSERTION(nullptr != cbrs, "no containing block");
 
     // If we weren't given a containing block width and height, then
     // compute one
     LogicalSize cbSize = (aContainingBlockSize == LogicalSize(wm, -1, -1))
       ? ComputeContainingBlockRectangle(aPresContext, cbrs)
       : aContainingBlockSize;
 
     // See if the containing block height is based on the size of its
     // content
     nsIAtom* fType;
     if (NS_AUTOHEIGHT == cbSize.BSize(wm)) {
       // See if the containing block is a cell frame which needs
       // to use the mComputedHeight of the cell instead of what the cell block passed in.
       // XXX It seems like this could lead to bugs with min-height and friends
-      if (cbrs->mParentReflowState) {
+      if (cbrs->mParentReflowInput) {
         fType = cbrs->mFrame->GetType();
         if (IS_TABLE_CELL(fType)) {
           // use the cell's computed block size
           cbSize.BSize(wm) = cbrs->ComputedSize(wm).BSize(wm);
         }
       }
     }
 
@@ -2331,18 +2331,18 @@ ReflowInput::InitConstraints(nsPresConte
         // Make sure legend frames with display:block and width:auto still
         // shrink-wrap.
         // Also shrink-wrap blocks that are orthogonal to their container.
         if (isBlock &&
             ((aFrameType == nsGkAtoms::legendFrame &&
               mFrame->StyleContext()->GetPseudo() != nsCSSAnonBoxes::scrolledContent) ||
              (aFrameType == nsGkAtoms::scrollFrame &&
               mFrame->GetContentInsertionFrame()->GetType() == nsGkAtoms::legendFrame) ||
-             (mCBReflowState &&
-              mCBReflowState->GetWritingMode().IsOrthogonalTo(mWritingMode)))) {
+             (mCBReflowInput &&
+              mCBReflowInput->GetWritingMode().IsOrthogonalTo(mWritingMode)))) {
           computeSizeFlags =
             ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
         }
 
         if (parentFrameType == nsGkAtoms::flexContainerFrame) {
           computeSizeFlags =
             ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
 
@@ -2409,17 +2409,17 @@ UpdateProp(FrameProperties& aProps,
     aProps.Delete(aProperty);
   }
 }
 
 void
 SizeComputationInput::InitOffsets(WritingMode aWM,
                               const LogicalSize& aPercentBasis,
                               nsIAtom* aFrameType,
-                              ReflowStateFlags aFlags,
+                              ReflowInputFlags aFlags,
                               const nsMargin* aBorder,
                               const nsMargin* aPadding)
 {
   DISPLAY_INIT_OFFSETS(mFrame, this, aPercentBasis, aBorder, aPadding);
 
   // Since we are in reflow, we don't need to store these properties anymore
   // unless they are dependent on width, in which case we store the new value.
   nsPresContext *presContext = mFrame->PresContext();
@@ -2562,17 +2562,17 @@ ReflowInput::CalculateBlockSideMargins(n
   // which is where margins will eventually be applied: we're calculating
   // margins that will be used by the container in its inline direction,
   // which in the case of an orthogonal contained block will correspond to
   // the block direction of this reflow state. So in the orthogonal-flow
   // case, "CalculateBlock*Side*Margins" will actually end up adjusting
   // the BStart/BEnd margins; those are the "sides" of the block from its
   // container's point of view.
   WritingMode cbWM =
-    mCBReflowState ? mCBReflowState->GetWritingMode(): GetWritingMode();
+    mCBReflowInput ? mCBReflowInput->GetWritingMode(): GetWritingMode();
 
   nscoord availISizeCBWM = AvailableSize(cbWM).ISize(cbWM);
   nscoord computedISizeCBWM = ComputedSize(cbWM).ISize(cbWM);
   if (computedISizeCBWM == NS_UNCONSTRAINEDSIZE) {
     // For orthogonal flows, where we found a parent orthogonal-limit
     // for AvailableISize() in Init(), we'll use the same here as well.
     computedISizeCBWM = availISizeCBWM;
   }
@@ -2613,23 +2613,23 @@ ReflowInput::CalculateBlockSideMargins(n
   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* prs = mParentReflowState;
+    const ReflowInput* prs = mParentReflowInput;
     if (aFrameType == nsGkAtoms::tableFrame) {
       NS_ASSERTION(prs->mFrame->GetType() == nsGkAtoms::tableWrapperFrame,
                    "table not inside table wrapper");
       // Center the table within the table wrapper based on the alignment
       // of the table wrapper's parent.
-      prs = prs->mParentReflowState;
+      prs = prs->mParentReflowInput;
     }
     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 =
           prs->mStyleText->mTextAlign != NS_STYLE_TEXT_ALIGN_MOZ_LEFT;
@@ -2743,17 +2743,17 @@ ComputeLineHeight(nsStyleContext* aStyle
   return GetNormalLineHeight(fm);
 }
 
 nscoord
 ReflowInput::CalcLineHeight() const
 {
   nscoord blockBSize =
     nsLayoutUtils::IsNonWrapperBlock(mFrame) ? ComputedBSize() :
-    (mCBReflowState ? mCBReflowState->ComputedBSize() : NS_AUTOHEIGHT);
+    (mCBReflowInput ? mCBReflowInput->ComputedBSize() : NS_AUTOHEIGHT);
 
   return CalcLineHeight(mFrame->GetContent(), mFrame->StyleContext(), blockBSize,
                         nsLayoutUtils::FontSizeInflationFor(mFrame));
 }
 
 /* static */ nscoord
 ReflowInput::CalcLineHeight(nsIContent* aContent,
                                   nsStyleContext* aStyleContext,
--- a/layout/generic/ReflowInput.h
+++ b/layout/generic/ReflowInput.h
@@ -170,18 +170,18 @@ public:
     , mWritingMode(aFrame->GetWritingMode())
   {
   }
 
   SizeComputationInput(nsIFrame *aFrame, nsRenderingContext *aRenderingContext,
                    mozilla::WritingMode aContainingBlockWritingMode,
                    nscoord aContainingBlockISize);
 
-  struct ReflowStateFlags {
-    ReflowStateFlags() { memset(this, 0, sizeof(*this)); }
+  struct ReflowInputFlags {
+    ReflowInputFlags() { memset(this, 0, sizeof(*this)); }
     uint16_t mSpecialBSizeReflow:1;  // used by tables to communicate special reflow (in process) to handle
                                      // percent bsize frames inside cells which may not have computed bsizes
     uint16_t mNextInFlowUntouched:1; // nothing in the frame's next-in-flow (or its descendants)
                                      // is changing
     uint16_t mIsTopOfPage:1;         // Is the current context at the top of a
                                      // page?  When true, we force something
                                      // that's too tall for a page/column to
                                      // fit anyway to avoid infinite loops.
@@ -201,17 +201,17 @@ public:
     uint16_t mTableIsSplittable:1;   // tables are splittable, this should happen only inside a page
                                      // and never insider a column frame
     uint16_t mHeightDependsOnAncestorCell:1;   // Does frame height depend on
                                                // an ancestor table-cell?
     uint16_t mIsColumnBalancing:1;   // nsColumnSetFrame is balancing columns
     uint16_t mIsFlexContainerMeasuringHeight:1; // nsFlexContainerFrame is
                                                 // reflowing this child to
                                                 // measure its intrinsic height.
-    uint16_t mDummyParentReflowState:1; // a "fake" reflow state made
+    uint16_t mDummyParentReflowInput:1; // a "fake" reflow state made
                                         // in order to be the parent
                                         // of a real one
     uint16_t mMustReflowPlaceholders:1; // Should this frame reflow its place-
                                         // holder children? If the available
                                         // height of this frame didn't change,
                                         // but its in a paginated environment
                                         // (e.g. columns), it should always
                                         // reflow its placeholder children.
@@ -276,17 +276,17 @@ private:
                       const mozilla::LogicalSize& aPercentBasis,
                       nsIAtom* aFrameType);
 
 protected:
 
   void InitOffsets(mozilla::WritingMode aWM,
                    const mozilla::LogicalSize& aPercentBasis,
                    nsIAtom* aFrameType,
-                   ReflowStateFlags aFlags,
+                   ReflowInputFlags aFlags,
                    const nsMargin* aBorder = nullptr,
                    const nsMargin* aPadding = nullptr);
 
   /*
    * Convert nsStyleCoord to nscoord when percentages depend on the
    * inline size of the containing block, and enumerated values are for
    * inline size, min-inline-size, or max-inline-size.  Does not handle
    * auto inline sizes.
@@ -312,44 +312,44 @@ protected:
  * XXX Refactor so only a base class (nsSizingState?) is used for intrinsic
  * size calculation.
  *
  * @see nsIFrame#Reflow()
  */
 struct ReflowInput : public SizeComputationInput {
   // the reflow states are linked together. this is the pointer to the
   // parent's reflow state
-  const ReflowInput* mParentReflowState;
+  const ReflowInput* mParentReflowInput;
 
   // pointer to the float manager associated with this area
   nsFloatManager* mFloatManager;
 
   // LineLayout object (only for inline reflow; set to nullptr otherwise)
   nsLineLayout*    mLineLayout;
 
   // The appropriate reflow state for the containing block (for
   // percentage widths, etc.) of this reflow state's frame.
-  const ReflowInput *mCBReflowState;
+  const ReflowInput *mCBReflowInput;
 
   // The type of frame, from css's perspective. This value is
   // initialized by the Init method below.
   nsCSSFrameType   mFrameType;
 
   // The amount the in-flow position of the block is moving vertically relative
   // to its previous in-flow position (i.e. the amount the line containing the
   // block is moving).
   // This should be zero for anything which is not a block outside, and it
   // should be zero for anything which has a non-block parent.
   // The intended use of this value is to allow the accurate determination
   // of the potential impact of a float
   // This takes on an arbitrary value the first time a block is reflowed
   nscoord mBlockDelta;
 
   // If an ReflowInput finds itself initialized with an unconstrained
-  // inline-size, it will look up its parentReflowState chain for a state
+  // inline-size, it will look up its parentReflowInput chain for a state
   // with an orthogonal writing mode and a non-NS_UNCONSTRAINEDSIZE value for
   // orthogonal limit; when it finds such a reflow-state, it will use its
   // orthogonal-limit value to constrain inline-size.
   // This is initialized to NS_UNCONSTRAINEDSIZE (so it will be ignored),
   // but reset to a suitable value for the reflow root by nsPresShell.
   nscoord mOrthogonalLimit;
 
   // Accessors for the private fields below. Forcing all callers to use these
@@ -586,17 +586,17 @@ public:
   // is required. When we discover that clearance is required, we
   // store the frame in which clearance was discovered to the location
   // requested here.
   nsIFrame** mDiscoveredClearance;
 
   // This value keeps track of how deeply nested a given reflow state
   // is from the top of the frame tree.
   int16_t mReflowDepth;
-  ReflowStateFlags mFlags;
+  ReflowInputFlags mFlags;
 
   // Logical and physical accessors for the resize flags. All users should go
   // via these accessors, so that in due course we can change the storage from
   // physical to logical.
   bool IsHResize() const {
     return mWritingMode.IsVertical() ? mFlags.mIsBResize : mFlags.mIsIResize;
   }
   bool IsVResize() const {
@@ -654,38 +654,38 @@ public:
                     const mozilla::LogicalSize& aAvailableSpace,
                     uint32_t                    aFlags = 0);
 
   /**
    * Initialize a reflow state for a child frame's reflow. Some parts of the
    * state are copied from the parent's reflow state. The remainder is computed.
    *
    * @param aPresContext Must be equal to aFrame->PresContext().
-   * @param aParentReflowState A reference to an ReflowInput object that
+   * @param aParentReflowInput A reference to an ReflowInput object that
    *        is to be the parent of this object.
    * @param aFrame The frame for whose reflow state is being constructed.
    * @param aAvailableSpace See comments for availableHeight and availableWidth
    *        members.
    * @param aContainingBlockSize An optional size, in app units, specifying
    *        the containing block size to use instead of the default which is
    *        to use the aAvailableSpace.
    * @param aFlags A set of flags used for additional boolean parameters (see
    *        below).
    */
   ReflowInput(nsPresContext*              aPresContext,
-                    const ReflowInput&    aParentReflowState,
+                    const ReflowInput&    aParentReflowInput,
                     nsIFrame*                   aFrame,
                     const mozilla::LogicalSize& aAvailableSpace,
                     const mozilla::LogicalSize* aContainingBlockSize = nullptr,
                     uint32_t                    aFlags = 0);
 
   // Values for |aFlags| passed to constructor
   enum {
     // Indicates that the parent of this reflow state is "fake" (see
-    // mDummyParentReflowState in mFlags).
+    // mDummyParentReflowInput in mFlags).
     DUMMY_PARENT_REFLOW_STATE = (1<<0),
 
     // Indicates that the calling function will initialize the reflow state, and
     // that the constructor should not call Init().
     CALLER_WILL_INIT = (1<<1),
 
     // The caller wants shrink-wrap behavior (i.e. ComputeSizeFlags::eShrinkWrap
     // will be passed to ComputeSize()).
@@ -917,17 +917,17 @@ public:
                                          ReflowInput* aState);
   static void DisplayInitFrameTypeExit(nsIFrame* aFrame,
                                        ReflowInput* aState,
                                        void* aValue);
 #endif
 
 protected:
   void InitFrameType(nsIAtom* aFrameType);
-  void InitCBReflowState();
+  void InitCBReflowInput();
   void InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType);
 
   void InitConstraints(nsPresContext*              aPresContext,
                        const mozilla::LogicalSize& aContainingBlockSize,
                        const nsMargin*             aBorder,
                        const nsMargin*             aPadding,
                        nsIAtom*                    aFrameType);
 
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -105,39 +105,39 @@ nsAbsoluteContainingBlock::RemoveFrame(n
   }
 
   mAbsoluteFrames.DestroyFrame(aOldFrame);
 }
 
 void
 nsAbsoluteContainingBlock::Reflow(nsContainerFrame*        aDelegatingFrame,
                                   nsPresContext*           aPresContext,
-                                  const ReflowInput& aReflowState,
+                                  const ReflowInput& aReflowInput,
                                   nsReflowStatus&          aReflowStatus,
                                   const nsRect&            aContainingBlock,
                                   AbsPosReflowFlags        aFlags,
                                   nsOverflowAreas*         aOverflowAreas)
 {
   nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
 
-  const bool reflowAll = aReflowState.ShouldReflowAllKids();
+  const bool reflowAll = aReflowInput.ShouldReflowAllKids();
   const bool isGrid = !!(aFlags & AbsPosReflowFlags::eIsGridContainerCB);
   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));
     if (kidNeedsReflow && !aPresContext->HasPendingInterrupt()) {
       // Reflow the frame
       nsReflowStatus  kidStatus = NS_FRAME_COMPLETE;
       const nsRect& cb = isGrid ? nsGridContainerFrame::GridItemCB(kidFrame)
                                 : aContainingBlock;
-      ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowState, cb,
+      ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowInput, cb,
                           aFlags, kidFrame, kidStatus, aOverflowAreas);
       nsIFrame* nextFrame = kidFrame->GetNextInFlow();
       if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus) &&
           aDelegatingFrame->IsFrameOfType(nsIFrame::eCanContainOverflowContainers)) {
         // Need a continuation
         if (!nextFrame) {
           nextFrame =
             aPresContext->PresShell()->FrameConstructor()->
@@ -338,131 +338,131 @@ nsAbsoluteContainingBlock::DoMarkFramesD
 
 // When bug 154892 is checked in, make sure that when 
 // mChildListID == kFixedList, the height is unconstrained.
 // since we don't allow replicated frames to split.
 
 void
 nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame*                aDelegatingFrame,
                                                nsPresContext*           aPresContext,
-                                               const ReflowInput& aReflowState,
+                                               const ReflowInput& aReflowInput,
                                                const nsRect&            aContainingBlock,
                                                AbsPosReflowFlags        aFlags,
                                                nsIFrame*                aKidFrame,
                                                nsReflowStatus&          aStatus,
                                                nsOverflowAreas*         aOverflowAreas)
 {
 #ifdef DEBUG
   if (nsBlockFrame::gNoisyReflow) {
     nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent);
     printf("abs pos ");
     nsAutoString name;
     aKidFrame->GetFrameName(name);
     printf("%s ", NS_LossyConvertUTF16toASCII(name).get());
 
     char width[16];
     char height[16];
-    PrettyUC(aReflowState.AvailableWidth(), width, 16);
-    PrettyUC(aReflowState.AvailableHeight(), height, 16);
+    PrettyUC(aReflowInput.AvailableWidth(), width, 16);
+    PrettyUC(aReflowInput.AvailableHeight(), height, 16);
     printf(" a=%s,%s ", width, height);
-    PrettyUC(aReflowState.ComputedWidth(), width, 16);
-    PrettyUC(aReflowState.ComputedHeight(), height, 16);
+    PrettyUC(aReflowInput.ComputedWidth(), width, 16);
+    PrettyUC(aReflowInput.ComputedHeight(), height, 16);
     printf("c=%s,%s \n", width, height);
   }
   AutoNoisyIndenter indent(nsBlockFrame::gNoisy);
 #endif // DEBUG
 
   WritingMode wm = aKidFrame->GetWritingMode();
   LogicalSize logicalCBSize(wm, aContainingBlock.Size());
   nscoord availISize = logicalCBSize.ISize(wm);
   if (availISize == -1) {
-    NS_ASSERTION(aReflowState.ComputedSize(wm).ISize(wm) !=
+    NS_ASSERTION(aReflowInput.ComputedSize(wm).ISize(wm) !=
                    NS_UNCONSTRAINEDSIZE,
                  "Must have a useful inline-size _somewhere_");
     availISize =
-      aReflowState.ComputedSizeWithPadding(wm).ISize(wm);
+      aReflowInput.ComputedSizeWithPadding(wm).ISize(wm);
   }
 
   uint32_t rsFlags = 0;
   if (aFlags & AbsPosReflowFlags::eIsGridContainerCB) {
     // When a grid container generates the abs.pos. CB for a *child* then
     // the static-position is the CB origin (i.e. of the grid area rect).
     // https://drafts.csswg.org/css-grid/#static-position
     nsIFrame* placeholder =
       aPresContext->PresShell()->GetPlaceholderFrameFor(aKidFrame);
     if (placeholder && placeholder->GetParent() == aDelegatingFrame) {
       rsFlags |= ReflowInput::STATIC_POS_IS_CB_ORIGIN;
     }
   }
-  ReflowInput kidReflowState(aPresContext, aReflowState, aKidFrame,
+  ReflowInput kidReflowInput(aPresContext, aReflowInput, aKidFrame,
                                    LogicalSize(wm, availISize,
                                                NS_UNCONSTRAINEDSIZE),
                                    &logicalCBSize, rsFlags);
 
   // Get the border values
-  WritingMode outerWM = aReflowState.GetWritingMode();
+  WritingMode outerWM = aReflowInput.GetWritingMode();
   const LogicalMargin border(outerWM,
-                             aReflowState.mStyleBorder->GetComputedBorder());
+                             aReflowInput.mStyleBorder->GetComputedBorder());
   const LogicalMargin margin =
-    kidReflowState.ComputedLogicalMargin().ConvertTo(outerWM, wm);
-  bool constrainBSize = (aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE)
+    kidReflowInput.ComputedLogicalMargin().ConvertTo(outerWM, wm);
+  bool constrainBSize = (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE)
     && (aFlags & AbsPosReflowFlags::eConstrainHeight)
        // Don't split if told not to (e.g. for fixed frames)
     && (aDelegatingFrame->GetType() != nsGkAtoms::inlineFrame)
        //XXX we don't handle splitting frames for inline absolute containing blocks yet
     && (aKidFrame->GetLogicalRect(aContainingBlock.Size()).BStart(wm) <=
-        aReflowState.AvailableBSize());
+        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
        // across next-in-flow breaks yet.
   if (constrainBSize) {
-    kidReflowState.AvailableBSize() =
-      aReflowState.AvailableBSize() - border.ConvertTo(wm, outerWM).BStart(wm) -
-      kidReflowState.ComputedLogicalMargin().BStart(wm);
-    if (NS_AUTOOFFSET != kidReflowState.ComputedLogicalOffsets().BStart(wm)) {
-      kidReflowState.AvailableBSize() -=
-        kidReflowState.ComputedLogicalOffsets().BStart(wm);
+    kidReflowInput.AvailableBSize() =
+      aReflowInput.AvailableBSize() - border.ConvertTo(wm, outerWM).BStart(wm) -
+      kidReflowInput.ComputedLogicalMargin().BStart(wm);
+    if (NS_AUTOOFFSET != kidReflowInput.ComputedLogicalOffsets().BStart(wm)) {
+      kidReflowInput.AvailableBSize() -=
+        kidReflowInput.ComputedLogicalOffsets().BStart(wm);
     }
   }
 
   // Do the reflow
-  ReflowOutput kidDesiredSize(kidReflowState);
-  aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
+  ReflowOutput kidDesiredSize(kidReflowInput);
+  aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowInput, aStatus);
 
   const LogicalSize kidSize = kidDesiredSize.Size(wm).ConvertTo(outerWM, wm);
 
   LogicalMargin offsets =
-    kidReflowState.ComputedLogicalOffsets().ConvertTo(outerWM, wm);
+    kidReflowInput.ComputedLogicalOffsets().ConvertTo(outerWM, wm);
 
   // If we're solving for start in either inline or block direction,
   // then compute it now that we know the dimensions.
   if ((NS_AUTOOFFSET == offsets.IStart(outerWM)) ||
       (NS_AUTOOFFSET == offsets.BStart(outerWM))) {
     if (-1 == logicalCBSize.ISize(wm)) {
       // Get the containing block width/height
       logicalCBSize =
-        kidReflowState.ComputeContainingBlockRectangle(aPresContext,
-                                                       &aReflowState);
+        kidReflowInput.ComputeContainingBlockRectangle(aPresContext,
+                                                       &aReflowInput);
     }
 
     if (NS_AUTOOFFSET == offsets.IStart(outerWM)) {
       NS_ASSERTION(NS_AUTOOFFSET != offsets.IEnd(outerWM),
                    "Can't solve for both start and end");
       offsets.IStart(outerWM) =
         logicalCBSize.ConvertTo(outerWM, wm).ISize(outerWM) -
         offsets.IEnd(outerWM) - margin.IStartEnd(outerWM) -
         kidSize.ISize(outerWM);
     }
     if (NS_AUTOOFFSET == offsets.BStart(outerWM)) {
       offsets.BStart(outerWM) =
         logicalCBSize.ConvertTo(outerWM, wm).BSize(outerWM) -
         offsets.BEnd(outerWM) - margin.BStartEnd(outerWM) -
         kidSize.BSize(outerWM);
     }
-    kidReflowState.SetComputedLogicalOffsets(offsets.ConvertTo(wm, outerWM));
+    kidReflowInput.SetComputedLogicalOffsets(offsets.ConvertTo(wm, outerWM));
   }
 
   // Position the child relative to our padding edge
   LogicalRect rect(outerWM,
                    border.IStart(outerWM) + offsets.IStart(outerWM) +
                      margin.IStart(outerWM),
                    border.BStart(outerWM) + offsets.BStart(outerWM) +
                      margin.BStart(outerWM),
@@ -471,17 +471,17 @@ nsAbsoluteContainingBlock::ReflowAbsolut
     rect.GetPhysicalRect(outerWM, logicalCBSize.GetPhysicalSize(wm) +
                          border.Size(outerWM).GetPhysicalSize(outerWM));
 
   // Offset the frame rect by the given origin of the absolute containing block.
   // If the frame is auto-positioned on both sides of an axis, it will be
   // positioned based on its containing block and we don't need to offset
   // (unless the caller demands it (the STATIC_POS_IS_CB_ORIGIN case)).
   if (aContainingBlock.TopLeft() != nsPoint(0, 0)) {
-    const nsStyleSides& offsets = kidReflowState.mStylePosition->mOffset;
+    const nsStyleSides& offsets = kidReflowInput.mStylePosition->mOffset;
     if (!(offsets.GetLeftUnit() == eStyleUnit_Auto &&
           offsets.GetRightUnit() == eStyleUnit_Auto) ||
         (rsFlags & ReflowInput::STATIC_POS_IS_CB_ORIGIN)) {
       r.x += aContainingBlock.x;
     }
     if (!(offsets.GetTopUnit() == eStyleUnit_Auto &&
           offsets.GetBottomUnit() == eStyleUnit_Auto) ||
         (rsFlags & ReflowInput::STATIC_POS_IS_CB_ORIGIN)) {
@@ -496,17 +496,17 @@ nsAbsoluteContainingBlock::ReflowAbsolut
     // Size and position the view and set its opacity, visibility, content
     // transparency, and clip
     nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, aKidFrame, view,
                                                kidDesiredSize.VisualOverflow());
   } else {
     nsContainerFrame::PositionChildViews(aKidFrame);
   }
 
-  aKidFrame->DidReflow(aPresContext, &kidReflowState,
+  aKidFrame->DidReflow(aPresContext, &kidReflowInput,
                        nsDidReflowStatus::FINISHED);
 
 #ifdef DEBUG
   if (nsBlockFrame::gNoisyReflow) {
     nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent - 1);
     printf("abs pos ");
     nsAutoString name;
     aKidFrame->GetFrameName(name);
--- a/layout/generic/nsAbsoluteContainingBlock.h
+++ b/layout/generic/nsAbsoluteContainingBlock.h
@@ -91,17 +91,17 @@ public:
    * @param aReflowStatus is assumed to be already-initialized, e.g. with the
    * status of the delegating frame's main reflow. This function merges in the
    * statuses of the absolutely positioned children's reflows.
    *
    * @param aFlags zero or more AbsPosReflowFlags
    */
   void Reflow(nsContainerFrame*        aDelegatingFrame,
               nsPresContext*           aPresContext,
-              const ReflowInput& aReflowState,
+              const ReflowInput& aReflowInput,
               nsReflowStatus&          aReflowStatus,
               const nsRect&            aContainingBlock,
               AbsPosReflowFlags        aFlags,
               nsOverflowAreas*         aOverflowAreas);
 
   void DestroyFrames(nsIFrame* aDelegatingFrame,
                      nsIFrame* aDestructRoot);
 
@@ -124,17 +124,17 @@ protected:
    * its placeholder or if the position or size of aFrame depends on a
    * containing block dimension that changed.
    */
   bool FrameDependsOnContainer(nsIFrame* aFrame, bool aCBWidthChanged,
                                bool aCBHeightChanged);
 
   void ReflowAbsoluteFrame(nsIFrame*                aDelegatingFrame,
                            nsPresContext*           aPresContext,
-                           const ReflowInput& aReflowState,
+                           const ReflowInput& aReflowInput,
                            const nsRect&            aContainingBlockRect,
                            AbsPosReflowFlags        aFlags,
                            nsIFrame*                aKidFrame,
                            nsReflowStatus&          aStatus,
                            nsOverflowAreas*         aOverflowAreas);
 
   /**
    * Mark our absolute frames dirty.
--- a/layout/generic/nsBRFrame.cpp
+++ b/layout/generic/nsBRFrame.cpp
@@ -33,17 +33,17 @@ public:
   virtual FrameSearchResult PeekOffsetCharacter(bool aForward, int32_t* aOffset,
                                      bool aRespectClusters = true) override;
   virtual FrameSearchResult PeekOffsetWord(bool aForward, bool aWordSelectEatSpace,
                               bool aIsKeyboardSelect, int32_t* aOffset,
                               PeekWordState* aState) override;
 
   virtual void Reflow(nsPresContext* aPresContext,
                           ReflowOutput& aDesiredSize,
-                          const ReflowInput& aReflowState,
+                          const ReflowInput& aReflowInput,
                           nsReflowStatus& aStatus) override;
   virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
                                  InlineMinISizeData *aData) override;
   virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
                                   InlinePrefISizeData *aData) override;
   virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
   virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
   virtual nsIAtom* GetType() const override;
@@ -76,37 +76,37 @@ NS_IMPL_FRAMEARENA_HELPERS(BRFrame)
 
 BRFrame::~BRFrame()
 {
 }
 
 void
 BRFrame::Reflow(nsPresContext* aPresContext,
                 ReflowOutput& aMetrics,
-                const ReflowInput& aReflowState,
+                const ReflowInput& aReflowInput,
                 nsReflowStatus& aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("BRFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
-  WritingMode wm = aReflowState.GetWritingMode();
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
+  WritingMode wm = aReflowInput.GetWritingMode();
   LogicalSize finalSize(wm);
   finalSize.BSize(wm) = 0; // BR frames with block size 0 are ignored in quirks
                            // mode by nsLineLayout::VerticalAlignFrames .
                            // However, it's not always 0.  See below.
   finalSize.ISize(wm) = 0;
   aMetrics.SetBlockStartAscent(0);
 
   // Only when the BR is operating in a line-layout situation will it
   // behave like a BR. Additionally, we suppress breaks from BR inside
   // of ruby frames. To determine if we're inside ruby, we have to rely
   // on the *parent's* ShouldSuppressLineBreak() method, instead of our
   // own, because we may have custom "display" value that makes our
   // ShouldSuppressLineBreak() return false.
-  nsLineLayout* ll = aReflowState.mLineLayout;
+  nsLineLayout* ll = aReflowInput.mLineLayout;
   if (ll && !GetParent()->StyleContext()->ShouldSuppressLineBreak()) {
     // Note that the compatibility mode check excludes AlmostStandards
     // mode, since this is the inline box model.  See bug 161691.
     if ( ll->LineIsEmpty() ||
          aPresContext->CompatibilityMode() == eCompatibility_FullStandards ) {
       // The line is logically empty; any whitespace is trimmed away.
       //
       // If this frame is going to terminate the line we know
@@ -119,17 +119,17 @@ BRFrame::Reflow(nsPresContext* aPresCont
       // of the full line-height
 
       // We also do this in strict mode because BR should act like a
       // normal inline frame.  That line-height is used is important
       // here for cases where the line-height is less than 1.
       RefPtr<nsFontMetrics> fm =
         nsLayoutUtils::GetInflatedFontMetricsForFrame(this);
       if (fm) {
-        nscoord logicalHeight = aReflowState.CalcLineHeight();
+        nscoord logicalHeight = aReflowInput.CalcLineHeight();
         finalSize.BSize(wm) = logicalHeight;
         aMetrics.SetBlockStartAscent(nsLayoutUtils::GetCenteredFontBaseline(
                                        fm, logicalHeight, wm.IsLineInverted()));
       }
       else {
         aMetrics.SetBlockStartAscent(aMetrics.BSize(wm) = 0);
       }
 
@@ -139,17 +139,17 @@ BRFrame::Reflow(nsPresContext* aPresCont
       // XXX This also fixes bug 10036!
       // Warning: nsTextControlFrame::CalculateSizeStandard depends on
       // the following line, see bug 228752.
       // The code below in AddInlinePrefISize also adds 1 appunit to width
       finalSize.ISize(wm) = 1;
     }
 
     // Return our reflow status
-    uint32_t breakType = aReflowState.mStyleDisplay->PhysicalBreakType(wm);
+    uint32_t breakType = aReflowInput.mStyleDisplay->PhysicalBreakType(wm);
     if (NS_STYLE_CLEAR_NONE == breakType) {
       breakType = NS_STYLE_CLEAR_LINE;
     }
 
     aStatus = NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER |
       NS_INLINE_MAKE_BREAK_TYPE(breakType);
     ll->SetLineEndsInBR(true);
   }
@@ -157,17 +157,17 @@ BRFrame::Reflow(nsPresContext* aPresCont
     aStatus = NS_FRAME_COMPLETE;
   }
 
   aMetrics.SetSize(wm, finalSize);
   aMetrics.SetOverflowAreasToDesiredBounds();
 
   mAscent = aMetrics.BlockStartAscent();
 
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
 }
 
 /* virtual */ void
 BRFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext,
                            nsIFrame::InlineMinISizeData *aData)
 {
   if (!GetParent()->StyleContext()->ShouldSuppressLineBreak()) {
     aData->ForceBreak();
--- a/layout/generic/nsBackdropFrame.cpp
+++ b/layout/generic/nsBackdropFrame.cpp
@@ -82,23 +82,23 @@ nsBackdropFrame::ComputeAutoSize(nsRende
                         aBorder.ISize(aWM) - aPadding.ISize(aWM);
   }
   return result;
 }
 
 /* virtual */ void
 nsBackdropFrame::Reflow(nsPresContext* aPresContext,
                         ReflowOutput& aDesiredSize,
-                        const ReflowInput& aReflowState,
+                        const ReflowInput& aReflowInput,
                         nsReflowStatus& aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsBackdropFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
 
   // Note that this frame is a child of the viewport frame.
-  WritingMode wm = aReflowState.GetWritingMode();
-  LogicalMargin borderPadding = aReflowState.ComputedLogicalBorderPadding();
-  nscoord isize = aReflowState.ComputedISize() + borderPadding.IStartEnd(wm);
-  nscoord bsize = aReflowState.ComputedBSize() + borderPadding.BStartEnd(wm);
+  WritingMode wm = aReflowInput.GetWritingMode();
+  LogicalMargin borderPadding = aReflowInput.ComputedLogicalBorderPadding();
+  nscoord isize = aReflowInput.ComputedISize() + borderPadding.IStartEnd(wm);
+  nscoord bsize = aReflowInput.ComputedBSize() + borderPadding.BStartEnd(wm);
   aDesiredSize.SetSize(wm, LogicalSize(wm, isize, bsize));
   aStatus = NS_FRAME_COMPLETE;
 }
--- a/layout/generic/nsBackdropFrame.h
+++ b/layout/generic/nsBackdropFrame.h
@@ -34,13 +34,13 @@ public:
                                       const LogicalSize& aCBSize,
                                       nscoord aAvailableISize,
                                       const LogicalSize& aMargin,
                                       const LogicalSize& aBorder,
                                       const LogicalSize& aPadding,
                                       bool aShrinkWrap) override;
   virtual void Reflow(nsPresContext* aPresContext,
                       ReflowOutput& aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus& aStatus) override;
 };
 
 #endif // nsBackdropFrame_h___
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -932,30 +932,30 @@ AvailableSpaceShrunk(WritingMode aWM,
   }
   // Have we shrunk on either side?
   return aNewAvailableSpace.IStart(aWM) > aOldAvailableSpace.IStart(aWM) ||
          aNewAvailableSpace.IEnd(aWM) < aOldAvailableSpace.IEnd(aWM);
 }
 
 static LogicalSize
 CalculateContainingBlockSizeForAbsolutes(WritingMode aWM,
-                                         const ReflowInput& aReflowState,
+                                         const ReflowInput& aReflowInput,
                                          LogicalSize aFrameSize)
 {
   // The issue here is that for a 'height' of 'auto' the reflow state
   // code won't know how to calculate the containing block height
   // because it's calculated bottom up. So we use our own computed
   // size as the dimensions.
-  nsIFrame* frame = aReflowState.mFrame;
+  nsIFrame* frame = aReflowInput.mFrame;
 
   LogicalSize cbSize(aFrameSize);
     // Containing block is relative to the padding edge
   const LogicalMargin& border =
-    LogicalMargin(aWM, aReflowState.ComputedPhysicalBorderPadding() -
-                       aReflowState.ComputedPhysicalPadding());
+    LogicalMargin(aWM, aReflowInput.ComputedPhysicalBorderPadding() -
+                       aReflowInput.ComputedPhysicalPadding());
   cbSize.ISize(aWM) -= border.IStartEnd(aWM);
   cbSize.BSize(aWM) -= border.BStartEnd(aWM);
 
   if (frame->GetParent()->GetContent() == frame->GetContent() &&
       frame->GetParent()->GetType() != nsGkAtoms::canvasFrame) {
     // We are a wrapped frame for the content (and the wrapper is not the
     // canvas frame, whose size is not meaningful here).
     // Use the container's dimensions, if they have been precomputed.
@@ -963,25 +963,25 @@ CalculateContainingBlockSizeForAbsolutes
     // frame is fully reflowed and using the resulting dimensions, even
     // if they're intrinsic.
     // In fact we should be attaching absolute children to the outermost
     // frame and not always sticking them in block frames.
 
     // First, find the reflow state for the outermost frame for this
     // content, except for fieldsets where the inner anonymous frame has
     // the correct padding area with the legend taken into account.
-    const ReflowInput* aLastRS = &aReflowState;
-    const ReflowInput* lastButOneRS = &aReflowState;
-    while (aLastRS->mParentReflowState &&
-           aLastRS->mParentReflowState->mFrame->GetContent() == frame->GetContent() &&
-           aLastRS->mParentReflowState->mFrame->GetType() != nsGkAtoms::fieldSetFrame) {
+    const ReflowInput* aLastRS = &aReflowInput;
+    const ReflowInput* lastButOneRS = &aReflowInput;
+    while (aLastRS->mParentReflowInput &&
+           aLastRS->mParentReflowInput->mFrame->GetContent() == frame->GetContent() &&
+           aLastRS->mParentReflowInput->mFrame->GetType() != nsGkAtoms::fieldSetFrame) {
       lastButOneRS = aLastRS;
-      aLastRS = aLastRS->mParentReflowState;
-    }
-    if (aLastRS != &aReflowState) {
+      aLastRS = aLastRS->mParentReflowInput;
+    }
+    if (aLastRS != &aReflowInput) {
       // Scrollbars need to be specifically excluded, if present, because they are outside the
       // padding-edge. We need better APIs for getting the various boxes from a frame.
       nsIScrollableFrame* scrollFrame = do_QueryFrame(aLastRS->mFrame);
       nsMargin scrollbars(0,0,0,0);
       if (scrollFrame) {
         scrollbars =
           scrollFrame->GetDesiredScrollbarSizes(aLastRS->mFrame->PresContext(),
                                                 aLastRS->mRenderingContext);
@@ -1016,99 +1016,99 @@ CalculateContainingBlockSizeForAbsolutes
   }
 
   return cbSize;
 }
 
 void
 nsBlockFrame::Reflow(nsPresContext*           aPresContext,
                      ReflowOutput&     aMetrics,
-                     const ReflowInput& aReflowState,
+                     const ReflowInput& aReflowInput,
                      nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsBlockFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
 #ifdef DEBUG
   if (gNoisyReflow) {
     IndentBy(stdout, gNoiseIndent);
     ListTag(stdout);
     printf(": begin reflow availSize=%d,%d computedSize=%d,%d\n",
-           aReflowState.AvailableISize(), aReflowState.AvailableBSize(),
-           aReflowState.ComputedISize(), aReflowState.ComputedBSize());
+           aReflowInput.AvailableISize(), aReflowInput.AvailableBSize(),
+           aReflowInput.ComputedISize(), aReflowInput.ComputedBSize());
   }
   AutoNoisyIndenter indent(gNoisy);
   PRTime start = 0; // Initialize these variablies to silence the compiler.
   int32_t ctc = 0;        // We only use these if they are set (gLameReflowMetrics).
   if (gLameReflowMetrics) {
     start = PR_Now();
     ctc = nsLineBox::GetCtorCount();
   }
 #endif
 
-  const ReflowInput *reflowState = &aReflowState;
-  WritingMode wm = aReflowState.GetWritingMode();
+  const ReflowInput *reflowInput = &aReflowInput;
+  WritingMode wm = aReflowInput.GetWritingMode();
   nscoord consumedBSize = GetConsumedBSize();
-  nscoord effectiveComputedBSize = GetEffectiveComputedBSize(aReflowState,
+  nscoord effectiveComputedBSize = GetEffectiveComputedBSize(aReflowInput,
                                                              consumedBSize);
-  Maybe<ReflowInput> mutableReflowState;
+  Maybe<ReflowInput> mutableReflowInput;
   // If we have non-auto block size, we're clipping our kids and we fit,
   // make sure our kids fit too.
-  if (aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
-      aReflowState.ComputedBSize() != NS_AUTOHEIGHT &&
-      ShouldApplyOverflowClipping(this, aReflowState.mStyleDisplay)) {
-    LogicalMargin blockDirExtras = aReflowState.ComputedLogicalBorderPadding();
+  if (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
+      aReflowInput.ComputedBSize() != NS_AUTOHEIGHT &&
+      ShouldApplyOverflowClipping(this, aReflowInput.mStyleDisplay)) {
+    LogicalMargin blockDirExtras = aReflowInput.ComputedLogicalBorderPadding();
     if (GetLogicalSkipSides().BStart()) {
       blockDirExtras.BStart(wm) = 0;
     } else {
       // Block-end margin never causes us to create continuations, so we
       // don't need to worry about whether it fits in its entirety.
       blockDirExtras.BStart(wm) +=
-        aReflowState.ComputedLogicalMargin().BStart(wm);
+        aReflowInput.ComputedLogicalMargin().BStart(wm);
     }
 
     if (effectiveComputedBSize + blockDirExtras.BStartEnd(wm) <=
-        aReflowState.AvailableBSize()) {
-      mutableReflowState.emplace(aReflowState);
-      mutableReflowState->AvailableBSize() = NS_UNCONSTRAINEDSIZE;
-      reflowState = mutableReflowState.ptr();
+        aReflowInput.AvailableBSize()) {
+      mutableReflowInput.emplace(aReflowInput);
+      mutableReflowInput->AvailableBSize() = NS_UNCONSTRAINEDSIZE;
+      reflowInput = mutableReflowInput.ptr();
     }
   }
 
   // See comment below about oldSize. Use *only* for the
   // abs-pos-containing-block-size-change optimization!
   nsSize oldSize = GetSize();
 
   // Should we create a float manager?
-  nsAutoFloatManager autoFloatManager(const_cast<ReflowInput&>(*reflowState));
+  nsAutoFloatManager autoFloatManager(const_cast<ReflowInput&>(*reflowInput));
 
   // XXXldb If we start storing the float manager in the frame rather
   // than keeping it around only during reflow then we should create it
   // only when there are actually floats to manage.  Otherwise things
   // like tables will gain significant bloat.
   bool needFloatManager = nsBlockFrame::BlockNeedsFloatManager(this);
   if (needFloatManager)
     autoFloatManager.CreateFloatManager(aPresContext);
 
   // OK, some lines may be reflowed. Blow away any saved line cursor
   // because we may invalidate the nondecreasing
   // overflowArea.VisualOverflow().y/yMost invariant, and we may even
   // delete the line with the line cursor.
   ClearLineCursor();
 
-  if (IsFrameTreeTooDeep(*reflowState, aMetrics, aStatus)) {
+  if (IsFrameTreeTooDeep(*reflowInput, aMetrics, aStatus)) {
     return;
   }
 
   bool blockStartMarginRoot, blockEndMarginRoot;
   IsMarginRoot(&blockStartMarginRoot, &blockEndMarginRoot);
 
   // Cache the consumed height in the block reflow state so that we don't have
   // to continually recompute it.
-  BlockReflowInput state(*reflowState, aPresContext, this,
+  BlockReflowInput state(*reflowInput, aPresContext, this,
                            blockStartMarginRoot, blockEndMarginRoot,
                            needFloatManager, consumedBSize);
 
   if (GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION)
     static_cast<nsBlockFrame*>(FirstContinuation())->ResolveBidi();
 
   if (RenumberLists(aPresContext)) {
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
@@ -1127,17 +1127,17 @@ nsBlockFrame::Reflow(nsPresContext*     
   // overflow lines hanging around; block reflow depends on the
   // overflow line lists being cleared out between reflow passes.
   DrainOverflowLines();
 
   // Handle paginated overflow (see nsContainerFrame.h)
   nsOverflowAreas ocBounds;
   nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
   if (GetPrevInFlow()) {
-    ReflowOverflowContainerChildren(aPresContext, *reflowState, ocBounds, 0,
+    ReflowOverflowContainerChildren(aPresContext, *reflowInput, ocBounds, 0,
                                     ocStatus);
   }
 
   // Now that we're done cleaning up our overflow container lists, we can
   // give |state| its nsOverflowContinuationTracker.
   nsOverflowContinuationTracker tracker(this, false);
   state.mOverflowTracker = &tracker;
 
@@ -1145,26 +1145,26 @@ nsBlockFrame::Reflow(nsPresContext*     
   DrainPushedFloats();
   nsOverflowAreas fcBounds;
   nsReflowStatus fcStatus = NS_FRAME_COMPLETE;
   ReflowPushedFloats(state, fcBounds, fcStatus);
 
   // If we're not dirty (which means we'll mark everything dirty later)
   // and our inline-size has changed, mark the lines dirty that we need to
   // mark dirty for a resize reflow.
-  if (!(GetStateBits() & NS_FRAME_IS_DIRTY) && reflowState->IsIResize()) {
+  if (!(GetStateBits() & NS_FRAME_IS_DIRTY) && reflowInput->IsIResize()) {
     PrepareResizeReflow(state);
   }
 
   // The same for percentage text-indent, except conditioned on the
   // parent resizing.
   if (!(GetStateBits() & NS_FRAME_IS_DIRTY) &&
-      reflowState->mCBReflowState &&
-      reflowState->mCBReflowState->IsIResize() &&
-      reflowState->mStyleText->mTextIndent.HasPercent() &&
+      reflowInput->mCBReflowInput &&
+      reflowInput->mCBReflowInput->IsIResize() &&
+      reflowInput->mStyleText->mTextIndent.HasPercent() &&
       !mLines.empty()) {
     mLines.front()->MarkDirty();
   }
 
   LazyMarkLinesDirty();
 
   mState &= ~NS_FRAME_FIRST_REFLOW;
 
@@ -1196,17 +1196,17 @@ nsBlockFrame::Reflow(nsPresContext*     
     }
   }
 
   NS_MergeReflowStatusInto(&state.mReflowStatus, ocStatus);
   NS_MergeReflowStatusInto(&state.mReflowStatus, fcStatus);
 
   // If we end in a BR with clear and affected floats continue,
   // we need to continue, too.
-  if (NS_UNCONSTRAINEDSIZE != reflowState->AvailableBSize() &&
+  if (NS_UNCONSTRAINEDSIZE != reflowInput->AvailableBSize() &&
       NS_FRAME_IS_COMPLETE(state.mReflowStatus) &&
       state.mFloatManager->ClearContinues(FindTrailingClear())) {
     NS_FRAME_SET_INCOMPLETE(state.mReflowStatus);
   }
 
   if (!NS_FRAME_IS_FULLY_COMPLETE(state.mReflowStatus)) {
     if (HasOverflowLines() || HasPushedFloats()) {
       state.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
@@ -1230,25 +1230,25 @@ nsBlockFrame::Reflow(nsPresContext*     
   // contains a block (example: <LI>\n<P>... ). This is where
   // the second case can happen.
   if (HasOutsideBullet() && !mLines.empty() &&
       (mLines.front()->IsBlock() ||
        (0 == mLines.front()->BSize() &&
         mLines.front() != mLines.back() &&
         mLines.begin().next()->IsBlock()))) {
     // Reflow the bullet
-    ReflowOutput metrics(aReflowState);
+    ReflowOutput metrics(aReflowInput);
     // XXX Use the entire line when we fix bug 25888.
     nsLayoutUtils::LinePosition position;
-    WritingMode wm = aReflowState.GetWritingMode();
+    WritingMode wm = aReflowInput.GetWritingMode();
     bool havePosition = nsLayoutUtils::GetFirstLinePosition(wm, this,
                                                             &position);
     nscoord lineBStart = havePosition ?
       position.mBStart :
-      reflowState->ComputedLogicalBorderPadding().BStart(wm);
+      reflowInput->ComputedLogicalBorderPadding().BStart(wm);
     nsIFrame* bullet = GetOutsideBullet();
     ReflowBullet(bullet, state, metrics, lineBStart);
     NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
                  "empty bullet took up space");
 
     if (havePosition && !BulletIsEmpty()) {
       // We have some lines to align the bullet with.  
 
@@ -1263,17 +1263,17 @@ nsBlockFrame::Reflow(nsPresContext*     
     // Otherwise just leave the bullet where it is, up against our
     // block-start padding.
   }
 
   CheckFloats(state);
 
   // Compute our final size
   nscoord blockEndEdgeOfChildren;
-  ComputeFinalSize(*reflowState, state, aMetrics, &blockEndEdgeOfChildren);
+  ComputeFinalSize(*reflowInput, state, aMetrics, &blockEndEdgeOfChildren);
 
   // If the block direction is right-to-left, we need to update the bounds of
   // lines that were placed relative to mContainerSize during reflow, as
   // we typically do not know the true container size until we've reflowed all
   // its children. So we use a dummy mContainerSize during reflow (see
   // BlockReflowInput's constructor) and then fix up the positions of the
   // lines here, once the final block size is known.
   //
@@ -1300,17 +1300,17 @@ nsBlockFrame::Reflow(nsPresContext*     
         for (nsIFrame* f : *bulletList) {
           f->MovePositionBy(physicalDelta);
         }
       }
     }
   }
 
   nsRect areaBounds = nsRect(0, 0, aMetrics.Width(), aMetrics.Height());
-  ComputeOverflowAreas(areaBounds, reflowState->mStyleDisplay,
+  ComputeOverflowAreas(areaBounds, reflowInput->mStyleDisplay,
                        blockEndEdgeOfChildren, aMetrics.mOverflowAreas);
   // Factor overflow container child bounds into the overflow area
   aMetrics.mOverflowAreas.UnionWith(ocBounds);
   // Factor pushed float child bounds into the overflow area
   aMetrics.mOverflowAreas.UnionWith(fcBounds);
 
   // Let the absolutely positioned container reflow any absolutely positioned
   // child frames that need to be reflowed, e.g., elements with a percentage
@@ -1328,32 +1328,32 @@ nsBlockFrame::Reflow(nsPresContext*     
   // When WillReflowAgainForClearance is true, we will reflow again without
   // resetting the size. Because of this, we must not reflow our abs-pos children
   // in that situation --- what we think is our "new size"
   // will not be our real new size. This also happens to be more efficient.
   WritingMode parentWM = aMetrics.GetWritingMode();
   if (HasAbsolutelyPositionedChildren()) {
     nsAbsoluteContainingBlock* absoluteContainer = GetAbsoluteContainingBlock();
     bool haveInterrupt = aPresContext->HasPendingInterrupt();
-    if (reflowState->WillReflowAgainForClearance() ||
+    if (reflowInput->WillReflowAgainForClearance() ||
         haveInterrupt) {
       // Make sure that when we reflow again we'll actually reflow all the abs
       // pos frames that might conceivably depend on our size (or all of them,
       // if we're dirty right now and interrupted; in that case we also need
       // to mark them all with NS_FRAME_IS_DIRTY).  Sadly, we can't do much
       // better than that, because we don't really know what our size will be,
       // and it might in fact not change on the followup reflow!
       if (haveInterrupt && (GetStateBits() & NS_FRAME_IS_DIRTY)) {
         absoluteContainer->MarkAllFramesDirty();
       } else {
         absoluteContainer->MarkSizeDependentFramesDirty();
       }
     } else {
       LogicalSize containingBlockSize =
-        CalculateContainingBlockSizeForAbsolutes(parentWM, *reflowState,
+        CalculateContainingBlockSizeForAbsolutes(parentWM, *reflowInput,
                                                  aMetrics.Size(parentWM));
 
       // Mark frames that depend on changes we just made to this frame as dirty:
       // Now we can assume that the padding edge hasn't moved.
       // We need to reflow the absolutes if one of them depends on
       // its placeholder position, or the containing block size in a
       // direction in which the containing block size might have
       // changed.
@@ -1362,34 +1362,34 @@ nsBlockFrame::Reflow(nsPresContext*     
       // when nsAbsoluteContainingBlock is logicalized
       bool cbWidthChanged = aMetrics.Width() != oldSize.width;
       bool isRoot = !GetContent()->GetParent();
       // If isRoot and we have auto height, then we are the initial
       // containing block and the containing block height is the
       // viewport height, which can't change during incremental
       // reflow.
       bool cbHeightChanged =
-        !(isRoot && NS_UNCONSTRAINEDSIZE == reflowState->ComputedHeight()) &&
+        !(isRoot && NS_UNCONSTRAINEDSIZE == reflowInput->ComputedHeight()) &&
         aMetrics.Height() != oldSize.height;
 
       nsRect containingBlock(nsPoint(0, 0),
                              containingBlockSize.GetPhysicalSize(parentWM));
       AbsPosReflowFlags flags = AbsPosReflowFlags::eConstrainHeight;
       if (cbWidthChanged) {
         flags |= AbsPosReflowFlags::eCBWidthChanged;
       }
       if (cbHeightChanged) {
         flags |= AbsPosReflowFlags::eCBHeightChanged;
       }
       // 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.
       SetupLineCursor();
-      absoluteContainer->Reflow(this, aPresContext, *reflowState,
+      absoluteContainer->Reflow(this, aPresContext, *reflowInput,
                                 state.mReflowStatus,
                                 containingBlock, flags,
                                 &aMetrics.mOverflowAreas);
       ClearLineCursor();
     }
   }
 
   FinishAndStoreOverflow(&aMetrics);
@@ -1447,17 +1447,17 @@ nsBlockFrame::Reflow(nsPresContext*     
     char buf[400];
     snprintf_literal(buf,
                      ": %lld elapsed (%lld per line) (%d lines; %d new lines)",
                      delta, perLineDelta, numLines, ectc - ctc);
     printf("%s\n", buf);
   }
 #endif
 
-  NS_FRAME_SET_TRUNCATION(aStatus, (*reflowState), aMetrics);
+  NS_FRAME_SET_TRUNCATION(aStatus, (*reflowInput), aMetrics);
 }
 
 bool
 nsBlockFrame::CheckForCollapsedBEndMarginFromClearanceLine()
 {
   line_iterator begin = begin_lines();
   line_iterator line = end_lines();
 
@@ -1472,36 +1472,36 @@ nsBlockFrame::CheckForCollapsedBEndMargi
     if (line->HasClearance()) {
       return true;
     }
   }
   // not reached
 }
 
 void
-nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
+nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
                                BlockReflowInput&      aState,
                                ReflowOutput&     aMetrics,
                                nscoord*                 aBEndEdgeOfChildren)
 {
-  WritingMode wm = aState.mReflowState.GetWritingMode();
+  WritingMode wm = aState.mReflowInput.GetWritingMode();
   const LogicalMargin& borderPadding = aState.BorderPadding();
 #ifdef NOISY_FINAL_SIZE
   ListTag(stdout);
   printf(": mBCoord=%d mIsBEndMarginRoot=%s mPrevBEndMargin=%d bp=%d,%d\n",
          aState.mBCoord, aState.GetFlag(BRS_ISBENDMARGINROOT) ? "yes" : "no",
          aState.mPrevBEndMargin.get(),
          borderPadding.BStart(wm), borderPadding.BEnd(wm));
 #endif
 
   // Compute final inline size
   LogicalSize finalSize(wm);
   finalSize.ISize(wm) =
     NSCoordSaturatingAdd(NSCoordSaturatingAdd(borderPadding.IStart(wm),
-                                              aReflowState.ComputedISize()),
+                                              aReflowInput.ComputedISize()),
                          borderPadding.IEnd(wm));
 
   // Return block-end margin information
   // rbs says he hit this assertion occasionally (see bug 86947), so
   // just set the margin to zero and we'll figure out why later
   //NS_ASSERTION(aMetrics.mCarriedOutBEndMargin.IsZero(),
   //             "someone else set the margin");
   nscoord nonCarriedOutBDirMargin = 0;
@@ -1520,99 +1520,99 @@ nsBlockFrame::ComputeFinalSize(const Ref
     aMetrics.mCarriedOutBEndMargin = aState.mPrevBEndMargin;
   } else {
     aMetrics.mCarriedOutBEndMargin.Zero();
   }
 
   nscoord blockEndEdgeOfChildren = aState.mBCoord + nonCarriedOutBDirMargin;
   // Shrink wrap our height around our contents.
   if (aState.GetFlag(BRS_ISBENDMARGINROOT) ||
-      NS_UNCONSTRAINEDSIZE != aReflowState.ComputedBSize()) {
+      NS_UNCONSTRAINEDSIZE != aReflowInput.ComputedBSize()) {
     // When we are a block-end-margin root make sure that our last
     // childs block-end margin is fully applied. We also do this when
     // we have a computed height, since in that case the carried out
     // margin is not going to be applied anywhere, so we should note it
     // here to be included in the overflow area.
     // Apply the margin only if there's space for it.
-    if (blockEndEdgeOfChildren < aState.mReflowState.AvailableBSize())
+    if (blockEndEdgeOfChildren < aState.mReflowInput.AvailableBSize())
     {
       // Truncate block-end margin if it doesn't fit to our available BSize.
       blockEndEdgeOfChildren =
         std::min(blockEndEdgeOfChildren + aState.mPrevBEndMargin.get(),
-               aState.mReflowState.AvailableBSize());
+               aState.mReflowInput.AvailableBSize());
     }
   }
   if (aState.GetFlag(BRS_FLOAT_MGR)) {
     // Include the float manager's state to properly account for the
     // block-end margin of any floated elements; e.g., inside a table cell.
     nscoord floatHeight =
       aState.ClearFloats(blockEndEdgeOfChildren, NS_STYLE_CLEAR_BOTH,
                          nullptr, nsFloatManager::DONT_CLEAR_PUSHED_FLOATS);
     blockEndEdgeOfChildren = std::max(blockEndEdgeOfChildren, floatHeight);
   }
 
-  if (NS_UNCONSTRAINEDSIZE != aReflowState.ComputedBSize()
+  if (NS_UNCONSTRAINEDSIZE != aReflowInput.ComputedBSize()
       && (GetParent()->GetType() != nsGkAtoms::columnSetFrame ||
-          aReflowState.mParentReflowState->AvailableBSize() == NS_UNCONSTRAINEDSIZE)) {
-    ComputeFinalBSize(aReflowState, &aState.mReflowStatus,
+          aReflowInput.mParentReflowInput->AvailableBSize() == NS_UNCONSTRAINEDSIZE)) {
+    ComputeFinalBSize(aReflowInput, &aState.mReflowStatus,
                       aState.mBCoord + nonCarriedOutBDirMargin,
                       borderPadding, finalSize, aState.mConsumedBSize);
     if (!NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
       // Use the current height; continuations will take up the rest.
       // Do extend the height to at least consume the available
       // height, otherwise our left/right borders (for example) won't
       // extend all the way to the break.
-      finalSize.BSize(wm) = std::max(aReflowState.AvailableBSize(),
+      finalSize.BSize(wm) = std::max(aReflowInput.AvailableBSize(),
                                      aState.mBCoord + nonCarriedOutBDirMargin);
       // ... but don't take up more block size than is available
       nscoord effectiveComputedBSize =
-        GetEffectiveComputedBSize(aReflowState, aState.GetConsumedBSize());
+        GetEffectiveComputedBSize(aReflowInput, aState.GetConsumedBSize());
       finalSize.BSize(wm) =
         std::min(finalSize.BSize(wm),
                  borderPadding.BStart(wm) + effectiveComputedBSize);
       // XXX It's pretty wrong that our bottom border still gets drawn on
       // on its own on the last-in-flow, even if we ran out of height
       // here. We need GetSkipSides to check whether we ran out of content
       // height in the current frame, not whether it's last-in-flow.
     }
 
     // Don't carry out a block-end margin when our BSize is fixed.
     aMetrics.mCarriedOutBEndMargin.Zero();
   }
   else if (NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
     nscoord contentBSize = blockEndEdgeOfChildren - borderPadding.BStart(wm);
-    nscoord autoBSize = aReflowState.ApplyMinMaxBSize(contentBSize);
+    nscoord autoBSize = aReflowInput.ApplyMinMaxBSize(contentBSize);
     if (autoBSize != contentBSize) {
       // Our min- or max-bsize value made our bsize change.  Don't carry out
       // our kids' block-end margins.
       aMetrics.mCarriedOutBEndMargin.Zero();
     }
     autoBSize += borderPadding.BStart(wm) + borderPadding.BEnd(wm);
     finalSize.BSize(wm) = autoBSize;
   }
   else {
-    NS_ASSERTION(aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
+    NS_ASSERTION(aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
       "Shouldn't be incomplete if availableBSize is UNCONSTRAINED.");
     finalSize.BSize(wm) = std::max(aState.mBCoord,
-                                   aReflowState.AvailableBSize());
-    if (aReflowState.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
+                                   aReflowInput.AvailableBSize());
+    if (aReflowInput.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
       // This should never happen, but it does. See bug 414255
       finalSize.BSize(wm) = aState.mBCoord;
     }
   }
 
   if (IS_TRUE_OVERFLOW_CONTAINER(this)) {
     if (NS_FRAME_IS_NOT_COMPLETE(aState.mReflowStatus)) {
       // Overflow containers can only be overflow complete.
       // Note that auto height overflow containers have no normal children
       NS_ASSERTION(finalSize.BSize(wm) == 0,
                    "overflow containers must be zero-block-size");
       NS_FRAME_SET_OVERFLOW_INCOMPLETE(aState.mReflowStatus);
     }
-  } else if (aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
+  } else if (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
              !NS_INLINE_IS_BREAK_BEFORE(aState.mReflowStatus) &&
              NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
     // Currently only used for grid items, but could be used in other contexts.
     // The FragStretchBSizeProperty is our expected non-fragmented block-size
     // we should stretch to (for align-self:stretch etc).  In some fragmentation
     // cases though, the last fragment (this frame since we're complete), needs
     // to have extra size applied because earlier fragments consumed too much of
     // our computed size due to overflowing their containing block.  (E.g. this
@@ -1861,28 +1861,28 @@ nsBlockFrame::PrepareResizeReflow(BlockR
   if (gDisableResizeOpt) {
     tryAndSkipLines = false;
   }
   if (gNoisyReflow) {
     if (!tryAndSkipLines) {
       IndentBy(stdout, gNoiseIndent);
       ListTag(stdout);
       printf(": marking all lines dirty: availISize=%d\n",
-             aState.mReflowState.AvailableISize());
+             aState.mReflowInput.AvailableISize());
     }
   }
 #endif
 
   if (tryAndSkipLines) {
-    WritingMode wm = aState.mReflowState.GetWritingMode();
+    WritingMode wm = aState.mReflowInput.GetWritingMode();
     nscoord newAvailISize =
-      aState.mReflowState.ComputedLogicalBorderPadding().IStart(wm) +
-      aState.mReflowState.ComputedISize();
-    NS_ASSERTION(NS_UNCONSTRAINEDSIZE != aState.mReflowState.ComputedLogicalBorderPadding().IStart(wm) &&
-                 NS_UNCONSTRAINEDSIZE != aState.mReflowState.ComputedISize(),
+      aState.mReflowInput.ComputedLogicalBorderPadding().IStart(wm) +
+      aState.mReflowInput.ComputedISize();
+    NS_ASSERTION(NS_UNCONSTRAINEDSIZE != aState.mReflowInput.ComputedLogicalBorderPadding().IStart(wm) &&
+                 NS_UNCONSTRAINEDSIZE != aState.mReflowInput.ComputedISize(),
                  "math on NS_UNCONSTRAINEDSIZE");
 
 #ifdef DEBUG
     if (gNoisyReflow) {
       IndentBy(stdout, gNoiseIndent);
       ListTag(stdout);
       printf(": trying to avoid marking all lines dirty\n");
     }
@@ -1951,35 +1951,35 @@ nsBlockFrame::PrepareResizeReflow(BlockR
  * |aDeltaBCoord| indicates how much it will later be slid (assuming it
  * doesn't get marked dirty and reflowed entirely).
  */
 void
 nsBlockFrame::PropagateFloatDamage(BlockReflowInput& aState,
                                    nsLineBox* aLine,
                                    nscoord aDeltaBCoord)
 {
-  nsFloatManager *floatManager = aState.mReflowState.mFloatManager;
-  NS_ASSERTION((aState.mReflowState.mParentReflowState &&
-                aState.mReflowState.mParentReflowState->mFloatManager == floatManager) ||
-                aState.mReflowState.mBlockDelta == 0, "Bad block delta passed in");
+  nsFloatManager *floatManager = aState.mReflowInput.mFloatManager;
+  NS_ASSERTION((aState.mReflowInput.mParentReflowInput &&
+                aState.mReflowInput.mParentReflowInput->mFloatManager == floatManager) ||
+                aState.mReflowInput.mBlockDelta == 0, "Bad block delta passed in");
 
   // Check to see if there are any floats; if there aren't, there can't
   // be any float damage
   if (!floatManager->HasAnyFloats())
     return;
 
   // Check the damage region recorded in the float damage.
   if (floatManager->HasFloatDamage()) {
     // Need to check mBounds *and* mCombinedArea to find intersections 
     // with aLine's floats
     nscoord lineBCoordBefore = aLine->BStart() + aDeltaBCoord;
     nscoord lineBCoordAfter = lineBCoordBefore + aLine->BSize();
     // Scrollable overflow should be sufficient for things that affect
     // layout.
-    WritingMode wm = aState.mReflowState.GetWritingMode();
+    WritingMode wm = aState.mReflowInput.GetWritingMode();
     nsSize containerSize = aState.ContainerSize();
     LogicalRect overflow = aLine->GetOverflowArea(eScrollableOverflow, wm,
                                                   containerSize);
     nscoord lineBCoordCombinedBefore = overflow.BStart(wm) + aDeltaBCoord;
     nscoord lineBCoordCombinedAfter = lineBCoordCombinedBefore +
                                       overflow.BSize(wm);
 
     bool isDirty = floatManager->IntersectsDamage(lineBCoordBefore,
@@ -1988,17 +1988,17 @@ nsBlockFrame::PropagateFloatDamage(Block
                                                   lineBCoordCombinedAfter);
     if (isDirty) {
       aLine->MarkDirty();
       return;
     }
   }
 
   // Check if the line is moving relative to the float manager
-  if (aDeltaBCoord + aState.mReflowState.mBlockDelta != 0) {
+  if (aDeltaBCoord + aState.mReflowInput.mBlockDelta != 0) {
     if (aLine->IsBlock()) {
       // Unconditionally reflow sliding blocks; we only really need to reflow
       // if there's a float impacting this block, but the current float manager
       // makes it difficult to check that.  Therefore, we let the child block
       // decide what it needs to reflow.
       aLine->MarkDirty();
     } else {
       bool wasImpactedByFloat = aLine->IsImpactedByFloat();
@@ -2078,30 +2078,30 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
   bool foundAnyClears = aState.mFloatBreakType != NS_STYLE_CLEAR_NONE;
   bool willReflowAgain = false;
 
 #ifdef DEBUG
   if (gNoisyReflow) {
     IndentBy(stdout, gNoiseIndent);
     ListTag(stdout);
     printf(": reflowing dirty lines");
-    printf(" computedISize=%d\n", aState.mReflowState.ComputedISize());
+    printf(" computedISize=%d\n", aState.mReflowInput.ComputedISize());
   }
   AutoNoisyIndenter indent(gNoisyReflow);
 #endif
 
   bool selfDirty = (GetStateBits() & NS_FRAME_IS_DIRTY) ||
-                     (aState.mReflowState.IsBResize() &&
+                     (aState.mReflowInput.IsBResize() &&
                       (GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE));
 
   // Reflow our last line if our availableBSize has increased
   // so that we (and our last child) pull up content as necessary
-  if (aState.mReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE
-      && GetNextInFlow() && aState.mReflowState.AvailableBSize() >
-        GetLogicalSize().BSize(aState.mReflowState.GetWritingMode())) {
+  if (aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE
+      && GetNextInFlow() && aState.mReflowInput.AvailableBSize() >
+        GetLogicalSize().BSize(aState.mReflowInput.GetWritingMode())) {
     line_iterator lastLine = end_lines();
     if (lastLine != begin_lines()) {
       --lastLine;
       lastLine->MarkDirty();
     }
   }
     // the amount by which we will slide the current line if it is not
     // dirty
@@ -2202,19 +2202,19 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
     // If we have a constrained height (i.e., breaking columns/pages),
     // and the distance to the bottom might have changed, then we need
     // to reflow any line that might have floats in it, both because the
     // breakpoints within those floats may have changed and because we
     // might have to push/pull the floats in their entirety.
     // FIXME: What about a deltaBCoord or block-size change that forces us to
     // push lines?  Why does that work?
     if (!line->IsDirty() &&
-        aState.mReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
-        (deltaBCoord != 0 || aState.mReflowState.IsBResize() ||
-         aState.mReflowState.mFlags.mMustReflowPlaceholders) &&
+        aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
+        (deltaBCoord != 0 || aState.mReflowInput.IsBResize() ||
+         aState.mReflowInput.mFlags.mMustReflowPlaceholders) &&
         (line->IsBlock() || line->HasFloats() || line->HadFloatPushed())) {
       line->MarkDirty();
     }
 
     if (!line->IsDirty()) {
       // See if there's any reflow damage that requires that we mark the
       // line dirty.
       PropagateFloatDamage(aState, line, deltaBCoord);
@@ -2230,17 +2230,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
                         !GetNextInFlow() &&
                         NS_STYLE_TEXT_ALIGN_AUTO == StyleText()->mTextAlignLast;
       uint8_t align = isLastLine ?
         StyleText()->mTextAlign : StyleText()->mTextAlignLast;
 
       if (line->mWritingMode.IsVertical() ||
           !line->mWritingMode.IsBidiLTR() ||
           !IsAlignedLeft(align,
-                         aState.mReflowState.mStyleVisibility->mDirection,
+                         aState.mReflowInput.mStyleVisibility->mDirection,
                          StyleTextReset()->mUnicodeBidi, this)) {
         line->MarkDirty();
       }
     }
 
     if (needToRecoverState && line->IsDirty()) {
       // We need to reconstruct the block-end margin only if we didn't
       // reflow the previous line and we do need to reflow (or repair
@@ -2264,17 +2264,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
     // Now repair the line and update |aState.mBCoord| by calling
     // |ReflowLine| or |SlideLine|.
     // If we're going to reflow everything again, then no need to reflow
     // the dirty line ... unless the line has floats, in which case we'd
     // better reflow it now to refresh its float cache, which may contain
     // dangling frame pointers! Ugh! This reflow of the line may be
     // incorrect because we skipped reflowing previous lines (e.g., floats
     // may be placed incorrectly), but that's OK because we'll mark the
-    // line dirty below under "if (aState.mReflowState.mDiscoveredClearance..."
+    // line dirty below under "if (aState.mReflowInput.mDiscoveredClearance..."
     if (line->IsDirty() && (line->HasFloats() || !willReflowAgain)) {
       lastLineMovedUp = true;
 
       bool maybeReflowingForFirstTime =
         line->IStart() == 0 && line->BStart() == 0 &&
         line->ISize() == 0 && line->BSize() == 0;
 
       // Compute the dirty lines "before" BEnd, after factoring in
@@ -2285,17 +2285,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
 
       NS_ASSERTION(!willReflowAgain || !line->IsBlock(),
                    "Don't reflow blocks while willReflowAgain is true, reflow of block abs-pos children depends on this");
 
       // Reflow the dirty line. If it's an incremental reflow, then force
       // it to invalidate the dirty area if necessary
       ReflowLine(aState, line, &keepGoing);
 
-      if (aState.mReflowState.WillReflowAgainForClearance()) {
+      if (aState.mReflowInput.WillReflowAgainForClearance()) {
         line->MarkDirty();
         willReflowAgain = true;
         // Note that once we've entered this state, every line that gets here
         // (e.g. because it has floats) gets marked dirty and reflowed again.
         // in the next pass. This is important, see above.
       }
 
       if (line->HasFloats()) {
@@ -2465,20 +2465,20 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
   // -- and we cannot have added more space for its first line to be
   // pulled up into,
   // -- it's an incremental reflow of a descendant
   // -- and we didn't reflow any floats (so the available space
   // didn't change)
   // -- my chain of next-in-flows either has no first line, or its first
   // line isn't dirty.
   bool heightConstrained =
-    aState.mReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE;
+    aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE;
   bool skipPull = willReflowAgain && heightConstrained;
   if (!skipPull && heightConstrained && aState.mNextInFlow &&
-      (aState.mReflowState.mFlags.mNextInFlowUntouched &&
+      (aState.mReflowInput.mFlags.mNextInFlowUntouched &&
        !lastLineMovedUp && 
        !(GetStateBits() & NS_FRAME_IS_DIRTY) &&
        !reflowedFloat)) {
     // We'll place lineIter at the last line of this block, so that 
     // nsBlockInFlowLineIterator::Next() will take us to the first
     // line of my next-in-flow-chain.  (But first, check that I 
     // have any lines -- if I don't, just bail out of this
     // optimization.) 
@@ -2570,17 +2570,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
       } else {
         // Now reflow it and any lines that it makes during it's reflow
         // (we have to loop here because reflowing the line may cause a new
         // line to be created; see SplitLine's callers for examples of
         // when this happens).
         while (line != end_lines()) {
           ReflowLine(aState, line, &keepGoing);
 
-          if (aState.mReflowState.WillReflowAgainForClearance()) {
+          if (aState.mReflowInput.WillReflowAgainForClearance()) {
             line->MarkDirty();
             keepGoing = false;
             NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
             break;
           }
 
           DumpLine(aState, line, deltaBCoord, -1);
           if (!keepGoing) {
@@ -2608,31 +2608,31 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
 
     if (NS_FRAME_IS_NOT_COMPLETE(aState.mReflowStatus)) {
       aState.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
     } //XXXfr shouldn't set this flag when nextinflow has no lines
   }
 
   // Handle an odd-ball case: a list-item with no lines
   if (HasOutsideBullet() && mLines.empty()) {
-    ReflowOutput metrics(aState.mReflowState);
+    ReflowOutput metrics(aState.mReflowInput);
     nsIFrame* bullet = GetOutsideBullet();
-    WritingMode wm = aState.mReflowState.GetWritingMode();
+    WritingMode wm = aState.mReflowInput.GetWritingMode();
     ReflowBullet(bullet, aState, metrics,
-                 aState.mReflowState.ComputedPhysicalBorderPadding().top);
+                 aState.mReflowInput.ComputedPhysicalBorderPadding().top);
     NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
                  "empty bullet took up space");
 
     if (!BulletIsEmpty()) {
       // There are no lines so we have to fake up some y motion so that
       // we end up with *some* height.
 
       if (metrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
         nscoord ascent;
-        WritingMode wm = aState.mReflowState.GetWritingMode();
+        WritingMode wm = aState.mReflowInput.GetWritingMode();
         if (nsLayoutUtils::GetFirstLineBaseline(wm, bullet, &ascent)) {
           metrics.SetBlockStartAscent(ascent);
         } else {
           metrics.SetBlockStartAscent(metrics.BSize(wm));
         }
       }
 
       RefPtr<nsFontMetrics> fm =
@@ -3124,20 +3124,20 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
   nsIFrame* frame = aLine->mFirstChild;
   if (!frame) {
     NS_ASSERTION(false, "program error - unexpected empty line"); 
     return; 
   }
 
   // Prepare the block reflow engine
   const nsStyleDisplay* display = frame->StyleDisplay();
-  nsBlockReflowContext brc(aState.mPresContext, aState.mReflowState);
+  nsBlockReflowContext brc(aState.mPresContext, aState.mReflowInput);
 
   uint8_t breakType =
-    display->PhysicalBreakType(aState.mReflowState.GetWritingMode());
+    display->PhysicalBreakType(aState.mReflowInput.GetWritingMode());
   if (NS_STYLE_CLEAR_NONE != aState.mFloatBreakType) {
     breakType = nsLayoutUtils::CombineBreakType(breakType,
                                                 aState.mFloatBreakType);
     aState.mFloatBreakType = NS_STYLE_CLEAR_NONE;
   }
 
   // Clear past floats before the block if the clear style is not none
   aLine->SetBreakTypeBefore(breakType);
@@ -3166,23 +3166,23 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
     replacedBlock = frame;
   }
 
   // If our block-start margin was counted as part of some parent's block-start
   // margin collapse, and we are being speculatively reflowed assuming this
   // frame DID NOT need clearance, then we need to check that
   // assumption.
   if (!treatWithClearance && !applyBStartMargin && mightClearFloats &&
-      aState.mReflowState.mDiscoveredClearance) {
+      aState.mReflowInput.mDiscoveredClearance) {
     nscoord curBCoord = aState.mBCoord + aState.mPrevBEndMargin.get();
     nscoord clearBCoord = aState.ClearFloats(curBCoord, breakType, replacedBlock);
     if (clearBCoord != curBCoord) {
       // Only record the first frame that requires clearance
-      if (!*aState.mReflowState.mDiscoveredClearance) {
-        *aState.mReflowState.mDiscoveredClearance = frame;
+      if (!*aState.mReflowInput.mDiscoveredClearance) {
+        *aState.mReflowInput.mDiscoveredClearance = frame;
       }
       aState.mPrevChild = frame;
       // Exactly what we do now is flexible since we'll definitely be
       // reflowed.
       return;
     }
   }
   if (treatWithClearance) {
@@ -3201,39 +3201,39 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
     nscoord bStartMargin = 0;
     bool mayNeedRetry = false;
     bool clearedFloats = false;
     if (applyBStartMargin) {
       // Precompute the blocks block-start margin value so that we can get the
       // correct available space (there might be a float that's
       // already been placed below the aState.mPrevBEndMargin
 
-      // Setup a reflowState to get the style computed block-start margin
+      // Setup a reflowInput to get the style computed block-start margin
       // value. We'll use a reason of `resize' so that we don't fudge
       // any incremental reflow state.
 
       // The availSpace here is irrelevant to our needs - all we want
       // out if this setup is the block-start margin value which doesn't depend
       // on the childs available space.
       // XXX building a complete ReflowInput just to get the block-start
       // margin seems like a waste. And we do this for almost every block!
       WritingMode wm = frame->GetWritingMode();
       LogicalSize availSpace = aState.ContentSize(wm);
-      ReflowInput reflowState(aState.mPresContext, aState.mReflowState,
+      ReflowInput reflowInput(aState.mPresContext, aState.mReflowInput,
                                     frame, availSpace);
 
       if (treatWithClearance) {
         aState.mBCoord += aState.mPrevBEndMargin.get();
         aState.mPrevBEndMargin.Zero();
       }
 
       // Now compute the collapsed margin-block-start value into
       // aState.mPrevBEndMargin, assuming that all child margins
       // collapse down to clearanceFrame.
-      brc.ComputeCollapsedBStartMargin(reflowState,
+      brc.ComputeCollapsedBStartMargin(reflowInput,
                                        &aState.mPrevBEndMargin,
                                        clearanceFrame,
                                        &mayNeedRetry);
 
       // XXX optimization; we could check the collapsing children to see if they are sure
       // to require clearance, and so avoid retrying them
 
       if (clearanceFrame) {
@@ -3259,17 +3259,17 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
           aLine->SetHasClearance();
 
           // Apply incoming margins
           aState.mBCoord += aState.mPrevBEndMargin.get();
           aState.mPrevBEndMargin.Zero();
 
           // Compute the collapsed margin again, ignoring the incoming margin this time
           mayNeedRetry = false;
-          brc.ComputeCollapsedBStartMargin(reflowState,
+          brc.ComputeCollapsedBStartMargin(reflowInput,
                                            &aState.mPrevBEndMargin,
                                            clearanceFrame,
                                            &mayNeedRetry);
         }
       }
 
       // Temporarily advance the running Y value so that the
       // GetAvailableSpace method will return the right available
@@ -3306,42 +3306,42 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
       }
     }
 
     aLine->SetLineIsImpactedByFloat(false);
 
     // Here aState.mBCoord is the block-start border-edge of the block.
     // Compute the available space for the block
     nsFlowAreaRect floatAvailableSpace = aState.GetFloatAvailableSpace();
-    WritingMode wm = aState.mReflowState.GetWritingMode();
+    WritingMode wm = aState.mReflowInput.GetWritingMode();
     LogicalRect availSpace(wm);
     aState.ComputeBlockAvailSpace(frame, display, floatAvailableSpace,
                                   replacedBlock != nullptr, availSpace);
 
     // The check for
-    //   (!aState.mReflowState.mFlags.mIsTopOfPage || clearedFloats)
+    //   (!aState.mReflowInput.mFlags.mIsTopOfPage || clearedFloats)
     // is to some degree out of paranoia:  if we reliably eat up block-start
     // margins at the top of the page as we ought to, it wouldn't be
     // needed.
-    if ((!aState.mReflowState.mFlags.mIsTopOfPage || clearedFloats) &&
+    if ((!aState.mReflowInput.mFlags.mIsTopOfPage || clearedFloats) &&
         availSpace.BSize(wm) < 0) {
       // We know already that this child block won't fit on this
       // page/column due to the block-start margin or the clearance.  So we
       // need to get out of here now.  (If we don't, most blocks will handle
       // things fine, and report break-before, but zero-height blocks
       // won't, and will thus make their parent overly-large and force
       // *it* to be pushed in its entirety.)
       // Doing this means that we also don't need to worry about the
       // |availSpace.BSize(wm) += bStartMargin| below interacting with
       // pushed floats (which force nscoord_MAX clearance) to cause a
       // constrained block size to turn into an unconstrained one.
       aState.mBCoord = startingBCoord;
       aState.mPrevBEndMargin = incomingMargin;
       *aKeepReflowGoing = false;
-      if (ShouldAvoidBreakInside(aState.mReflowState)) {
+      if (ShouldAvoidBreakInside(aState.mReflowInput)) {
         aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
       } else {
         PushLines(aState, aLine.prev());
         NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
       }
       return;
     }
 
@@ -3352,46 +3352,46 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
     if (NS_UNCONSTRAINEDSIZE != availSpace.BSize(wm)) {
       availSpace.BSize(wm) += bStartMargin;
     }
 
     // construct the html reflow state for the block. ReflowBlock
     // will initialize it.
     Maybe<ReflowInput> blockHtmlRS;
     blockHtmlRS.emplace(
-      aState.mPresContext, aState.mReflowState, frame,
+      aState.mPresContext, aState.mReflowInput, frame,
       availSpace.Size(wm).ConvertTo(frame->GetWritingMode(), wm));
 
     nsFloatManager::SavedState floatManagerState;
     nsReflowStatus frameReflowStatus;
     do {
       if (floatAvailableSpace.mHasFloats) {
         // Set if floatAvailableSpace.mHasFloats is true for any
         // iteration of the loop.
         aLine->SetLineIsImpactedByFloat(true);
       }
 
       // We might need to store into mDiscoveredClearance later if it's
       // currently null; we want to overwrite any writes that
       // brc.ReflowBlock() below does, so we need to remember now
       // whether it's empty.
       const bool shouldStoreClearance =
-        aState.mReflowState.mDiscoveredClearance &&
-        !*aState.mReflowState.mDiscoveredClearance;
+        aState.mReflowInput.mDiscoveredClearance &&
+        !*aState.mReflowInput.mDiscoveredClearance;
 
       // Reflow the block into the available space
       if (mayNeedRetry || replacedBlock) {
         aState.mFloatManager->PushState(&floatManagerState);
       }
 
       if (mayNeedRetry) {
         blockHtmlRS->mDiscoveredClearance = &clearanceFrame;
       } else if (!applyBStartMargin) {
         blockHtmlRS->mDiscoveredClearance =
-          aState.mReflowState.mDiscoveredClearance;
+          aState.mReflowInput.mDiscoveredClearance;
       }
 
       frameReflowStatus = NS_FRAME_COMPLETE;
       brc.ReflowBlock(availSpace, applyBStartMargin, aState.mPrevBEndMargin,
                       clearance, aState.IsAdjacentWithTop(),
                       aLine.get(), *blockHtmlRS, frameReflowStatus, aState);
 
       // Now the block has a height.  Using that height, get the
@@ -3452,21 +3452,21 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
       if (!advanced && availSpace.IsEqualEdges(oldAvailSpace)) {
         break;
       }
 
       // We need another reflow.
       aState.mFloatManager->PopState(&floatManagerState);
 
       if (!treatWithClearance && !applyBStartMargin &&
-          aState.mReflowState.mDiscoveredClearance) {
+          aState.mReflowInput.mDiscoveredClearance) {
         // We set shouldStoreClearance above to record only the first
         // frame that requires clearance.
         if (shouldStoreClearance) {
-          *aState.mReflowState.mDiscoveredClearance = frame;
+          *aState.mReflowInput.mDiscoveredClearance = frame;
         }
         aState.mPrevChild = frame;
         // Exactly what we do now is flexible since we'll definitely be
         // reflowed.
         return;
       }
 
       if (advanced) {
@@ -3476,17 +3476,17 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
         applyBStartMargin = false;
         bStartMargin = 0;
         treatWithClearance = true; // avoid hitting test above
         clearance = 0;
       }
 
       blockHtmlRS.reset();
       blockHtmlRS.emplace(
-        aState.mPresContext, aState.mReflowState, frame,
+        aState.mPresContext, aState.mReflowInput, frame,
         availSpace.Size(wm).ConvertTo(frame->GetWritingMode(), wm));
     } while (true);
 
     if (mayNeedRetry && clearanceFrame) {
       aState.mFloatManager->PopState(&floatManagerState);
       aState.mBCoord = startingBCoord;
       aState.mPrevBEndMargin = incomingMargin;
       continue;
@@ -3507,17 +3507,17 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
 
 #if defined(REFLOW_STATUS_COVERAGE)
     RecordReflowStatus(true, frameReflowStatus);
 #endif
 
     if (NS_INLINE_IS_BREAK_BEFORE(frameReflowStatus)) {
       // None of the child block fits.
       *aKeepReflowGoing = false;
-      if (ShouldAvoidBreakInside(aState.mReflowState)) {
+      if (ShouldAvoidBreakInside(aState.mReflowInput)) {
         aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
       } else {
         PushLines(aState, aLine.prev());
         NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
       }
     }
     else {
       // Note: line-break-after a block is a nop
@@ -3532,17 +3532,17 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
         !floatAvailableSpace.mHasFloats;
       nsCollapsingMargin collapsedBEndMargin;
       nsOverflowAreas overflowAreas;
       *aKeepReflowGoing = brc.PlaceBlock(*blockHtmlRS, forceFit, aLine.get(),
                                          collapsedBEndMargin,
                                          overflowAreas,
                                          frameReflowStatus);
       if (!NS_FRAME_IS_FULLY_COMPLETE(frameReflowStatus) &&
-          ShouldAvoidBreakInside(aState.mReflowState)) {
+          ShouldAvoidBreakInside(aState.mReflowInput)) {
         *aKeepReflowGoing = false;
       }
 
       if (aLine->SetCarriedOutBEndMargin(collapsedBEndMargin)) {
         line_iterator nextLine = aLine;
         ++nextLine;
         if (nextLine != end_lines()) {
           nextLine->MarkPreviousMarginDirty();
@@ -3678,17 +3678,17 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
         printf(": frame=");
         nsFrame::ListTag(stdout, mFrame);
         printf(" carriedOutBEndMargin=%d collapsedBEndMargin=%d => %d\n",
                brc.GetCarriedOutBEndMargin().get(), collapsedBEndMargin.get(),
                aState.mPrevBEndMargin.get());
 #endif
       } else {
         if ((aLine == mLines.front() && !GetPrevInFlow()) ||
-            ShouldAvoidBreakInside(aState.mReflowState)) {
+            ShouldAvoidBreakInside(aState.mReflowInput)) {
           // If it's our very first line *or* we're not at the top of the page
           // and we have page-break-inside:avoid, then we need to be pushed to
           // our parent's next-in-flow.
           aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
         } else {
           // Push the line that didn't fit and any lines that follow it
           // to our next-in-flow.
           PushLines(aState, aLine.prev());
@@ -3733,28 +3733,28 @@ nsBlockFrame::ReflowInlineFrames(BlockRe
     nscoord availableSpaceHeight = 0;
     do {
       bool allowPullUp = true;
       nsIFrame* forceBreakInFrame = nullptr;
       int32_t forceBreakOffset = -1;
       gfxBreakPriority forceBreakPriority = gfxBreakPriority::eNoBreak;
       do {
         nsFloatManager::SavedState floatManagerState;
-        aState.mReflowState.mFloatManager->PushState(&floatManagerState);
+        aState.mReflowInput.mFloatManager->PushState(&floatManagerState);
 
         // Once upon a time we allocated the first 30 nsLineLayout objects
         // on the stack, and then we switched to the heap.  At that time
         // these objects were large (1100 bytes on a 32 bit system).
         // Then the nsLineLayout object was shrunk to 156 bytes by
         // removing some internal buffers.  Given that it is so much
         // smaller, the complexity of 2 different ways of allocating
         // no longer makes sense.  Now we always allocate on the stack.
         nsLineLayout lineLayout(aState.mPresContext,
-                                aState.mReflowState.mFloatManager,
-                                &aState.mReflowState, &aLine, nullptr);
+                                aState.mReflowInput.mFloatManager,
+                                &aState.mReflowInput, &aLine, nullptr);
         lineLayout.Init(&aState, aState.mMinLineHeight, aState.mLineNumber);
         if (forceBreakInFrame) {
           lineLayout.ForceBreakAtPosition(forceBreakInFrame, forceBreakOffset);
         }
         DoReflowInlineFrames(aState, lineLayout, aLine,
                              floatAvailableSpace, availableSpaceHeight,
                              &floatManagerState, aKeepReflowGoing,
                              &lineReflowStatus, allowPullUp);
@@ -3769,17 +3769,17 @@ nsBlockFrame::ReflowInlineFrames(BlockRe
             // set forceBreakInFrame to null and we won't back up, which is
             // correct.
             forceBreakInFrame =
               lineLayout.GetLastOptionalBreakPosition(&forceBreakOffset, &forceBreakPriority);
           } else {
             forceBreakInFrame = nullptr;
           }
           // restore the float manager state
-          aState.mReflowState.mFloatManager->PopState(&floatManagerState);
+          aState.mReflowInput.mFloatManager->PopState(&floatManagerState);
           // Clear out float lists
           aState.mCurrentLineFloats.DeleteAll();
           aState.mBelowCurrentLineFloats.DeleteAll();
         }
 
         // Don't allow pullup on a subsequent LINE_REFLOW_REDO_NO_PULL pass
         allowPullUp = false;
       } while (LINE_REFLOW_REDO_NO_PULL == lineReflowStatus);
@@ -3825,17 +3825,17 @@ nsBlockFrame::DoReflowInlineFrames(Block
   // are impacted by floats.
   if (aFloatAvailableSpace.mHasFloats)
     aLine->SetLineIsImpactedByFloat(true);
 #ifdef REALLY_NOISY_REFLOW
   printf("nsBlockFrame::DoReflowInlineFrames %p impacted = %d\n",
          this, aFloatAvailableSpace.mHasFloats);
 #endif
 
-  WritingMode outerWM = aState.mReflowState.GetWritingMode();
+  WritingMode outerWM = aState.mReflowInput.GetWritingMode();
   WritingMode lineWM = GetWritingMode(aLine->mFirstChild);
   LogicalRect lineRect =
     aFloatAvailableSpace.mRect.ConvertTo(lineWM, outerWM,
                                          aState.ContainerSize());
 
   nscoord iStart = lineRect.IStart(lineWM);
   nscoord availISize = lineRect.ISize(lineWM);
   nscoord availBSize;
@@ -3980,19 +3980,19 @@ nsBlockFrame::DoReflowInlineFrames(Block
       // We should never hit this case if we've placed floats on the
       // line; if we have, then the GetFloatAvailableSpace call is wrong
       // and needs to happen after the caller pops the space manager
       // state.
       aState.mFloatManager->AssertStateMatches(aFloatStateBeforeLine);
       aState.mBCoord += aFloatAvailableSpace.mRect.BSize(outerWM);
       aFloatAvailableSpace = aState.GetFloatAvailableSpace();
     } else {
-      NS_ASSERTION(NS_UNCONSTRAINEDSIZE != aState.mReflowState.AvailableBSize(),
+      NS_ASSERTION(NS_UNCONSTRAINEDSIZE != aState.mReflowInput.AvailableBSize(),
                    "We shouldn't be running out of height here");
-      if (NS_UNCONSTRAINEDSIZE == aState.mReflowState.AvailableBSize()) {
+      if (NS_UNCONSTRAINEDSIZE == aState.mReflowInput.AvailableBSize()) {
         // just move it down a bit to try to get out of this mess
         aState.mBCoord += 1;
         // We should never hit this case if we've placed floats on the
         // line; if we have, then the GetFloatAvailableSpace call is wrong
         // and needs to happen after the caller pops the space manager
         // state.
         aState.mFloatManager->AssertStateMatches(aFloatStateBeforeLine);
         aFloatAvailableSpace = aState.GetFloatAvailableSpace();
@@ -4249,17 +4249,17 @@ nsBlockFrame::SplitFloat(BlockReflowInpu
     nextInFlow = aState.mPresContext->PresShell()->FrameConstructor()->
       CreateContinuingFrame(aState.mPresContext, aFloat, this);
   }
   if (NS_FRAME_OVERFLOW_IS_INCOMPLETE(aFloatStatus)) {
     nextInFlow->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
   }
 
   uint8_t floatStyle =
-    aFloat->StyleDisplay()->PhysicalFloats(aState.mReflowState.GetWritingMode());
+    aFloat->StyleDisplay()->PhysicalFloats(aState.mReflowInput.GetWritingMode());
   if (floatStyle == NS_STYLE_FLOAT_LEFT) {
     aState.mFloatManager->SetSplitLeftFloatAcrossBreak();
   } else {
     MOZ_ASSERT(floatStyle == NS_STYLE_FLOAT_RIGHT, "unexpected float side");
     aState.mFloatManager->SetSplitRightFloatAcrossBreak();
   }
 
   aState.AppendPushedFloatChain(nextInFlow);
@@ -4419,25 +4419,25 @@ nsBlockFrame::PlaceLine(BlockReflowInput
   //
   // According to the CSS2 spec, section 12.6.1, the "marker" box
   // participates in the height calculation of the list-item box's
   // first line box.
   //
   // There are exactly two places a bullet can be placed: near the
   // first or second line. It's only placed on the second line in a
   // rare case: when the first line is empty.
-  WritingMode wm = aState.mReflowState.GetWritingMode();
+  WritingMode wm = aState.mReflowInput.GetWritingMode();
   bool addedBullet = false;
   if (HasOutsideBullet() &&
       ((aLine == mLines.front() &&
         (!aLineLayout.IsZeroBSize() || (aLine == mLines.back()))) ||
        (mLines.front() != mLines.back() &&
         0 == mLines.front()->BSize() &&
         aLine == mLines.begin().next()))) {
-    ReflowOutput metrics(aState.mReflowState);
+    ReflowOutput metrics(aState.mReflowInput);
     nsIFrame* bullet = GetOutsideBullet();
     ReflowBullet(bullet, aState, metrics, aState.mBCoord);
     NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
                  "empty bullet took up space");
     aLineLayout.AddBulletFrame(bullet, metrics);
     addedBullet = true;
   }
   aLineLayout.VerticalAlignLine();
@@ -4538,28 +4538,28 @@ nsBlockFrame::PlaceLine(BlockReflowInput
     // We already called |ShouldApplyBStartMargin|, and if we applied it
     // then BRS_APPLYBSTARTMARGIN is set.
     nscoord dy = aState.GetFlag(BRS_APPLYBSTARTMARGIN)
                    ? -aState.mPrevBEndMargin.get() : 0;
     newBCoord = aState.mBCoord + dy;
   }
 
   if (!NS_FRAME_IS_FULLY_COMPLETE(aState.mReflowStatus) &&
-      ShouldAvoidBreakInside(aState.mReflowState)) {
+      ShouldAvoidBreakInside(aState.mReflowInput)) {
     aLine->AppendFloats(aState.mCurrentLineFloats);
     aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
     return true;
   }
 
   // See if the line fit (our first line always does).
   if (mLines.front() != aLine &&
       newBCoord > aState.mBEndEdge &&
       aState.mBEndEdge != NS_UNCONSTRAINEDSIZE) {
     NS_ASSERTION(aState.mCurrentLine == aLine, "oops");
-    if (ShouldAvoidBreakInside(aState.mReflowState)) {
+    if (ShouldAvoidBreakInside(aState.mReflowInput)) {
       // All our content doesn't fit, start on the next page.
       aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
     } else {
       // Push aLine and all of its children and anything else that
       // follows to our next-in-flow.
       PushTruncatedLine(aState, aLine, aKeepReflowGoing);
     }
     return true;
@@ -6046,17 +6046,17 @@ LogicalRect
 nsBlockFrame::AdjustFloatAvailableSpace(BlockReflowInput& aState,
                                         const LogicalRect& aFloatAvailableSpace,
                                         nsIFrame* aFloatFrame)
 {
   // Compute the available inline size. By default, assume the inline
   // size of the containing block.
   nscoord availISize;
   const nsStyleDisplay* floatDisplay = aFloatFrame->StyleDisplay();
-  WritingMode wm = aState.mReflowState.GetWritingMode();
+  WritingMode wm = aState.mReflowInput.GetWritingMode();
 
   if (NS_STYLE_DISPLAY_TABLE != floatDisplay->mDisplay ||
       eCompatibility_NavQuirks != aState.mPresContext->CompatibilityMode() ) {
     availISize = aState.ContentISize();
   }
   else {
     // This quirk matches the one in BlockReflowInput::FlowAndPlaceFloat
     // give tables only the available space
@@ -6090,20 +6090,20 @@ nsBlockFrame::ComputeFloatISize(BlockRef
 {
   NS_PRECONDITION(aFloat->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
                   "aFloat must be an out-of-flow frame");
   // Reflow the float.
   LogicalRect availSpace = AdjustFloatAvailableSpace(aState,
                                                      aFloatAvailableSpace,
                                                      aFloat);
 
-  WritingMode blockWM = aState.mReflowState.GetWritingMode();
+  WritingMode blockWM = aState.mReflowInput.GetWritingMode();
   WritingMode floatWM = aFloat->GetWritingMode();
   ReflowInput
-    floatRS(aState.mPresContext, aState.mReflowState, aFloat,
+    floatRS(aState.mPresContext, aState.mReflowInput, aFloat,
             availSpace.Size(blockWM).ConvertTo(floatWM, blockWM));
 
   return floatRS.ComputedSizeWithMarginBorderPadding(blockWM).ISize(blockWM);
 }
 
 void
 nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
                           const LogicalRect&  aAdjustedAvailableSpace,
@@ -6113,27 +6113,27 @@ nsBlockFrame::ReflowFloat(BlockReflowInp
                           bool                aFloatPushedDown,
                           nsReflowStatus&     aReflowStatus)
 {
   NS_PRECONDITION(aFloat->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
                   "aFloat must be an out-of-flow frame");
   // Reflow the float.
   aReflowStatus = NS_FRAME_COMPLETE;
 
-  WritingMode wm = aState.mReflowState.GetWritingMode();
+  WritingMode wm = aState.mReflowInput.GetWritingMode();
 #ifdef NOISY_FLOAT
   printf("Reflow Float %p in parent %p, availSpace(%d,%d,%d,%d)\n",
          aFloat, this,
          aAdjustedAvailableSpace.IStart(wm), aAdjustedAvailableSpace.BStart(wm),
          aAdjustedAvailableSpace.ISize(wm), aAdjustedAvailableSpace.BSize(wm)
   );
 #endif
 
   ReflowInput
-    floatRS(aState.mPresContext, aState.mReflowState, aFloat,
+    floatRS(aState.mPresContext, aState.mReflowInput, aFloat,
             aAdjustedAvailableSpace.Size(wm).ConvertTo(aFloat->GetWritingMode(),
                                                        wm));
 
   // Normally the mIsTopOfPage state is copied from the parent reflow
   // state.  However, when reflowing a float, if we've placed other
   // floats that force this float *down* or *narrower*, we should unset
   // the mIsTopOfPage state.
   // FIXME: This is somewhat redundant with the |isAdjacentWithTop|
@@ -6142,17 +6142,17 @@ nsBlockFrame::ReflowFloat(BlockReflowInp
   // about adjacency with the top, so it seems misleading.
   if (floatRS.mFlags.mIsTopOfPage &&
       (aFloatPushedDown ||
        aAdjustedAvailableSpace.ISize(wm) != aState.ContentISize())) {
     floatRS.mFlags.mIsTopOfPage = false;
   }
 
   // Setup a block reflow context to reflow the float.
-  nsBlockReflowContext brc(aState.mPresContext, aState.mReflowState);
+  nsBlockReflowContext brc(aState.mPresContext, aState.mReflowInput);
 
   // Reflow the float
   bool isAdjacentWithTop = aState.IsAdjacentWithTop();
 
   nsIFrame* clearanceFrame = nullptr;
   do {
     nsCollapsingMargin margin;
     bool mayNeedRetry = false;
@@ -7172,32 +7172,32 @@ nsBlockFrame::RenumberListsFor(nsPresCon
 }
 
 void
 nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
                            BlockReflowInput& aState,
                            ReflowOutput& aMetrics,
                            nscoord aLineTop)
 {
-  const ReflowInput &rs = aState.mReflowState;
+  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 reflowState(aState.mPresContext, rs,
+  ReflowInput reflowInput(aState.mPresContext, rs,
                                 aBulletFrame, availSize);
   nsReflowStatus  status;
-  aBulletFrame->Reflow(aState.mPresContext, aMetrics, reflowState, 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
   // they reposition the line.
   LogicalRect floatAvailSpace =
     aState.GetFloatAvailableSpaceWithState(aLineTop,
@@ -7217,31 +7217,31 @@ nsBlockFrame::ReflowBullet(nsIFrame* aBu
 
   // 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 = 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 =
-    reflowState.ComputedLogicalMargin().ConvertTo(wm, bulletWM);
+    reflowInput.ComputedLogicalMargin().ConvertTo(wm, bulletWM);
   nscoord iStart = floatAvailSpace.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,
                                         aMetrics.ISize(wm),
                                         aMetrics.BSize(wm)),
                         aState.ContainerSize());
-  aBulletFrame->DidReflow(aState.mPresContext, &aState.mReflowState,
+  aBulletFrame->DidReflow(aState.mPresContext, &aState.mReflowInput,
                           nsDidReflowStatus::FINISHED);
 }
 
 // This is used to scan frames for any float placeholders, add their
 // floats to the list represented by aList, and remove the
 // floats from whatever list they might be in. We don't search descendants
 // that are float containing blocks.  Floats that or not children of 'this'
 // are ignored (they are not added to aList).
@@ -7393,18 +7393,18 @@ nsBlockFrame::BlockCanIntersectFloats(ns
 // matter.
 /* static */
 nsBlockFrame::ReplacedElementISizeToClear
 nsBlockFrame::ISizeToClearPastFloats(const BlockReflowInput& aState,
                                      const LogicalRect& aFloatAvailableSpace,
                                      nsIFrame* aFrame)
 {
   nscoord inlineStartOffset, inlineEndOffset;
-  WritingMode wm = aState.mReflowState.GetWritingMode();
-  SizeComputationInput offsetState(aFrame, aState.mReflowState.mRenderingContext,
+  WritingMode wm = aState.mReflowInput.GetWritingMode();
+  SizeComputationInput offsetState(aFrame, aState.mReflowInput.mRenderingContext,
                                wm, aState.mContentArea.ISize(wm));
 
   ReplacedElementISizeToClear result;
   aState.ComputeReplacedBlockOffsetsForFloats(aFrame, aFloatAvailableSpace,
                                               inlineStartOffset,
                                               inlineEndOffset);
   nscoord availISize = aState.mContentArea.ISize(wm) -
                        inlineStartOffset - inlineEndOffset;
@@ -7413,21 +7413,21 @@ nsBlockFrame::ISizeToClearPastFloats(con
   // want to displace if the width won't compute to a value small enough
   // to fit.
   // All we really need here is the result of ComputeSize, and we
   // could *almost* get that from an SizeComputationInput, except for the
   // last argument.
   WritingMode frWM = aFrame->GetWritingMode();
   LogicalSize availSpace = LogicalSize(wm, availISize, NS_UNCONSTRAINEDSIZE).
                              ConvertTo(frWM, wm);
-  ReflowInput reflowState(aState.mPresContext, aState.mReflowState,
+  ReflowInput reflowInput(aState.mPresContext, aState.mReflowInput,
                                 aFrame, availSpace);
   result.borderBoxISize =
-    reflowState.ComputedSizeWithBorderPadding().ConvertTo(wm, frWM).ISize(wm);
-  // Use the margins from offsetState rather than reflowState so that
+    reflowInput.ComputedSizeWithBorderPadding().ConvertTo(wm, frWM).ISize(wm);
+  // Use the margins from offsetState rather than reflowInput so that
   // they aren't reduced by ignoring margins in overconstrained cases.
   LogicalMargin computedMargin =
     offsetState.ComputedLogicalMargin().ConvertTo(wm, frWM);
   result.marginIStart = computedMargin.IStart(wm);
   return result;
 }
  
 /* static */
@@ -7444,59 +7444,59 @@ nsBlockFrame::GetNearestAncestorBlock(ns
     // Not a block. Check its parent next.
     aCandidate = aCandidate->GetParent();
   }
   NS_NOTREACHED("Fell off frame tree looking for ancestor block!");
   return nullptr;
 }
 
 void
-nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowState,
+nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
                                 nsReflowStatus*          aStatus,
                                 nscoord                  aContentBSize,
                                 const LogicalMargin&     aBorderPadding,
                                 LogicalSize&             aFinalSize,
                                 nscoord                  aConsumed)
 {
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
   // Figure out how much of the computed height should be
   // applied to this frame.
-  nscoord computedBSizeLeftOver = GetEffectiveComputedBSize(aReflowState,
+  nscoord computedBSizeLeftOver = GetEffectiveComputedBSize(aReflowInput,
                                                             aConsumed);
   NS_ASSERTION(!( IS_TRUE_OVERFLOW_CONTAINER(this)
                   && computedBSizeLeftOver ),
                "overflow container must not have computedBSizeLeftOver");
 
   aFinalSize.BSize(wm) =
     NSCoordSaturatingAdd(NSCoordSaturatingAdd(aBorderPadding.BStart(wm),
                                               computedBSizeLeftOver),
                          aBorderPadding.BEnd(wm));
 
   if (NS_FRAME_IS_NOT_COMPLETE(*aStatus) &&
-      aFinalSize.BSize(wm) < aReflowState.AvailableBSize()) {
+      aFinalSize.BSize(wm) < aReflowInput.AvailableBSize()) {
     // We fit in the available space - change status to OVERFLOW_INCOMPLETE.
     // XXXmats why didn't Reflow report OVERFLOW_INCOMPLETE in the first place?
     // XXXmats and why exclude the case when our size == AvailableBSize?
     NS_FRAME_SET_OVERFLOW_INCOMPLETE(*aStatus);
   }
 
   if (NS_FRAME_IS_COMPLETE(*aStatus)) {
     if (computedBSizeLeftOver > 0 &&
-        NS_UNCONSTRAINEDSIZE != aReflowState.AvailableBSize() &&
-        aFinalSize.BSize(wm) > aReflowState.AvailableBSize()) {
-      if (ShouldAvoidBreakInside(aReflowState)) {
+        NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableBSize() &&
+        aFinalSize.BSize(wm) > aReflowInput.AvailableBSize()) {
+      if (ShouldAvoidBreakInside(aReflowInput)) {
         *aStatus = NS_INLINE_LINE_BREAK_BEFORE();
         return;
       }
       // We don't fit and we consumed some of the computed height,
       // so we should consume all the available height and then
       // break.  If our bottom border/padding straddles the break
       // point, then this will increase our height and push the
       // border/padding to the next page/column.
-      aFinalSize.BSize(wm) = std::max(aReflowState.AvailableBSize(),
+      aFinalSize.BSize(wm) = std::max(aReflowInput.AvailableBSize(),
                                       aContentBSize);
       NS_FRAME_SET_INCOMPLETE(*aStatus);
       if (!GetNextInFlow())
         *aStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
     }
   }
 }
 
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -236,40 +236,40 @@ public:
 
   virtual nsresult GetPrefWidthTightBounds(nsRenderingContext* aContext,
                                            nscoord* aX,
                                            nscoord* aXMost) override;
 
   /**
    * Compute the final block size of this frame.
    *
-   * @param aReflowState Data structure passed from parent during reflow.
+   * @param aReflowInput Data structure passed from parent during reflow.
    * @param aReflowStatus A pointer to the reflow status for when we're finished
    *        doing reflow. this will get set appropriately if the block-size
    *        causes us to exceed the current available (page) block-size.
    * @param aContentBSize The block-size of content, precomputed outside of this
    *        function. The final block-size that is used in aMetrics will be set
    *        to either this or the available block-size, whichever is larger, in
    *        the case where our available block-size is constrained, and we
    *        overflow that available block-size.
    * @param aBorderPadding The margins representing the border padding for block
    *        frames. Can be 0.
    * @param aFinalSize Out parameter for final block-size.
    * @param aConsumed The block-size already consumed by our previous-in-flows.
    */
-  void ComputeFinalBSize(const ReflowInput&      aReflowState,
+  void ComputeFinalBSize(const ReflowInput&      aReflowInput,
                          nsReflowStatus*               aStatus,
                          nscoord                       aContentBSize,
                          const mozilla::LogicalMargin& aBorderPadding,
                          mozilla::LogicalSize&         aFinalSize,
                          nscoord                       aConsumed);
 
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual nsresult AttributeChanged(int32_t         aNameSpaceID,
                                     nsIAtom*        aAttribute,
                                     int32_t         aModType) override;
 
   /**
    * Move any frames on our overflow list to the end of our principal list.
@@ -409,17 +409,17 @@ protected:
                  nsLineBox* aLine, nscoord aDeltaBCoord);
 
   void UpdateLineContainerSize(nsLineBox* aLine,
                                const nsSize& aNewContainerSize);
 
   // helper for SlideLine and UpdateLineContainerSize
   void MoveChildFramesOfLine(nsLineBox* aLine, nscoord aDeltaBCoord);
 
-  void ComputeFinalSize(const ReflowInput& aReflowState,
+  void ComputeFinalSize(const ReflowInput& aReflowInput,
                         BlockReflowInput&      aState,
                         ReflowOutput&     aMetrics,
                         nscoord*                 aBottomEdgeOfChildren);
 
   void ComputeOverflowAreas(const nsRect&         aBounds,
                             const nsStyleDisplay* aDisplay,
                             nscoord               aBottomEdgeOfChildren,
                             nsOverflowAreas&      aOverflowAreas);
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -25,17 +25,17 @@ using namespace mozilla;
 #undef  NOISY_MAX_ELEMENT_SIZE
 #undef   REALLY_NOISY_MAX_ELEMENT_SIZE
 #undef  NOISY_BLOCK_DIR_MARGINS
 #endif
 
 nsBlockReflowContext::nsBlockReflowContext(nsPresContext* aPresContext,
                                            const ReflowInput& aParentRS)
   : mPresContext(aPresContext),
-    mOuterReflowState(aParentRS),
+    mOuterReflowInput(aParentRS),
     mSpace(aParentRS.GetWritingMode()),
     mMetrics(aParentRS)
 {
 }
 
 static nsIFrame* DescendIntoBlockLevelFrame(nsIFrame* aFrame)
 {
   nsIAtom* type = aFrame->GetType();
@@ -147,51 +147,51 @@ nsBlockReflowContext::ComputeCollapsedBS
           // child blocks margin and so in so that we can look into
           // it. For its margins to be computed we need to have a reflow
           // state for it.
 
           // We may have to construct an extra reflow state here if
           // we drilled down through a block wrapper. At the moment
           // we can only drill down one level so we only have to support
           // one extra reflow state.
-          const ReflowInput* outerReflowState = &aRS;
+          const ReflowInput* outerReflowInput = &aRS;
           if (frame != aRS.mFrame) {
             NS_ASSERTION(frame->GetParent() == aRS.mFrame,
                          "Can only drill through one level of block wrapper");
             LogicalSize availSpace = aRS.ComputedSize(frame->GetWritingMode());
-            outerReflowState = new ReflowInput(prescontext,
+            outerReflowInput = new ReflowInput(prescontext,
                                                      aRS, frame, availSpace);
           }
           {
             LogicalSize availSpace =
-              outerReflowState->ComputedSize(kid->GetWritingMode());
-            ReflowInput innerReflowState(prescontext,
-                                               *outerReflowState, kid,
+              outerReflowInput->ComputedSize(kid->GetWritingMode());
+            ReflowInput innerReflowInput(prescontext,
+                                               *outerReflowInput, kid,
                                                availSpace);
             // Record that we're being optimistic by assuming the kid
             // has no clearance
             if (kid->StyleDisplay()->mBreakType != NS_STYLE_CLEAR_NONE ||
                 !nsBlockFrame::BlockCanIntersectFloats(kid)) {
               *aMayNeedRetry = true;
             }
-            if (ComputeCollapsedBStartMargin(innerReflowState, aMargin,
+            if (ComputeCollapsedBStartMargin(innerReflowInput, aMargin,
                                              aClearanceFrame, aMayNeedRetry,
                                              &isEmpty)) {
               line->MarkDirty();
               dirtiedLine = true;
             }
             if (isEmpty) {
-              WritingMode innerWM = innerReflowState.GetWritingMode();
+              WritingMode innerWM = innerReflowInput.GetWritingMode();
               LogicalMargin innerMargin =
-                innerReflowState.ComputedLogicalMargin().ConvertTo(parentWM, innerWM);
+                innerReflowInput.ComputedLogicalMargin().ConvertTo(parentWM, innerWM);
               aMargin->Include(innerMargin.BEnd(parentWM));
             }
           }
-          if (outerReflowState != &aRS) {
-            delete const_cast<ReflowInput*>(outerReflowState);
+          if (outerReflowInput != &aRS) {
+            delete const_cast<ReflowInput*>(outerReflowInput);
           }
         }
         if (!isEmpty) {
           if (!setBlockIsEmpty && aBlockIsEmpty) {
             setBlockIsEmpty = true;
             *aBlockIsEmpty = false;
           }
           goto done;
@@ -227,29 +227,29 @@ nsBlockReflowContext::ReflowBlock(const 
                                   nscoord             aClearance,
                                   bool                aIsAdjacentWithBStart,
                                   nsLineBox*          aLine,
                                   ReflowInput&  aFrameRS,
                                   nsReflowStatus&     aFrameReflowStatus,
                                   BlockReflowInput& aState)
 {
   mFrame = aFrameRS.mFrame;
-  mWritingMode = aState.mReflowState.GetWritingMode();
+  mWritingMode = aState.mReflowInput.GetWritingMode();
   mContainerSize = aState.ContainerSize();
   mSpace = aSpace;
 
   if (!aIsAdjacentWithBStart) {
     aFrameRS.mFlags.mIsTopOfPage = false;  // make sure this is cleared
   }
 
   if (aApplyBStartMargin) {
     mBStartMargin = aPrevMargin;
 
 #ifdef NOISY_BLOCKDIR_MARGINS
-    nsFrame::ListTag(stdout, mOuterReflowState.mFrame);
+    nsFrame::ListTag(stdout, mOuterReflowInput.mFrame);
     printf(": reflowing ");
     nsFrame::ListTag(stdout, mFrame);
     printf(" margin => %d, clearance => %d\n", mBStartMargin.get(), aClearance);
 #endif
 
     // Adjust the available size if it's constrained so that the
     // child frame doesn't think it can reflow into its margin area.
     if (mWritingMode.IsOrthogonalTo(mFrame->GetWritingMode())) {
@@ -289,27 +289,27 @@ nsBlockReflowContext::ReflowBlock(const 
                       usedMargin.IStartEnd(mWritingMode),
                       mSpace.BSize(mWritingMode) -
                       usedMargin.BStartEnd(mWritingMode));
     tI = space.LineLeft(mWritingMode, mContainerSize);
     tB = mBCoord;
 
     if ((mFrame->GetStateBits() & NS_BLOCK_FLOAT_MGR) == 0)
       aFrameRS.mBlockDelta =
-        mOuterReflowState.mBlockDelta + mBCoord - aLine->BStart();
+        mOuterReflowInput.mBlockDelta + mBCoord - aLine->BStart();
   }
 
 #ifdef DEBUG
   mMetrics.ISize(mWritingMode) = nscoord(0xdeadbeef);
   mMetrics.BSize(mWritingMode) = nscoord(0xdeadbeef);
 #endif
 
-  mOuterReflowState.mFloatManager->Translate(tI, tB);
+  mOuterReflowInput.mFloatManager->Translate(tI, tB);
   mFrame->Reflow(mPresContext, mMetrics, aFrameRS, aFrameReflowStatus);
-  mOuterReflowState.mFloatManager->Translate(-tI, -tB);
+  mOuterReflowInput.mFloatManager->Translate(-tI, -tB);
 
 #ifdef DEBUG
   if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
     if ((CRAZY_SIZE(mMetrics.ISize(mWritingMode)) ||
          CRAZY_SIZE(mMetrics.BSize(mWritingMode))) &&
         !mFrame->GetParent()->IsCrazySizeAssertSuppressed()) {
       printf("nsBlockReflowContext: ");
       nsFrame::ListTag(stdout, mFrame);
@@ -352,29 +352,29 @@ nsBlockReflowContext::ReflowBlock(const 
 }
 
 /**
  * Attempt to place the block frame within the available space.  If
  * it fits, apply inline-dir ("horizontal") positioning (CSS 10.3.3),
  * collapse margins (CSS2 8.3.1). Also apply relative positioning.
  */
 bool
-nsBlockReflowContext::PlaceBlock(const ReflowInput&  aReflowState,
+nsBlockReflowContext::PlaceBlock(const ReflowInput&  aReflowInput,
                                  bool                      aForceFit,
                                  nsLineBox*                aLine,
                                  nsCollapsingMargin&       aBEndMarginResult,
                                  nsOverflowAreas&          aOverflowAreas,
                                  nsReflowStatus            aReflowStatus)
 {
   // Compute collapsed block-end margin value.
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
   WritingMode parentWM = mMetrics.GetWritingMode();
   if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {
     aBEndMarginResult = mMetrics.mCarriedOutBEndMargin;
-    aBEndMarginResult.Include(aReflowState.ComputedLogicalMargin().
+    aBEndMarginResult.Include(aReflowInput.ComputedLogicalMargin().
       ConvertTo(parentWM, wm).BEnd(parentWM));
   } else {
     // The used block-end-margin is set to zero before a break.
     aBEndMarginResult.Zero();
   }
 
   nscoord backupContainingBlockAdvance = 0;
 
@@ -390,17 +390,17 @@ nsBlockReflowContext::PlaceBlock(const R
   bool empty = 0 == mMetrics.BSize(parentWM) && aLine->CachedIsEmpty();
   if (empty) {
     // Collapse the block-end margin with the block-start margin that was
     // already applied.
     aBEndMarginResult.Include(mBStartMargin);
 
 #ifdef NOISY_BLOCKDIR_MARGINS
     printf("  ");
-    nsFrame::ListTag(stdout, mOuterReflowState.mFrame);
+    nsFrame::ListTag(stdout, mOuterReflowInput.mFrame);
     printf(": ");
     nsFrame::ListTag(stdout, mFrame);
     printf(" -- collapsing block start & end margin together; BStart=%d spaceBStart=%d\n",
            mBCoord, mSpace.BStart(mWritingMode));
 #endif
     // Section 8.3.1 of CSS 2.1 says that blocks with adjoining
     // "top/bottom" (i.e. block-start/end) margins whose top margin collapses
     // with their parent's top margin should have their top border-edge at the
@@ -426,17 +426,17 @@ nsBlockReflowContext::PlaceBlock(const R
   // even if there's some sort of integer overflow that makes bCoord +
   // mMetrics.BSize() appear to go beyond the available block size.
   if (!empty && !aForceFit &&
       mSpace.BSize(mWritingMode) != NS_UNCONSTRAINEDSIZE) {
     nscoord bEnd = mBCoord -
                    backupContainingBlockAdvance + mMetrics.BSize(mWritingMode);
     if (bEnd > mSpace.BEnd(mWritingMode)) {
       // didn't fit, we must acquit.
-      mFrame->DidReflow(mPresContext, &aReflowState,
+      mFrame->DidReflow(mPresContext, &aReflowInput,
                         nsDidReflowStatus::FINISHED);
       return false;
     }
   }
 
   aLine->SetBounds(mWritingMode,
                    mICoord, mBCoord - backupContainingBlockAdvance,
                    mMetrics.ISize(mWritingMode), mMetrics.BSize(mWritingMode),
@@ -446,19 +446,19 @@ nsBlockReflowContext::PlaceBlock(const R
   LogicalPoint logPos =
     LogicalPoint(mWritingMode, mICoord, mBCoord).
       ConvertTo(frameWM, mWritingMode,
                 mContainerSize - mMetrics.PhysicalSize());
 
   // ApplyRelativePositioning in right-to-left writing modes needs to
   // know the updated frame width
   mFrame->SetSize(mWritingMode, mMetrics.Size(mWritingMode));
-  aReflowState.ApplyRelativePositioning(&logPos, mContainerSize);
+  aReflowInput.ApplyRelativePositioning(&logPos, mContainerSize);
 
   // Now place the frame and complete the reflow process
   nsContainerFrame::FinishReflowChild(mFrame, mPresContext, mMetrics,
-                                      &aReflowState, frameWM, logPos,
+                                      &aReflowInput, frameWM, logPos,
                                       mContainerSize, 0);
 
   aOverflowAreas = mMetrics.mOverflowAreas + mFrame->GetPosition();
 
   return true;
 }
--- a/layout/generic/nsBlockReflowContext.h
+++ b/layout/generic/nsBlockReflowContext.h
@@ -32,21 +32,21 @@ public:
   ~nsBlockReflowContext() { }
 
   void ReflowBlock(const mozilla::LogicalRect& aSpace,
                    bool                        aApplyBStartMargin,
                    nsCollapsingMargin&         aPrevMargin,
                    nscoord                     aClearance,
                    bool                        aIsAdjacentWithBStart,
                    nsLineBox*                  aLine,
-                   ReflowInput&          aReflowState,
+                   ReflowInput&          aReflowInput,
                    nsReflowStatus&             aReflowStatus,
                    BlockReflowInput&         aState);
 
-  bool PlaceBlock(const ReflowInput& aReflowState,
+  bool PlaceBlock(const ReflowInput& aReflowInput,
                   bool                     aForceFit,
                   nsLineBox*               aLine,
                   nsCollapsingMargin&      aBEndMarginResult /* out */,
                   nsOverflowAreas&         aOverflowAreas,
                   nsReflowStatus           aReflowStatus);
 
   nsCollapsingMargin& GetCarriedOutBEndMargin() {
     return mMetrics.mCarriedOutBEndMargin;
@@ -78,17 +78,17 @@ public:
   bool ComputeCollapsedBStartMargin(const ReflowInput& aRS,
                                     nsCollapsingMargin* aMargin,
                                     nsIFrame* aClearanceFrame,
                                     bool* aMayNeedRetry,
                                     bool* aIsEmpty = nullptr);
 
 protected:
   nsPresContext* mPresContext;
-  const ReflowInput& mOuterReflowState;
+  const ReflowInput& mOuterReflowInput;
 
   nsIFrame* mFrame;
   mozilla::LogicalRect mSpace;
 
   nscoord mICoord, mBCoord;
   nsSize mContainerSize;
   mozilla::WritingMode mWritingMode;
   ReflowOutput mMetrics;
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -626,34 +626,34 @@ nsBulletFrame::GetDesiredSize(nsPresCont
       break;
   }
   aMetrics.SetSize(wm, finalSize);
 }
 
 void
 nsBulletFrame::Reflow(nsPresContext* aPresContext,
                       ReflowOutput& aMetrics,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus& aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsBulletFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
 
   float inflation = nsLayoutUtils::FontSizeInflationFor(this);
   SetFontSizeInflation(inflation);
 
   // Get the base size
-  GetDesiredSize(aPresContext, aReflowState.mRenderingContext, aMetrics, inflation,
+  GetDesiredSize(aPresContext, aReflowInput.mRenderingContext, aMetrics, inflation,
                  &mPadding);
 
   // Add in the border and padding; split the top/bottom between the
   // ascent and descent to make things look nice
-  WritingMode wm = aReflowState.GetWritingMode();
-  const LogicalMargin& bp = aReflowState.ComputedLogicalBorderPadding();
+  WritingMode wm = aReflowInput.GetWritingMode();
+  const LogicalMargin& bp = aReflowInput.ComputedLogicalBorderPadding();
   mPadding.BStart(wm) += NSToCoordRound(bp.BStart(wm) * inflation);
   mPadding.IEnd(wm) += NSToCoordRound(bp.IEnd(wm) * inflation);
   mPadding.BEnd(wm) += NSToCoordRound(bp.BEnd(wm) * inflation);
   mPadding.IStart(wm) += NSToCoordRound(bp.IStart(wm) * inflation);
 
   WritingMode lineWM = aMetrics.GetWritingMode();
   LogicalMargin linePadding = mPadding.ConvertTo(lineWM, wm);
   aMetrics.ISize(lineWM) += linePadding.IStartEnd(lineWM);
@@ -663,17 +663,17 @@ nsBulletFrame::Reflow(nsPresContext* aPr
 
   // XXX this is a bit of a hack, we're assuming that no glyphs used for bullets
   // overflow their font-boxes. It'll do for now; to fix it for real, we really
   // should rewrite all the text-handling code here to use gfxTextRun (bug
   // 397294).
   aMetrics.SetOverflowAreasToDesiredBounds();
 
   aStatus = NS_FRAME_COMPLETE;
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
 }
 
 /* virtual */ nscoord
 nsBulletFrame::GetMinISize(nsRenderingContext *aRenderingContext)
 {
   WritingMode wm = GetWritingMode();
   ReflowOutput metrics(wm);
   DISPLAY_MIN_WIDTH(this, metrics.ISize(wm));
--- a/layout/generic/nsBulletFrame.h
+++ b/layout/generic/nsBulletFrame.h
@@ -73,17 +73,17 @@ public:
   virtual nsIAtom* GetType() const override;
   virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) override;
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
 #endif
 
   virtual void Reflow(nsPresContext* aPresContext,
                       ReflowOutput& aMetrics,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus& aStatus) override;
   virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
   virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
   void AddInlineMinISize(nsRenderingContext* aRenderingContext,
                          nsIFrame::InlineMinISizeData* aData) override;
   void AddInlinePrefISize(nsRenderingContext* aRenderingContext,
                           nsIFrame::InlinePrefISizeData* aData) override;
 
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -568,22 +568,22 @@ nsCanvasFrame::GetPrefISize(nsRenderingC
   else
     result = mFrames.FirstChild()->GetPrefISize(aRenderingContext);
   return result;
 }
 
 void
 nsCanvasFrame::Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsCanvasFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
   NS_FRAME_TRACE_REFLOW_IN("nsCanvasFrame::Reflow");
 
   // Initialize OUT parameter
   aStatus = NS_FRAME_COMPLETE;
 
   nsCanvasFrame* prevCanvasFrame = static_cast<nsCanvasFrame*>
                                                (GetPrevInFlow());
   if (prevCanvasFrame) {
@@ -598,59 +598,59 @@ nsCanvasFrame::Reflow(nsPresContext*    
       // reflowed but must not be lost until the canvas frame is destroyed.
       mFrames.InsertFrames(this, nullptr, *overflow);
     }
   }
 
   // Set our size up front, since some parts of reflow depend on it
   // being already set.  Note that the computed height may be
   // unconstrained; that's ok.  Consumers should watch out for that.
-  SetSize(nsSize(aReflowState.ComputedWidth(), aReflowState.ComputedHeight())); 
+  SetSize(nsSize(aReflowInput.ComputedWidth(), aReflowInput.ComputedHeight())); 
 
   // Reflow our one and only normal child frame. It's either the root
   // element's frame or a placeholder for that frame, if the root element
   // is abs-pos or fixed-pos. We may have additional children which
   // are placeholders for continuations of fixed-pos content, but those
   // don't need to be reflowed. The normal child is always comes before
   // the fixed-pos placeholders, because we insert it at the start
   // of the child list, above.
-  ReflowOutput kidDesiredSize(aReflowState);
+  ReflowOutput kidDesiredSize(aReflowInput);
   if (mFrames.IsEmpty()) {
     // We have no child frame, so return an empty size
     aDesiredSize.Width() = aDesiredSize.Height() = 0;
   } else {
     nsIFrame* kidFrame = mFrames.FirstChild();
     bool kidDirty = (kidFrame->GetStateBits() & NS_FRAME_IS_DIRTY) != 0;
 
     ReflowInput
-      kidReflowState(aPresContext, aReflowState, kidFrame,
-                     aReflowState.AvailableSize(kidFrame->GetWritingMode()));
+      kidReflowInput(aPresContext, aReflowInput, kidFrame,
+                     aReflowInput.AvailableSize(kidFrame->GetWritingMode()));
 
-    if (aReflowState.IsBResizeForWM(kidReflowState.GetWritingMode()) &&
+    if (aReflowInput.IsBResizeForWM(kidReflowInput.GetWritingMode()) &&
         (kidFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
       // Tell our kid it's being block-dir resized too.  Bit of a
       // hack for framesets.
-      kidReflowState.SetBResize(true);
+      kidReflowInput.SetBResize(true);
     }
 
-    WritingMode wm = aReflowState.GetWritingMode();
-    WritingMode kidWM = kidReflowState.GetWritingMode();
-    nsSize containerSize = aReflowState.ComputedPhysicalSize();
+    WritingMode wm = aReflowInput.GetWritingMode();
+    WritingMode kidWM = kidReflowInput.GetWritingMode();
+    nsSize containerSize = aReflowInput.ComputedPhysicalSize();
 
-    LogicalMargin margin = kidReflowState.ComputedLogicalMargin();
+    LogicalMargin margin = kidReflowInput.ComputedLogicalMargin();
     LogicalPoint kidPt(kidWM, margin.IStart(kidWM), margin.BStart(kidWM));
 
-    kidReflowState.ApplyRelativePositioning(&kidPt, containerSize);
+    kidReflowInput.ApplyRelativePositioning(&kidPt, containerSize);
 
     // Reflow the frame
-    ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState,
+    ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput,
                 kidWM, kidPt, containerSize, 0, aStatus);
 
     // Complete the reflow and position and size the child frame
-    FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowState,
+    FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowInput,
                       kidWM, kidPt, containerSize, 0);
 
     if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
       nsIFrame* nextFrame = kidFrame->GetNextInFlow();
       NS_ASSERTION(nextFrame || aStatus & NS_FRAME_REFLOW_NEXTINFLOW,
         "If it's incomplete and has no nif yet, it must flag a nif reflow.");
       if (!nextFrame) {
         nextFrame = aPresContext->PresShell()->FrameConstructor()->
@@ -680,40 +680,40 @@ nsCanvasFrame::Reflow(nsPresContext*    
       nsIFrame* viewport = PresContext()->GetPresShell()->GetRootFrame();
       viewport->InvalidateFrame();
     }
     
     // Return our desired size. Normally it's what we're told, but
     // sometimes we can be given an unconstrained height (when a window
     // is sizing-to-content), and we should compute our desired height.
     LogicalSize finalSize(wm);
-    finalSize.ISize(wm) = aReflowState.ComputedISize();
-    if (aReflowState.ComputedBSize() == NS_UNCONSTRAINEDSIZE) {
+    finalSize.ISize(wm) = aReflowInput.ComputedISize();
+    if (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE) {
       finalSize.BSize(wm) = kidFrame->GetLogicalSize(wm).BSize(wm) +
-        kidReflowState.ComputedLogicalMargin().BStartEnd(wm);
+        kidReflowInput.ComputedLogicalMargin().BStartEnd(wm);
     } else {
-      finalSize.BSize(wm) = aReflowState.ComputedBSize();
+      finalSize.BSize(wm) = aReflowInput.ComputedBSize();
     }
 
     aDesiredSize.SetSize(wm, finalSize);
     aDesiredSize.SetOverflowAreasToDesiredBounds();
     aDesiredSize.mOverflowAreas.UnionWith(
       kidDesiredSize.mOverflowAreas + kidFrame->GetPosition());
   }
 
   if (prevCanvasFrame) {
-    ReflowOverflowContainerChildren(aPresContext, aReflowState,
+    ReflowOverflowContainerChildren(aPresContext, aReflowInput,
                                     aDesiredSize.mOverflowAreas, 0,
                                     aStatus);
   }
 
-  FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
+  FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
 
   NS_FRAME_TRACE_REFLOW_OUT("nsCanvasFrame::Reflow", aStatus);
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 nsIAtom*
 nsCanvasFrame::GetType() const
 {
   return nsGkAtoms::canvasFrame;
 }
 
--- a/layout/generic/nsCanvasFrame.h
+++ b/layout/generic/nsCanvasFrame.h
@@ -67,17 +67,17 @@ public:
   virtual void RemoveFrame(ChildListID     aListID,
                            nsIFrame*       aOldFrame) override;
 #endif
 
   virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
   virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
   virtual bool IsFrameOfType(uint32_t aFlags) const override
   {
     return nsContainerFrame::IsFrameOfType(aFlags &
              ~(nsIFrame::eCanContainOverflowContainers));
   }
 
   // nsIAnonymousContentCreator
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -150,40 +150,40 @@ nsColumnSetFrame::PaintColumnRule(nsRend
                                                  skipSides);
 
     child = nextSibling;
     nextSibling = nextSibling->GetNextSibling();
   }
 }
 
 static nscoord
-GetAvailableContentISize(const ReflowInput& aReflowState)
+GetAvailableContentISize(const ReflowInput& aReflowInput)
 {
-  if (aReflowState.AvailableISize() == NS_INTRINSICSIZE) {
+  if (aReflowInput.AvailableISize() == NS_INTRINSICSIZE) {
     return NS_INTRINSICSIZE;
   }
 
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
   nscoord borderPaddingISize =
-    aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm);
-  return std::max(0, aReflowState.AvailableISize() - borderPaddingISize);
+    aReflowInput.ComputedLogicalBorderPadding().IStartEnd(wm);
+  return std::max(0, aReflowInput.AvailableISize() - borderPaddingISize);
 }
 
 nscoord
-nsColumnSetFrame::GetAvailableContentBSize(const ReflowInput& aReflowState)
+nsColumnSetFrame::GetAvailableContentBSize(const ReflowInput& aReflowInput)
 {
-  if (aReflowState.AvailableBSize() == NS_INTRINSICSIZE) {
+  if (aReflowInput.AvailableBSize() == NS_INTRINSICSIZE) {
     return NS_INTRINSICSIZE;
   }
 
-  WritingMode wm = aReflowState.GetWritingMode();
-  LogicalMargin bp = aReflowState.ComputedLogicalBorderPadding();
-  bp.ApplySkipSides(GetLogicalSkipSides(&aReflowState));
-  bp.BEnd(wm) = aReflowState.ComputedLogicalBorderPadding().BEnd(wm);
-  return std::max(0, aReflowState.AvailableBSize() - bp.BStartEnd(wm));
+  WritingMode wm = aReflowInput.GetWritingMode();
+  LogicalMargin bp = aReflowInput.ComputedLogicalBorderPadding();
+  bp.ApplySkipSides(GetLogicalSkipSides(&aReflowInput));
+  bp.BEnd(wm) = aReflowInput.ComputedLogicalBorderPadding().BEnd(wm);
+  return std::max(0, aReflowInput.AvailableBSize() - bp.BStartEnd(wm));
 }
 
 static nscoord
 GetColumnGap(nsColumnSetFrame*    aFrame,
              const nsStyleColumn* aColStyle)
 {
   if (eStyleUnit_Normal == aColStyle->mColumnGap.GetUnit())
     return aFrame->StyleFont()->mFont.size;
@@ -193,56 +193,56 @@ GetColumnGap(nsColumnSetFrame*    aFrame
     return colGap;
   }
 
   NS_NOTREACHED("Unknown gap type");
   return 0;
 }
 
 nsColumnSetFrame::ReflowConfig
-nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowState,
+nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowInput,
                                        bool aForceAuto = false,
                                        nscoord aFeasibleBSize = NS_INTRINSICSIZE,
                                        nscoord aInfeasibleBSize = 0)
 {
   nscoord knownFeasibleBSize = aFeasibleBSize;
   nscoord knownInfeasibleBSize = aInfeasibleBSize;
 
   const nsStyleColumn* colStyle = StyleColumn();
-  nscoord availContentISize = GetAvailableContentISize(aReflowState);
-  if (aReflowState.ComputedISize() != NS_INTRINSICSIZE) {
-    availContentISize = aReflowState.ComputedISize();
+  nscoord availContentISize = GetAvailableContentISize(aReflowInput);
+  if (aReflowInput.ComputedISize() != NS_INTRINSICSIZE) {
+    availContentISize = aReflowInput.ComputedISize();
   }
 
   nscoord consumedBSize = GetConsumedBSize();
 
   // The effective computed height is the height of the current continuation
   // of the column set frame. This should be the same as the computed height
   // if we have an unconstrained available height.
-  nscoord computedBSize = GetEffectiveComputedBSize(aReflowState,
+  nscoord computedBSize = GetEffectiveComputedBSize(aReflowInput,
                                                     consumedBSize);
-  nscoord colBSize = GetAvailableContentBSize(aReflowState);
+  nscoord colBSize = GetAvailableContentBSize(aReflowInput);
 
-  if (aReflowState.ComputedBSize() != NS_INTRINSICSIZE) {
-    colBSize = aReflowState.ComputedBSize();
-  } else if (aReflowState.ComputedMaxBSize() != NS_INTRINSICSIZE) {
-    colBSize = std::min(colBSize, aReflowState.ComputedMaxBSize());
+  if (aReflowInput.ComputedBSize() != NS_INTRINSICSIZE) {
+    colBSize = aReflowInput.ComputedBSize();
+  } else if (aReflowInput.ComputedMaxBSize() != NS_INTRINSICSIZE) {
+    colBSize = std::min(colBSize, aReflowInput.ComputedMaxBSize());
   }
 
   nscoord colGap = GetColumnGap(this, colStyle);
   int32_t numColumns = colStyle->mColumnCount;
 
   // If column-fill is set to 'balance', then we want to balance the columns.
   const bool isBalancing = colStyle->mColumnFill == NS_STYLE_COLUMN_FILL_BALANCE
                            && !aForceAuto;
   if (isBalancing) {
     const uint32_t MAX_NESTED_COLUMN_BALANCING = 2;
     uint32_t cnt = 0;
-    for (const ReflowInput* rs = aReflowState.mParentReflowState;
-         rs && cnt < MAX_NESTED_COLUMN_BALANCING; rs = rs->mParentReflowState) {
+    for (const ReflowInput* rs = aReflowInput.mParentReflowInput;
+         rs && cnt < MAX_NESTED_COLUMN_BALANCING; rs = rs->mParentReflowInput) {
       if (rs->mFlags.mIsColumnBalancing) {
         ++cnt;
       }
     }
     if (cnt == MAX_NESTED_COLUMN_BALANCING) {
       numColumns = 1;
     }
   }
@@ -338,34 +338,34 @@ nsColumnSetFrame::ChooseColumnStrategy(c
   ReflowConfig config = { numColumns, colISize, expectedISizeLeftOver, colGap,
                           colBSize, isBalancing, knownFeasibleBSize,
                           knownInfeasibleBSize, computedBSize, consumedBSize };
   return config;
 }
 
 bool
 nsColumnSetFrame::ReflowColumns(ReflowOutput& aDesiredSize,
-                                const ReflowInput& aReflowState,
+                                const ReflowInput& aReflowInput,
                                 nsReflowStatus& aReflowStatus,
                                 ReflowConfig& aConfig,
                                 bool aLastColumnUnbounded,
                                 nsCollapsingMargin* aCarriedOutBEndMargin,
                                 ColumnBalanceData& aColData)
 {
-  bool feasible = ReflowChildren(aDesiredSize, aReflowState,
+  bool feasible = ReflowChildren(aDesiredSize, aReflowInput,
                                  aReflowStatus, aConfig, aLastColumnUnbounded,
                                  aCarriedOutBEndMargin, aColData);
 
   if (aColData.mHasExcessBSize) {
-    aConfig = ChooseColumnStrategy(aReflowState, true);
+    aConfig = ChooseColumnStrategy(aReflowInput, true);
 
     // We need to reflow our children again one last time, otherwise we might
     // end up with a stale column height for some of our columns, since we
     // bailed out of balancing.
-    feasible = ReflowChildren(aDesiredSize, aReflowState, aReflowStatus,
+    feasible = ReflowChildren(aDesiredSize, aReflowInput, aReflowStatus,
                               aConfig, aLastColumnUnbounded,
                               aCarriedOutBEndMargin, aColData);
   }
 
   return feasible;
 }
 
 static void MoveChildTo(nsIFrame* aChild, LogicalPoint aOrigin,
@@ -445,17 +445,17 @@ nsColumnSetFrame::GetPrefISize(nsRenderi
   // The multiplication above can make 'iSize' negative (integer overflow),
   // so use std::max to protect against that.
   result = std::max(iSize, colISize);
   return result;
 }
 
 bool
 nsColumnSetFrame::ReflowChildren(ReflowOutput&     aDesiredSize,
-                                 const ReflowInput& aReflowState,
+                                 const ReflowInput& aReflowInput,
                                  nsReflowStatus&          aStatus,
                                  const ReflowConfig&      aConfig,
                                  bool                     aUnboundedLastColumn,
                                  nsCollapsingMargin*      aCarriedOutBEndMargin,
                                  ColumnBalanceData&       aColData)
 {
   aColData.Reset();
   bool allFit = true;
@@ -483,42 +483,42 @@ nsColumnSetFrame::ReflowChildren(ReflowO
     // We need a way to do an incremental reflow and be sure availableHeight
     // changes are taken account of! Right now I think block frames with absolute
     // children might exit early.
     //NS_ASSERTION(aKidReason != eReflowReason_Incremental,
     //             "incremental reflow should not have changed the balance height");
   }
 
   // get our border and padding
-  LogicalMargin borderPadding = aReflowState.ComputedLogicalBorderPadding();
-  borderPadding.ApplySkipSides(GetLogicalSkipSides(&aReflowState));
+  LogicalMargin borderPadding = aReflowInput.ComputedLogicalBorderPadding();
+  borderPadding.ApplySkipSides(GetLogicalSkipSides(&aReflowInput));
 
   nsRect contentRect(0, 0, 0, 0);
   nsOverflowAreas overflowRects;
 
   nsIFrame* child = mFrames.FirstChild();
   LogicalPoint childOrigin(wm, borderPadding.IStart(wm),
                            borderPadding.BStart(wm));
   // In vertical-rl mode, columns will not be correctly placed if the
-  // reflowState's ComputedWidth() is UNCONSTRAINED (in which case we'll get
+  // reflowInput's ComputedWidth() is UNCONSTRAINED (in which case we'll get
   // a containerSize.width of zero here). In that case, the column positions
   // will be adjusted later, after our correct contentSize is known.
-  nsSize containerSize = aReflowState.ComputedSizeAsContainerIfConstrained();
+  nsSize containerSize = aReflowInput.ComputedSizeAsContainerIfConstrained();
 
   // For RTL, since the columns might not fill the frame exactly, we
   // need to account for the slop. Otherwise we'll waste time moving the
   // columns by some tiny amount
 
   // XXX when all of layout is converted to logical coordinates, we
   //     probably won't need to do this hack any more. For now, we
   //     confine it to the legacy horizontal-rl case
   if (!isVertical && isRTL) {
-    nscoord availISize = aReflowState.AvailableISize();
-    if (aReflowState.ComputedISize() != NS_INTRINSICSIZE) {
-      availISize = aReflowState.ComputedISize();
+    nscoord availISize = aReflowInput.AvailableISize();
+    if (aReflowInput.ComputedISize() != NS_INTRINSICSIZE) {
+      availISize = aReflowInput.ComputedISize();
     }
     if (availISize != NS_INTRINSICSIZE) {
       childOrigin.I(wm) = containerSize.width - borderPadding.Left(wm) -
                           availISize;
 #ifdef DEBUG_roc
       printf("*** childOrigin.iCoord = %d\n", childOrigin.I(wm));
 #endif
     }
@@ -534,17 +534,17 @@ nsColumnSetFrame::ReflowChildren(ReflowO
     // might be pullable back to this column. We can't skip if it's the last child
     // because we need to obtain the bottom margin. We can't skip
     // if this is the last column and we're supposed to assign unbounded
     // height to it, because that could change the available height from
     // the last time we reflowed it and we should try to pull all the
     // content from its next sibling. (Note that it might be the last
     // column, but not be the last child because the desired number of columns
     // has changed.)
-    bool skipIncremental = !aReflowState.ShouldReflowAllKids()
+    bool skipIncremental = !aReflowInput.ShouldReflowAllKids()
       && !NS_SUBTREE_DIRTY(child)
       && child->GetNextSibling()
       && !(aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1)
       && !NS_SUBTREE_DIRTY(child->GetNextSibling());
     // If we need to pull up content from the prev-in-flow then this is not just
     // a height shrink. The prev in flow will have set the dirty bit.
     // Check the overflow rect YMost instead of just the child's content height. The child
     // may have overflowing content that cares about the available height boundary.
@@ -592,80 +592,80 @@ nsColumnSetFrame::ReflowChildren(ReflowO
       childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
 #ifdef DEBUG_roc
       printf("*** Skipping child #%d %p (incremental %d, resize block-size shrink %d): status = %d\n",
              columnCount, (void*)child, skipIncremental, skipResizeBSizeShrink, aStatus);
 #endif
     } else {
       LogicalSize availSize(wm, aConfig.mColISize, aConfig.mColMaxBSize);
       if (aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1) {
-        availSize.BSize(wm) = GetAvailableContentBSize(aReflowState);
+        availSize.BSize(wm) = GetAvailableContentBSize(aReflowInput);
       }
 
-      LogicalSize computedSize = aReflowState.ComputedSize(wm);
+      LogicalSize computedSize = aReflowInput.ComputedSize(wm);
 
       if (reflowNext)
         child->AddStateBits(NS_FRAME_IS_DIRTY);
 
       LogicalSize kidCBSize(wm, availSize.ISize(wm), computedSize.BSize(wm));
-      ReflowInput kidReflowState(PresContext(), aReflowState, child,
+      ReflowInput kidReflowInput(PresContext(), aReflowInput, child,
                                        availSize, &kidCBSize);
-      kidReflowState.mFlags.mIsTopOfPage = true;
-      kidReflowState.mFlags.mTableIsSplittable = false;
-      kidReflowState.mFlags.mIsColumnBalancing = aConfig.mBalanceColCount < INT32_MAX;
+      kidReflowInput.mFlags.mIsTopOfPage = true;
+      kidReflowInput.mFlags.mTableIsSplittable = false;
+      kidReflowInput.mFlags.mIsColumnBalancing = aConfig.mBalanceColCount < INT32_MAX;
 
       // We need to reflow any float placeholders, even if our column height
       // hasn't changed.
-      kidReflowState.mFlags.mMustReflowPlaceholders = !colBSizeChanged;
+      kidReflowInput.mFlags.mMustReflowPlaceholders = !colBSizeChanged;
 
 #ifdef DEBUG_roc
       printf("*** Reflowing child #%d %p: availHeight=%d\n",
              columnCount, (void*)child,availSize.BSize(wm));
 #endif
 
       // Note if the column's next in flow is not being changed by this incremental reflow.
       // This may allow the current column to avoid trying to pull lines from the next column.
       if (child->GetNextSibling() &&
           !(GetStateBits() & NS_FRAME_IS_DIRTY) &&
         !(child->GetNextSibling()->GetStateBits() & NS_FRAME_IS_DIRTY)) {
-        kidReflowState.mFlags.mNextInFlowUntouched = true;
+        kidReflowInput.mFlags.mNextInFlowUntouched = true;
       }
 
       ReflowOutput kidDesiredSize(wm, aDesiredSize.mFlags);
 
       // XXX it would be cool to consult the float manager for the
       // previous block to figure out the region of floats from the
       // previous column that extend into this column, and subtract
       // that region from the new float manager.  So you could stick a
       // really big float in the first column and text in following
       // columns would flow around it.
 
       // Reflow the frame
       LogicalPoint origin(wm,
                           childOrigin.I(wm) +
-                          kidReflowState.ComputedLogicalMargin().IStart(wm),
+                          kidReflowInput.ComputedLogicalMargin().IStart(wm),
                           childOrigin.B(wm) +
-                          kidReflowState.ComputedLogicalMargin().BStart(wm));
-      ReflowChild(child, PresContext(), kidDesiredSize, kidReflowState,
+                          kidReflowInput.ComputedLogicalMargin().BStart(wm));
+      ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput,
                   wm, origin, containerSize, 0, aStatus);
 
       reflowNext = (aStatus & NS_FRAME_REFLOW_NEXTINFLOW) != 0;
 
 #ifdef DEBUG_roc
       printf("*** Reflowed child #%d %p: status = %d, desiredSize=%d,%d CarriedOutBEndMargin=%d\n",
              columnCount, (void*)child, aStatus, kidDesiredSize.Width(), kidDesiredSize.Height(),
              kidDesiredSize.mCarriedOutBEndMargin.get());
 #endif
 
       NS_FRAME_TRACE_REFLOW_OUT("Column::Reflow", aStatus);
 
       *aCarriedOutBEndMargin = kidDesiredSize.mCarriedOutBEndMargin;
 
       FinishReflowChild(child, PresContext(), kidDesiredSize,
-                        &kidReflowState, wm, childOrigin, containerSize, 0);
+                        &kidReflowInput, wm, childOrigin, containerSize, 0);
 
       childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
       if (childContentBEnd > aConfig.mColMaxBSize) {
         allFit = false;
       }
       if (childContentBEnd > availSize.BSize(wm)) {
         aColData.mMaxOverflowingBSize = std::max(childContentBEnd,
             aColData.mMaxOverflowingBSize);
@@ -710,18 +710,18 @@ nsColumnSetFrame::ReflowChildren(ReflowO
         }
       }
       else if (kidNextInFlow->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER) {
         aStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
         reflowNext = true;
         kidNextInFlow->RemoveStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
       }
 
-      if ((contentBEnd > aReflowState.ComputedMaxBSize() ||
-           contentBEnd > aReflowState.ComputedBSize()) &&
+      if ((contentBEnd > aReflowInput.ComputedMaxBSize() ||
+           contentBEnd > aReflowInput.ComputedBSize()) &&
            aConfig.mBalanceColCount < INT32_MAX) {
         // We overflowed vertically, but have not exceeded the number of
         // columns. We're going to go into overflow columns now, so balancing
         // no longer applies.
         aColData.mHasExcessBSize = true;
       }
 
       if (columnCount >= aConfig.mBalanceColCount) {
@@ -778,37 +778,37 @@ nsColumnSetFrame::ReflowChildren(ReflowO
 
   aColData.mMaxBSize = contentBEnd;
   LogicalSize contentSize = LogicalSize(wm, contentRect.Size());
   contentSize.BSize(wm) = std::max(contentSize.BSize(wm), contentBEnd);
   mLastFrameStatus = aStatus;
 
   // Apply computed and min/max values
   if (aConfig.mComputedBSize != NS_INTRINSICSIZE) {
-    if (aReflowState.AvailableBSize() != NS_INTRINSICSIZE) {
+    if (aReflowInput.AvailableBSize() != NS_INTRINSICSIZE) {
       contentSize.BSize(wm) = std::min(contentSize.BSize(wm),
                                        aConfig.mComputedBSize);
     } else {
       contentSize.BSize(wm) = aConfig.mComputedBSize;
     }
   } else {
     // We add the "consumed" block-size back in so that we're applying
     // constraints to the correct bSize value, then subtract it again
     // after we've finished with the min/max calculation. This prevents us from
     // having a last continuation that is smaller than the min bSize. but which
     // has prev-in-flows, trigger a larger bSize than actually required.
     contentSize.BSize(wm) =
-      aReflowState.ApplyMinMaxBSize(contentSize.BSize(wm),
+      aReflowInput.ApplyMinMaxBSize(contentSize.BSize(wm),
                                     aConfig.mConsumedBSize);
   }
-  if (aReflowState.ComputedISize() != NS_INTRINSICSIZE) {
-    contentSize.ISize(wm) = aReflowState.ComputedISize();
+  if (aReflowInput.ComputedISize() != NS_INTRINSICSIZE) {
+    contentSize.ISize(wm) = aReflowInput.ComputedISize();
   } else {
     contentSize.ISize(wm) =
-      aReflowState.ApplyMinMaxISize(contentSize.ISize(wm));
+      aReflowInput.ApplyMinMaxISize(contentSize.ISize(wm));
   }
 
   contentSize.ISize(wm) += borderPadding.IStartEnd(wm);
   contentSize.BSize(wm) += borderPadding.BStartEnd(wm);
   aDesiredSize.SetSize(wm, contentSize);
   aDesiredSize.mOverflowAreas = overflowRects;
   aDesiredSize.UnionOverflowAreasWithDesiredBounds();
 
@@ -856,34 +856,34 @@ nsColumnSetFrame::DrainOverflowColumns()
   if (overflows) {
     // We're already the parent for these frames, so no need to set
     // their parent again.
     mFrames.AppendFrames(nullptr, *overflows);
   }
 }
 
 void
-nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowState,
+nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowInput,
                                        nsPresContext* aPresContext,
                                        ReflowConfig& aConfig,
                                        ColumnBalanceData& aColData,
                                        ReflowOutput& aDesiredSize,
                                        nsCollapsingMargin& aOutMargin,
                                        bool& aUnboundedLastColumn,
                                        bool& aRunWasFeasible,
                                        nsReflowStatus& aStatus)
 {
   bool feasible = aRunWasFeasible;
 
-  nsMargin bp = aReflowState.ComputedPhysicalBorderPadding();
+  nsMargin bp = aReflowInput.ComputedPhysicalBorderPadding();
   bp.ApplySkipSides(GetSkipSides());
-  bp.bottom = aReflowState.ComputedPhysicalBorderPadding().bottom;
+  bp.bottom = aReflowInput.ComputedPhysicalBorderPadding().bottom;
 
   nscoord availableContentBSize =
-    GetAvailableContentBSize(aReflowState);
+    GetAvailableContentBSize(aReflowInput);
 
   // Termination of the algorithm below is guaranteed because
   // aConfig.knownFeasibleBSize - aConfig.knownInfeasibleBSize decreases in every
   // iteration.
 
   // We set this flag when we detect that we may contain a frame
   // that can break anywhere (thus foiling the linear decrease-by-one
   // search)
@@ -975,17 +975,17 @@ nsColumnSetFrame::FindBestBalanceBSize(c
 #ifdef DEBUG_roc
     printf("*** nsColumnSetFrame::Reflow balancing choosing next guess=%d\n", nextGuess);
 #endif
 
     aConfig.mColMaxBSize = nextGuess;
 
     aUnboundedLastColumn = false;
     AddStateBits(NS_FRAME_IS_DIRTY);
-    feasible = ReflowColumns(aDesiredSize, aReflowState, aStatus, aConfig, false,
+    feasible = ReflowColumns(aDesiredSize, aReflowInput, aStatus, aConfig, false,
                              &aOutMargin, aColData);
 
     if (!aConfig.mIsBalancing) {
       // Looks like we had excess height when balancing, so we gave up on
       // trying to balance.
       break;
     }
   }
@@ -1004,43 +1004,43 @@ nsColumnSetFrame::FindBestBalanceBSize(c
       aConfig.mColMaxBSize = aConfig.mKnownFeasibleBSize;
     }
     if (!skip) {
       // If our height is unconstrained, make sure that the last column is
       // allowed to have arbitrary height here, even though we were balancing.
       // Otherwise we'd have to split, and it's not clear what we'd do with
       // that.
       AddStateBits(NS_FRAME_IS_DIRTY);
-      feasible = ReflowColumns(aDesiredSize, aReflowState, aStatus, aConfig,
+      feasible = ReflowColumns(aDesiredSize, aReflowInput, aStatus, aConfig,
                                availableContentBSize == NS_UNCONSTRAINEDSIZE,
                                &aOutMargin, aColData);
     }
   }
 
   aRunWasFeasible = feasible;
 }
 
 void
 nsColumnSetFrame::Reflow(nsPresContext*           aPresContext,
                          ReflowOutput&     aDesiredSize,
-                         const ReflowInput& aReflowState,
+                         const ReflowInput& aReflowInput,
                          nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   // Don't support interruption in columns
   nsPresContext::InterruptPreventer noInterrupts(aPresContext);
 
   DO_GLOBAL_REFLOW_COUNT("nsColumnSetFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
 
   // Initialize OUT parameter
   aStatus = NS_FRAME_COMPLETE;
 
   // Our children depend on our block-size if we have a fixed block-size.
-  if (aReflowState.ComputedBSize() != NS_AUTOHEIGHT) {
+  if (aReflowInput.ComputedBSize() != NS_AUTOHEIGHT) {
     AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
   } else {
     RemoveStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
   }
 
 #ifdef DEBUG
   nsFrameList::Enumerator oc(GetChildList(kOverflowContainersList));
   for (; !oc.AtEnd(); oc.Next()) {
@@ -1050,75 +1050,75 @@ nsColumnSetFrame::Reflow(nsPresContext* 
   for (; !eoc.AtEnd(); eoc.Next()) {
     MOZ_ASSERT(!IS_TRUE_OVERFLOW_CONTAINER(eoc.get()));
   }
 #endif
 
   nsOverflowAreas ocBounds;
   nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
   if (GetPrevInFlow()) {
-    ReflowOverflowContainerChildren(aPresContext, aReflowState, ocBounds, 0,
+    ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
                                     ocStatus);
   }
 
   //------------ Handle Incremental Reflow -----------------
 
   // If inline size is unconstrained, set aForceAuto to true to allow
   // the columns to expand in the inline direction. (This typically
   // happens in orthogonal flows where the inline direction is the
   // container's block direction).
   ReflowConfig config =
-    ChooseColumnStrategy(aReflowState,
-                         aReflowState.ComputedISize() == NS_UNCONSTRAINEDSIZE);
+    ChooseColumnStrategy(aReflowInput,
+                         aReflowInput.ComputedISize() == NS_UNCONSTRAINEDSIZE);
 
   // If balancing, then we allow the last column to grow to unbounded
   // height during the first reflow. This gives us a way to estimate
   // what the average column height should be, because we can measure
   // the heights of all the columns and sum them up. But don't do this
   // if we have a next in flow because we don't want to suck all its
   // content back here and then have to push it out again!
   nsIFrame* nextInFlow = GetNextInFlow();
   bool unboundedLastColumn = config.mIsBalancing && !nextInFlow;
   nsCollapsingMargin carriedOutBottomMargin;
   ColumnBalanceData colData;
   colData.mHasExcessBSize = false;
 
-  bool feasible = ReflowColumns(aDesiredSize, aReflowState, aStatus, config,
+  bool feasible = ReflowColumns(aDesiredSize, aReflowInput, aStatus, config,
                                 unboundedLastColumn, &carriedOutBottomMargin,
                                 colData);
 
   // If we're not balancing, then we're already done, since we should have
   // reflown all of our children, and there is no need for a binary search to
   // determine proper column height.
   if (config.mIsBalancing && !aPresContext->HasPendingInterrupt()) {
-    FindBestBalanceBSize(aReflowState, aPresContext, config, colData,
+    FindBestBalanceBSize(aReflowInput, aPresContext, config, colData,
                           aDesiredSize, carriedOutBottomMargin,
                           unboundedLastColumn, feasible, aStatus);
   }
 
   if (aPresContext->HasPendingInterrupt() &&
-      aReflowState.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
+      aReflowInput.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
     // In this situation, we might be lying about our reflow status, because
     // our last kid (the one that got interrupted) was incomplete.  Fix that.
     aStatus = NS_FRAME_COMPLETE;
   }
 
   NS_ASSERTION(NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
-               aReflowState.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
+               aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
                "Column set should be complete if the available block-size is unconstrained");
 
   // Merge overflow container bounds and status.
   aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
   NS_MergeReflowStatusInto(&aStatus, ocStatus);
 
-  FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus, false);
+  FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus, false);
 
   aDesiredSize.mCarriedOutBEndMargin = carriedOutBottomMargin;
 
-  NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
+  NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
 void
 nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                    const nsRect&           aDirtyRect,
                                    const nsDisplayListSet& aLists)
 {
   DisplayBorderBackgroundOutline(aBuilder, aLists);
--- a/layout/generic/nsColumnSetFrame.h
+++ b/layout/generic/nsColumnSetFrame.h
@@ -21,17 +21,17 @@ class nsColumnSetFrame final : public ns
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   explicit nsColumnSetFrame(nsStyleContext* aContext);
 
   virtual void Reflow(nsPresContext* aPresContext,
                       ReflowOutput& aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus& aStatus) override;
 
 #ifdef DEBUG
   virtual void SetInitialChildList(ChildListID     aListID,
                                    nsFrameList&    aChildList) override;
   virtual void AppendFrames(ChildListID     aListID,
                             nsFrameList&    aFrameList) override;
   virtual void InsertFrames(ChildListID     aListID,
@@ -43,17 +43,17 @@ public:
 
   virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
   virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
 
   /**
    * Retrieve the available height for content of this frame. The available content
    * height is the available height for the frame, minus borders and padding.
    */
-  virtual nscoord GetAvailableContentBSize(const ReflowInput& aReflowState);
+  virtual nscoord GetAvailableContentBSize(const ReflowInput& aReflowInput);
 
   virtual nsContainerFrame* GetContentInsertionFrame() override {
     nsIFrame* frame = PrincipalChildList().FirstChild();
 
     // if no children return nullptr
     if (!frame)
       return nullptr;
 
@@ -157,38 +157,38 @@ protected:
 
     void Reset() {
       mMaxBSize = mSumBSize = mLastBSize = mMaxOverflowingBSize = 0;
       mHasExcessBSize = false;
     }
   };
 
   bool ReflowColumns(ReflowOutput& aDesiredSize,
-                     const ReflowInput& aReflowState,
+                     const ReflowInput& aReflowInput,
                      nsReflowStatus& aReflowStatus,
                      ReflowConfig& aConfig,
                      bool aLastColumnUnbounded,
                      nsCollapsingMargin* aCarriedOutBEndMargin,
                      ColumnBalanceData& aColData);
 
   /**
    * The basic reflow strategy is to call this function repeatedly to
    * obtain specific parameters that determine the layout of the
    * columns. This function will compute those parameters from the CSS
    * style. This function will also be responsible for implementing
    * the state machine that controls column balancing.
    */
-  ReflowConfig ChooseColumnStrategy(const ReflowInput& aReflowState,
+  ReflowConfig ChooseColumnStrategy(const ReflowInput& aReflowInput,
                                     bool aForceAuto, nscoord aFeasibleBSize,
                                     nscoord aInfeasibleBSize);
 
   /**
    * Perform the binary search for the best balance height for this column set.
    *
-   * @param aReflowState The input parameters for the current reflow iteration.
+   * @param aReflowInput The input parameters for the current reflow iteration.
    * @param aPresContext The presentation context in which the current reflow
    *        iteration is occurring.
    * @param aConfig The ReflowConfig object associated with this column set
    *        frame, generated by ChooseColumnStrategy().
    * @param aColData A data structure used to keep track of data needed between
    *        successive iterations of the balancing process.
    * @param aDesiredSize The final output size of the column set frame (output
    *        of reflow procedure).
@@ -199,31 +199,31 @@ protected:
    *        balancing procedure to measure the height of all content in
    *        descendant frames of the column set.
    * @param aRunWasFeasible An input/output parameter indicating whether or not
    *        the last iteration of the balancing loop was a feasible height to
    *        fit all content from descendant frames.
    * @param aStatus A final reflow status of the column set frame, passed in as
    *        an output parameter.
    */
-  void FindBestBalanceBSize(const ReflowInput& aReflowState,
+  void FindBestBalanceBSize(const ReflowInput& aReflowInput,
                             nsPresContext* aPresContext,
                             ReflowConfig& aConfig,
                             ColumnBalanceData& aColData,
                             ReflowOutput& aDesiredSize,
                             nsCollapsingMargin& aOutMargin,
                             bool& aUnboundedLastColumn,
                             bool& aRunWasFeasible,
                             nsReflowStatus& aStatus);
   /**
    * Reflow column children. Returns true iff the content that was reflowed
    * fit into the mColMaxBSize.
    */
   bool ReflowChildren(ReflowOutput& aDesiredSize,
-                        const ReflowInput& aReflowState,
+                        const ReflowInput& aReflowInput,
                         nsReflowStatus& aStatus,
                         const ReflowConfig& aConfig,
                         bool aLastColumnUnbounded,
                         nsCollapsingMargin* aCarriedOutBEndMargin,
                         ColumnBalanceData& aColData);
 };
 
 #endif // nsColumnSetFrame_h___
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -990,41 +990,41 @@ nsContainerFrame::ComputeAutoSize(nsRend
   }
   return result;
 }
 
 void
 nsContainerFrame::ReflowChild(nsIFrame*                aKidFrame,
                               nsPresContext*           aPresContext,
                               ReflowOutput&     aDesiredSize,
-                              const ReflowInput& aReflowState,
+                              const ReflowInput& aReflowInput,
                               const WritingMode&       aWM,
                               const LogicalPoint&      aPos,
                               const nsSize&            aContainerSize,
                               uint32_t                 aFlags,
                               nsReflowStatus&          aStatus,
                               nsOverflowContinuationTracker* aTracker)
 {
-  NS_PRECONDITION(aReflowState.mFrame == aKidFrame, "bad reflow state");
+  NS_PRECONDITION(aReflowInput.mFrame == aKidFrame, "bad reflow state");
   if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
     NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
                  "ReflowChild with unconstrained container width!");
   }
 
   // Position the child frame and its view if requested.
   if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
     aKidFrame->SetPosition(aWM, aPos, aContainerSize);
   }
 
   if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
     PositionFrameView(aKidFrame);
   }
 
   // Reflow the child frame
-  aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
+  aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
 
   // If the child frame is complete, delete any next-in-flows,
   // but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set.
   if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
       NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
       !(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
     nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
     if (kidNextInFlow) {
@@ -1038,36 +1038,36 @@ nsContainerFrame::ReflowChild(nsIFrame* 
 }
 
 //XXX temporary: hold on to a copy of the old physical version of
 //    ReflowChild so that we can convert callers incrementally.
 void
 nsContainerFrame::ReflowChild(nsIFrame*                aKidFrame,
                               nsPresContext*           aPresContext,
                               ReflowOutput&     aDesiredSize,
-                              const ReflowInput& aReflowState,
+                              const ReflowInput& aReflowInput,
                               nscoord                  aX,
                               nscoord                  aY,
                               uint32_t                 aFlags,
                               nsReflowStatus&          aStatus,
                               nsOverflowContinuationTracker* aTracker)
 {
-  NS_PRECONDITION(aReflowState.mFrame == aKidFrame, "bad reflow state");
+  NS_PRECONDITION(aReflowInput.mFrame == aKidFrame, "bad reflow state");
 
   // Position the child frame and its view if requested.
   if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
     aKidFrame->SetPosition(nsPoint(aX, aY));
   }
 
   if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
     PositionFrameView(aKidFrame);
   }
 
   // Reflow the child frame
-  aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
+  aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
 
   // If the child frame is complete, delete any next-in-flows,
   // but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set.
   if (NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
       !(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
     nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
     if (kidNextInFlow) {
       // Remove all of the childs next-in-flows. Make sure that we ask
@@ -1131,17 +1131,17 @@ nsContainerFrame::PositionChildViews(nsI
  * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
  *    don't want to automatically sync the frame and view
  * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
  */
 void
 nsContainerFrame::FinishReflowChild(nsIFrame*                  aKidFrame,
                                     nsPresContext*             aPresContext,
                                     const ReflowOutput& aDesiredSize,
-                                    const ReflowInput*   aReflowState,
+                                    const ReflowInput*   aReflowInput,
                                     const WritingMode&         aWM,
                                     const LogicalPoint&        aPos,
                                     const nsSize&              aContainerSize,
                                     uint32_t                   aFlags)
 {
   if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
     NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
                  "FinishReflowChild with unconstrained container width!");
@@ -1171,26 +1171,26 @@ nsContainerFrame::FinishReflowChild(nsIF
   if (!(aFlags & NS_FRAME_NO_MOVE_VIEW) && curOrigin != newOrigin) {
     if (!aKidFrame->HasView()) {
       // If the frame has moved, then we need to make sure any child views are
       // correctly positioned
       PositionChildViews(aKidFrame);
     }
   }
 
-  aKidFrame->DidReflow(aPresContext, aReflowState, nsDidReflowStatus::FINISHED);
+  aKidFrame->DidReflow(aPresContext, aReflowInput, nsDidReflowStatus::FINISHED);
 }
 
 //XXX temporary: hold on to a copy of the old physical version of
 //    FinishReflowChild so that we can convert callers incrementally.
 void
 nsContainerFrame::FinishReflowChild(nsIFrame*                  aKidFrame,
                                     nsPresContext*             aPresContext,
                                     const ReflowOutput& aDesiredSize,
-                                    const ReflowInput*   aReflowState,
+                                    const ReflowInput*   aReflowInput,
                                     nscoord                    aX,
                                     nscoord                    aY,
                                     uint32_t                   aFlags)
 {
   nsPoint curOrigin = aKidFrame->GetPosition();
 
   if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
     aKidFrame->SetRect(nsRect(aX, aY, aDesiredSize.Width(), aDesiredSize.Height()));
@@ -1210,36 +1210,36 @@ nsContainerFrame::FinishReflowChild(nsIF
       (curOrigin.x != aX || curOrigin.y != aY)) {
     if (!aKidFrame->HasView()) {
       // If the frame has moved, then we need to make sure any child views are
       // correctly positioned
       PositionChildViews(aKidFrame);
     }
   }
 
-  aKidFrame->DidReflow(aPresContext, aReflowState, nsDidReflowStatus::FINISHED);
+  aKidFrame->DidReflow(aPresContext, aReflowInput, nsDidReflowStatus::FINISHED);
 }
 
 void
 nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext*           aPresContext,
-                                                  const ReflowInput& aReflowState,
+                                                  const ReflowInput& aReflowInput,
                                                   nsOverflowAreas&         aOverflowRects,
                                                   uint32_t                 aFlags,
                                                   nsReflowStatus&          aStatus,
                                                   ChildFrameMerger         aMergeFunc)
 {
   NS_PRECONDITION(aPresContext, "null pointer");
 
   nsFrameList* overflowContainers = DrainExcessOverflowContainersList(aMergeFunc);
   if (!overflowContainers) {
     return; // nothing to reflow
   }
 
   nsOverflowContinuationTracker tracker(this, false, false);
-  bool shouldReflowAllKids = aReflowState.ShouldReflowAllKids();
+  bool shouldReflowAllKids = aReflowInput.ShouldReflowAllKids();
 
   for (nsIFrame* frame : *overflowContainers) {
     if (frame->GetPrevInFlow()->GetParent() != GetPrevInFlow()) {
       // frame's prevInFlow has moved, skip reflowing this frame;
       // it will get reflowed once it's been placed
       continue;
     }
     // If the available vertical height has changed, we need to reflow
@@ -1247,24 +1247,24 @@ nsContainerFrame::ReflowOverflowContaine
     if (shouldReflowAllKids || NS_SUBTREE_DIRTY(frame)) {
       // Get prev-in-flow
       nsIFrame* prevInFlow = frame->GetPrevInFlow();
       NS_ASSERTION(prevInFlow,
                    "overflow container frame must have a prev-in-flow");
       NS_ASSERTION(frame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER,
                    "overflow container frame must have overflow container bit set");
       WritingMode wm = frame->GetWritingMode();
-      nsSize containerSize = aReflowState.AvailableSize(wm).GetPhysicalSize(wm);
+      nsSize containerSize = aReflowInput.AvailableSize(wm).GetPhysicalSize(wm);
       LogicalRect prevRect = prevInFlow->GetLogicalRect(wm, containerSize);
 
       // Initialize reflow params
       LogicalSize availSpace(wm, prevRect.ISize(wm),
-                             aReflowState.AvailableSize(wm).BSize(wm));
-      ReflowOutput desiredSize(aReflowState);
-      ReflowInput frameState(aPresContext, aReflowState,
+                             aReflowInput.AvailableSize(wm).BSize(wm));
+      ReflowOutput desiredSize(aReflowInput);
+      ReflowInput frameState(aPresContext, aReflowInput,
                                    frame, availSpace);
       nsReflowStatus frameStatus;
 
       // Reflow
       LogicalPoint pos(wm, prevRect.IStart(wm), 0);
       ReflowChild(frame, aPresContext, desiredSize, frameState,
                   wm, pos, containerSize, aFlags, frameStatus, &tracker);
       //XXXfr Do we need to override any shrinkwrap effects here?
@@ -1304,20 +1304,20 @@ nsContainerFrame::ReflowOverflowContaine
       }
       NS_MergeReflowStatusInto(&aStatus, frameStatus);
       // At this point it would be nice to assert !frame->GetOverflowRect().IsEmpty(),
       // but we have some unsplittable frames that, when taller than
       // availableHeight will push zero-height content into a next-in-flow.
     }
     else {
       tracker.Skip(frame, aStatus);
-      if (aReflowState.mFloatManager) {
-        nsBlockFrame::RecoverFloatsFor(frame, *aReflowState.mFloatManager,
-                                       aReflowState.GetWritingMode(),
-                                       aReflowState.ComputedPhysicalSize());
+      if (aReflowInput.mFloatManager) {
+        nsBlockFrame::RecoverFloatsFor(frame, *aReflowInput.mFloatManager,
+                                       aReflowInput.GetWritingMode(),
+                                       aReflowInput.ComputedPhysicalSize());
       }
     }
     ConsiderChildOverflow(aOverflowRects, frame);
   }
 }
 
 void
 nsContainerFrame::DisplayOverflowContainers(nsDisplayListBuilder*   aBuilder,
--- a/layout/generic/nsContainerFrame.h
+++ b/layout/generic/nsContainerFrame.h
@@ -250,17 +250,17 @@ public:
    * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
    *    don't want to automatically sync the frame and view
    * NS_FRAME_NO_MOVE_FRAME - don't move the frame. aPos is ignored in this
    *    case. Also implies NS_FRAME_NO_MOVE_VIEW
    */
   void ReflowChild(nsIFrame*                      aChildFrame,
                    nsPresContext*                 aPresContext,
                    ReflowOutput&           aDesiredSize,
-                   const ReflowInput&       aReflowState,
+                   const ReflowInput&       aReflowInput,
                    const mozilla::WritingMode&    aWM,
                    const mozilla::LogicalPoint&   aPos,
                    const nsSize&                  aContainerSize,
                    uint32_t                       aFlags,
                    nsReflowStatus&                aStatus,
                    nsOverflowContinuationTracker* aTracker = nullptr);
 
   /**
@@ -280,39 +280,39 @@ public:
    *    case. Also implies NS_FRAME_NO_MOVE_VIEW
    * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
    *    don't want to automatically sync the frame and view
    * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
    */
   static void FinishReflowChild(nsIFrame*                    aKidFrame,
                                 nsPresContext*               aPresContext,
                                 const ReflowOutput&   aDesiredSize,
-                                const ReflowInput*     aReflowState,
+                                const ReflowInput*     aReflowInput,
                                 const mozilla::WritingMode&  aWM,
                                 const mozilla::LogicalPoint& aPos,
                                 const nsSize&                aContainerSize,
                                 uint32_t                     aFlags);
 
   //XXX temporary: hold on to a copy of the old physical versions of
   //    ReflowChild and FinishReflowChild so that we can convert callers
   //    incrementally.
   void ReflowChild(nsIFrame*                      aKidFrame,
                    nsPresContext*                 aPresContext,
                    ReflowOutput&           aDesiredSize,
-                   const ReflowInput&       aReflowState,
+                   const ReflowInput&       aReflowInput,
                    nscoord                        aX,
                    nscoord                        aY,
                    uint32_t                       aFlags,
                    nsReflowStatus&                aStatus,
                    nsOverflowContinuationTracker* aTracker = nullptr);
 
   static void FinishReflowChild(nsIFrame*                  aKidFrame,
                                 nsPresContext*             aPresContext,
                                 const ReflowOutput& aDesiredSize,
-                                const ReflowInput*   aReflowState,
+                                const ReflowInput*   aReflowInput,
                                 nscoord                    aX,
                                 nscoord                    aY,
                                 uint32_t                   aFlags);
 
   static void PositionChildViews(nsIFrame* aFrame);
 
   // ==========================================================================
   /* Overflow containers are continuation frames that hold overflow. They
@@ -383,17 +383,17 @@ public:
    * continuations it makes, removing them from its child list, and
    * making sure they are stored properly in the overflow container lists.
    * The nsOverflowContinuationTracker helper class should be used for this.
    *
    * @param aFlags is passed through to ReflowChild
    * @param aMergeFunc is passed to DrainExcessOverflowContainersList
    */
   void ReflowOverflowContainerChildren(nsPresContext*           aPresContext,
-                                       const ReflowInput& aReflowState,
+                                       const ReflowInput& aReflowInput,
                                        nsOverflowAreas&         aOverflowRects,
                                        uint32_t                 aFlags,
                                        nsReflowStatus&          aStatus,
                                        ChildFrameMerger aMergeFunc =
                                          DefaultChildFrameMerge);
 
   /**
    * Move any frames on our overflow list to the end of our principal list.
--- a/layout/generic/nsFirstLetterFrame.cpp
+++ b/layout/generic/nsFirstLetterFrame.cpp
@@ -159,57 +159,57 @@ nsFirstLetterFrame::ComputeSize(nsRender
   }
   return nsContainerFrame::ComputeSize(aRenderingContext, aWM,
       aCBSize, aAvailableISize, aMargin, aBorder, aPadding, aFlags);
 }
 
 void
 nsFirstLetterFrame::Reflow(nsPresContext*          aPresContext,
                            ReflowOutput&     aMetrics,
-                           const ReflowInput& aReflowState,
+                           const ReflowInput& aReflowInput,
                            nsReflowStatus&          aReflowStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsFirstLetterFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aReflowStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aReflowStatus);
 
   // Grab overflow list
   DrainOverflowFrames(aPresContext);
 
   nsIFrame* kid = mFrames.FirstChild();
 
   // Setup reflow state for our child
-  WritingMode wm = aReflowState.GetWritingMode();
-  LogicalSize availSize = aReflowState.AvailableSize();
-  const LogicalMargin& bp = aReflowState.ComputedLogicalBorderPadding();
+  WritingMode wm = aReflowInput.GetWritingMode();
+  LogicalSize availSize = aReflowInput.AvailableSize();
+  const LogicalMargin& bp = aReflowInput.ComputedLogicalBorderPadding();
   NS_ASSERTION(availSize.ISize(wm) != NS_UNCONSTRAINEDSIZE,
                "should no longer use unconstrained inline size");
   availSize.ISize(wm) -= bp.IStartEnd(wm);
   if (NS_UNCONSTRAINEDSIZE != availSize.BSize(wm)) {
     availSize.BSize(wm) -= bp.BStartEnd(wm);
   }
 
   WritingMode lineWM = aMetrics.GetWritingMode();
   ReflowOutput kidMetrics(lineWM);
 
   // Reflow the child
-  if (!aReflowState.mLineLayout) {
+  if (!aReflowInput.mLineLayout) {
     // When there is no lineLayout provided, we provide our own. The
     // only time that the first-letter-frame is not reflowing in a
     // line context is when its floating.
     WritingMode kidWritingMode = GetWritingMode(kid);
     LogicalSize kidAvailSize = availSize.ConvertTo(kidWritingMode, wm);
-    ReflowInput rs(aPresContext, aReflowState, kid, kidAvailSize);
-    nsLineLayout ll(aPresContext, nullptr, &aReflowState, nullptr, nullptr);
+    ReflowInput rs(aPresContext, aReflowInput, kid, kidAvailSize);
+    nsLineLayout ll(aPresContext, nullptr, &aReflowInput, nullptr, nullptr);
 
     ll.BeginLineReflow(bp.IStart(wm), bp.BStart(wm),
                        availSize.ISize(wm), NS_UNCONSTRAINEDSIZE,
                        false, true, kidWritingMode,
-                       nsSize(aReflowState.AvailableWidth(),
-                              aReflowState.AvailableHeight()));
+                       nsSize(aReflowInput.AvailableWidth(),
+                              aReflowInput.AvailableHeight()));
     rs.mLineLayout = &ll;
     ll.SetInFirstLetter(true);
     ll.SetFirstLetterStyleOK(true);
 
     kid->Reflow(aPresContext, kidMetrics, rs, aReflowStatus);
 
     ll.EndLineReflow();
     ll.SetInFirstLetter(false);
@@ -237,40 +237,40 @@ nsFirstLetterFrame::Reflow(nsPresContext
     // area is in the overflow rect of the child textframe.
     aMetrics.UnionOverflowAreasWithDesiredBounds();
     ConsiderChildOverflow(aMetrics.mOverflowAreas, kid);
 
     FinishAndStoreOverflow(&aMetrics);
   }
   else {
     // Pretend we are a span and reflow the child frame
-    nsLineLayout* ll = aReflowState.mLineLayout;
+    nsLineLayout* ll = aReflowInput.mLineLayout;
     bool          pushedFrame;
 
     ll->SetInFirstLetter(
       mStyleContext->GetPseudo() == nsCSSPseudoElements::firstLetter);
-    ll->BeginSpan(this, &aReflowState, bp.IStart(wm),
+    ll->BeginSpan(this, &aReflowInput, bp.IStart(wm),
                   availSize.ISize(wm), &mBaseline);
     ll->ReflowFrame(kid, aReflowStatus, &kidMetrics, pushedFrame);
     NS_ASSERTION(lineWM.IsVertical() == wm.IsVertical(),
                  "we're assuming we can mix sizes between lineWM and wm "
                  "since we shouldn't have orthogonal writing modes within "
                  "a line.");
     aMetrics.ISize(lineWM) = ll->EndSpan(this) + bp.IStartEnd(wm);
     ll->SetInFirstLetter(false);
 
     nsLayoutUtils::SetBSizeFromFontMetrics(this, aMetrics, bp, lineWM, wm);
   }
 
   if (!NS_INLINE_IS_BREAK_BEFORE(aReflowStatus)) {
     // Create a continuation or remove existing continuations based on
     // the reflow completion status.
     if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {
-      if (aReflowState.mLineLayout) {
-        aReflowState.mLineLayout->SetFirstLetterStyleOK(false);
+      if (aReflowInput.mLineLayout) {
+        aReflowInput.mLineLayout->SetFirstLetterStyleOK(false);
       }
       nsIFrame* kidNextInFlow = kid->GetNextInFlow();
       if (kidNextInFlow) {
         // Remove all of the childs next-in-flows
         kidNextInFlow->GetParent()->DeleteNextInFlowChild(kidNextInFlow, true);
       }
     }
     else {
@@ -289,17 +289,17 @@ nsFirstLetterFrame::Reflow(nsPresContext
         // text that the first letter frame was made out of.
         nsIFrame* continuation;
         CreateContinuationForFloatingParent(aPresContext, kid,
                                             &continuation, true);
       }
     }
   }
 
-  NS_FRAME_SET_TRUNCATION(aReflowStatus, aReflowState, aMetrics);
+  NS_FRAME_SET_TRUNCATION(aReflowStatus, aReflowInput, aMetrics);
 }
 
 /* virtual */ bool
 nsFirstLetterFrame::CanContinueTextRun() const
 {
   // We can continue a text run through a first-letter frame.
   return true;
 }
@@ -393,17 +393,17 @@ nsFirstLetterFrame::DrainOverflowFrames(
 
 nscoord
 nsFirstLetterFrame::GetLogicalBaseline(WritingMode aWritingMode) const
 {
   return mBaseline;
 }
 
 nsIFrame::LogicalSides
-nsFirstLetterFrame::GetLogicalSkipSides(const ReflowInput* aReflowState) const
+nsFirstLetterFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const
 {
   if (GetPrevContinuation()) {
     // We shouldn't get calls to GetSkipSides for later continuations since
     // they have separate style contexts with initial values for all the
     // properties that could trigger a call to GetSkipSides.  Then again,
     // it's not really an error to call GetSkipSides on any frame, so
     // that's why we handle it properly.
     return LogicalSides(eLogicalSideBitsAll);
--- a/layout/generic/nsFirstLetterFrame.h
+++ b/layout/generic/nsFirstLetterFrame.h
@@ -57,22 +57,22 @@ public:
               nscoord aAvailableISize,
               const mozilla::LogicalSize& aMargin,
               const mozilla::LogicalSize& aBorder,
               const mozilla::LogicalSize& aPadding,
               ComputeSizeFlags aFlags) override;
 
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
-                      const ReflowInput& aReflowState,
+                      const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
 
   virtual bool CanContinueTextRun() const override;
   virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
-  virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowState = nullptr) const override;
+  virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
 
 //override of nsFrame method
   virtual nsresult GetChildFrameContainingOffset(int32_t inContentOffset,
                                                  bool inHint,
                                                  int32_t* outFrameContentOffset,
                                                  nsIFrame** outChildFrame) override;
 
   nscoord GetFirstLetterBaseline() const { return mBaseline; }
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -405,17 +405,17 @@ private:
  * Represents a flex item.
  * Includes the various pieces of input that the Flexbox Layout Algorithm uses
  * to resolve a flexible width.
  */
 class nsFlexContainerFrame::FlexItem : public LinkedListElement<FlexItem>
 {
 public:
   // Normal constructor:
-  FlexItem(ReflowInput& aFlexItemReflowState,
+  FlexItem(ReflowInput& aFlexItemReflowInput,
            float aFlexGrow, float aFlexShrink, nscoord aMainBaseSize,
            nscoord aMainMinSize, nscoord aMainMaxSize,
            nscoord aTentativeCrossSize,
            nscoord aCrossMinSize, nscoord aCrossMaxSize,
            const FlexboxAxisTracker& aAxisTracker);
 
   // Simplified constructor, to be used only for generating "struts":
   // (NOTE: This "strut" constructor uses the *container's* writing mode, which
@@ -739,17 +739,17 @@ public:
   uint32_t GetNumAutoMarginsInAxis(AxisOrientationType aAxis) const;
 
   // Once the main size has been resolved, should we bother doing layout to
   // establish the cross size?
   bool CanMainSizeInfluenceCrossSize(const FlexboxAxisTracker& aAxisTracker) const;
 
 protected:
   // Helper called by the constructor, to set mNeedsMinSizeAutoResolution:
-  void CheckForMinSizeAuto(const ReflowInput& aFlexItemReflowState,
+  void CheckForMinSizeAuto(const ReflowInput& aFlexItemReflowInput,
                            const FlexboxAxisTracker& aAxisTracker);
 
   // Our frame:
   nsIFrame* const mFrame;
 
   // Values that we already know in constructor: (and are hence mostly 'const')
   const float mFlexGrow;
   const float mFlexShrink;
@@ -1176,30 +1176,30 @@ nsFlexContainerFrame::IsHorizontal()
   const FlexboxAxisTracker axisTracker(this, GetWritingMode());
   return axisTracker.IsMainAxisHorizontal();
 }
 
 UniquePtr<FlexItem>
 nsFlexContainerFrame::GenerateFlexItemForChild(
   nsPresContext* aPresContext,
   nsIFrame*      aChildFrame,
-  const ReflowInput& aParentReflowState,
+  const ReflowInput& aParentReflowInput,
   const FlexboxAxisTracker& aAxisTracker)
 {
   // Create temporary reflow state just for sizing -- to get hypothetical
   // main-size and the computed values of min / max main-size property.
   // (This reflow state will _not_ be used for reflow.)
   ReflowInput
-    childRS(aPresContext, aParentReflowState, aChildFrame,
-            aParentReflowState.ComputedSize(aChildFrame->GetWritingMode()));
+    childRS(aPresContext, aParentReflowInput, aChildFrame,
+            aParentReflowInput.ComputedSize(aChildFrame->GetWritingMode()));
 
   // FLEX GROW & SHRINK WEIGHTS
   // --------------------------
   float flexGrow, flexShrink;
-  if (IsLegacyBox(aParentReflowState.mStyleDisplay, mStyleContext)) {
+  if (IsLegacyBox(aParentReflowInput.mStyleDisplay, mStyleContext)) {
     flexGrow = flexShrink = aChildFrame->StyleXUL()->mBoxFlex;
   } else {
     const nsStylePosition* stylePos = aChildFrame->StylePosition();
     flexGrow   = stylePos->mFlexGrow;
     flexShrink = stylePos->mFlexShrink;
   }
 
   WritingMode childWM = childRS.GetWritingMode();
@@ -1309,26 +1309,26 @@ nsFlexContainerFrame::GenerateFlexItemFo
 }
 
 // Static helper-functions for ResolveAutoFlexBasisAndMinSize():
 // -------------------------------------------------------------
 // Indicates whether the cross-size property is set to something definite.
 // The logic here should be similar to the logic for isAutoWidth/isAutoHeight
 // in nsLayoutUtils::ComputeSizeWithIntrinsicDimensions().
 static bool
-IsCrossSizeDefinite(const ReflowInput& aItemReflowState,
+IsCrossSizeDefinite(const ReflowInput& aItemReflowInput,
                     const FlexboxAxisTracker& aAxisTracker)
 {
-  const nsStylePosition* pos = aItemReflowState.mStylePosition;
+  const nsStylePosition* pos = aItemReflowInput.mStylePosition;
   if (aAxisTracker.IsCrossAxisHorizontal()) {
     return pos->mWidth.GetUnit() != eStyleUnit_Auto;
   }
   // else, vertical. (We need to use IsAutoHeight() to catch e.g. %-height
   // applied to indefinite-height containing block, which counts as auto.)
-  nscoord cbHeight = aItemReflowState.mCBReflowState->ComputedHeight();
+  nscoord cbHeight = aItemReflowInput.mCBReflowInput->ComputedHeight();
   return !nsLayoutUtils::IsAutoHeight(pos->mHeight, cbHeight);
 }
 
 // If aFlexItem has a definite cross size, this function returns it, for usage
 // (in combination with an intrinsic ratio) for resolving the item's main size
 // or main min-size.
 //
 // The parameter "aMinSizeFallback" indicates whether we should fall back to
@@ -1337,38 +1337,38 @@ IsCrossSizeDefinite(const ReflowInput& a
 // param is true, then this function is guaranteed to return a definite value
 // (i.e. not NS_AUTOHEIGHT, excluding cases where huge sizes are involved).
 //
 // XXXdholbert the min-size behavior here is based on my understanding in
 //   http://lists.w3.org/Archives/Public/www-style/2014Jul/0053.html
 // If my understanding there ends up being wrong, we'll need to update this.
 static nscoord
 CrossSizeToUseWithRatio(const FlexItem& aFlexItem,
-                        const ReflowInput& aItemReflowState,
+                        const ReflowInput& aItemReflowInput,
                         bool aMinSizeFallback,
                         const FlexboxAxisTracker& aAxisTracker)
 {
   if (aFlexItem.IsStretched()) {
     // Definite cross-size, imposed via 'align-self:stretch' & flex container.
     return aFlexItem.GetCrossSize();
   }
 
-  if (IsCrossSizeDefinite(aItemReflowState, aAxisTracker)) {
+  if (IsCrossSizeDefinite(aItemReflowInput, aAxisTracker)) {
     // Definite cross size.
     return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
-                                       aItemReflowState.ComputedISize(),
-                                       aItemReflowState.ComputedBSize());
+                                       aItemReflowInput.ComputedISize(),
+                                       aItemReflowInput.ComputedBSize());
   }
 
   if (aMinSizeFallback) {
     // Indefinite cross-size, and we're resolving main min-size, so we'll fall
     // back to ussing the cross min-size (which should be definite).
     return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
-                                       aItemReflowState.ComputedMinISize(),
-                                       aItemReflowState.ComputedMinBSize());
+                                       aItemReflowInput.ComputedMinISize(),
+                                       aItemReflowInput.ComputedMinBSize());
   }
 
   // Indefinite cross-size.
   return NS_AUTOHEIGHT;
 }
 
 // Convenience function; returns a main-size, given a cross-size and an
 // intrinsic ratio. The intrinsic ratio must not have 0 in its cross-axis
@@ -1393,58 +1393,58 @@ MainSizeFromAspectRatio(nscoord aCrossSi
 // By "partially", I mean we don't consider the min-content size (but we do
 // consider flex-basis, main max-size, and the intrinsic aspect ratio).
 // The caller is responsible for computing & considering the min-content size
 // in combination with the partially-resolved value that this function returns.
 //
 // Spec reference: http://dev.w3.org/csswg/css-flexbox/#min-size-auto
 static nscoord
 PartiallyResolveAutoMinSize(const FlexItem& aFlexItem,
-                            const ReflowInput& aItemReflowState,
+                            const ReflowInput& aItemReflowInput,
                             const FlexboxAxisTracker& aAxisTracker)
 {
   MOZ_ASSERT(aFlexItem.NeedsMinSizeAutoResolution(),
              "only call for FlexItems that need min-size auto resolution");
 
   nscoord minMainSize = nscoord_MAX; // Intentionally huge; we'll shrink it
                                      // from here, w/ std::min().
 
   // We need the smallest of:
   // * the used flex-basis, if the computed flex-basis was 'auto':
   // XXXdholbert ('auto' might be renamed to 'main-size'; see bug 1032922)
   if (eStyleUnit_Auto ==
-      aItemReflowState.mStylePosition->mFlexBasis.GetUnit() &&
+      aItemReflowInput.mStylePosition->mFlexBasis.GetUnit() &&
       aFlexItem.GetFlexBaseSize() != NS_AUTOHEIGHT) {
     // NOTE: We skip this if the flex base size depends on content & isn't yet
     // resolved. This is OK, because the caller is responsible for computing
     // the min-content height and min()'ing it with the value we return, which
     // is equivalent to what would happen if we min()'d that at this point.
     minMainSize = std::min(minMainSize, aFlexItem.GetFlexBaseSize());
   }
 
   // * the computed max-width (max-height), if that value is definite:
   nscoord maxSize =
     GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
-                               aItemReflowState.ComputedMaxISize(),
-                               aItemReflowState.ComputedMaxBSize());
+                               aItemReflowInput.ComputedMaxISize(),
+                               aItemReflowInput.ComputedMaxBSize());
   if (maxSize != NS_UNCONSTRAINEDSIZE) {
     minMainSize = std::min(minMainSize, maxSize);
   }
 
   // * if the item has no intrinsic aspect ratio, its min-content size:
   //  --- SKIPPING THIS IN THIS FUNCTION --- caller's responsibility.
 
   // * if the item has an intrinsic aspect ratio, the width (height) calculated
   //   from the aspect ratio and any definite size constraints in the opposite
   //   dimension.
   if (aAxisTracker.GetCrossComponent(aFlexItem.IntrinsicRatio()) != 0) {
     // We have a usable aspect ratio. (not going to divide by 0)
     const bool useMinSizeIfCrossSizeIsIndefinite = true;
     nscoord crossSizeToUseWithRatio =
-      CrossSizeToUseWithRatio(aFlexItem, aItemReflowState,
+      CrossSizeToUseWithRatio(aFlexItem, aItemReflowInput,
                               useMinSizeIfCrossSizeIsIndefinite,
                               aAxisTracker);
     nscoord minMainSizeFromRatio =
       MainSizeFromAspectRatio(crossSizeToUseWithRatio,
                               aFlexItem.IntrinsicRatio(), aAxisTracker);
     minMainSize = std::min(minMainSize, minMainSizeFromRatio);
   }
 
@@ -1452,32 +1452,32 @@ PartiallyResolveAutoMinSize(const FlexIt
 }
 
 // Resolves flex-basis:auto, using the given intrinsic ratio and the flex
 // item's cross size.  On success, updates the flex item with its resolved
 // flex-basis and returns true. On failure (e.g. if the ratio is invalid or
 // the cross-size is indefinite), returns false.
 static bool
 ResolveAutoFlexBasisFromRatio(FlexItem& aFlexItem,
-                              const ReflowInput& aItemReflowState,
+                              const ReflowInput& aItemReflowInput,
                               const FlexboxAxisTracker& aAxisTracker)
 {
   MOZ_ASSERT(NS_AUTOHEIGHT == aFlexItem.GetFlexBaseSize(),
              "Should only be called to resolve an 'auto' flex-basis");
   // If the flex item has ...
   //  - an intrinsic aspect ratio,
   //  - a [used] flex-basis of 'main-size' [auto?] [We have this, if we're here.]
   //  - a definite cross size
   // then the flex base size is calculated from its inner cross size and the
   // flex item’s intrinsic aspect ratio.
   if (aAxisTracker.GetCrossComponent(aFlexItem.IntrinsicRatio()) != 0) {
     // We have a usable aspect ratio. (not going to divide by 0)
     const bool useMinSizeIfCrossSizeIsIndefinite = false;
     nscoord crossSizeToUseWithRatio =
-      CrossSizeToUseWithRatio(aFlexItem, aItemReflowState,
+      CrossSizeToUseWithRatio(aFlexItem, aItemReflowInput,
                               useMinSizeIfCrossSizeIsIndefinite,
                               aAxisTracker);
     if (crossSizeToUseWithRatio != NS_AUTOHEIGHT) {
       // We have a definite cross-size
       nscoord mainSizeFromRatio =
         MainSizeFromAspectRatio(crossSizeToUseWithRatio,
                                 aFlexItem.IntrinsicRatio(), aAxisTracker);
       aFlexItem.SetFlexBaseSizeAndMainSize(mainSizeFromRatio);
@@ -1488,17 +1488,17 @@ ResolveAutoFlexBasisFromRatio(FlexItem& 
 }
 
 // Note: If & when we handle "min-height: min-content" for flex items,
 // we may want to resolve that in this function, too.
 void
 nsFlexContainerFrame::
   ResolveAutoFlexBasisAndMinSize(nsPresContext* aPresContext,
                                  FlexItem& aFlexItem,
-                                 const ReflowInput& aItemReflowState,
+                                 const ReflowInput& aItemReflowInput,
                                  const FlexboxAxisTracker& aAxisTracker)
 {
   // (Note: We should never have a used flex-basis of "auto" if our main axis
   // is horizontal; width values should always be resolvable without reflow.)
   const bool isMainSizeAuto = (!aAxisTracker.IsMainAxisHorizontal() &&
                                NS_AUTOHEIGHT == aFlexItem.GetFlexBaseSize());
 
   const bool isMainMinSizeAuto = aFlexItem.NeedsMinSizeAutoResolution();
@@ -1513,17 +1513,17 @@ nsFlexContainerFrame::
   // (e.g. using it as a contstraint when measuring our content in the
   // main axis, or using it with the intrinsic ratio to obtain a main size).
   // BEFORE WE DO THAT, we need let the item "pre-stretch" its cross size (if
   // it's got 'align-self:stretch'), for a certain case where the spec says
   // the stretched cross size is considered "definite". That case is if we
   // have a single-line (nowrap) flex container which itself has a definite
   // cross-size.  Otherwise, we'll wait to do stretching, since (in other
   // cases) we don't know how much the item should stretch yet.
-  const ReflowInput* flexContainerRS = aItemReflowState.mParentReflowState;
+  const ReflowInput* flexContainerRS = aItemReflowInput.mParentReflowInput;
   MOZ_ASSERT(flexContainerRS,
              "flex item's reflow state should have ptr to container's state");
   if (NS_STYLE_FLEX_WRAP_NOWRAP == flexContainerRS->mStylePosition->mFlexWrap) {
     // XXXdholbert Maybe this should share logic with ComputeCrossSize()...
     // Alternately, maybe tentative container cross size should be passed down.
     nscoord containerCrossSize =
       GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aAxisTracker.GetWritingMode(),
                                   flexContainerRS->ComputedISize(),
@@ -1537,43 +1537,43 @@ nsFlexContainerFrame::
     }
   }
 
   nscoord resolvedMinSize; // (only set/used if isMainMinSizeAuto==true)
   bool minSizeNeedsToMeasureContent = false; // assume the best
   if (isMainMinSizeAuto) {
     // Resolve the min-size, except for considering the min-content size.
     // (We'll consider that later, if we need to.)
-    resolvedMinSize = PartiallyResolveAutoMinSize(aFlexItem, aItemReflowState,
+    resolvedMinSize = PartiallyResolveAutoMinSize(aFlexItem, aItemReflowInput,
                                                   aAxisTracker);
     if (resolvedMinSize > 0 &&
         aAxisTracker.GetCrossComponent(aFlexItem.IntrinsicRatio()) == 0) {
       // We don't have a usable aspect ratio, so we need to consider our
       // min-content size as another candidate min-size, which we'll have to
       // min() with the current resolvedMinSize.
       // (If resolvedMinSize were already at 0, we could skip this measurement
       // because it can't go any lower. But it's not 0, so we need it.)
       minSizeNeedsToMeasureContent = true;
     }
   }
 
   bool flexBasisNeedsToMeasureContent = false; // assume the best
   if (isMainSizeAuto) {
-    if (!ResolveAutoFlexBasisFromRatio(aFlexItem, aItemReflowState,
+    if (!ResolveAutoFlexBasisFromRatio(aFlexItem, aItemReflowInput,
                                        aAxisTracker)) {
       flexBasisNeedsToMeasureContent = true;
     }
   }
 
   // Measure content, if needed (w/ intrinsic-width method or a reflow)
   if (minSizeNeedsToMeasureContent || flexBasisNeedsToMeasureContent) {
     if (aAxisTracker.IsMainAxisHorizontal()) {
       if (minSizeNeedsToMeasureContent) {
         nscoord frameMinISize =
-          aFlexItem.Frame()->GetMinISize(aItemReflowState.mRenderingContext);
+          aFlexItem.Frame()->GetMinISize(aItemReflowInput.mRenderingContext);
         resolvedMinSize = std::min(resolvedMinSize, frameMinISize);
       }
       NS_ASSERTION(!flexBasisNeedsToMeasureContent,
                    "flex-basis:auto should have been resolved in the "
                    "reflow state, for horizontal flexbox. It shouldn't need "
                    "special handling here");
     } else {
       // If this item is flexible (vertically), or if we're measuring the
@@ -1609,24 +1609,24 @@ nsFlexContainerFrame::
   }
 }
 
 nscoord
 nsFlexContainerFrame::
   MeasureFlexItemContentHeight(nsPresContext* aPresContext,
                                FlexItem& aFlexItem,
                                bool aForceVerticalResizeForMeasuringReflow,
-                               const ReflowInput& aParentReflowState)
+                               const ReflowInput& aParentReflowInput)
 {
   // Set up a reflow state for measuring the flex item's auto-height:
   WritingMode wm = aFlexItem.Frame()->GetWritingMode();
-  LogicalSize availSize = aParentReflowState.ComputedSize(wm);
+  LogicalSize availSize = aParentReflowInput.ComputedSize(wm);
   availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
   ReflowInput
-    childRSForMeasuringHeight(aPresContext, aParentReflowState,
+    childRSForMeasuringHeight(aPresContext, aParentReflowInput,
                               aFlexItem.Frame(), availSize,
                               nullptr, ReflowInput::CALLER_WILL_INIT);
   childRSForMeasuringHeight.mFlags.mIsFlexContainerMeasuringHeight = true;
   childRSForMeasuringHeight.Init(aPresContext);
 
   if (aFlexItem.IsStretched()) {
     childRSForMeasuringHeight.SetComputedWidth(aFlexItem.GetCrossSize());
     childRSForMeasuringHeight.SetHResize(true);
@@ -1664,85 +1664,85 @@ nsFlexContainerFrame::
   // Subtract border/padding in vertical axis, to get _just_
   // the effective computed value of the "height" property.
   nscoord childDesiredHeight = childDesiredSize.Height() -
     childRSForMeasuringHeight.ComputedPhysicalBorderPadding().TopBottom();
 
   return std::max(0, childDesiredHeight);
 }
 
-FlexItem::FlexItem(ReflowInput& aFlexItemReflowState,
+FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
                    float aFlexGrow, float aFlexShrink, nscoord aFlexBaseSize,
                    nscoord aMainMinSize,  nscoord aMainMaxSize,
                    nscoord aTentativeCrossSize,
                    nscoord aCrossMinSize, nscoord aCrossMaxSize,
                    const FlexboxAxisTracker& aAxisTracker)
-  : mFrame(aFlexItemReflowState.mFrame),
+  : mFrame(aFlexItemReflowInput.mFrame),
     mFlexGrow(aFlexGrow),
     mFlexShrink(aFlexShrink),
     mIntrinsicRatio(mFrame->GetIntrinsicRatio()),
-    mBorderPadding(aFlexItemReflowState.ComputedPhysicalBorderPadding()),
-    mMargin(aFlexItemReflowState.ComputedPhysicalMargin()),
+    mBorderPadding(aFlexItemReflowInput.ComputedPhysicalBorderPadding()),
+    mMargin(aFlexItemReflowInput.ComputedPhysicalMargin()),
     mMainMinSize(aMainMinSize),
     mMainMaxSize(aMainMaxSize),
     mCrossMinSize(aCrossMinSize),
     mCrossMaxSize(aCrossMaxSize),
     mMainPosn(0),
     mCrossSize(aTentativeCrossSize),
     mCrossPosn(0),
     mAscent(0),
     mShareOfWeightSoFar(0.0f),
     mIsFrozen(false),
     mHadMinViolation(false),
     mHadMaxViolation(false),
     mHadMeasuringReflow(false),
     mIsStretched(false),
     mIsStrut(false),
     // mNeedsMinSizeAutoResolution is initialized in CheckForMinSizeAuto()
-    mWM(aFlexItemReflowState.GetWritingMode())
+    mWM(aFlexItemReflowInput.GetWritingMode())
     // mAlignSelf, see below
 {
   MOZ_ASSERT(mFrame, "expecting a non-null child frame");
   MOZ_ASSERT(mFrame->GetType() != nsGkAtoms::placeholderFrame,
              "placeholder frames should not be treated as flex items");
   MOZ_ASSERT(!(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW),
              "out-of-flow frames should not be treated as flex items");
 
-  const ReflowInput* containerRS = aFlexItemReflowState.mParentReflowState;
+  const ReflowInput* containerRS = aFlexItemReflowInput.mParentReflowInput;
   if (IsLegacyBox(containerRS->mStyleDisplay,
                   containerRS->mFrame->StyleContext())) {
     // For -webkit-box/-webkit-inline-box, we need to:
     // (1) Use "-webkit-box-align" instead of "align-items" to determine the
     //     container's cross-axis alignment behavior.
     // (2) Suppress the ability for flex items to override that with their own
     //     cross-axis alignment. (The legacy box model doesn't support this.)
     // So, each FlexItem simply copies the container's converted "align-items"
     // value and disregards their own "align-self" property.
     const nsStyleXUL* containerStyleXUL = containerRS->mFrame->StyleXUL();
     mAlignSelf = ConvertLegacyStyleToAlignItems(containerStyleXUL);
   } else {
-    mAlignSelf = aFlexItemReflowState.mStylePosition->ComputedAlignSelf(
+    mAlignSelf = aFlexItemReflowInput.mStylePosition->ComputedAlignSelf(
                    mFrame->StyleContext()->GetParent());
     if (MOZ_LIKELY(mAlignSelf == NS_STYLE_ALIGN_NORMAL)) {
       mAlignSelf = NS_STYLE_ALIGN_STRETCH;
     }
 
     // XXX strip off the <overflow-position> bit until we implement that
     mAlignSelf &= ~NS_STYLE_ALIGN_FLAG_BITS;
   }
 
   SetFlexBaseSizeAndMainSize(aFlexBaseSize);
-  CheckForMinSizeAuto(aFlexItemReflowState, aAxisTracker);
+  CheckForMinSizeAuto(aFlexItemReflowInput, aAxisTracker);
 
   // Assert that any "auto" margin components are set to 0.
   // (We'll resolve them later; until then, we want to treat them as 0-sized.)
 #ifdef DEBUG
   {
     const nsStyleSides& styleMargin =
-      aFlexItemReflowState.mStyleMargin->mMargin;
+      aFlexItemReflowInput.mStyleMargin->mMargin;
     NS_FOR_CSS_SIDES(side) {
       if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
         MOZ_ASSERT(GetMarginComponentForSide(side) == 0,
                    "Someone else tried to resolve our auto margin");
       }
     }
   }
 #endif // DEBUG
@@ -1801,21 +1801,21 @@ FlexItem::FlexItem(nsIFrame* aChildFrame
              "Should only make struts for children with 'visibility:collapse'");
   MOZ_ASSERT(mFrame->GetType() != nsGkAtoms::placeholderFrame,
              "placeholder frames should not be treated as flex items");
   MOZ_ASSERT(!(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW),
              "out-of-flow frames should not be treated as flex items");
 }
 
 void
-FlexItem::CheckForMinSizeAuto(const ReflowInput& aFlexItemReflowState,
+FlexItem::CheckForMinSizeAuto(const ReflowInput& aFlexItemReflowInput,
                               const FlexboxAxisTracker& aAxisTracker)
 {
-  const nsStylePosition* pos = aFlexItemReflowState.mStylePosition;
-  const nsStyleDisplay* disp = aFlexItemReflowState.mStyleDisplay;
+  const nsStylePosition* pos = aFlexItemReflowInput.mStylePosition;
+  const nsStyleDisplay* disp = aFlexItemReflowInput.mStyleDisplay;
 
   // We'll need special behavior for "min-[width|height]:auto" (whichever is in
   // the main axis) iff:
   // (a) its computed value is "auto"
   // (b) the "overflow" sub-property in the same axis (the main axis) has a
   //     computed value of "visible"
   const nsStyleCoord& minSize = GET_MAIN_COMPONENT(aAxisTracker,
                                                    pos->mMinWidth,
@@ -3358,27 +3358,27 @@ AddNewFlexLineToList(LinkedList<FlexLine
     aLines.insertBack(newLine);
   }
   return newLine;
 }
 
 void
 nsFlexContainerFrame::GenerateFlexLines(
   nsPresContext* aPresContext,
-  const ReflowInput& aReflowState,
+  const ReflowInput& aReflowInput,
   nscoord aContentBoxMainSize,
   nscoord aAvailableBSizeForContent,
   const nsTArray<StrutInfo>& aStruts,
   const FlexboxAxisTracker& aAxisTracker,
   LinkedList<FlexLine>& aLines)
 {
   MOZ_ASSERT(aLines.isEmpty(), "Expecting outparam to start out empty");
 
   const bool isSingleLine =
-    NS_STYLE_FLEX_WRAP_NOWRAP == aReflowState.mStylePosition->mFlexWrap;
+    NS_STYLE_FLEX_WRAP_NOWRAP == aReflowInput.mStylePosition->mFlexWrap;
 
   // If we're transparently reversing axes, then we'll need to link up our
   // FlexItems and FlexLines in the reverse order, so that the rest of flex
   // layout (with flipped axes) will still produce the correct result.
   // Here, we declare a convenience bool that we'll pass when adding a new
   // FlexLine or FlexItem, to make us insert it at the beginning of its list
   // (so the list ends up reversed).
   const bool shouldInsertAtFront = aAxisTracker.AreAxesInternallyReversed();
@@ -3396,18 +3396,18 @@ nsFlexContainerFrame::GenerateFlexLines(
     wrapThreshold = aContentBoxMainSize;
 
     // If the flex container doesn't have a definite content-box main-size
     // (e.g. if main axis is vertical & 'height' is 'auto'), make sure we at
     // least wrap when we hit its max main-size.
     if (wrapThreshold == NS_UNCONSTRAINEDSIZE) {
       const nscoord flexContainerMaxMainSize =
         GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, aAxisTracker.GetWritingMode(),
-                                   aReflowState.ComputedMaxISize(),
-                                   aReflowState.ComputedMaxBSize());
+                                   aReflowInput.ComputedMaxISize(),
+                                   aReflowInput.ComputedMaxBSize());
 
       wrapThreshold = flexContainerMaxMainSize;
     }
 
     // Also: if we're column-oriented and paginating in the block dimension,
     // we may need to wrap to a new flex line sooner (before we grow past the
     // available BSize, potentially running off the end of the page).
     if (aAxisTracker.IsColumnOriented() &&
@@ -3432,21 +3432,21 @@ nsFlexContainerFrame::GenerateFlexLines(
     }
 
     UniquePtr<FlexItem> item;
     if (nextStrutIdx < aStruts.Length() &&
         aStruts[nextStrutIdx].mItemIdx == itemIdxInContainer) {
 
       // Use the simplified "strut" FlexItem constructor:
       item = MakeUnique<FlexItem>(childFrame, aStruts[nextStrutIdx].mStrutCrossSize,
-                                  aReflowState.GetWritingMode());
+                                  aReflowInput.GetWritingMode());
       nextStrutIdx++;
     } else {
       item = GenerateFlexItemForChild(aPresContext, childFrame,
-                                      aReflowState, aAxisTracker);
+                                      aReflowInput, aAxisTracker);
     }
 
     nscoord itemInnerHypotheticalMainSize = item->GetMainSize();
     nscoord itemOuterHypotheticalMainSize =
       item->GetOuterMainSize(aAxisTracker.GetMainAxis());
 
     // Check if we need to wrap |item| to a new line
     // (i.e. check if its outer hypothetical main size pushes our line over
@@ -3472,35 +3472,35 @@ nsFlexContainerFrame::GenerateFlexLines(
     itemIdxInContainer++;
   }
 }
 
 // Retrieves the content-box main-size of our flex container from the
 // reflow state (specifically, the main-size of *this continuation* of the
 // flex container).
 nscoord
-nsFlexContainerFrame::GetMainSizeFromReflowState(
-  const ReflowInput& aReflowState,
+nsFlexContainerFrame::GetMainSizeFromReflowInput(
+  const ReflowInput& aReflowInput,
   const FlexboxAxisTracker& aAxisTracker)
 {
   if (aAxisTracker.IsRowOriented()) {
     // Row-oriented --> our main axis is the inline axis, so our main size
     // is our inline size (which should already be resolved).
     // XXXdholbert ISize may be (wrongly) unconstrained right now: bug 1163238
     // Uncomment when that's fixed:
     /*
-    NS_WARN_IF_FALSE(aReflowState.ComputedISize() != NS_UNCONSTRAINEDSIZE,
+    NS_WARN_IF_FALSE(aReflowInput.ComputedISize() != NS_UNCONSTRAINEDSIZE,
                      "Unconstrained inline size; this should only result from "
                      "huge sizes (not intrinsic sizing w/ orthogonal flows)");
     */
-    return aReflowState.ComputedISize();
+    return aReflowInput.ComputedISize();
   }
 
   // Note: This may be unconstrained, if our block size is "auto":
-  return GetEffectiveComputedBSize(aReflowState);
+  return GetEffectiveComputedBSize(aReflowInput);
 }
 
 // Returns the largest outer hypothetical main-size of any line in |aLines|.
 // (i.e. the hypothetical main-size of the largest line)
 static nscoord
 GetLargestLineMainSize(const FlexLine* aFirstLine)
 {
   nscoord largestLineOuterSize = 0;
@@ -3516,24 +3516,24 @@ GetLargestLineMainSize(const FlexLine* a
  * - the "tentative" main size, taken from the reflow state ("tentative"
  *    because it may be unconstrained or may run off the page).
  * - the available BSize (needed if the main axis is the block axis).
  * - the sizes of our lines of flex items.
  *
  * Guaranteed to return a definite length, i.e. not NS_UNCONSTRAINEDSIZE,
  * aside from cases with huge lengths which happen to compute to that value.
  * XXXdholbert (this^ isn't quite true, if we're row-oriented and in an
- * orthogonal flow, per mentions of bug 1163238 in GetMainSizeFromReflowState.)
+ * orthogonal flow, per mentions of bug 1163238 in GetMainSizeFromReflowInput.)
  *
  * (Note: This function should be structurally similar to 'ComputeCrossSize()',
  * except that here, the caller has already grabbed the tentative size from the
  * reflow state.)
  */
 static nscoord
-ResolveFlexContainerMainSize(const ReflowInput& aReflowState,
+ResolveFlexContainerMainSize(const ReflowInput& aReflowInput,
                              const FlexboxAxisTracker& aAxisTracker,
                              nscoord aTentativeMainSize,
                              nscoord aAvailableBSizeForContent,
                              const FlexLine* aFirstLine,
                              nsReflowStatus& aStatus)
 {
   MOZ_ASSERT(aFirstLine, "null first line pointer");
 
@@ -3571,45 +3571,45 @@ ResolveFlexContainerMainSize(const Reflo
   }
 
   // Column-oriented case, with auto BSize:
   // Resolve auto BSize to the largest FlexLine length, clamped to our
   // computed min/max main-size properties.
   // XXXdholbert Handle constrained-aAvailableBSizeForContent case here.
   nscoord largestLineOuterSize = GetLargestLineMainSize(aFirstLine);
   return NS_CSS_MINMAX(largestLineOuterSize,
-                       aReflowState.ComputedMinBSize(),
-                       aReflowState.ComputedMaxBSize());
+                       aReflowInput.ComputedMinBSize(),
+                       aReflowInput.ComputedMaxBSize());
 }
 
 nscoord
-nsFlexContainerFrame::ComputeCrossSize(const ReflowInput& aReflowState,
+nsFlexContainerFrame::ComputeCrossSize(const ReflowInput& aReflowInput,
                                        const FlexboxAxisTracker& aAxisTracker,
                                        nscoord aSumLineCrossSizes,
                                        nscoord aAvailableBSizeForContent,
                                        bool* aIsDefinite,
                                        nsReflowStatus& aStatus)
 {
   MOZ_ASSERT(aIsDefinite, "outparam pointer must be non-null");
 
   if (aAxisTracker.IsColumnOriented()) {
     // Column-oriented --> our cross axis is the inline axis, so our cross size
     // is our inline size (which should already be resolved).
     // XXXdholbert ISize may be (wrongly) unconstrained right now: bug 1163238.
     // Uncomment when that's fixed:
     /*
-    NS_WARN_IF_FALSE(aReflowState.ComputedISize() != NS_UNCONSTRAINEDSIZE,
+    NS_WARN_IF_FALSE(aReflowInput.ComputedISize() != NS_UNCONSTRAINEDSIZE,
                      "Unconstrained inline size; this should only result from "
                      "huge sizes (not intrinsic sizing w/ orthogonal flows)");
     */
     *aIsDefinite = true;
-    return aReflowState.ComputedISize();
+    return aReflowInput.ComputedISize();
   }
 
-  nscoord effectiveComputedBSize = GetEffectiveComputedBSize(aReflowState);
+  nscoord effectiveComputedBSize = GetEffectiveComputedBSize(aReflowInput);
   if (effectiveComputedBSize != NS_INTRINSICSIZE) {
     // Row-oriented case (cross axis is block-axis), with fixed BSize:
     *aIsDefinite = true;
     if (aAvailableBSizeForContent == NS_UNCONSTRAINEDSIZE ||
         effectiveComputedBSize < aAvailableBSizeForContent) {
       // Not in a fragmenting context, OR no need to fragment because we have
       // more available BSize than we need. Either way, just use our fixed
       // BSize.  (Note that the reflow state has already done the appropriate
@@ -3632,18 +3632,18 @@ nsFlexContainerFrame::ComputeCrossSize(c
   }
 
   // Row-oriented case (cross axis is block axis), with auto BSize:
   // Shrink-wrap our line(s), subject to our min-size / max-size
   // constraints in that (block) axis.
   // XXXdholbert Handle constrained-aAvailableBSizeForContent case here.
   *aIsDefinite = false;
   return NS_CSS_MINMAX(aSumLineCrossSizes,
-                       aReflowState.ComputedMinBSize(),
-                       aReflowState.ComputedMaxBSize());
+                       aReflowInput.ComputedMinBSize(),
+                       aReflowInput.ComputedMaxBSize());
 }
 
 void
 FlexLine::PositionItemsInMainAxis(uint8_t aJustifyContent,
                                   nscoord aContentBoxMainSize,
                                   const FlexboxAxisTracker& aAxisTracker)
 {
   MainAxisPositionTracker mainAxisPosnTracker(aAxisTracker, this,
@@ -3675,78 +3675,78 @@ FlexLine::PositionItemsInMainAxis(uint8_
  * flex container's content-box cross-start edge to its baseline), returns
  * its actual physical ascent value (the distance from the *border-box* top
  * edge to its baseline).
  */
 static nscoord
 ComputePhysicalAscentFromFlexRelativeAscent(
   nscoord aFlexRelativeAscent,
   nscoord aContentBoxCrossSize,
-  const ReflowInput& aReflowState,
+  const ReflowInput& aReflowInput,
   const FlexboxAxisTracker& aAxisTracker)
 {
-  return aReflowState.ComputedPhysicalBorderPadding().top +
+  return aReflowInput.ComputedPhysicalBorderPadding().top +
     PhysicalCoordFromFlexRelativeCoord(aFlexRelativeAscent,
                                        aContentBoxCrossSize,
                                        aAxisTracker.GetCrossAxis());
 }
 
 void
 nsFlexContainerFrame::SizeItemInCrossAxis(
   nsPresContext* aPresContext,
   const FlexboxAxisTracker& aAxisTracker,
-  ReflowInput& aChildReflowState,
+  ReflowInput& aChildReflowInput,
   FlexItem& aItem)
 {
   if (aAxisTracker.IsCrossAxisHorizontal()) {
     MOZ_ASSERT(aItem.HasIntrinsicRatio(),
                "For now, caller's CanMainSizeInfluenceCrossSize check should "
                "only allow us to get here for items with intrinsic ratio");
     // XXXdholbert When we finish support for vertical writing-modes,
     // (in bug 1079155 or a dependency), we'll relax the horizontal check in
     // CanMainSizeInfluenceCrossSize, and this function will need to be able
     // to measure the baseline & width (given our resolved height)
     // of vertical-writing-mode flex items here.
     // For now, we only expect to get here for items with an intrinsic aspect
     // ratio; and for those items, we can just read the size off of the reflow
     // state, without performing reflow.
-    aItem.SetCrossSize(aChildReflowState.ComputedWidth());
+    aItem.SetCrossSize(aChildReflowInput.ComputedWidth());
     return;
   }
 
   MOZ_ASSERT(!aItem.HadMeasuringReflow(),
              "We shouldn't need more than one measuring reflow");
 
   if (aItem.GetAlignSelf() == NS_STYLE_ALIGN_STRETCH) {
     // This item's got "align-self: stretch", so we probably imposed a
     // stretched computed height on it during its previous reflow. We're
     // not imposing that height for *this* measuring reflow, so we need to
     // tell it to treat this reflow as a vertical resize (regardless of
     // whether any of its ancestors are being resized).
-    aChildReflowState.SetVResize(true);
+    aChildReflowInput.SetVResize(true);
   }
-  ReflowOutput childDesiredSize(aChildReflowState);
+  ReflowOutput childDesiredSize(aChildReflowInput);
   nsReflowStatus childReflowStatus;
   const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
   ReflowChild(aItem.Frame(), aPresContext,
-              childDesiredSize, aChildReflowState,
+              childDesiredSize, aChildReflowInput,
               0, 0, flags, childReflowStatus);
   aItem.SetHadMeasuringReflow();
 
   // XXXdholbert Once we do pagination / splitting, we'll need to actually
   // handle incomplete childReflowStatuses. But for now, we give our kids
   // unconstrained available height, which means they should always complete.
   MOZ_ASSERT(NS_FRAME_IS_COMPLETE(childReflowStatus),
              "We gave flex item unconstrained available height, so it "
              "should be complete");
 
   // Tell the child we're done with its initial reflow.
   // (Necessary for e.g. GetBaseline() to work below w/out asserting)
   FinishReflowChild(aItem.Frame(), aPresContext,
-                    childDesiredSize, &aChildReflowState, 0, 0, flags);
+                    childDesiredSize, &aChildReflowInput, 0, 0, flags);
 
   // Save the sizing info that we learned from this reflow
   // -----------------------------------------------------
 
   // Tentatively store the child's desired content-box cross-size.
   // Note that childDesiredSize is the border-box size, so we have to
   // subtract border & padding to get the content-box size.
   // (Note that at this point in the code, we know our cross axis is vertical,
@@ -3803,35 +3803,35 @@ FlexLine::PositionItemsInCrossAxis(nscoo
     // Back out to cross-axis edge of the line.
     lineCrossAxisPosnTracker.ResetPosition();
   }
 }
 
 void
 nsFlexContainerFrame::Reflow(nsPresContext*           aPresContext,
                              ReflowOutput&     aDesiredSize,
-                             const ReflowInput& aReflowState,
+                             const ReflowInput& aReflowInput,
                              nsReflowStatus&          aStatus)
 {
   MarkInReflow();
   DO_GLOBAL_REFLOW_COUNT("nsFlexContainerFrame");
-  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
+  DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
   MOZ_LOG(gFlexContainerLog, LogLevel::Debug,
          ("Reflow() for nsFlexContainerFrame %p\n", this));
 
-  if (IsFrameTreeTooDeep(aReflowState, aDesiredSize, aStatus)) {
+  if (IsFrameTreeTooDeep(aReflowInput, aDesiredSize, aStatus)) {
     return;
   }
 
   // We (and our children) can only depend on our ancestor's bsize if we have
   // a percent-bsize, or if we're positioned and we have "block-start" and "block-end"
   // set and have block-size:auto.  (There are actually other cases, too -- e.g. if
   // our parent is itself a block-dir flex container and we're flexible -- but
   // we'll let our ancestors handle those sorts of cases.)
-  WritingMode wm = aReflowState.GetWritingMode();
+  WritingMode wm = aReflowInput.GetWritingMode();
   const nsStylePosition* stylePos = StylePosition();
   const nsStyleCoord& bsize = stylePos->BSize(wm);
   if (bsize.HasPercent() ||
       (StyleDisplay()->IsAbsolutelyPositionedStyle() &&
        eStyleUnit_Auto == bsize.GetUnit() &&
        eStyleUnit_Auto != stylePos->mOffset.GetBStartUnit(wm) &&
        eStyleUnit_Auto != stylePos->mOffset.GetBEndUnit(wm))) {
     AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
@@ -3850,42 +3850,42 @@ nsFlexContainerFrame::Reflow(nsPresConte
   if (!HasAnyStateBits(NS_STATE_FLEX_CHILDREN_REORDERED)) {
     if (SortChildrenIfNeeded<IsOrderLEQ>()) {
       AddStateBits(NS_STATE_FLEX_CHILDREN_REORDERED);
     }
   } else {
     SortChildrenIfNeeded<IsOrderLEQWithDOMFallback>();
   }
 
-  const FlexboxAxisTracker axisTracker(this, aReflowState.GetWritingMode());
+  const FlexboxAxisTracker axisTracker(this, aReflowInput.GetWritingMode());
 
   // If we're being fragmented into a constrained BSize, then subtract off
   // borderpadding BStart from that constrained BSize, to get the available
   // BSize for our content box. (No need to subtract the borderpadding BStart
   // if we're already skipping it via GetLogicalSkipSides, though.)
-  nscoord availableBSizeForContent = aReflowState.AvailableBSize();
+  nscoord availableBSizeForContent = aReflowInput.AvailableBSize();
   if (availableBSizeForContent != NS_UNCONSTRAINEDSIZE &&
-      !(GetLogicalSkipSides(&aReflowState).BStart())) {
+      !(GetLogicalSkipSides(&aReflowInput).BStart())) {
     availableBSizeForContent -=
-      aReflowState.ComputedLogicalBorderPadding().BStart(wm);
+      aReflowInput.ComputedLogicalBorderPadding().BStart(wm);
     // (Don't let that push availableBSizeForContent below zero, though):
     availableBSizeForContent = std::max(availableBSizeForContent, 0);
   }
 
-  nscoord contentBoxMainSize = GetMainSizeFromReflowState(aReflowState,
+  nscoord contentBoxMainSize = GetMainSizeFromReflowInput(aReflowInput,
                                                           axisTracker);
 
   AutoTArray<StrutInfo, 1> struts;
-  DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus,
+  DoFlexLayout(aPresContext, aDesiredSize, aReflowInput, aStatus,
                contentBoxMainSize, availableBSizeForContent,
                struts, axisTracker);
 
   if (!struts.IsEmpty()) {
     // We're restarting flex layout, with new knowledge of collapsed items.
-    DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus,
+    DoFlexLayout(aPresContext, aDesiredSize, aReflowInput, aStatus,
                  contentBoxMainSize, availableBSizeForContent,
                  struts, axisTracker);
   }
 }
 
 // RAII class to clean up a list of FlexLines.
 // Specifically, this removes each line from the list, deletes all the
 // FlexItems in its list, and deletes the FlexLine.
@@ -3946,35 +3946,35 @@ public:
 private:
   const FrameProperties mItemProps;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 void
 nsFlexContainerFrame::DoFlexLayout(nsPresContext*           aPresContext,
                                    ReflowOutput&     aDesiredSize,
-                                   const ReflowInput& aReflowState,
+                                   const ReflowInput& aReflowInput,
                                    nsReflowStatus&          aStatus,
                                    nscoord aContentBoxMainSize,
                                    nscoord aAvailableBSizeForContent,
                                    nsTArray<StrutInfo>& aStruts,
                                    const FlexboxAxisTracker& aAxisTracker)
 {
   aStatus = NS_FRAME_COMPLETE;
 
   LinkedList<FlexLine> lines;
   AutoFlexLineListClearer cleanupLines(lines);
 
-  GenerateFlexLines(aPresContext, aReflowState,
+  GenerateFlexLines(aPresContext, aReflowInput,
                     aContentBoxMainSize,
                     aAvailableBSizeForContent,
                     aStruts, aAxisTracker, lines);
 
   aContentBoxMainSize =
-    ResolveFlexContainerMainSize(aReflowState, aAxisTracker,
+    ResolveFlexContainerMainSize(aReflowInput, aAxisTracker,
                                  aContentBoxMainSize, aAvailableBSizeForContent,
                                  lines.getFirst(), aStatus);
 
   for (FlexLine* line = lines.getFirst(); line; line = line->getNext()) {
     line->ResolveFlexibleLengths(aContentBoxMainSize);
   }
 
   // Cross Size Determination - Flexbox spec section 9.4
@@ -3994,48 +3994,48 @@ nsFlexContainerFrame::DoFlexLayout(nsPre
           // cross size in the reflow state. (For other flex items, it's OK
           // (and cheaper) to impose our main size *after* the reflow state has
           // been constructed, since the main size shouldn't influence anything
           // about cross-size measurement until we actually reflow the child.)
           sizeOverride.emplace(*item);
         }
 
         WritingMode wm = item->Frame()->GetWritingMode();
-        LogicalSize availSize = aReflowState.ComputedSize(wm);
+        LogicalSize availSize = aReflowInput.ComputedSize(wm);
         availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
-        ReflowInput childReflowState(aPresContext, aReflowState,
+        ReflowInput childReflowInput(aPresContext, aReflowInput,
                                            item->Frame(), availSize);
         if (!sizeOverride) {
           // Directly override the computed main-size, by tweaking reflow state:
           if (aAxisTracker.IsMainAxisHorizontal()) {
-            childReflowState.SetComputedWidth(item->GetMainSize());
+            childReflowInput.SetComputedWidth(item->GetMainSize());
           } else {
-            childReflowState.SetComputedHeight(item->GetMainSize());
+            childReflowInput.SetComputedHeight(item->GetMainSize());
           }
         }
 
         SizeItemInCrossAxis(aPresContext, aAxisTracker,
-                            childReflowState, *item);
+                            childReflowInput, *item);
       }
     }
     // Now that we've finished with this line's items, size the line itself:
     line->ComputeCrossSizeAndBaseline(aAxisTracker);
     sumLineCrossSizes += line->GetLineCrossSize();
   }
 
   bool isCrossSizeDefinite;
   const nscoord contentBoxCrossSize =
-    ComputeCrossSize(aReflowState, aAxisTracker, sumLineCrossSizes,
+    ComputeCrossSize(aReflowInput, aAxisTracker, sumLineCrossSizes,
                      aAvailableBSizeForContent, &isCrossSizeDefinite, aStatus);
 
   // Set up state for cross-axis alignment, at a high level (outside the
   // scope of a particular flex line)
   CrossAxisPositionTracker
     crossAxisPosnTracker(lines.getFirst(),
-                         aReflowState.mStylePosition->ComputedAlignContent(),
+                         aReflowInput.mStylePosition->ComputedAlignContent(),
                          contentBoxCrossSize, isCrossSizeDefinite,
                          aAxisTracker);
 
   // Now that we know the cross size of each line (including
   // "align-content:stretch" adjustments, from the CrossAxisPositionTracker
   // constructor), we can create struts for any flex items with
   // "visibility: collapse" (and restart flex layout).
   if (aStruts.IsEmpty()) { // (Don't make struts if we already did)
@@ -4056,24 +4056,24 @@ nsFlexContainerFrame::DoFlexLayout(nsPre
     if (firstLineBaselineOffset == nscoord_MIN) {
       // No baseline-aligned items in line. Use sentinel value to prompt us to
       // get baseline from the first FlexItem after we've reflowed it.
       flexContainerAscent = nscoord_MIN;
     } else  {
       flexContainerAscent =
         ComputePhysicalAscentFromFlexRelativeAscent(
           crossAxisPosnTracker.GetPosition() + firstLineBaselineOffset,
-          contentBoxCrossSize, aReflowState, aAxisTracker);
+          contentBoxCrossSize, aReflowInput, aAxisTracker);
     }
   }
 
-  const auto justifyContent = IsLegacyBox(aReflowState.mStyleDisplay,
+  const auto justifyContent = IsLegacyBox(aReflowInput.mStyleDisplay,
                                           mStyleContext) ?
     ConvertLegacyStyleToJustifyContent(StyleXUL()) :
-    aReflowState.mStylePosition->ComputedJustifyContent();
+    aReflowInput.mStylePosition->ComputedJustifyContent();
 
   for (FlexLine* line = lines.getFirst(); line; line = line->getNext()) {
     // Main-Axis Alignment - Flexbox spec section 9.5
     // ==============================================
     line->PositionItemsInMainAxis(justifyContent,
                                   aContentBoxMainSize,
                                   aAxisTracker);
 
@@ -4094,44 +4094,44 @@ nsFlexContainerFrame::DoFlexLayout(nsPre
     if (lastLineBaselineOffset == nscoord_MIN) {
       // No baseline-aligned items in line. Use sentinel value to prompt us to
       // get baseline from the last FlexItem after we've reflowed it.
       flexContainerAscent = nscoord_MIN;
     } else {
       flexContainerAscent =
         ComputePhysicalAscentFromFlexRelativeAscent(
           crossAxisPosnTracker.GetPosition() - lastLineBaselineOffset,
-          contentBoxCrossSize, aReflowState, aAxisTracker);
+          contentBoxCrossSize, aReflowInput, aAxisTracker);
     }
   }
 
   // Before giving each child a final reflow, calculate the origin of the
   // flex container's content box (with respect to its border-box), so that
   // we can compute our flex item's final positions.
-  WritingMode flexWM = aReflowState.GetWritingMode();
-  LogicalMargin containerBP = aReflowState.ComputedLogicalBorderPadding();
+  WritingMode flexWM = aReflowInput.GetWritingMode();
+  LogicalMargin containerBP = aReflowInput.ComputedLogicalBorderPadding();
 
   // Unconditionally skip block-end border & padding for now, regardless of
   // writing-mode/GetLogicalSkipSides.  We add it lower down, after we've
   // established baseline and decided whether bottom border-padding fits (if
   // we're fragmented).
   const nscoord blockEndContainerBP = containerBP.BEnd(flexWM);
   const LogicalSides skipSides =
-    GetLogicalSkipSides(&aReflowState) | LogicalSides(eLogicalSideBitsBEnd);
+    GetLogicalSkipSides(&aReflowInput) | LogicalSides(eLogicalSideBitsBEnd);
   containerBP.ApplySkipSides(skipSides);
 
   const LogicalPoint containerContentBoxOrigin(flexWM,
                                                containerBP.IStart(flexWM),
                                                containerBP.BStart(flexWM));
 
   // Determine flex container's border-box size (used in positioning children):
   LogicalSize logSize =