Bug 1277129 Part 6a - Rename frame to mFrame in SizeComputationInput. draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 21 Jul 2016 12:58:29 +0800
changeset 390455 98d6286c2cdbb033faec0a5c61dcfc0ca975e31d
parent 390454 cda9271d3637029eb56ccd337e9ddeee08037c68
child 390456 79160785fb5c07a7265102a7a992426e92c825fc
push id23670
push usertlin@mozilla.com
push dateThu, 21 Jul 2016 05:05:21 +0000
bugs1277129
milestone50.0a1
Bug 1277129 Part 6a - Rename frame to mFrame in SizeComputationInput. MozReview-Commit-ID: Gza8NeThzz2
layout/generic/ReflowInput.cpp
layout/generic/ReflowInput.h
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockReflowContext.cpp
layout/generic/nsContainerFrame.cpp
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFontInflationData.cpp
layout/generic/nsFrame.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsLineLayout.cpp
layout/generic/nsLineLayout.h
layout/generic/nsTextFrame.cpp
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableFrame.cpp
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowGroupFrame.cpp
layout/tables/nsTableWrapperFrame.cpp
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -149,30 +149,30 @@ FontSizeInflationListMarginAdjustment(co
 // grid item, we need to make it take the containing-block block-size as
 // well as the inline-size, since flex items and grid items resolve
 // block-direction percent margins and padding against the
 // containing-block block-size, rather than its inline-size.
 SizeComputationInput::SizeComputationInput(nsIFrame *aFrame,
                                    nsRenderingContext *aRenderingContext,
                                    WritingMode aContainingBlockWritingMode,
                                    nscoord aContainingBlockISize)
-  : frame(aFrame)
+  : mFrame(aFrame)
   , rendContext(aRenderingContext)
   , mWritingMode(aFrame->GetWritingMode())
 {
   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;
-  InitOffsets(aContainingBlockWritingMode, cbSize, frame->GetType(), 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,
@@ -194,74 +194,74 @@ ReflowInput::ReflowInput(
                   "frame should be clean when getting special bsize reflow");
 
   mParentReflowState = &aParentReflowState;
 
   // 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)
-    frame->AddStateBits(mParentReflowState->frame->GetStateBits() &
+    mFrame->AddStateBits(mParentReflowState->mFrame->GetStateBits() &
                         NS_FRAME_IS_DIRTY);
 
   AvailableISize() = aAvailableSpace.ISize(mWritingMode);
   AvailableBSize() = aAvailableSpace.BSize(mWritingMode);
 
   if (mWritingMode.IsOrthogonalTo(aParentReflowState.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();
     }
   }
 
   mFloatManager = aParentReflowState.mFloatManager;
-  if (frame->IsFrameOfType(nsIFrame::eLineParticipant))
+  if (mFrame->IsFrameOfType(nsIFrame::eLineParticipant))
     mLineLayout = aParentReflowState.mLineLayout;
   else
     mLineLayout = nullptr;
 
   // Note: mFlags was initialized as a copy of aParentReflowState.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.frame);
+    CheckNextInFlowParenthood(aFrame, aParentReflowState.mFrame);
   mFlags.mAssumingHScrollbar = mFlags.mAssumingVScrollbar = false;
   mFlags.mIsColumnBalancing = false;
   mFlags.mIsFlexContainerMeasuringHeight = false;
   mFlags.mDummyParentReflowState = 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;
 
   if ((aFlags & DUMMY_PARENT_REFLOW_STATE) ||
       (mParentReflowState->mFlags.mDummyParentReflowState &&
-       frame->GetType() == nsGkAtoms::tableFrame)) {
+       mFrame->GetType() == nsGkAtoms::tableFrame)) {
     mFlags.mDummyParentReflowState = true;
   }
 
   if (!(aFlags & CALLER_WILL_INIT)) {
     Init(aPresContext, aContainingBlockSize);
   }
 }
 
 inline nscoord
 SizeComputationInput::ComputeISizeValue(nscoord aContainingBlockISize,
                                     nscoord aContentEdgeToBoxSizing,
                                     nscoord aBoxSizingToMarginEdge,
                                     const nsStyleCoord& aCoord) const
 {
-  return nsLayoutUtils::ComputeISizeValue(rendContext, frame,
+  return nsLayoutUtils::ComputeISizeValue(rendContext, mFrame,
                                           aContainingBlockISize,
                                           aContentEdgeToBoxSizing,
                                           aBoxSizingToMarginEdge,
                                           aCoord);
 }
 
 nscoord
 SizeComputationInput::ComputeISizeValue(nscoord aContainingBlockISize,
@@ -292,60 +292,60 @@ SizeComputationInput::ComputeBSizeValue(
   }
   return nsLayoutUtils::ComputeBSizeValue(aContainingBlockBSize,
                                           inside, aCoord);
 }
 
 void
 ReflowInput::SetComputedWidth(nscoord aComputedWidth)
 {
-  NS_ASSERTION(frame, "Must have a frame!");
+  NS_ASSERTION(mFrame, "Must have a frame!");
   // It'd be nice to assert that |frame| is not in reflow, but this fails for
   // two reasons:
   //
   // 1) Viewport frames reset the computed width on a copy of their reflow
   //    state when reflowing fixed-pos kids.  In that case we actually don't
   //    want to mess with the resize flags, because comparing the frame's rect
   //    to the munged computed width is pointless.
   // 2) nsFrame::BoxReflow creates a reflow state for its parent.  This reflow
   //    state is not used to reflow the parent, but just as a parent for the
   //    frame's own reflow state.  So given a nsBoxFrame inside some non-XUL
   //    (like a text control, for example), we'll end up creating a reflow
   //    state for the parent while the parent is reflowing.
 
   NS_PRECONDITION(aComputedWidth >= 0, "Invalid computed width");
   if (ComputedWidth() != aComputedWidth) {
     ComputedWidth() = aComputedWidth;
-    nsIAtom* frameType = frame->GetType();
+    nsIAtom* frameType = mFrame->GetType();
     if (frameType != nsGkAtoms::viewportFrame || // Or check GetParent()?
         mWritingMode.IsVertical()) {
-      InitResizeFlags(frame->PresContext(), frameType);
+      InitResizeFlags(mFrame->PresContext(), frameType);
     }
   }
 }
 
 void
 ReflowInput::SetComputedHeight(nscoord aComputedHeight)
 {
-  NS_ASSERTION(frame, "Must have a frame!");
+  NS_ASSERTION(mFrame, "Must have a frame!");
   // It'd be nice to assert that |frame| is not in reflow, but this fails
   // because:
   //
   //    nsFrame::BoxReflow creates a reflow state for its parent.  This reflow
   //    state is not used to reflow the parent, but just as a parent for the
   //    frame's own reflow state.  So given a nsBoxFrame inside some non-XUL
   //    (like a text control, for example), we'll end up creating a reflow
   //    state for the parent while the parent is reflowing.
 
   NS_PRECONDITION(aComputedHeight >= 0, "Invalid computed height");
   if (ComputedHeight() != aComputedHeight) {
     ComputedHeight() = aComputedHeight;
-    nsIAtom* frameType = frame->GetType();
+    nsIAtom* frameType = mFrame->GetType();
     if (frameType != nsGkAtoms::viewportFrame || !mWritingMode.IsVertical()) {
-      InitResizeFlags(frame->PresContext(), frameType);
+      InitResizeFlags(mFrame->PresContext(), frameType);
     }
   }
 }
 
 void
 ReflowInput::Init(nsPresContext*     aPresContext,
                         const LogicalSize* aContainingBlockSize,
                         const nsMargin*    aBorder,
@@ -364,90 +364,90 @@ ReflowInput::Init(nsPresContext*     aPr
     }
   }
 
   LAYOUT_WARN_IF_FALSE(AvailableISize() != NS_UNCONSTRAINEDSIZE,
                        "have unconstrained inline-size; this should only "
                        "result from very large sizes, not attempts at "
                        "intrinsic inline-size calculation");
 
-  mStylePosition = frame->StylePosition();
-  mStyleDisplay = frame->StyleDisplay();
-  mStyleVisibility = frame->StyleVisibility();
-  mStyleBorder = frame->StyleBorder();
-  mStyleMargin = frame->StyleMargin();
-  mStylePadding = frame->StylePadding();
-  mStyleText = frame->StyleText();
+  mStylePosition = mFrame->StylePosition();
+  mStyleDisplay = mFrame->StyleDisplay();
+  mStyleVisibility = mFrame->StyleVisibility();
+  mStyleBorder = mFrame->StyleBorder();
+  mStyleMargin = mFrame->StyleMargin();
+  mStylePadding = mFrame->StylePadding();
+  mStyleText = mFrame->StyleText();
 
-  nsIAtom* type = frame->GetType();
+  nsIAtom* type = mFrame->GetType();
 
   InitFrameType(type);
   InitCBReflowState();
 
   LogicalSize cbSize(mWritingMode, -1, -1);
   if (aContainingBlockSize) {
     cbSize = *aContainingBlockSize;
   }
 
   InitConstraints(aPresContext, cbSize, aBorder, aPadding, type);
 
   InitResizeFlags(aPresContext, type);
 
-  nsIFrame *parent = frame->GetParent();
+  nsIFrame *parent = mFrame->GetParent();
   if (parent &&
       (parent->GetStateBits() & NS_FRAME_IN_CONSTRAINED_BSIZE) &&
       !(parent->GetType() == nsGkAtoms::scrollFrame &&
         parent->StyleDisplay()->mOverflowY != NS_STYLE_OVERFLOW_HIDDEN)) {
-    frame->AddStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
+    mFrame->AddStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
   } else if (type == nsGkAtoms::svgForeignObjectFrame) {
     // An SVG foreignObject frame is inherently constrained block-size.
-    frame->AddStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
+    mFrame->AddStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
   } else {
     const nsStyleCoord& bSizeCoord = mStylePosition->BSize(mWritingMode);
     const nsStyleCoord& maxBSizeCoord = mStylePosition->MaxBSize(mWritingMode);
     if ((bSizeCoord.GetUnit() != eStyleUnit_Auto ||
          maxBSizeCoord.GetUnit() != eStyleUnit_None) &&
          // Don't set NS_FRAME_IN_CONSTRAINED_BSIZE on body or html elements.
-         (frame->GetContent() &&
-        !(frame->GetContent()->IsAnyOfHTMLElements(nsGkAtoms::body,
+         (mFrame->GetContent() &&
+        !(mFrame->GetContent()->IsAnyOfHTMLElements(nsGkAtoms::body,
                                                    nsGkAtoms::html)))) {
 
       // If our block-size was specified as a percentage, then this could
       // actually resolve to 'auto', based on:
       // http://www.w3.org/TR/CSS21/visudet.html#the-height-property
-      nsIFrame* containingBlk = frame;
+      nsIFrame* containingBlk = mFrame;
       while (containingBlk) {
         const nsStylePosition* stylePos = containingBlk->StylePosition();
         const nsStyleCoord& bSizeCoord = stylePos->BSize(mWritingMode);
         const nsStyleCoord& maxBSizeCoord = stylePos->MaxBSize(mWritingMode);
         if ((bSizeCoord.IsCoordPercentCalcUnit() &&
              !bSizeCoord.HasPercent()) ||
             (maxBSizeCoord.IsCoordPercentCalcUnit() &&
              !maxBSizeCoord.HasPercent())) {
-          frame->AddStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
+          mFrame->AddStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
           break;
         } else if ((bSizeCoord.IsCoordPercentCalcUnit() &&
                     bSizeCoord.HasPercent()) ||
                    (maxBSizeCoord.IsCoordPercentCalcUnit() &&
                     maxBSizeCoord.HasPercent())) {
           if (!(containingBlk = containingBlk->GetContainingBlock())) {
             // If we've reached the top of the tree, then we don't have
             // a constrained block-size.
-            frame->RemoveStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
+            mFrame->RemoveStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
             break;
           }
 
           continue;
         } else {
-          frame->RemoveStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
+          mFrame->RemoveStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
           break;
         }
       }
     } else {
-      frame->RemoveStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
+      mFrame->RemoveStateBits(NS_FRAME_IN_CONSTRAINED_BSIZE);
     }
   }
 
   if (mParentReflowState &&
       mParentReflowState->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
@@ -457,35 +457,35 @@ ReflowInput::Init(nsPresContext*     aPr
         eStyleUnit_Auto == mStylePosition->ISize(mWritingMode).GetUnit()) {
       ComputedISize() = NS_UNCONSTRAINEDSIZE;
     } else {
       AvailableBSize() = NS_UNCONSTRAINEDSIZE;
     }
   }
 
   LAYOUT_WARN_IF_FALSE((mFrameType == NS_CSS_FRAME_TYPE_INLINE &&
-                        !frame->IsFrameOfType(nsIFrame::eReplaced)) ||
+                        !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()
 {
   if (!mParentReflowState) {
     mCBReflowState = nullptr;
     return;
   }
 
-  if (mParentReflowState->frame == frame->GetContainingBlock()) {
+  if (mParentReflowState->mFrame == mFrame->GetContainingBlock()) {
     // Inner table frames need to use the containing block of the outer
     // table frame.
-    if (frame->GetType() == nsGkAtoms::tableFrame) {
+    if (mFrame->GetType() == nsGkAtoms::tableFrame) {
       mCBReflowState = mParentReflowState->mCBReflowState;
     } else {
       mCBReflowState = mParentReflowState;
     }
   } else {
     mCBReflowState = mParentReflowState->mCBReflowState;
   }
 }
@@ -504,45 +504,45 @@ IsQuirkContainingBlockHeight(const Reflo
   if (nsGkAtoms::blockFrame == aFrameType ||
 #ifdef MOZ_XUL
       nsGkAtoms::XULLabelFrame == aFrameType ||
 #endif
       nsGkAtoms::scrollFrame == aFrameType) {
     // Note: This next condition could change due to a style change,
     // but that would cause a style reflow anyway, which means we're ok.
     if (NS_AUTOHEIGHT == rs->ComputedHeight()) {
-      if (!rs->frame->IsAbsolutelyPositioned()) {
+      if (!rs->mFrame->IsAbsolutelyPositioned()) {
         return false;
       }
     }
   }
   return true;
 }
 
 
 void
 ReflowInput::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType)
 {
   const WritingMode wm = mWritingMode; // just a shorthand
   bool isIResize =
-    frame->ISize(wm) !=
+    mFrame->ISize(wm) !=
       ComputedISize() + ComputedLogicalBorderPadding().IStartEnd(wm);
 
-  if ((frame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) &&
+  if ((mFrame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) &&
       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;
 
-    if (dirty || (!frame->GetParent() && isIResize)) {
+    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
       // case of style change reflow, except that because inflation
       // doesn't affect the intrinsic sizing codepath, there's no need
@@ -556,25 +556,25 @@ ReflowInput::InitResizeFlags(nsPresConte
       // caused by script where a style or content change in one place
       // causes a resize in another (e.g., rebalancing a table).
 
       // FIXME: This isn't so great for the cases where
       // ReflowInput::SetComputedWidth is called, if the first time
       // we go through InitResizeFlags we set IsHResize() to true, and then
       // the second time we'd set it to false even without the
       // NS_FRAME_IS_DIRTY bit already set.
-      if (frame->GetType() == nsGkAtoms::svgForeignObjectFrame) {
+      if (mFrame->GetType() == nsGkAtoms::svgForeignObjectFrame) {
         // Foreign object frames use dirty bits in a special way.
-        frame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
-        nsIFrame *kid = frame->PrincipalChildList().FirstChild();
+        mFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
+        nsIFrame *kid = mFrame->PrincipalChildList().FirstChild();
         if (kid) {
           kid->AddStateBits(NS_FRAME_IS_DIRTY);
         }
       } else {
-        frame->AddStateBits(NS_FRAME_IS_DIRTY);
+        mFrame->AddStateBits(NS_FRAME_IS_DIRTY);
       }
 
       // Mark intrinsic widths on all descendants dirty.  We need to do
       // this (1) since we're changing the size of text and need to
       // clear text runs on text frames and (2) since we actually are
       // changing some intrinsic widths, but only those that live inside
       // of containers.
 
@@ -588,17 +588,17 @@ ReflowInput::InitResizeFlags(nsPresConte
 
       // This is also different from what PresShell::FrameNeedsReflow
       // does because it doesn't go through placeholders.  It doesn't
       // need to because we're actually doing something that cares about
       // frame tree geometry (the width on an ancestor) rather than
       // style.
 
       AutoTArray<nsIFrame*, 32> stack;
-      stack.AppendElement(frame);
+      stack.AppendElement(mFrame);
 
       do {
         nsIFrame *f = stack.ElementAt(stack.Length() - 1);
         stack.RemoveElementAt(stack.Length() - 1);
 
         nsIFrame::ChildListIterator lists(f);
         for (; !lists.IsDone(); lists.Next()) {
           nsFrameList::Enumerator childFrames(lists.CurrentList());
@@ -607,37 +607,37 @@ ReflowInput::InitResizeFlags(nsPresConte
             kid->MarkIntrinsicISizesDirty();
             stack.AppendElement(kid);
           }
         }
       } while (stack.Length() != 0);
     }
   }
 
-  SetIResize(!(frame->GetStateBits() & NS_FRAME_IS_DIRTY) &&
+  SetIResize(!(mFrame->GetStateBits() & NS_FRAME_IS_DIRTY) &&
              isIResize);
 
   // XXX Should we really need to null check mCBReflowState?  (We do for
   // at least nsBoxFrame).
   if (IS_TABLE_CELL(aFrameType) &&
       (mFlags.mSpecialBSizeReflow ||
-       (frame->FirstInFlow()->GetStateBits() &
+       (mFrame->FirstInFlow()->GetStateBits() &
          NS_TABLE_CELL_HAD_SPECIAL_REFLOW)) &&
-      (frame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
+      (mFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
     // Need to set the bit on the cell so that
     // mCBReflowState->IsBResize() is set correctly below when
     // reflowing descendant.
     SetBResize(true);
-  } else if (mCBReflowState && frame->IsBlockWrapper()) {
+  } else if (mCBReflowState && 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(frame)) {
+  } else if (mCBReflowState && !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
@@ -648,61 +648,61 @@ ReflowInput::InitResizeFlags(nsPresConte
     // 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));
     if (ComputedBSize() == NS_AUTOHEIGHT) {
-      SetBResize(IsBResize() || NS_SUBTREE_DIRTY(frame));
+      SetBResize(IsBResize() || NS_SUBTREE_DIRTY(mFrame));
     }
   } else if (ComputedBSize() == NS_AUTOHEIGHT) {
     if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
         mCBReflowState) {
       SetBResize(mCBReflowState->IsBResizeForWM(wm));
     } else {
       SetBResize(IsIResize());
     }
-    SetBResize(IsBResize() || NS_SUBTREE_DIRTY(frame));
+    SetBResize(IsBResize() || NS_SUBTREE_DIRTY(mFrame));
   } else {
     // not 'auto' block-size
-    SetBResize(frame->BSize(wm) !=
+    SetBResize(mFrame->BSize(wm) !=
                ComputedBSize() + ComputedLogicalBorderPadding().BStartEnd(wm));
   }
 
   bool dependsOnCBBSize =
     (mStylePosition->BSizeDependsOnContainer(wm) &&
      // FIXME: condition this on not-abspos?
      mStylePosition->BSize(wm).GetUnit() != eStyleUnit_Auto) ||
     mStylePosition->MinBSizeDependsOnContainer(wm) ||
     mStylePosition->MaxBSizeDependsOnContainer(wm) ||
     mStylePosition->OffsetHasPercent(wm.PhysicalSide(eLogicalSideBStart)) ||
     mStylePosition->mOffset.GetBEndUnit(wm) != eStyleUnit_Auto ||
-    frame->IsXULBoxFrame();
+    mFrame->IsXULBoxFrame();
 
   if (mStyleText->mLineHeight.GetUnit() == eStyleUnit_Enumerated) {
     NS_ASSERTION(mStyleText->mLineHeight.GetIntValue() ==
                  NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT,
                  "bad line-height value");
 
     // line-height depends on block bsize
-    frame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
+    mFrame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
     // but only on containing blocks if this frame is not a suitable block
-    dependsOnCBBSize |= !nsLayoutUtils::IsNonWrapperBlock(frame);
+    dependsOnCBBSize |= !nsLayoutUtils::IsNonWrapperBlock(mFrame);
   }
 
   // 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->frame->GetType()) || 
+      (IS_TABLE_CELL(mCBReflowState->mFrame->GetType()) || 
        mCBReflowState->mFlags.mHeightDependsOnAncestorCell) &&
       !mCBReflowState->mFlags.mSpecialBSizeReflow && 
       dependsOnCBBSize) {
     SetBResize(true);
     mFlags.mHeightDependsOnAncestorCell = true;
   }
 
   // Set NS_FRAME_CONTAINS_RELATIVE_BSIZE if it's needed.
@@ -718,43 +718,43 @@ ReflowInput::InitResizeFlags(nsPresConte
     const ReflowInput *rs = this;
     bool hitCBReflowState = false;
     do {
       rs = rs->mParentReflowState;
       if (!rs) {
         break;
       }
         
-      if (rs->frame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)
+      if (rs->mFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)
         break; // no need to go further
-      rs->frame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
+      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;
       }
 
       // 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 ||
              (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
-              !IsQuirkContainingBlockHeight(rs, rs->frame->GetType())));
+              !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.
     
   }
-  if (frame->GetStateBits() & NS_FRAME_IS_DIRTY) {
+  if (mFrame->GetStateBits() & NS_FRAME_IS_DIRTY) {
     // If we're reflowing everything, then we'll find out if we need
     // to re-set this.
-    frame->RemoveStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
+    mFrame->RemoveStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
   }
 }
 
 nscoord
 ReflowInput::GetContainingBlockContentISize(WritingMode aWritingMode) const
 {
   if (!mCBReflowState) {
     return 0;
@@ -772,37 +772,37 @@ ReflowInput::InitFrameType(nsIAtom* aFra
 
   // Section 9.7 of the CSS2 spec indicates that absolute position
   // takes precedence over float which takes precedence over display.
   // XXXldb nsRuleNode::ComputeDisplayData should take care of this, right?
   // Make sure the frame was actually moved out of the flow, and don't
   // just assume what the style says, because we might not have had a
   // useful float/absolute containing block
 
-  DISPLAY_INIT_TYPE(frame, this);
+  DISPLAY_INIT_TYPE(mFrame, this);
 
   if (aFrameType == nsGkAtoms::tableFrame) {
     mFrameType = NS_CSS_FRAME_TYPE_BLOCK;
     return;
   }
 
-  NS_ASSERTION(frame->StyleDisplay()->IsAbsolutelyPositionedStyle() ==
+  NS_ASSERTION(mFrame->StyleDisplay()->IsAbsolutelyPositionedStyle() ==
                  disp->IsAbsolutelyPositionedStyle(),
                "Unexpected position style");
-  NS_ASSERTION(frame->StyleDisplay()->IsFloatingStyle() ==
+  NS_ASSERTION(mFrame->StyleDisplay()->IsFloatingStyle() ==
                  disp->IsFloatingStyle(), "Unexpected float style");
-  if (frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
-    if (disp->IsAbsolutelyPositioned(frame)) {
+  if (mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
+    if (disp->IsAbsolutelyPositioned(mFrame)) {
       frameType = NS_CSS_FRAME_TYPE_ABSOLUTE;
       //XXXfr hack for making frames behave properly when in overflow container lists
       //      see bug 154892; need to revisit later
-      if (frame->GetPrevInFlow())
+      if (mFrame->GetPrevInFlow())
         frameType = NS_CSS_FRAME_TYPE_BLOCK;
     }
-    else if (disp->IsFloating(frame)) {
+    else if (disp->IsFloating(mFrame)) {
       frameType = NS_CSS_FRAME_TYPE_FLOATING;
     } else {
       NS_ASSERTION(disp->mDisplay == NS_STYLE_DISPLAY_POPUP,
                    "unknown out of flow frame type");
       frameType = NS_CSS_FRAME_TYPE_UNKNOWN;
     }
   }
   else {
@@ -847,19 +847,19 @@ ReflowInput::InitFrameType(nsIAtom* aFra
     case NS_STYLE_DISPLAY_NONE:
     default:
       frameType = NS_CSS_FRAME_TYPE_UNKNOWN;
       break;
     }
   }
 
   // See if the frame is replaced
-  if (frame->IsFrameOfType(nsIFrame::eReplacedContainsBlock)) {
+  if (mFrame->IsFrameOfType(nsIFrame::eReplacedContainsBlock)) {
     frameType = NS_FRAME_REPLACED_CONTAINS_BLOCK(frameType);
-  } else if (frame->IsFrameOfType(nsIFrame::eReplaced)) {
+  } else if (mFrame->IsFrameOfType(nsIFrame::eReplaced)) {
     frameType = NS_FRAME_REPLACED(frameType);
   }
 
   mFrameType = frameType;
 }
 
 /* static */ void
 ReflowInput::ComputeRelativeOffsets(WritingMode aWM,
@@ -1024,25 +1024,25 @@ ReflowInput::ApplyRelativePositioning(ns
 }
 
 nsIFrame*
 ReflowInput::GetHypotheticalBoxContainer(nsIFrame*    aFrame,
                                                nscoord&     aCBIStartEdge,
                                                LogicalSize& aCBSize) const
 {
   aFrame = aFrame->GetContainingBlock();
-  NS_ASSERTION(aFrame != frame, "How did that happen?");
+  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->frame != aFrame;
+    for (state = mParentReflowState; state && state->mFrame != aFrame;
          state = state->mParentReflowState) {
       /* do nothing */
     }
   } else {
     state = nullptr;
   }
 
   if (state) {
@@ -1234,17 +1234,17 @@ ReflowInput::CalculateHypotheticalPositi
   WritingMode wm = containingBlock->GetWritingMode();
 
   nsStyleCoord styleISize = mStylePosition->ISize(wm);
   bool isAutoISize = styleISize.GetUnit() == eStyleUnit_Auto;
   nsSize      intrinsicSize;
   bool        knowIntrinsicSize = false;
   if (NS_FRAME_IS_REPLACED(mFrameType) && isAutoISize) {
     // See if we can get the intrinsic size of the element
-    knowIntrinsicSize = GetIntrinsicSizeFor(frame, intrinsicSize, aFrameType);
+    knowIntrinsicSize = GetIntrinsicSizeFor(mFrame, intrinsicSize, aFrameType);
   }
 
   // See if we can calculate what the box inline size would have been if
   // the element had been in the flow
   nscoord boxISize;
   bool    knowBoxISize = false;
   if ((NS_STYLE_DISPLAY_INLINE == mStyleDisplay->mOriginalDisplay) &&
       !NS_FRAME_IS_REPLACED(mFrameType)) {
@@ -1391,44 +1391,44 @@ ReflowInput::CalculateHypotheticalPositi
   // The current coordinate space is that of the nearest block to the placeholder.
   // Convert to the coordinate space of the absolute containing block
   // One weird thing here is that for fixed-positioned elements we want to do
   // the conversion incorrectly; specifically we want to ignore any scrolling
   // that may have happened;
   nsPoint cbOffset;
   if (mStyleDisplay->mPosition == NS_STYLE_POSITION_FIXED &&
       // Exclude cases inside -moz-transform where fixed is like absolute.
-      nsLayoutUtils::IsReallyFixedPos(frame)) {
+      nsLayoutUtils::IsReallyFixedPos(mFrame)) {
     // In this case, cbrs->frame will likely be an ancestor of
     // containingBlock, so can just walk our way up the frame tree.
     // Make sure to not add positions of frames whose parent is a
     // scrollFrame, since we're doing fixed positioning, which assumes
     // everything is scrolled to (0,0).
     cbOffset.MoveTo(0, 0);
     do {
       cbOffset += containingBlock->GetPositionIgnoringScrolling();
       nsContainerFrame* parent = containingBlock->GetParent();
       if (!parent) {
         // Oops, our absolute containing block isn't an ancestor of the
         // placeholder's containing block. This can happen if the placeholder
         // is pushed to a different page in a printing context.  'cbOffset' is
         // currently relative to the root frame (containingBlock) - so just
         // subtract the offset to the absolute containing block to make it
         // relative to that.
-        cbOffset -= containingBlock->GetOffsetTo(cbrs->frame);
+        cbOffset -= containingBlock->GetOffsetTo(cbrs->mFrame);
         break;
       }
       containingBlock = parent;
-    } while (containingBlock != cbrs->frame);
+    } while (containingBlock != cbrs->mFrame);
   } else {
     // XXXldb We need to either ignore scrolling for the absolute
     // positioning case too (and take the incompatibility) or figure out
     // how to make these positioned elements actually *move* when we
     // scroll, and thus avoid the resulting incremental reflow bugs.
-    cbOffset = containingBlock->GetOffsetTo(cbrs->frame);
+    cbOffset = containingBlock->GetOffsetTo(cbrs->mFrame);
   }
   nsSize cbrsSize = cbrs->ComputedSizeAsContainerIfConstrained();
   LogicalPoint logCBOffs(wm, cbOffset, cbrsSize - containerSize);
   aHypotheticalPos.mIStart += logCBOffs.I(wm);
   aHypotheticalPos.mBStart += logCBOffs.B(wm);
 
   // The specified offsets are relative to the absolute containing block's
   // padding edge and our current values are relative to the border edge, so
@@ -1511,17 +1511,17 @@ ReflowInput::InitAbsoluteConstraints(nsP
 {
   WritingMode wm = GetWritingMode();
   WritingMode cbwm = cbrs->GetWritingMode();
   NS_PRECONDITION(aCBSize.BSize(cbwm) != NS_AUTOHEIGHT,
                   "containing block bsize must be constrained");
 
   NS_ASSERTION(aFrameType != nsGkAtoms::tableFrame,
                "InitAbsoluteConstraints should not be called on table frames");
-  NS_ASSERTION(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
+  NS_ASSERTION(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
                "Why are we here?");
 
   const auto& styleOffset = mStylePosition->mOffset;
   bool iStartIsAuto = styleOffset.GetIStartUnit(cbwm) == eStyleUnit_Auto;
   bool iEndIsAuto   = styleOffset.GetIEndUnit(cbwm) == eStyleUnit_Auto;
   bool bStartIsAuto = styleOffset.GetBStartUnit(cbwm) == eStyleUnit_Auto;
   bool bEndIsAuto   = styleOffset.GetBEndUnit(cbwm) == eStyleUnit_Auto;
 
@@ -1531,17 +1531,17 @@ ReflowInput::InitAbsoluteConstraints(nsP
   nsHypotheticalPosition hypotheticalPos;
   if ((iStartIsAuto && iEndIsAuto) || (bStartIsAuto && bEndIsAuto)) {
     if (mFlags.mStaticPosIsCBOrigin) {
       hypotheticalPos.mWritingMode = cbwm;
       hypotheticalPos.mIStart = nscoord(0);
       hypotheticalPos.mBStart = nscoord(0);
     } else {
       nsIFrame* placeholderFrame =
-        aPresContext->PresShell()->GetPlaceholderFrameFor(frame);
+        aPresContext->PresShell()->GetPlaceholderFrameFor(mFrame);
       NS_ASSERTION(placeholderFrame, "no placeholder frame");
       CalculateHypotheticalPosition(aPresContext, placeholderFrame, cbrs,
                                     hypotheticalPos, aFrameType);
     }
   }
 
   // Initialize the 'left' and 'right' computed offsets
   // XXX Handle new 'static-position' value...
@@ -1615,20 +1615,20 @@ ReflowInput::InitAbsoluteConstraints(nsP
     if (iStartIsAuto || iEndIsAuto) {
       computeSizeFlags =
         ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
     }
   }
 
   LogicalSize computedSize(wm);
   {
-    AutoMaybeDisableFontInflation an(frame);
+    AutoMaybeDisableFontInflation an(mFrame);
 
     computedSize =
-      frame->ComputeSize(rendContext, wm, cbSize.ConvertTo(wm, cbwm),
+      mFrame->ComputeSize(rendContext, wm, cbSize.ConvertTo(wm, cbwm),
                          cbSize.ConvertTo(wm, cbwm).ISize(wm), // XXX or AvailableISize()?
                          ComputedLogicalMargin().Size(wm) +
                            ComputedLogicalOffsets().Size(wm),
                          ComputedLogicalBorderPadding().Size(wm) -
                            ComputedLogicalPadding().Size(wm),
                          ComputedLogicalPadding().Size(wm),
                          computeSizeFlags);
     ComputedISize() = computedSize.ISize(wm);
@@ -1880,45 +1880,45 @@ CalcQuirkContainingBlockHeight(const Ref
   
   // initialize the default to NS_AUTOHEIGHT as this is the containings block
   // computed height when this function is called. It is possible that we 
   // don't alter this height especially if we are restricted to one level
   nscoord result = NS_AUTOHEIGHT; 
                              
   const ReflowInput* rs = aCBReflowState;
   for (; rs; rs = rs->mParentReflowState) {
-    nsIAtom* frameType = rs->frame->GetType();
+    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) {
 
       secondAncestorRS = firstAncestorRS;
       firstAncestorRS = rs;
 
       // If the current frame we're looking at is positioned, we don't want to
       // go any further (see bug 221784).  The behavior we want here is: 1) If
       // not auto-height, use this as the percentage base.  2) If auto-height,
       // keep looking, unless the frame is positioned.
       if (NS_AUTOHEIGHT == rs->ComputedHeight()) {
-        if (rs->frame->IsAbsolutelyPositioned()) {
+        if (rs->mFrame->IsAbsolutelyPositioned()) {
           break;
         } else {
           continue;
         }
       }
     }
     else if (nsGkAtoms::canvasFrame == frameType) {
       // Always continue on to the height calculation
     }
     else if (nsGkAtoms::pageContentFrame == frameType) {
-      nsIFrame* prevInFlow = rs->frame->GetPrevInFlow();
+      nsIFrame* prevInFlow = rs->mFrame->GetPrevInFlow();
       // only use the page content frame for a height basis if it is the first in flow
       if (prevInFlow) 
         break;
     }
     else {
       break;
     }
 
@@ -1935,37 +1935,37 @@ CalcQuirkContainingBlockHeight(const Ref
         (nsGkAtoms::pageContentFrame == frameType)) {
 
       result -= GetBlockMarginBorderPadding(firstAncestorRS);
       result -= GetBlockMarginBorderPadding(secondAncestorRS);
 
 #ifdef DEBUG
       // make sure the first ancestor is the HTML and the second is the BODY
       if (firstAncestorRS) {
-        nsIContent* frameContent = firstAncestorRS->frame->GetContent();
+        nsIContent* frameContent = firstAncestorRS->mFrame->GetContent();
         if (frameContent) {
           NS_ASSERTION(frameContent->IsHTMLElement(nsGkAtoms::html),
                        "First ancestor is not HTML");
         }
       }
       if (secondAncestorRS) {
-        nsIContent* frameContent = secondAncestorRS->frame->GetContent();
+        nsIContent* frameContent = secondAncestorRS->mFrame->GetContent();
         if (frameContent) {
           NS_ASSERTION(frameContent->IsHTMLElement(nsGkAtoms::body),
                        "Second ancestor is not BODY");
         }
       }
 #endif
       
     }
     // if we got to the html frame (a block child of the canvas) ...
     else if (nsGkAtoms::blockFrame == frameType &&
              rs->mParentReflowState &&
              nsGkAtoms::canvasFrame ==
-               rs->mParentReflowState->frame->GetType()) {
+               rs->mParentReflowState->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);
@@ -1982,36 +1982,36 @@ ReflowInput::ComputeContainingBlockRecta
   // formed by the content edge of the nearest block-level ancestor
   LogicalSize cbSize = aContainingBlockRS->ComputedSize();
 
   WritingMode wm = aContainingBlockRS->GetWritingMode();
 
   // mFrameType for abs-pos tables is NS_CSS_FRAME_TYPE_BLOCK, so we need to
   // special case them here.
   if (NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE ||
-      (frame->GetType() == nsGkAtoms::tableFrame &&
-       frame->IsAbsolutelyPositioned() &&
-       (frame->GetParent()->GetStateBits() & NS_FRAME_OUT_OF_FLOW))) {
+      (mFrame->GetType() == nsGkAtoms::tableFrame &&
+       mFrame->IsAbsolutelyPositioned() &&
+       (mFrame->GetParent()->GetStateBits() & NS_FRAME_OUT_OF_FLOW))) {
     // See if the ancestor is block-level or inline-level
     if (NS_FRAME_GET_TYPE(aContainingBlockRS->mFrameType) == NS_CSS_FRAME_TYPE_INLINE) {
       // Base our size on the actual size of the frame.  In cases when this is
       // completely bogus (eg initial reflow), this code shouldn't even be
       // called, since the code in nsInlineFrame::Reflow will pass in
       // the containing block dimensions to our constructor.
       // XXXbz we should be taking the in-flows into account too, but
       // that's very hard.
 
       LogicalMargin computedBorder =
         aContainingBlockRS->ComputedLogicalBorderPadding() -
         aContainingBlockRS->ComputedLogicalPadding();
-      cbSize.ISize(wm) = aContainingBlockRS->frame->ISize(wm) -
+      cbSize.ISize(wm) = aContainingBlockRS->mFrame->ISize(wm) -
                          computedBorder.IStartEnd(wm);
       NS_ASSERTION(cbSize.ISize(wm) >= 0,
                    "Negative containing block isize!");
-      cbSize.BSize(wm) = aContainingBlockRS->frame->BSize(wm) -
+      cbSize.BSize(wm) = aContainingBlockRS->mFrame->BSize(wm) -
                          computedBorder.BStartEnd(wm);
       NS_ASSERTION(cbSize.BSize(wm) >= 0,
                    "Negative containing block bsize!");
     } else {
       // If the ancestor is block-level, the containing block is formed by the
       // padding edge of the ancestor
       cbSize.ISize(wm) +=
         aContainingBlockRS->ComputedLogicalPadding().IStartEnd(wm);
@@ -2087,26 +2087,26 @@ OffsetPercentBasis(const nsIFrame*    aF
 void
 ReflowInput::InitConstraints(nsPresContext*     aPresContext,
                                    const LogicalSize& aContainingBlockSize,
                                    const nsMargin*    aBorder,
                                    const nsMargin*    aPadding,
                                    nsIAtom*           aFrameType)
 {
   WritingMode wm = GetWritingMode();
-  DISPLAY_INIT_CONSTRAINTS(frame, this,
+  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) {
     // XXXldb This doesn't mean what it used to!
-    InitOffsets(wm, OffsetPercentBasis(frame, wm, aContainingBlockSize),
+    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);
 
     ComputedISize() =
       AvailableISize() - ComputedLogicalBorderPadding().IStartEnd(wm);
@@ -2139,31 +2139,31 @@ ReflowInput::InitConstraints(nsPresConte
     // 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) {
-        fType = cbrs->frame->GetType();
+        fType = cbrs->mFrame->GetType();
         if (IS_TABLE_CELL(fType)) {
           // use the cell's computed block size
           cbSize.BSize(wm) = cbrs->ComputedSize(wm).BSize(wm);
         }
       }
     }
 
     // XXX Might need to also pass the CB height (not width) for page boxes,
     // too, if we implement them.
 
     // For calculating positioning offsets, margins, borders and
     // padding, we use the writing mode of the containing block
     WritingMode cbwm = cbrs->GetWritingMode();
-    InitOffsets(cbwm, OffsetPercentBasis(frame, cbwm,
+    InitOffsets(cbwm, OffsetPercentBasis(mFrame, cbwm,
                                          cbSize.ConvertTo(cbwm, wm)),
                 aFrameType, mFlags, aBorder, aPadding);
 
     // For calculating the size of this box, we use its own writing mode
     const nsStyleCoord &blockSize = mStylePosition->BSize(wm);
     nsStyleUnit blockSizeUnit = blockSize.GetUnit();
 
     // Check for a percentage based block size and a containing block
@@ -2215,19 +2215,19 @@ ReflowInput::InitConstraints(nsPresConte
     }
 
     // Compute our offsets if the element is relatively positioned.  We
     // need the correct containing block inline-size and block-size
     // here, which is why we need to do it after all the quirks-n-such
     // above. (If the element is sticky positioned, we need to wait
     // until the scroll container knows its size, so we compute offsets
     // from StickyScrollContainer::UpdatePositions.)
-    if (mStyleDisplay->IsRelativelyPositioned(frame) &&
+    if (mStyleDisplay->IsRelativelyPositioned(mFrame) &&
         NS_STYLE_POSITION_RELATIVE == mStyleDisplay->mPosition) {
-      ComputeRelativeOffsets(cbwm, frame, cbSize.ConvertTo(cbwm, wm),
+      ComputeRelativeOffsets(cbwm, mFrame, cbSize.ConvertTo(cbwm, wm),
                              ComputedPhysicalOffsets());
     } else {
       // Initialize offsets to 0
       ComputedPhysicalOffsets().SizeTo(0, 0, 0, 0);
     }
 
     // Calculate the computed values for min and max properties.  Note that
     // this MUST come after we've computed our border and padding.
@@ -2292,55 +2292,55 @@ ReflowInput::InitConstraints(nsPresConte
       // Doesn't apply to table elements
       ComputedMinWidth() = ComputedMinHeight() = 0;
       ComputedMaxWidth() = ComputedMaxHeight() = NS_UNCONSTRAINEDSIZE;
 
     } else if (NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE) {
       // XXX not sure if this belongs here or somewhere else - cwk
       InitAbsoluteConstraints(aPresContext, cbrs, cbSize.ConvertTo(cbrs->GetWritingMode(), wm), aFrameType);
     } else {
-      AutoMaybeDisableFontInflation an(frame);
+      AutoMaybeDisableFontInflation an(mFrame);
 
       bool isBlock = NS_CSS_FRAME_TYPE_BLOCK == NS_FRAME_GET_TYPE(mFrameType);
       typedef nsIFrame::ComputeSizeFlags ComputeSizeFlags;
       ComputeSizeFlags computeSizeFlags =
         isBlock ? ComputeSizeFlags::eDefault : ComputeSizeFlags::eShrinkWrap;
       if (mFlags.mShrinkWrap) {
         computeSizeFlags =
           ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
       }
       if (mFlags.mUseAutoBSize) {
         computeSizeFlags =
           ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eUseAutoBSize);
       }
 
-      nsIFrame* parent = frame->GetParent();
+      nsIFrame* parent = mFrame->GetParent();
       nsIAtom* parentFrameType = parent ? parent->GetType() : nullptr;
       if (parentFrameType == nsGkAtoms::gridContainerFrame) {
         // Shrink-wrap grid items that will be aligned (rather than stretched)
         // in its inline axis.
         auto inlineAxisAlignment = wm.IsOrthogonalTo(cbwm) ?
-          mStylePosition->ComputedAlignSelf(frame->StyleContext()->GetParent()) :
-          mStylePosition->ComputedJustifySelf(frame->StyleContext()->GetParent());
+          mStylePosition->ComputedAlignSelf(mFrame->StyleContext()->GetParent()) :
+          mStylePosition->ComputedJustifySelf(mFrame->StyleContext()->GetParent());
         if ((inlineAxisAlignment != NS_STYLE_ALIGN_STRETCH &&
              inlineAxisAlignment != NS_STYLE_ALIGN_NORMAL) ||
             mStyleMargin->mMargin.GetIStartUnit(wm) == eStyleUnit_Auto ||
             mStyleMargin->mMargin.GetIEndUnit(wm) == eStyleUnit_Auto) {
           computeSizeFlags =
             ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
         }
       } else {
         // Make sure legend frames with display:block and width:auto still
         // shrink-wrap.
         // Also shrink-wrap blocks that are orthogonal to their container.
         if (isBlock &&
             ((aFrameType == nsGkAtoms::legendFrame &&
-              frame->StyleContext()->GetPseudo() != nsCSSAnonBoxes::scrolledContent) ||
+              mFrame->StyleContext()->GetPseudo() != nsCSSAnonBoxes::scrolledContent) ||
              (aFrameType == nsGkAtoms::scrollFrame &&
-              frame->GetContentInsertionFrame()->GetType() == nsGkAtoms::legendFrame) ||
+              mFrame->GetContentInsertionFrame()->GetType() == nsGkAtoms::legendFrame) ||
              (mCBReflowState &&
               mCBReflowState->GetWritingMode().IsOrthogonalTo(mWritingMode)))) {
           computeSizeFlags =
             ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eShrinkWrap);
         }
 
         if (parentFrameType == nsGkAtoms::flexContainerFrame) {
           computeSizeFlags =
@@ -2361,33 +2361,33 @@ ReflowInput::InitConstraints(nsPresConte
 
       if (cbSize.ISize(wm) == NS_UNCONSTRAINEDSIZE) {
         // For orthogonal flows, where we found a parent orthogonal-limit
         // for AvailableISize() in Init(), we'll use the same here as well.
         cbSize.ISize(wm) = AvailableISize();
       }
 
       LogicalSize size =
-        frame->ComputeSize(rendContext, wm, cbSize, AvailableISize(),
+        mFrame->ComputeSize(rendContext, wm, cbSize, AvailableISize(),
                            ComputedLogicalMargin().Size(wm),
                            ComputedLogicalBorderPadding().Size(wm) -
                              ComputedLogicalPadding().Size(wm),
                            ComputedLogicalPadding().Size(wm),
                            computeSizeFlags);
 
       ComputedISize() = size.ISize(wm);
       ComputedBSize() = size.BSize(wm);
       NS_ASSERTION(ComputedISize() >= 0, "Bogus inline-size");
       NS_ASSERTION(ComputedBSize() == NS_UNCONSTRAINEDSIZE ||
                    ComputedBSize() >= 0, "Bogus block-size");
 
       // Exclude inline tables, side captions, flex and grid items from block
       // margin calculations.
       if (isBlock &&
-          !IsSideCaption(frame, mStyleDisplay, cbwm) &&
+          !IsSideCaption(mFrame, mStyleDisplay, cbwm) &&
           mStyleDisplay->mDisplay != NS_STYLE_DISPLAY_INLINE_TABLE &&
           parentFrameType != nsGkAtoms::flexContainerFrame &&
           parentFrameType != nsGkAtoms::gridContainerFrame) {
         CalculateBlockSideMargins(aFrameType);
       }
     }
   }
 }
@@ -2413,70 +2413,70 @@ UpdateProp(FrameProperties& aProps,
 void
 SizeComputationInput::InitOffsets(WritingMode aWM,
                               const LogicalSize& aPercentBasis,
                               nsIAtom* aFrameType,
                               ReflowStateFlags aFlags,
                               const nsMargin* aBorder,
                               const nsMargin* aPadding)
 {
-  DISPLAY_INIT_OFFSETS(frame, this, aPercentBasis, aBorder, 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 = frame->PresContext();
-  FrameProperties props(presContext->PropertyTable(), frame);
+  nsPresContext *presContext = mFrame->PresContext();
+  FrameProperties props(presContext->PropertyTable(), mFrame);
   props.Delete(nsIFrame::UsedBorderProperty());
 
   // Compute margins from the specified margin style information. These
   // become the default computed values, and may be adjusted below
   // XXX fix to provide 0,0 for the top&bottom margins for
   // inline-non-replaced elements
   bool needMarginProp = ComputeMargin(aWM, aPercentBasis);
   // XXX We need to include 'auto' horizontal margins in this too!
   // ... but if we did that, we'd need to fix nsFrame::GetUsedMargin
   // to use it even when the margins are all zero (since sometimes
   // they get treated as auto)
   ::UpdateProp(props, nsIFrame::UsedMarginProperty(), needMarginProp,
                ComputedPhysicalMargin());
 
 
-  const nsStyleDisplay *disp = frame->StyleDisplay();
-  bool isThemed = frame->IsThemed(disp);
+  const nsStyleDisplay *disp = mFrame->StyleDisplay();
+  bool isThemed = mFrame->IsThemed(disp);
   bool needPaddingProp;
   nsIntMargin widget;
   if (isThemed &&
       presContext->GetTheme()->GetWidgetPadding(presContext->DeviceContext(),
-                                                frame, disp->mAppearance,
+                                                mFrame, disp->mAppearance,
                                                 &widget)) {
     ComputedPhysicalPadding().top = presContext->DevPixelsToAppUnits(widget.top);
     ComputedPhysicalPadding().right = presContext->DevPixelsToAppUnits(widget.right);
     ComputedPhysicalPadding().bottom = presContext->DevPixelsToAppUnits(widget.bottom);
     ComputedPhysicalPadding().left = presContext->DevPixelsToAppUnits(widget.left);
     needPaddingProp = false;
   }
-  else if (frame->IsSVGText()) {
+  else if (mFrame->IsSVGText()) {
     ComputedPhysicalPadding().SizeTo(0, 0, 0, 0);
     needPaddingProp = false;
   }
   else if (aPadding) { // padding is an input arg
     ComputedPhysicalPadding() = *aPadding;
-    needPaddingProp = frame->StylePadding()->IsWidthDependent() ||
-	  (frame->GetStateBits() & NS_FRAME_REFLOW_ROOT);
+    needPaddingProp = mFrame->StylePadding()->IsWidthDependent() ||
+	  (mFrame->GetStateBits() & NS_FRAME_REFLOW_ROOT);
   }
   else {
     needPaddingProp = ComputePadding(aWM, aPercentBasis, aFrameType);
   }
 
   // Add [align|justify]-content:baseline padding contribution.
   typedef const FramePropertyDescriptor<SmallValueHolder<nscoord>>* Prop;
   auto ApplyBaselinePadding = [this, &needPaddingProp]
          (LogicalAxis aAxis, Prop aProp) {
     bool found;
-    nscoord val = frame->Properties().Get(aProp, &found);
+    nscoord val = mFrame->Properties().Get(aProp, &found);
     if (found) {
       NS_ASSERTION(val != nscoord(0), "zero in this property is useless");
       WritingMode wm = GetWritingMode();
       LogicalSide side;
       if (val > 0) {
         side = MakeLogicalSide(aAxis, eLogicalEdgeStart);
       } else {
         side = MakeLogicalSide(aAxis, eLogicalEdgeEnd);
@@ -2491,40 +2491,40 @@ SizeComputationInput::InitOffsets(Writin
   }
   if (!aFlags.mShrinkWrap) {
     ApplyBaselinePadding(eLogicalAxisInline, nsIFrame::IBaselinePadProperty());
   }
 
   if (isThemed) {
     nsIntMargin widget;
     presContext->GetTheme()->GetWidgetBorder(presContext->DeviceContext(),
-                                             frame, disp->mAppearance,
+                                             mFrame, disp->mAppearance,
                                              &widget);
     ComputedPhysicalBorderPadding().top =
       presContext->DevPixelsToAppUnits(widget.top);
     ComputedPhysicalBorderPadding().right =
       presContext->DevPixelsToAppUnits(widget.right);
     ComputedPhysicalBorderPadding().bottom =
       presContext->DevPixelsToAppUnits(widget.bottom);
     ComputedPhysicalBorderPadding().left =
       presContext->DevPixelsToAppUnits(widget.left);
   }
-  else if (frame->IsSVGText()) {
+  else if (mFrame->IsSVGText()) {
     ComputedPhysicalBorderPadding().SizeTo(0, 0, 0, 0);
   }
   else if (aBorder) {  // border is an input arg
     ComputedPhysicalBorderPadding() = *aBorder;
   }
   else {
-    ComputedPhysicalBorderPadding() = frame->StyleBorder()->GetComputedBorder();
+    ComputedPhysicalBorderPadding() = mFrame->StyleBorder()->GetComputedBorder();
   }
   ComputedPhysicalBorderPadding() += ComputedPhysicalPadding();
 
   if (aFrameType == nsGkAtoms::tableFrame) {
-    nsTableFrame *tableFrame = static_cast<nsTableFrame*>(frame);
+    nsTableFrame *tableFrame = static_cast<nsTableFrame*>(mFrame);
 
     if (tableFrame->IsBorderCollapse()) {
       // border-collapsed tables don't use any of their padding, and
       // only part of their border.  We need to do this here before we
       // try to do anything like handling 'auto' widths,
       // 'box-sizing', or 'auto' margins.
       ComputedPhysicalPadding().SizeTo(0,0,0,0);
       SetComputedLogicalBorderPadding(
@@ -2533,17 +2533,17 @@ SizeComputationInput::InitOffsets(Writin
 
     // The margin is inherited to the table wrapper frame via
     // the ::-moz-table-wrapper rule in ua.css.
     ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
   } else if (aFrameType == nsGkAtoms::scrollbarFrame) {
     // scrollbars may have had their width or height smashed to zero
     // by the associated scrollframe, in which case we must not report
     // any padding or border.
-    nsSize size(frame->GetSize());
+    nsSize size(mFrame->GetSize());
     if (size.width == 0 || size.height == 0) {
       ComputedPhysicalPadding().SizeTo(0,0,0,0);
       ComputedPhysicalBorderPadding().SizeTo(0,0,0,0);
     }
   }
   ::UpdateProp(props, nsIFrame::UsedPaddingProperty(), needPaddingProp,
                ComputedPhysicalPadding());
 }
@@ -2615,17 +2615,17 @@ ReflowInput::CalculateBlockSideMargins(n
   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;
     if (aFrameType == nsGkAtoms::tableFrame) {
-      NS_ASSERTION(prs->frame->GetType() == nsGkAtoms::tableWrapperFrame,
+      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;
     }
     if (prs &&
         (prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_LEFT ||
          prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER ||
@@ -2742,21 +2742,21 @@ ComputeLineHeight(nsStyleContext* aStyle
     GetFontMetricsForStyleContext(aStyleContext, aFontSizeInflation);
   return GetNormalLineHeight(fm);
 }
 
 nscoord
 ReflowInput::CalcLineHeight() const
 {
   nscoord blockBSize =
-    nsLayoutUtils::IsNonWrapperBlock(frame) ? ComputedBSize() :
+    nsLayoutUtils::IsNonWrapperBlock(mFrame) ? ComputedBSize() :
     (mCBReflowState ? mCBReflowState->ComputedBSize() : NS_AUTOHEIGHT);
 
-  return CalcLineHeight(frame->GetContent(), frame->StyleContext(), blockBSize,
-                        nsLayoutUtils::FontSizeInflationFor(frame));
+  return CalcLineHeight(mFrame->GetContent(), mFrame->StyleContext(), blockBSize,
+                        nsLayoutUtils::FontSizeInflationFor(mFrame));
 }
 
 /* static */ nscoord
 ReflowInput::CalcLineHeight(nsIContent* aContent,
                                   nsStyleContext* aStyleContext,
                                   nscoord aBlockBSize,
                                   float aFontSizeInflation)
 {
@@ -2781,22 +2781,22 @@ ReflowInput::CalcLineHeight(nsIContent* 
   return lineHeight;
 }
 
 bool
 SizeComputationInput::ComputeMargin(WritingMode aWM,
                                 const LogicalSize& aPercentBasis)
 {
   // SVG text frames have no margin.
-  if (frame->IsSVGText()) {
+  if (mFrame->IsSVGText()) {
     return false;
   }
 
   // If style style can provide us the margin directly, then use it.
-  const nsStyleMargin *styleMargin = frame->StyleMargin();
+  const nsStyleMargin *styleMargin = mFrame->StyleMargin();
 
   bool isCBDependent = !styleMargin->GetMargin(ComputedPhysicalMargin());
   if (isCBDependent) {
     // We have to compute the value. Note that this calculation is
     // performed according to the writing mode of the containing block
     // (http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-flows)
     LogicalMargin m(aWM);
     m.IStart(aWM) = nsLayoutUtils::
@@ -2813,34 +2813,34 @@ SizeComputationInput::ComputeMargin(Writ
       ComputeCBDependentValue(aPercentBasis.BSize(aWM),
                               styleMargin->mMargin.GetBEnd(aWM));
 
     SetComputedLogicalMargin(aWM, m);
   }
 
   // ... but font-size-inflation-based margin adjustment uses the
   // frame's writing mode
-  nscoord marginAdjustment = FontSizeInflationListMarginAdjustment(frame);
+  nscoord marginAdjustment = FontSizeInflationListMarginAdjustment(mFrame);
 
   if (marginAdjustment > 0) {
     LogicalMargin m = ComputedLogicalMargin();
     m.IStart(mWritingMode) += marginAdjustment;
     SetComputedLogicalMargin(m);
   }
 
   return isCBDependent;
 }
 
 bool
 SizeComputationInput::ComputePadding(WritingMode aWM,
                                  const LogicalSize& aPercentBasis,
                                  nsIAtom* aFrameType)
 {
   // If style can provide us the padding directly, then use it.
-  const nsStylePadding *stylePadding = frame->StylePadding();
+  const nsStylePadding *stylePadding = mFrame->StylePadding();
   bool isCBDependent = !stylePadding->GetPadding(ComputedPhysicalPadding());
   // a table row/col group, row/col doesn't have padding
   // XXXldb Neither do border-collapse tables.
   if (nsGkAtoms::tableRowGroupFrame == aFrameType ||
       nsGkAtoms::tableColGroupFrame == aFrameType ||
       nsGkAtoms::tableRowFrame      == aFrameType ||
       nsGkAtoms::tableColFrame      == aFrameType) {
     ComputedPhysicalPadding().SizeTo(0,0,0,0);
@@ -2975,16 +2975,16 @@ ReflowInput::SetTruncated(const ReflowOu
   } else {
     *aStatus &= ~NS_FRAME_TRUNCATED;
   }
 }
 
 bool
 ReflowInput::IsFloating() const
 {
-  return mStyleDisplay->IsFloating(frame);
+  return mStyleDisplay->IsFloating(mFrame);
 }
 
 uint8_t
 ReflowInput::GetDisplay() const
 {
-  return mStyleDisplay->GetDisplay(frame);
+  return mStyleDisplay->GetDisplay(mFrame);
 }
--- a/layout/generic/ReflowInput.h
+++ b/layout/generic/ReflowInput.h
@@ -98,18 +98,18 @@ namespace mozilla {
 
 // A base class of ReflowInput that computes only the padding,
 // border, and margin, since those values are needed more often.
 struct SizeComputationInput {
 public:
   typedef mozilla::WritingMode WritingMode;
   typedef mozilla::LogicalMargin LogicalMargin;
 
-  // the frame being reflowed
-  nsIFrame*           frame;
+  // The frame being reflowed.
+  nsIFrame* mFrame;
 
   // rendering context to use for measurement
   nsRenderingContext* rendContext;
 
   const nsMargin& ComputedPhysicalMargin() const { return mComputedMargin; }
   const nsMargin& ComputedPhysicalBorderPadding() const { return mComputedBorderPadding; }
   const nsMargin& ComputedPhysicalPadding() const { return mComputedPadding; }
 
@@ -160,17 +160,17 @@ protected:
   nsMargin         mComputedBorderPadding;
 
   // Computed padding values
   nsMargin         mComputedPadding;
 
 public:
   // Callers using this constructor must call InitOffsets on their own.
   SizeComputationInput(nsIFrame *aFrame, nsRenderingContext *aRenderingContext)
-    : frame(aFrame)
+    : mFrame(aFrame)
     , rendContext(aRenderingContext)
     , mWritingMode(aFrame->GetWritingMode())
   {
   }
 
   SizeComputationInput(nsIFrame *aFrame, nsRenderingContext *aRenderingContext,
                    mozilla::WritingMode aContainingBlockWritingMode,
                    nscoord aContainingBlockISize);
@@ -811,20 +811,20 @@ public:
 
   bool ShouldReflowAllKids() const {
     // Note that we could make a stronger optimization for IsBResize if
     // we use it in a ShouldReflowChild test that replaces the current
     // checks of NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN, if it
     // were tested there along with NS_FRAME_CONTAINS_RELATIVE_BSIZE.
     // This would need to be combined with a slight change in which
     // frames NS_FRAME_CONTAINS_RELATIVE_BSIZE is marked on.
-    return (frame->GetStateBits() & NS_FRAME_IS_DIRTY) ||
+    return (mFrame->GetStateBits() & NS_FRAME_IS_DIRTY) ||
            IsIResize() ||
            (IsBResize() && 
-            (frame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE));
+            (mFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE));
   }
 
   // This method doesn't apply min/max computed widths to the value passed in.
   void SetComputedWidth(nscoord aComputedWidth);
 
   // This method doesn't apply min/max computed heights to the value passed in.
   void SetComputedHeight(nscoord aComputedHeight);
 
@@ -865,17 +865,17 @@ public:
                                      nsMargin& aComputedOffsets);
 
   // If a relatively positioned element, adjust the position appropriately.
   static void ApplyRelativePositioning(nsIFrame* aFrame,
                                        const nsMargin& aComputedOffsets,
                                        nsPoint* aPosition);
 
   void ApplyRelativePositioning(nsPoint* aPosition) const {
-    ApplyRelativePositioning(frame, ComputedPhysicalOffsets(), aPosition);
+    ApplyRelativePositioning(mFrame, ComputedPhysicalOffsets(), aPosition);
   }
 
   static void
   ApplyRelativePositioning(nsIFrame* aFrame,
                            mozilla::WritingMode aWritingMode,
                            const mozilla::LogicalMargin& aComputedOffsets,
                            mozilla::LogicalPoint* aPosition,
                            const nsSize& aContainerSize) {
@@ -891,17 +891,17 @@ public:
                              aComputedOffsets.GetPhysicalMargin(aWritingMode),
                              &pos);
     *aPosition = mozilla::LogicalPoint(aWritingMode, pos,
                                        aContainerSize - frameSize);
   }
 
   void ApplyRelativePositioning(mozilla::LogicalPoint* aPosition,
                                 const nsSize& aContainerSize) const {
-    ApplyRelativePositioning(frame, mWritingMode,
+    ApplyRelativePositioning(mFrame, mWritingMode,
                              ComputedLogicalOffsets(), aPosition,
                              aContainerSize);
   }
 
 #ifdef DEBUG
   // Reflow trace methods.  Defined in nsFrame.cpp so they have access
   // to the display-reflow infrastructure.
   static void* DisplayInitConstraintsEnter(nsIFrame* aFrame,
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -939,17 +939,17 @@ static LogicalSize
 CalculateContainingBlockSizeForAbsolutes(WritingMode aWM,
                                          const ReflowInput& aReflowState,
                                          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.frame;
+  nsIFrame* frame = aReflowState.mFrame;
 
   LogicalSize cbSize(aFrameSize);
     // Containing block is relative to the padding edge
   const LogicalMargin& border =
     LogicalMargin(aWM, aReflowState.ComputedPhysicalBorderPadding() -
                        aReflowState.ComputedPhysicalPadding());
   cbSize.ISize(aWM) -= border.IStartEnd(aWM);
   cbSize.BSize(aWM) -= border.BStartEnd(aWM);
@@ -966,29 +966,29 @@ CalculateContainingBlockSizeForAbsolutes
     // 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->frame->GetContent() == frame->GetContent() &&
-           aLastRS->mParentReflowState->frame->GetType() != nsGkAtoms::fieldSetFrame) {
+           aLastRS->mParentReflowState->mFrame->GetContent() == frame->GetContent() &&
+           aLastRS->mParentReflowState->mFrame->GetType() != nsGkAtoms::fieldSetFrame) {
       lastButOneRS = aLastRS;
       aLastRS = aLastRS->mParentReflowState;
     }
     if (aLastRS != &aReflowState) {
       // 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->frame);
+      nsIScrollableFrame* scrollFrame = do_QueryFrame(aLastRS->mFrame);
       nsMargin scrollbars(0,0,0,0);
       if (scrollFrame) {
         scrollbars =
-          scrollFrame->GetDesiredScrollbarSizes(aLastRS->frame->PresContext(),
+          scrollFrame->GetDesiredScrollbarSizes(aLastRS->mFrame->PresContext(),
                                                 aLastRS->rendContext);
         if (!lastButOneRS->mFlags.mAssumingHScrollbar) {
           scrollbars.top = scrollbars.bottom = 0;
         }
         if (!lastButOneRS->mFlags.mAssumingVScrollbar) {
           scrollbars.left = scrollbars.right = 0;
         }
       }
@@ -3623,17 +3623,17 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
             
             // The block-end margin for a block is only applied on the last
             // flow block. Since we just continued the child block frame,
             // we know that line->mFirstChild is not the last flow block
             // therefore zero out the running margin value.
 #ifdef NOISY_BLOCK_DIR_MARGINS
             ListTag(stdout);
             printf(": reflow incomplete, frame=");
-            nsFrame::ListTag(stdout, frame);
+            nsFrame::ListTag(stdout, mFrame);
             printf(" prevBEndMargin=%d, setting to zero\n",
                    aState.mPrevBEndMargin.get());
 #endif
             aState.mPrevBEndMargin.Zero();
           }
           else { // frame is complete but its overflow is not complete
             // Disconnect the next-in-flow and put it in our overflow tracker
             if (!madeContinuation &&
@@ -3651,37 +3651,37 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
 
             // Put it in our overflow list
             aState.mOverflowTracker->Insert(nextFrame, frameReflowStatus);
             NS_MergeReflowStatusInto(&aState.mReflowStatus, frameReflowStatus);
 
 #ifdef NOISY_BLOCK_DIR_MARGINS
             ListTag(stdout);
             printf(": reflow complete but overflow incomplete for ");
-            nsFrame::ListTag(stdout, frame);
+            nsFrame::ListTag(stdout, mFrame);
             printf(" prevBEndMargin=%d collapsedBEndMargin=%d\n",
                    aState.mPrevBEndMargin.get(), collapsedBEndMargin.get());
 #endif
             aState.mPrevBEndMargin = collapsedBEndMargin;
           }
         }
         else { // frame is fully complete
 #ifdef NOISY_BLOCK_DIR_MARGINS
           ListTag(stdout);
           printf(": reflow complete for ");
-          nsFrame::ListTag(stdout, frame);
+          nsFrame::ListTag(stdout, mFrame);
           printf(" prevBEndMargin=%d collapsedBEndMargin=%d\n",
                  aState.mPrevBEndMargin.get(), collapsedBEndMargin.get());
 #endif
           aState.mPrevBEndMargin = collapsedBEndMargin;
         }
 #ifdef NOISY_BLOCK_DIR_MARGINS
         ListTag(stdout);
         printf(": frame=");
-        nsFrame::ListTag(stdout, 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)) {
           // If it's our very first line *or* we're not at the top of the page
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -62,29 +62,29 @@ nsBlockReflowContext::ComputeCollapsedBS
   // Include block-start element of frame's margin
   aMargin->Include(aRS.ComputedLogicalMargin().ConvertTo(parentWM, wm).BStart(parentWM));
 
   // The inclusion of the block-end margin when empty is done by the caller
   // since it doesn't need to be done by the top-level (non-recursive)
   // caller.
 
 #ifdef NOISY_BLOCKDIR_MARGINS
-  nsFrame::ListTag(stdout, aRS.frame);
+  nsFrame::ListTag(stdout, aRS.mFrame);
   printf(": %d => %d\n", aRS.ComputedLogicalMargin().BStart(wm), aMargin->get());
 #endif
 
   bool dirtiedLine = false;
   bool setBlockIsEmpty = false;
 
   // Calculate the frame's generational block-start-margin from its child
   // blocks. Note that if the frame has a non-zero block-start-border or
   // block-start-padding then this step is skipped because it will be a margin
   // root.  It is also skipped if the frame is a margin root for other
   // reasons.
-  nsIFrame* frame = DescendIntoBlockLevelFrame(aRS.frame);
+  nsIFrame* frame = DescendIntoBlockLevelFrame(aRS.mFrame);
   nsPresContext* prescontext = frame->PresContext();
   nsBlockFrame* block = nullptr;
   if (0 == aRS.ComputedLogicalBorderPadding().BStart(wm)) {
     block = nsLayoutUtils::GetAsBlock(frame);
     if (block) {
       bool bStartMarginRoot, unused;
       block->IsMarginRoot(&bStartMarginRoot, &unused);
       if (bStartMarginRoot) {
@@ -148,18 +148,18 @@ nsBlockReflowContext::ComputeCollapsedBS
           // 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;
-          if (frame != aRS.frame) {
-            NS_ASSERTION(frame->GetParent() == aRS.frame,
+          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,
                                                      aRS, frame, availSpace);
           }
           {
             LogicalSize availSpace =
               outerReflowState->ComputedSize(kid->GetWritingMode());
@@ -197,28 +197,28 @@ nsBlockReflowContext::ComputeCollapsedBS
           goto done;
         }
       }
       if (!setBlockIsEmpty && aBlockIsEmpty) {
         // The first time we reach here is when this is the first block
         // and we have processed all its normal lines.
         setBlockIsEmpty = true;
         // All lines are empty, or we wouldn't be here!
-        *aBlockIsEmpty = aRS.frame->IsSelfEmpty();
+        *aBlockIsEmpty = aRS.mFrame->IsSelfEmpty();
       }
     }
   }
   done:
 
   if (!setBlockIsEmpty && aBlockIsEmpty) {
-    *aBlockIsEmpty = aRS.frame->IsEmpty();
+    *aBlockIsEmpty = aRS.mFrame->IsEmpty();
   }
   
 #ifdef NOISY_BLOCKDIR_MARGINS
-  nsFrame::ListTag(stdout, aRS.frame);
+  nsFrame::ListTag(stdout, aRS.mFrame);
   printf(": => %d\n", aMargin->get());
 #endif
 
   return dirtiedLine;
 }
 
 void
 nsBlockReflowContext::ReflowBlock(const LogicalRect&  aSpace,
@@ -226,30 +226,30 @@ nsBlockReflowContext::ReflowBlock(const 
                                   nsCollapsingMargin& aPrevMargin,
                                   nscoord             aClearance,
                                   bool                aIsAdjacentWithBStart,
                                   nsLineBox*          aLine,
                                   ReflowInput&  aFrameRS,
                                   nsReflowStatus&     aFrameReflowStatus,
                                   BlockReflowInput& aState)
 {
-  mFrame = aFrameRS.frame;
+  mFrame = aFrameRS.mFrame;
   mWritingMode = aState.mReflowState.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.frame);
+    nsFrame::ListTag(stdout, mOuterReflowState.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())) {
@@ -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.frame);
+    nsFrame::ListTag(stdout, mOuterReflowState.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
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -998,17 +998,17 @@ nsContainerFrame::ReflowChild(nsIFrame* 
                               const ReflowInput& aReflowState,
                               const WritingMode&       aWM,
                               const LogicalPoint&      aPos,
                               const nsSize&            aContainerSize,
                               uint32_t                 aFlags,
                               nsReflowStatus&          aStatus,
                               nsOverflowContinuationTracker* aTracker)
 {
-  NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state");
+  NS_PRECONDITION(aReflowState.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);
@@ -1045,17 +1045,17 @@ nsContainerFrame::ReflowChild(nsIFrame* 
                               ReflowOutput&     aDesiredSize,
                               const ReflowInput& aReflowState,
                               nscoord                  aX,
                               nscoord                  aY,
                               uint32_t                 aFlags,
                               nsReflowStatus&          aStatus,
                               nsOverflowContinuationTracker* aTracker)
 {
-  NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state");
+  NS_PRECONDITION(aReflowState.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);
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -1670,17 +1670,17 @@ nsFlexContainerFrame::
 }
 
 FlexItem::FlexItem(ReflowInput& aFlexItemReflowState,
                    float aFlexGrow, float aFlexShrink, nscoord aFlexBaseSize,
                    nscoord aMainMinSize,  nscoord aMainMaxSize,
                    nscoord aTentativeCrossSize,
                    nscoord aCrossMinSize, nscoord aCrossMaxSize,
                    const FlexboxAxisTracker& aAxisTracker)
-  : mFrame(aFlexItemReflowState.frame),
+  : mFrame(aFlexItemReflowState.mFrame),
     mFlexGrow(aFlexGrow),
     mFlexShrink(aFlexShrink),
     mIntrinsicRatio(mFrame->GetIntrinsicRatio()),
     mBorderPadding(aFlexItemReflowState.ComputedPhysicalBorderPadding()),
     mMargin(aFlexItemReflowState.ComputedPhysicalMargin()),
     mMainMinSize(aMainMinSize),
     mMainMaxSize(aMainMaxSize),
     mCrossMinSize(aCrossMinSize),
@@ -1703,25 +1703,25 @@ FlexItem::FlexItem(ReflowInput& aFlexIte
   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;
   if (IsLegacyBox(containerRS->mStyleDisplay,
-                  containerRS->frame->StyleContext())) {
+                  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->frame->StyleXUL();
+    const nsStyleXUL* containerStyleXUL = containerRS->mFrame->StyleXUL();
     mAlignSelf = ConvertLegacyStyleToAlignItems(containerStyleXUL);
   } else {
     mAlignSelf = aFlexItemReflowState.mStylePosition->ComputedAlignSelf(
                    mFrame->StyleContext()->GetParent());
     if (MOZ_LIKELY(mAlignSelf == NS_STYLE_ALIGN_NORMAL)) {
       mAlignSelf = NS_STYLE_ALIGN_STRETCH;
     }
 
--- a/layout/generic/nsFontInflationData.cpp
+++ b/layout/generic/nsFontInflationData.cpp
@@ -28,17 +28,17 @@ nsFontInflationData::FindFontInflationDa
                "should have found a flow root");
 
   return bfc->Properties().Get(FontInflationDataProperty());
 }
 
 /* static */ bool
 nsFontInflationData::UpdateFontInflationDataISizeFor(const ReflowInput& aReflowState)
 {
-  nsIFrame *bfc = aReflowState.frame;
+  nsIFrame *bfc = aReflowState.mFrame;
   NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
                "should have been given a flow root");
   FrameProperties bfcProps(bfc->Properties());
   nsFontInflationData *data = bfcProps.Get(FontInflationDataProperty());
   bool oldInflationEnabled;
   nscoord oldNCAISize;
   if (data) {
     oldNCAISize = data->mNCAISize;
@@ -119,17 +119,17 @@ NearestCommonAncestorFirstInFlow(nsIFram
 
   return result;
 }
 
 static nscoord
 ComputeDescendantISize(const ReflowInput& aAncestorReflowState,
                        nsIFrame *aDescendantFrame)
 {
-  nsIFrame *ancestorFrame = aAncestorReflowState.frame->FirstInFlow();
+  nsIFrame *ancestorFrame = aAncestorReflowState.mFrame->FirstInFlow();
   if (aDescendantFrame == ancestorFrame) {
     return aAncestorReflowState.ComputedISize();
   }
 
   AutoTArray<nsIFrame*, 16> frames;
   for (nsIFrame *f = aDescendantFrame; f != ancestorFrame;
        f = f->GetParent()->FirstInFlow()) {
     frames.AppendElement(f);
@@ -147,38 +147,38 @@ ComputeDescendantISize(const ReflowInput
   for (uint32_t i = 0; i < len; ++i) {
     const ReflowInput &parentReflowState =
       (i == 0) ? aAncestorReflowState : reflowStates[i - 1];
     nsIFrame *frame = frames[len - i - 1];
     WritingMode wm = frame->GetWritingMode();
     LogicalSize availSize = parentReflowState.ComputedSize(wm);
     availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
     MOZ_ASSERT(frame->GetParent()->FirstInFlow() ==
-                 parentReflowState.frame->FirstInFlow(),
+                 parentReflowState.mFrame->FirstInFlow(),
                "bad logic in this function");
     new (reflowStates + i) ReflowInput(presContext, parentReflowState,
                                              frame, availSize);
   }
 
-  MOZ_ASSERT(reflowStates[len - 1].frame == aDescendantFrame,
+  MOZ_ASSERT(reflowStates[len - 1].mFrame == aDescendantFrame,
              "bad logic in this function");
   nscoord result = reflowStates[len - 1].ComputedISize();
 
   for (uint32_t i = len; i-- != 0; ) {
     reflowStates[i].~ReflowInput();
   }
   free(reflowStates);
 
   return result;
 }
 
 void
 nsFontInflationData::UpdateISize(const ReflowInput &aReflowState)
 {
-  nsIFrame *bfc = aReflowState.frame;
+  nsIFrame *bfc = aReflowState.mFrame;
   NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
                "must be block formatting context");
 
   nsIFrame *firstInflatableDescendant =
              FindEdgeInflatableFrameIn(bfc, eFromStart);
   if (!firstInflatableDescendant) {
     mTextAmount = 0;
     mTextThreshold = 0; // doesn't matter
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -9078,20 +9078,20 @@ nsFrame::BoxReflow(nsBoxLayoutState&    
     parentFrame->GetXULPadding(parentReflowState.ComputedPhysicalPadding());
     parentFrame->GetXULBorder(parentReflowState.ComputedPhysicalBorderPadding());
     parentReflowState.ComputedPhysicalBorderPadding() +=
       parentReflowState.ComputedPhysicalPadding();
 
     // Construct the parent chain manually since constructing it normally
     // messes up dimensions.
     const ReflowInput *outerReflowState = aState.OuterReflowState();
-    NS_ASSERTION(!outerReflowState || outerReflowState->frame != this,
+    NS_ASSERTION(!outerReflowState || outerReflowState->mFrame != this,
                  "in and out of XUL on a single frame?");
     const ReflowInput* parentRS;
-    if (outerReflowState && outerReflowState->frame == parentFrame) {
+    if (outerReflowState && outerReflowState->mFrame == parentFrame) {
       // We're a frame (such as a text control frame) that jumps into
       // box reflow and then straight out of it on the child frame.
       // This means we actually have a real parent reflow state.
       // nsLayoutUtils::InflationMinFontSizeFor used to need this to be
       // linked up correctly for text control frames, so do so here).
       parentRS = outerReflowState;
     } else {
       parentRS = &parentReflowState;
@@ -10219,17 +10219,17 @@ void DR_State::FindMatchingRule(DR_Frame
     
 DR_FrameTreeNode* DR_State::CreateTreeNode(nsIFrame*                aFrame,
                                            const ReflowInput* aReflowState)
 {
   // find the frame of the parent reflow state (usually just the parent of aFrame)
   nsIFrame* parentFrame;
   if (aReflowState) {
     const ReflowInput* parentRS = aReflowState->mParentReflowState;
-    parentFrame = (parentRS) ? parentRS->frame : nullptr;
+    parentFrame = (parentRS) ? parentRS->mFrame : nullptr;
   } else {
     parentFrame = aFrame->GetParent();
   }
 
   // find the parent tree node leaf
   DR_FrameTreeNode* parentNode = nullptr;
   
   DR_FrameTreeNode* lastLeaf = nullptr;
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -226,17 +226,17 @@ struct MOZ_STACK_CLASS ScrollReflowInput
   // Whether we decided to show the vertical scrollbar
   bool mShowVScrollbar;
 
   ScrollReflowInput(nsIScrollableFrame* aFrame,
                     const ReflowInput& aState) :
     mReflowState(aState),
     // mBoxState is just used for scrollbars so we don't need to
     // worry about the reflow depth here
-    mBoxState(aState.frame->PresContext(), aState.rendContext, 0),
+    mBoxState(aState.mFrame->PresContext(), aState.rendContext, 0),
     mStyles(aFrame->GetScrollbarStyles()) {
   }
 };
 
 } // namespace mozilla
 
 // XXXldb Can this go away?
 static nsSize ComputeInsideBorderSize(ScrollReflowInput* aState,
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -1867,17 +1867,17 @@ private:
     , mRenderingContext(aRenderingContext)
     , mFrame(aFrame)
     , mSharedGridData(nullptr)
     , mBorderPadding(aWM)
     , mFragBStart(0)
     , mStartRow(0)
     , mWM(aWM)
   {
-    MOZ_ASSERT(!aReflowState || aReflowState->frame == mFrame);
+    MOZ_ASSERT(!aReflowState || aReflowState->mFrame == mFrame);
     if (aReflowState) {
       mBorderPadding = aReflowState->ComputedLogicalBorderPadding();
       mSkipSides = aFrame->PreReflowBlockLevelLogicalSkipSides();
       mBorderPadding.ApplySkipSides(mSkipSides);
     }
   }
 };
 
@@ -4562,24 +4562,24 @@ nsGridContainerFrame::GridReflowState::C
 Maybe<nsGridContainerFrame::Fragmentainer>
 nsGridContainerFrame::GetNearestFragmentainer(const GridReflowState& aState) const
 {
   Maybe<nsGridContainerFrame::Fragmentainer> data;
   WritingMode wm = aState.mWM;
   const ReflowInput* gridRS = aState.mReflowState;
   const ReflowInput* cbRS = gridRS->mCBReflowState;
   for ( ; cbRS; cbRS = cbRS->mCBReflowState) {
-    nsIScrollableFrame* sf = do_QueryFrame(cbRS->frame);
+    nsIScrollableFrame* sf = do_QueryFrame(cbRS->mFrame);
     if (sf) {
       break;
     }
     if (wm.IsOrthogonalTo(cbRS->GetWritingMode())) {
       break;
     }
-    nsIAtom* frameType = cbRS->frame->GetType();
+    nsIAtom* frameType = cbRS->mFrame->GetType();
     if ((frameType == nsGkAtoms::canvasFrame &&
          PresContext()->IsPaginated()) ||
         frameType == nsGkAtoms::columnSetFrame) {
       data.emplace();
       data->mIsTopOfPage = gridRS->mFlags.mIsTopOfPage;
       data->mToFragmentainerEnd = aState.mFragBStart +
         gridRS->AvailableBSize() - aState.mBorderPadding.BStart(wm);
       const auto numRows = aState.mRows.mSizes.Length();
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -78,43 +78,43 @@ nsLineLayout::nsLineLayout(nsPresContext
     mNeedBackup(false),
     mInFirstLine(false),
     mGotLineBox(false),
     mInFirstLetter(false),
     mHasBullet(false),
     mDirtyNextLine(false),
     mLineAtStart(false),
     mHasRuby(false),
-    mSuppressLineWrap(aOuterReflowState->frame->IsSVGText())
+    mSuppressLineWrap(aOuterReflowState->mFrame->IsSVGText())
 {
   MOZ_ASSERT(aOuterReflowState, "aOuterReflowState must not be null");
-  NS_ASSERTION(aFloatManager || aOuterReflowState->frame->GetType() ==
+  NS_ASSERTION(aFloatManager || aOuterReflowState->mFrame->GetType() ==
                                   nsGkAtoms::letterFrame,
                "float manager should be present");
   MOZ_ASSERT((!!mBaseLineLayout) ==
-             (aOuterReflowState->frame->GetType() ==
+             (aOuterReflowState->mFrame->GetType() ==
               nsGkAtoms::rubyTextContainerFrame),
              "Only ruby text container frames have "
              "a different base line layout");
   MOZ_COUNT_CTOR(nsLineLayout);
 
   // Stash away some style data that we need
-  nsBlockFrame* blockFrame = do_QueryFrame(aOuterReflowState->frame);
+  nsBlockFrame* blockFrame = do_QueryFrame(aOuterReflowState->mFrame);
   if (blockFrame)
     mStyleText = blockFrame->StyleTextForLineLayout();
   else
-    mStyleText = aOuterReflowState->frame->StyleText();
+    mStyleText = aOuterReflowState->mFrame->StyleText();
 
   mLineNumber = 0;
   mTotalPlacedFrames = 0;
   mBStartEdge = 0;
   mTrimmableISize = 0;
 
   mInflationMinFontSize =
-    nsLayoutUtils::InflationMinFontSizeFor(aOuterReflowState->frame);
+    nsLayoutUtils::InflationMinFontSizeFor(aOuterReflowState->mFrame);
 
   // Instead of always pre-initializing the free-lists for frames and
   // spans, we do it on demand so that situations that only use a few
   // frames and spans won't waste a lot of time in unneeded
   // initialization.
   PL_INIT_ARENA_POOL(&mArena, "nsLineLayout", 1024);
   mFrameFreeList = nullptr;
   mSpanFreeList = nullptr;
@@ -157,29 +157,29 @@ nsLineLayout::BeginLineReflow(nscoord aI
   NS_ASSERTION(nullptr == mRootSpan, "bad linelayout user");
   LAYOUT_WARN_IF_FALSE(aISize != NS_UNCONSTRAINEDSIZE,
                        "have unconstrained width; this should only result from "
                        "very large sizes, not attempts at intrinsic width "
                        "calculation");
 #ifdef DEBUG
   if ((aISize != NS_UNCONSTRAINEDSIZE) && CRAZY_SIZE(aISize) &&
       !LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
-    nsFrame::ListTag(stdout, mBlockReflowState->frame);
+    nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
     printf(": Init: bad caller: width WAS %d(0x%x)\n",
            aISize, aISize);
   }
   if ((aBSize != NS_UNCONSTRAINEDSIZE) && CRAZY_SIZE(aBSize) &&
       !LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
-    nsFrame::ListTag(stdout, mBlockReflowState->frame);
+    nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
     printf(": Init: bad caller: height WAS %d(0x%x)\n",
            aBSize, aBSize);
   }
 #endif
 #ifdef NOISY_REFLOW
-  nsFrame::ListTag(stdout, mBlockReflowState->frame);
+  nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
   printf(": BeginLineReflow: %d,%d,%d,%d impacted=%s %s\n",
          aICoord, aBCoord, aISize, aBSize,
          aImpactedByFloats?"true":"false",
          aIsTopOfPage ? "top-of-page" : "");
 #endif
 #ifdef DEBUG
   mSpansAllocated = mSpansFreed = mFramesAllocated = mFramesFreed = 0;
 #endif
@@ -214,35 +214,35 @@ nsLineLayout::BeginLineReflow(nscoord aI
   mBStartEdge = aBCoord;
 
   psd->mNoWrap = !mStyleText->WhiteSpaceCanWrapStyle() || mSuppressLineWrap;
   psd->mWritingMode = aWritingMode;
 
   // If this is the first line of a block then see if the text-indent
   // property amounts to anything.
 
-  if (0 == mLineNumber && !HasPrevInFlow(mBlockReflowState->frame)) {
+  if (0 == mLineNumber && !HasPrevInFlow(mBlockReflowState->mFrame)) {
     const nsStyleCoord &textIndent = mStyleText->mTextIndent;
     nscoord pctBasis = 0;
     if (textIndent.HasPercent()) {
       pctBasis =
         mBlockReflowState->GetContainingBlockContentISize(aWritingMode);
     }
     nscoord indent = nsRuleNode::ComputeCoordPercentCalc(textIndent, pctBasis);
 
     mTextIndent = indent;
 
     psd->mICoord += indent;
   }
 
-  PerFrameData* pfd = NewPerFrameData(mBlockReflowState->frame);
+  PerFrameData* pfd = NewPerFrameData(mBlockReflowState->mFrame);
   pfd->mAscent = 0;
   pfd->mSpan = psd;
   psd->mFrame = pfd;
-  nsIFrame* frame = mBlockReflowState->frame;
+  nsIFrame* frame = mBlockReflowState->mFrame;
   if (frame->GetType() == nsGkAtoms::rubyTextContainerFrame) {
     // Ruby text container won't be reflowed via ReflowFrame, hence the
     // relative positioning information should be recorded here.
     MOZ_ASSERT(mBaseLineLayout != this);
     pfd->mRelativePos =
       mBlockReflowState->mStyleDisplay->IsRelativelyPositionedStyle();
     if (pfd->mRelativePos) {
       MOZ_ASSERT(
@@ -253,17 +253,17 @@ nsLineLayout::BeginLineReflow(nscoord aI
     }
   }
 }
 
 void
 nsLineLayout::EndLineReflow()
 {
 #ifdef NOISY_REFLOW
-  nsFrame::ListTag(stdout, mBlockReflowState->frame);
+  nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
   printf(": EndLineReflow: width=%d\n", mRootSpan->mICoord - mRootSpan->mIStart);
 #endif
 
   NS_ASSERTION(!mBaseLineLayout ||
                (!mSpansAllocated && !mSpansFreed && !mSpanFreeList &&
                 !mFramesAllocated && !mFramesFreed && !mFrameFreeList),
                "Allocated frames or spans on non-base line layout?");
 
@@ -309,24 +309,24 @@ nsLineLayout::UpdateBand(WritingMode aWM
          availSpace.IStart(lineWM), availSpace.BStart(lineWM),
          availSpace.ISize(lineWM), availSpace.BSize(lineWM),
          aFloatFrame);
 #endif
 #ifdef DEBUG
   if ((availSpace.ISize(lineWM) != NS_UNCONSTRAINEDSIZE) &&
       CRAZY_SIZE(availSpace.ISize(lineWM)) &&
       !LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
-    nsFrame::ListTag(stdout, mBlockReflowState->frame);
+    nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
     printf(": UpdateBand: bad caller: ISize WAS %d(0x%x)\n",
            availSpace.ISize(lineWM), availSpace.ISize(lineWM));
   }
   if ((availSpace.BSize(lineWM) != NS_UNCONSTRAINEDSIZE) &&
       CRAZY_SIZE(availSpace.BSize(lineWM)) &&
       !LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
-    nsFrame::ListTag(stdout, mBlockReflowState->frame);
+    nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
     printf(": UpdateBand: bad caller: BSize WAS %d(0x%x)\n",
            availSpace.BSize(lineWM), availSpace.BSize(lineWM));
   }
 #endif
 
   // Compute the difference between last times width and the new width
   NS_WARN_IF_FALSE(mRootSpan->mIEnd != NS_UNCONSTRAINEDSIZE &&
                    availSpace.ISize(lineWM) != NS_UNCONSTRAINEDSIZE,
@@ -335,17 +335,17 @@ nsLineLayout::UpdateBand(WritingMode aWM
                    "calculation");
   // The root span's mIStart moves to aICoord
   nscoord deltaICoord = availSpace.IStart(lineWM) - mRootSpan->mIStart;
   // The inline size of all spans changes by this much (the root span's
   // mIEnd moves to aICoord + aISize, its new inline size is aISize)
   nscoord deltaISize = availSpace.ISize(lineWM) -
                        (mRootSpan->mIEnd - mRootSpan->mIStart);
 #ifdef NOISY_REFLOW
-  nsFrame::ListTag(stdout, mBlockReflowState->frame);
+  nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
   printf(": UpdateBand: %d,%d,%d,%d deltaISize=%d deltaICoord=%d\n",
          availSpace.IStart(lineWM), availSpace.BStart(lineWM),
          availSpace.ISize(lineWM), availSpace.BSize(lineWM),
          deltaISize, deltaICoord);
 #endif
 
   // Update the root span position
   mRootSpan->mIStart += deltaICoord;
@@ -438,17 +438,17 @@ nsLineLayout::BeginSpan(nsIFrame* aFrame
   psd->mFrame = pfd;
   psd->mParent = mCurrentSpan;
   psd->mReflowState = aSpanReflowState;
   psd->mIStart = aIStart;
   psd->mICoord = aIStart;
   psd->mIEnd = aIEnd;
   psd->mBaseline = aBaseline;
 
-  nsIFrame* frame = aSpanReflowState->frame;
+  nsIFrame* frame = aSpanReflowState->mFrame;
   psd->mNoWrap = !frame->StyleText()->WhiteSpaceCanWrap(frame) ||
                  mSuppressLineWrap ||
                  frame->StyleContext()->ShouldSuppressLineBreak();
   psd->mWritingMode = aSpanReflowState->GetWritingMode();
 
   // Switch to new span
   mCurrentSpan = psd;
   mSpanDepth++;
@@ -1465,17 +1465,17 @@ nsLineLayout::PlaceFrame(PerFrameData* p
 
 void
 nsLineLayout::AddBulletFrame(nsIFrame* aFrame,
                              const ReflowOutput& aMetrics)
 {
   NS_ASSERTION(mCurrentSpan == mRootSpan, "bad linelayout user");
   NS_ASSERTION(mGotLineBox, "must have line box");
 
-  nsIFrame *blockFrame = mBlockReflowState->frame;
+  nsIFrame *blockFrame = mBlockReflowState->mFrame;
   NS_ASSERTION(blockFrame->IsFrameOfType(nsIFrame::eBlockFrame),
                "must be for block");
   if (!static_cast<nsBlockFrame*>(blockFrame)->BulletIsEmpty()) {
     mHasBullet = true;
     mLineBox->SetHasBullet();
   }
 
   WritingMode lineWM = mRootSpan->mWritingMode;
@@ -1999,17 +1999,17 @@ nsLineLayout::VerticalAlignFrames(PerSpa
     }
 
     // Get vertical-align property ("vertical-align" is the CSS name for
     // block-direction align)
     const nsStyleCoord& verticalAlign = frame->StyleDisplay()->mVerticalAlign;
     uint8_t verticalAlignEnum = frame->VerticalAlignEnum();
 #ifdef NOISY_BLOCKDIR_ALIGN
     printf("  [frame]");
-    nsFrame::ListTag(stdout, frame);
+    nsFrame::ListTag(stdout, mFrame);
     printf(": verticalAlignUnit=%d (enum == %d",
            verticalAlign.GetUnit(),
            ((eStyleUnit_Enumerated == verticalAlign.GetUnit())
             ? verticalAlign.GetIntValue()
             : -1));
     if (verticalAlignEnum != nsIFrame::eInvalidVerticalAlign) {
       printf(", after SVG dominant-baseline conversion == %d",
              verticalAlignEnum);
@@ -3116,17 +3116,17 @@ nsLineLayout::TextAlignLine(nsLineBox* a
   WritingMode lineWM = psd->mWritingMode;
   LAYOUT_WARN_IF_FALSE(psd->mIEnd != NS_UNCONSTRAINEDSIZE,
                        "have unconstrained width; this should only result from "
                        "very large sizes, not attempts at intrinsic width "
                        "calculation");
   nscoord availISize = psd->mIEnd - psd->mIStart;
   nscoord remainingISize = availISize - aLine->ISize();
 #ifdef NOISY_INLINEDIR_ALIGN
-  nsFrame::ListTag(stdout, mBlockReflowState->frame);
+  nsFrame::ListTag(stdout, mBlockReflowState->mFrame);
   printf(": availISize=%d lineBounds.IStart=%d lineISize=%d delta=%d\n",
          availISize, aLine->IStart(), aLine->ISize(), remainingISize);
 #endif
 
   // 'text-align-last: auto' is equivalent to the value of the 'text-align'
   // property except when 'text-align' is set to 'justify', in which case it
   // is 'justify' when 'text-justify' is 'distribute' and 'start' otherwise.
   //
@@ -3141,17 +3141,17 @@ nsLineLayout::TextAlignLine(nsLineBox* a
       if (textAlign == NS_STYLE_TEXT_ALIGN_JUSTIFY) {
         textAlign = NS_STYLE_TEXT_ALIGN_START;
       }
     } else {
       textAlign = mStyleText->mTextAlignLast;
     }
   }
 
-  bool isSVG = mBlockReflowState->frame->IsSVGText();
+  bool isSVG = mBlockReflowState->mFrame->IsSVGText();
   bool doTextAlign = remainingISize > 0 || textAlignTrue;
 
   int32_t additionalGaps = 0;
   if (!isSVG && (mHasRuby || (doTextAlign &&
                               textAlign == NS_STYLE_TEXT_ALIGN_JUSTIFY))) {
     JustificationComputationState computeState;
     ComputeFrameJustification(psd, computeState);
     if (mHasRuby && computeState.mFirstParticipant) {
@@ -3358,17 +3358,17 @@ nsLineLayout::RelativePositionFrames(Per
         // (3) When there are text emphasis marks, since the marks may be
         //     put further away if the text is inside ruby.
         // (4) When there are text strokes
         if (pfd->mRecomputeOverflow ||
             frame->StyleContext()->HasTextDecorationLines() ||
             frame->StyleText()->HasTextEmphasis() ||
             frame->StyleText()->HasWebkitTextStroke()) {
           nsTextFrame* f = static_cast<nsTextFrame*>(frame);
-          r = f->RecomputeOverflow(mBlockReflowState->frame);
+          r = f->RecomputeOverflow(mBlockReflowState->mFrame);
         }
         frame->FinishAndStoreOverflow(r, frame->GetSize());
       }
 
       // If we have something that's not an inline but with a complex frame
       // hierarchy inside that contains views, they need to be
       // positioned.
       // All descendant views must be repositioned even if this frame
--- a/layout/generic/nsLineLayout.h
+++ b/layout/generic/nsLineLayout.h
@@ -337,17 +337,17 @@ public:
     return mForceBreakFrame == aFrame ? mForceBreakFrameOffset : -1;
   }
 
   /**
    * This can't be null. It usually returns a block frame but may return
    * some other kind of frame when inline frames are reflowed in a non-block
    * context (e.g. MathML or floating first-letter).
    */
-  nsIFrame* LineContainerFrame() const { return mBlockReflowState->frame; }
+  nsIFrame* LineContainerFrame() const { return mBlockReflowState->mFrame; }
   const ReflowInput* LineContainerRS() const { return mBlockReflowState; }
   const nsLineList::iterator* GetLine() const {
     return mGotLineBox ? &mLineBox : nullptr;
   }
   nsLineList::iterator* GetLine() {
     return mGotLineBox ? &mLineBox : nullptr;
   }
   
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -9162,17 +9162,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL
     boundingBox.y += mAscent;
   }
   aMetrics.SetOverflowAreasToDesiredBounds();
   aMetrics.VisualOverflow().UnionRect(aMetrics.VisualOverflow(), boundingBox);
 
   // When we have text decorations, we don't need to compute their overflow now
   // because we're guaranteed to do it later
   // (see nsLineLayout::RelativePositionFrames)
-  UnionAdditionalOverflow(presContext, aLineLayout.LineContainerRS()->frame,
+  UnionAdditionalOverflow(presContext, aLineLayout.LineContainerRS()->mFrame,
                           provider, &aMetrics.VisualOverflow(), false);
 
   /////////////////////////////////////////////////////////////////////
   // Clean up, update state
   /////////////////////////////////////////////////////////////////////
 
   // If all our characters are discarded or collapsed, then trimmable width
   // from the last textframe should be preserved. Otherwise the trimmable width
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -115,75 +115,75 @@ nsTableCellFrame::NotifyPercentBSize(con
   // containing block of an inner table is the containing block of its
   // table wrapper.
   // XXXldb Given the now-stricter |NeedsToObserve|, many if not all of
   // these tests are probably unnecessary.
 
   // Maybe the cell reflow state; we sure if we're inside the |if|.
   const ReflowInput *cellRS = aReflowState.mCBReflowState;
 
-  if (cellRS && cellRS->frame == this &&
+  if (cellRS && cellRS->mFrame == this &&
       (cellRS->ComputedBSize() == NS_UNCONSTRAINEDSIZE ||
        cellRS->ComputedBSize() == 0)) { // XXXldb Why 0?
     // This is a percentage bsize on a frame whose percentage bsizes
     // are based on the bsize of the cell, since its containing block
     // is the inner cell frame.
 
     // We'll only honor the percent bsize if sibling-cells/ancestors
     // have specified/pct bsize. (Also, siblings only count for this if
     // both this cell and the sibling cell span exactly 1 row.)
 
     if (nsTableFrame::AncestorsHaveStyleBSize(*cellRS) ||
         (GetTableFrame()->GetEffectiveRowSpan(*this) == 1 &&
-         cellRS->mParentReflowState->frame->
+         cellRS->mParentReflowState->mFrame->
            HasAnyStateBits(NS_ROW_HAS_CELL_WITH_STYLE_BSIZE))) {
 
       for (const ReflowInput *rs = aReflowState.mParentReflowState;
            rs != cellRS;
            rs = rs->mParentReflowState) {
-        rs->frame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
+        rs->mFrame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
       }
 
       nsTableFrame::RequestSpecialBSizeReflow(*cellRS);
     }
   }
 }
 
 // The cell needs to observe its block and things inside its block but nothing below that
 bool
 nsTableCellFrame::NeedsToObserve(const ReflowInput& aReflowState)
 {
   const ReflowInput *rs = aReflowState.mParentReflowState;
   if (!rs)
     return false;
-  if (rs->frame == this) {
+  if (rs->mFrame == this) {
     // We always observe the child block.  It will never send any
     // notifications, but we need this so that the observer gets
     // propagated to its kids.
     return true;
   }
   rs = rs->mParentReflowState;
   if (!rs) {
     return false;
   }
 
   // We always need to let the percent bsize observer be propagated
   // from a table wrapper frame to an inner table frame.
-  nsIAtom *fType = aReflowState.frame->GetType();
+  nsIAtom *fType = aReflowState.mFrame->GetType();
   if (fType == nsGkAtoms::tableFrame) {
     return true;
   }
 
   // We need the observer to be propagated to all children of the cell
   // (i.e., children of the child block) in quirks mode, but only to
   // tables in standards mode.
   // XXX This may not be true in the case of orthogonal flows within
   // the cell (bug 1174711 comment 8); we may need to observe isizes
   // instead of bsizes for orthogonal children.
-  return rs->frame == this &&
+  return rs->mFrame == this &&
          (PresContext()->CompatibilityMode() == eCompatibility_NavQuirks ||
           fType == nsGkAtoms::tableWrapperFrame);
 }
 
 nsresult
 nsTableCellFrame::GetRowIndex(int32_t &aRowIndex) const
 {
   nsresult result;
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -72,20 +72,20 @@ struct TableReflowInput {
   // Running block-offset
   nscoord bCoord;
 
   TableReflowInput(const ReflowInput& aReflowState,
                      const LogicalSize& aAvailSize)
     : reflowState(aReflowState)
     , availSize(aAvailSize)
   {
-    MOZ_ASSERT(reflowState.frame->GetType() == nsGkAtoms::tableFrame,
+    MOZ_ASSERT(reflowState.mFrame->GetType() == nsGkAtoms::tableFrame,
                "TableReflowInput should only be created for nsTableFrame");
     nsTableFrame* table =
-      static_cast<nsTableFrame*>(reflowState.frame->FirstInFlow());
+      static_cast<nsTableFrame*>(reflowState.mFrame->FirstInFlow());
     WritingMode wm = aReflowState.GetWritingMode();
     LogicalMargin borderPadding = table->GetChildAreaOffset(wm, &reflowState);
 
     iCoord = borderPadding.IStart(wm) + table->GetColSpacing(-1);
     bCoord = borderPadding.BStart(wm); //cellspacing added during reflow
 
     // XXX do we actually need to check for unconstrained inline-size here?
     if (NS_UNCONSTRAINEDSIZE != availSize.ISize(wm)) {
@@ -1672,18 +1672,18 @@ nsTableFrame::ComputeAutoSize(nsRenderin
 
 // Return true if aParentReflowState.frame or any of its ancestors within
 // the containing table have non-auto bsize. (e.g. pct or fixed bsize)
 bool
 nsTableFrame::AncestorsHaveStyleBSize(const ReflowInput& aParentReflowState)
 {
   WritingMode wm = aParentReflowState.GetWritingMode();
   for (const ReflowInput* rs = &aParentReflowState;
-       rs && rs->frame; rs = rs->mParentReflowState) {
-    nsIAtom* frameType = rs->frame->GetType();
+       rs && rs->mFrame; rs = rs->mParentReflowState) {
+    nsIAtom* frameType = rs->mFrame->GetType();
     if (IS_TABLE_CELL(frameType)                     ||
         (nsGkAtoms::tableRowFrame      == frameType) ||
         (nsGkAtoms::tableRowGroupFrame == frameType)) {
       const nsStyleCoord &bsize = rs->mStylePosition->BSize(wm);
       // calc() with percentages treated like 'auto' on internal table elements
       if (bsize.GetUnit() != eStyleUnit_Auto &&
           (!bsize.IsCalcUnit() || !bsize.HasPercent())) {
         return true;
@@ -1697,23 +1697,23 @@ nsTableFrame::AncestorsHaveStyleBSize(co
   return false;
 }
 
 // See if a special block-size reflow needs to occur and if so,
 // call RequestSpecialBSizeReflow
 void
 nsTableFrame::CheckRequestSpecialBSizeReflow(const ReflowInput& aReflowState)
 {
-  NS_ASSERTION(IS_TABLE_CELL(aReflowState.frame->GetType()) ||
-               aReflowState.frame->GetType() == nsGkAtoms::tableRowFrame ||
-               aReflowState.frame->GetType() == nsGkAtoms::tableRowGroupFrame ||
-               aReflowState.frame->GetType() == nsGkAtoms::tableFrame,
+  NS_ASSERTION(IS_TABLE_CELL(aReflowState.mFrame->GetType()) ||
+               aReflowState.mFrame->GetType() == nsGkAtoms::tableRowFrame ||
+               aReflowState.mFrame->GetType() == nsGkAtoms::tableRowGroupFrame ||
+               aReflowState.mFrame->GetType() == nsGkAtoms::tableFrame,
                "unexpected frame type");
   WritingMode wm = aReflowState.GetWritingMode();
-  if (!aReflowState.frame->GetPrevInFlow() &&  // 1st in flow
+  if (!aReflowState.mFrame->GetPrevInFlow() &&  // 1st in flow
       (NS_UNCONSTRAINEDSIZE == aReflowState.ComputedBSize() ||  // no computed bsize
        0                    == aReflowState.ComputedBSize()) &&
       eStyleUnit_Percent == aReflowState.mStylePosition->BSize(wm).GetUnit() && // pct bsize
       nsTableFrame::AncestorsHaveStyleBSize(*aReflowState.mParentReflowState)) {
     nsTableFrame::RequestSpecialBSizeReflow(aReflowState);
   }
 }
 
@@ -1721,25 +1721,25 @@ nsTableFrame::CheckRequestSpecialBSizeRe
 // bsize reflow will occur. During a special bsize reflow, a table, row group,
 // row, or cell returns the last size it was reflowed at. However, the table may
 // change the bsize of row groups, rows, cells in DistributeBSizeToRows after.
 // And the row group can change the bsize of rows, cells in CalculateRowBSizes.
 void
 nsTableFrame::RequestSpecialBSizeReflow(const ReflowInput& aReflowState)
 {
   // notify the frame and its ancestors of the special reflow, stopping at the containing table
-  for (const ReflowInput* rs = &aReflowState; rs && rs->frame; rs = rs->mParentReflowState) {
-    nsIAtom* frameType = rs->frame->GetType();
+  for (const ReflowInput* rs = &aReflowState; rs && rs->mFrame; rs = rs->mParentReflowState) {
+    nsIAtom* frameType = rs->mFrame->GetType();
     NS_ASSERTION(IS_TABLE_CELL(frameType) ||
                  nsGkAtoms::tableRowFrame == frameType ||
                  nsGkAtoms::tableRowGroupFrame == frameType ||
                  nsGkAtoms::tableFrame == frameType,
                  "unexpected frame type");
 
-    rs->frame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
+    rs->mFrame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
     if (nsGkAtoms::tableFrame == frameType) {
       NS_ASSERTION(rs != &aReflowState,
                    "should not request special bsize reflow for table");
       // always stop when we reach a table
       break;
     }
   }
 }
@@ -2746,17 +2746,17 @@ void
 nsTableFrame::InitChildReflowState(ReflowInput& aReflowState)
 {
   nsMargin collapseBorder;
   nsMargin padding(0,0,0,0);
   nsMargin* pCollapseBorder = nullptr;
   nsPresContext* presContext = PresContext();
   if (IsBorderCollapse()) {
     nsTableRowGroupFrame* rgFrame =
-       static_cast<nsTableRowGroupFrame*>(aReflowState.frame);
+       static_cast<nsTableRowGroupFrame*>(aReflowState.mFrame);
     WritingMode wm = GetWritingMode();
     LogicalMargin border = rgFrame->GetBCBorderWidth(wm);
     collapseBorder = border.GetPhysicalMargin(wm);
     pCollapseBorder = &collapseBorder;
   }
   aReflowState.Init(presContext, nullptr, pCollapseBorder, &padding);
 
   NS_ASSERTION(!mBits.mResizedColumns ||
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -72,17 +72,17 @@ nsTableRowFrame::InitChildReflowState(ns
                                       const LogicalSize&      aAvailSize,
                                       bool                    aBorderCollapse,
                                       TableCellReflowInput& aReflowState)
 {
   nsMargin collapseBorder;
   nsMargin* pCollapseBorder = nullptr;
   if (aBorderCollapse) {
     // we only reflow cells, so don't need to check frame type
-    nsBCTableCellFrame* bcCellFrame = (nsBCTableCellFrame*)aReflowState.frame;
+    nsBCTableCellFrame* bcCellFrame = (nsBCTableCellFrame*)aReflowState.mFrame;
     if (bcCellFrame) {
       WritingMode wm = GetWritingMode();
       collapseBorder = bcCellFrame->GetBorderWidth(wm).GetPhysicalMargin(wm);
       pCollapseBorder = &collapseBorder;
     }
   }
   aReflowState.Init(&aPresContext, nullptr, pCollapseBorder);
   aReflowState.FixUp(aAvailSize);
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -316,17 +316,17 @@ void
 nsTableRowGroupFrame::InitChildReflowState(nsPresContext&     aPresContext,
                                            bool               aBorderCollapse,
                                            ReflowInput& aReflowState)
 {
   nsMargin collapseBorder;
   nsMargin padding(0,0,0,0);
   nsMargin* pCollapseBorder = nullptr;
   if (aBorderCollapse) {
-    nsTableRowFrame *rowFrame = do_QueryFrame(aReflowState.frame);
+    nsTableRowFrame *rowFrame = do_QueryFrame(aReflowState.mFrame);
     if (rowFrame) {
       WritingMode wm = GetWritingMode();
       LogicalMargin border = rowFrame->GetBCBorderWidth(wm);
       collapseBorder = border.GetPhysicalMargin(wm);
       pCollapseBorder = &collapseBorder;
     }
   }
   aReflowState.Init(&aPresContext, nullptr, pCollapseBorder, &padding);
@@ -1588,20 +1588,20 @@ nsTableRowGroupFrame::GetBSizeBasis(cons
   if ((aReflowState.ComputedBSize() > 0) && (aReflowState.ComputedBSize() < NS_UNCONSTRAINEDSIZE)) {
     nscoord cellSpacing = tableFrame->GetRowSpacing(startRowIndex,
                                                     std::max(startRowIndex,
                                                              startRowIndex + GetRowCount() - 1));
     result = aReflowState.ComputedBSize() - cellSpacing;
   }
   else {
     const ReflowInput* parentRS = aReflowState.mParentReflowState;
-    if (parentRS && (tableFrame != parentRS->frame)) {
+    if (parentRS && (tableFrame != parentRS->mFrame)) {
       parentRS = parentRS->mParentReflowState;
     }
-    if (parentRS && (tableFrame == parentRS->frame) &&
+    if (parentRS && (tableFrame == parentRS->mFrame) &&
         (parentRS->ComputedBSize() > 0) && (parentRS->ComputedBSize() < NS_UNCONSTRAINEDSIZE)) {
       nscoord cellSpacing = tableFrame->GetRowSpacing(-1, tableFrame->GetRowCount());
       result = parentRS->ComputedBSize() - cellSpacing;
     }
   }
 
   return result;
 }
--- a/layout/tables/nsTableWrapperFrame.cpp
+++ b/layout/tables/nsTableWrapperFrame.cpp
@@ -230,17 +230,17 @@ nsTableWrapperFrame::GetParentStyleConte
 void
 nsTableWrapperFrame::InitChildReflowState(nsPresContext&     aPresContext,
                                           ReflowInput& aReflowState)
 {
   nsMargin collapseBorder;
   nsMargin collapsePadding(0,0,0,0);
   nsMargin* pCollapseBorder  = nullptr;
   nsMargin* pCollapsePadding = nullptr;
-  if (aReflowState.frame == InnerTableFrame() &&
+  if (aReflowState.mFrame == InnerTableFrame() &&
       InnerTableFrame()->IsBorderCollapse()) {
     WritingMode wm = aReflowState.GetWritingMode();
     LogicalMargin border = InnerTableFrame()->GetIncludedOuterBCBorder(wm);
     collapseBorder = border.GetPhysicalMargin(wm);
     pCollapseBorder = &collapseBorder;
     pCollapsePadding = &collapsePadding;
   }
   aReflowState.Init(&aPresContext, nullptr, pCollapseBorder, pCollapsePadding);