Bug 1231256 (part 1) - Remove unused nsBoxLayoutState parameters from many functions. r=roc.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 07 Dec 2015 10:17:47 -0800
changeset 313420 182171efdc63a30529e7568a2215caa637fb4df0
parent 313419 2b324879163fe9927d4c3a1f81fa2c04613f01fc
child 313421 62a5376b5872f56e6ca5f066707e9a51bb6f3cac
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1231256
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1231256 (part 1) - Remove unused nsBoxLayoutState parameters from many functions. r=roc.
layout/generic/nsFrame.cpp
layout/generic/nsFrame.h
layout/generic/nsIFrame.h
layout/xul/grid/nsGrid.cpp
layout/xul/grid/nsGrid.h
layout/xul/grid/nsGridCell.cpp
layout/xul/grid/nsGridLayout2.cpp
layout/xul/grid/nsGridLayout2.h
layout/xul/grid/nsGridRowGroupFrame.cpp
layout/xul/grid/nsGridRowGroupFrame.h
layout/xul/grid/nsGridRowLeafFrame.cpp
layout/xul/grid/nsGridRowLeafLayout.cpp
layout/xul/nsBox.cpp
layout/xul/nsBox.h
layout/xul/nsBoxFrame.cpp
layout/xul/nsBoxFrame.h
layout/xul/nsLeafBoxFrame.cpp
layout/xul/nsLeafBoxFrame.h
layout/xul/nsMenuFrame.cpp
layout/xul/nsSliderFrame.cpp
layout/xul/nsSplitterFrame.cpp
layout/xul/nsSprocketLayout.cpp
layout/xul/nsStackLayout.cpp
layout/xul/nsStackLayout.h
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -8531,23 +8531,23 @@ nsFrame::GetMaxSize(nsBoxLayoutState& aS
 
   size = nsBox::GetMaxSize(aState);
   metrics->mMaxSize = size;
 
   return size;
 }
 
 nscoord
-nsFrame::GetFlex(nsBoxLayoutState& aState)
+nsFrame::GetFlex()
 {
   nsBoxLayoutMetrics *metrics = BoxMetrics();
   if (!DoesNeedRecalc(metrics->mFlex))
      return metrics->mFlex;
 
-  metrics->mFlex = nsBox::GetFlex(aState);
+  metrics->mFlex = nsBox::GetFlex();
 
   return metrics->mFlex;
 }
 
 nscoord
 nsFrame::GetBoxAscent(nsBoxLayoutState& aState)
 {
   nsBoxLayoutMetrics *metrics = BoxMetrics();
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -406,17 +406,17 @@ public:
   // Helper for GetContentAndOffsetsFromPoint; calculation of content offsets
   // in this function assumes there is no child frame that can be targeted.
   virtual ContentOffsets CalcContentOffsetsFromFramePoint(nsPoint aPoint);
 
   // Box layout methods
   virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
-  virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState) override;
+  virtual nscoord GetFlex() override;
   virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
 
   // We compute and store the HTML content's overflow area. So don't
   // try to compute it in the box code.
   virtual bool ComputesOwnOverflowArea() override { return true; }
 
   //--------------------------------------------------
   // Additional methods
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -2775,17 +2775,17 @@ NS_PTR_TO_INT32(frame->Properties().Get(
    * This returns the minimum size for the scroll area if this frame is
    * being scrolled. Usually it's (0,0).
    */
   virtual nsSize GetMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState) = 0;
 
   // Implemented in nsBox, used in nsBoxFrame
   uint32_t GetOrdinal();
 
-  virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState) = 0;
+  virtual nscoord GetFlex() = 0;
   virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) = 0;
   virtual bool IsCollapsed() = 0;
   // This does not alter the overflow area. If the caller is changing
   // the box size, the caller is responsible for updating the overflow
   // area. It's enough to just call Layout or SyncLayout on the
   // box. You can pass true to aRemoveOverflowArea as a
   // convenience.
   virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
@@ -2804,17 +2804,17 @@ NS_PTR_TO_INT32(frame->Properties().Get(
   // For nsSprocketLayout
   virtual Valignment GetVAlign() const = 0;
   virtual Halignment GetHAlign() const = 0;
 
   bool IsHorizontal() const { return (mState & NS_STATE_IS_HORIZONTAL) != 0; }
   bool IsNormalDirection() const { return (mState & NS_STATE_IS_DIRECTION_NORMAL) != 0; }
 
   nsresult Redraw(nsBoxLayoutState& aState);
-  virtual nsresult RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild)=0;
+  virtual nsresult RelayoutChildAtOrdinal(nsIFrame* aChild)=0;
   // XXX take this out after we've branched
   virtual bool GetMouseThrough() const { return false; }
 
 #ifdef DEBUG_LAYOUT
   virtual nsresult SetDebug(nsBoxLayoutState& aState, bool aDebug)=0;
   virtual nsresult GetDebug(bool& aDebug)=0;
 
   virtual nsresult DumpBox(FILE* out)=0;
@@ -2825,17 +2825,17 @@ NS_PTR_TO_INT32(frame->Properties().Get(
    * should return false if this is not a text frame.
    */
   virtual bool HasSignificantTerminalNewline() const;
 
   static bool AddCSSPrefSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth, bool& aHeightSet);
   static bool AddCSSMinSize(nsBoxLayoutState& aState, nsIFrame* aBox,
                             nsSize& aSize, bool& aWidth, bool& aHeightSet);
   static bool AddCSSMaxSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth, bool& aHeightSet);
-  static bool AddCSSFlex(nsBoxLayoutState& aState, nsIFrame* aBox, nscoord& aFlex);
+  static bool AddCSSFlex(nsIFrame* aBox, nscoord& aFlex);
 
   // END OF BOX LAYOUT METHODS
   // The above methods have been migrated from nsIBox and are in the process of
   // being refactored. DO NOT USE OUTSIDE OF XUL.
 
   struct CaretPosition {
     CaretPosition();
     ~CaretPosition();
--- a/layout/xul/grid/nsGrid.cpp
+++ b/layout/xul/grid/nsGrid.cpp
@@ -566,22 +566,21 @@ nsGrid::GetBoxTotalMargin(nsIFrame* aBox
  * gets first and last rows and their indexes.
  * If it fails because there are no rows then:
  * FirstRow is nullptr
  * LastRow is nullptr
  * aFirstIndex = -1
  * aLastIndex = -1
  */
 void
-nsGrid::GetFirstAndLastRow(nsBoxLayoutState& aState, 
-                          int32_t& aFirstIndex, 
-                          int32_t& aLastIndex, 
-                          nsGridRow*& aFirstRow,
-                          nsGridRow*& aLastRow,
-                          bool aIsHorizontal)
+nsGrid::GetFirstAndLastRow(int32_t& aFirstIndex,
+                           int32_t& aLastIndex,
+                           nsGridRow*& aFirstRow,
+                           nsGridRow*& aLastRow,
+                           bool aIsHorizontal)
 {
   aFirstRow = nullptr;
   aLastRow = nullptr;
   aFirstIndex = -1;
   aLastIndex = -1;
 
   int32_t count = GetRowCount(aIsHorizontal);
 
@@ -620,17 +619,17 @@ nsGrid::GetFirstAndLastRow(nsBoxLayoutSt
 }
 
 /**
  * A row can have a top and bottom offset. Usually this is just the top and bottom border/padding.
  * However if the row is the first or last it could be affected by the fact a column or columns could
  * have a top or bottom margin. 
  */
 void
-nsGrid::GetRowOffsets(nsBoxLayoutState& aState, int32_t aIndex, nscoord& aTop, nscoord& aBottom, bool aIsHorizontal)
+nsGrid::GetRowOffsets(int32_t aIndex, nscoord& aTop, nscoord& aBottom, bool aIsHorizontal)
 {
 
   RebuildIfNeeded();
 
   nsGridRow* row = GetRowAt(aIndex, aIsHorizontal);
 
   if (row->IsOffsetSet()) 
   {
@@ -693,17 +692,17 @@ nsGrid::GetRowOffsets(nsBoxLayoutState& 
   // our columns. If that's larger than the rows top border/padding use it.
 
   // If we are the last row then get the largest bottom border/padding in 
   // our columns. If that's larger than the rows bottom border/padding use it.
   int32_t firstIndex = 0;
   int32_t lastIndex = 0;
   nsGridRow* firstRow = nullptr;
   nsGridRow* lastRow = nullptr;
-  GetFirstAndLastRow(aState, firstIndex, lastIndex, firstRow, lastRow, aIsHorizontal);
+  GetFirstAndLastRow(firstIndex, lastIndex, firstRow, lastRow, aIsHorizontal);
 
   if (aIndex == firstIndex || aIndex == lastIndex) {
     nscoord maxTop = 0;
     nscoord maxBottom = 0;
 
     // run through the columns. Look at each column
     // pick the largest top border or bottom border
     int32_t count = GetColumnCount(aIsHorizontal); 
@@ -813,28 +812,28 @@ nsGrid::GetPrefRowHeight(nsBoxLayoutStat
     // yep do nothing.
     if (row->mPref != -1)
       return row->mPref;
   }
 
   // get the offsets so they are cached.
   nscoord top;
   nscoord bottom;
-  GetRowOffsets(aState, aIndex, top, bottom, aIsHorizontal);
+  GetRowOffsets(aIndex, top, bottom, aIsHorizontal);
 
   // is the row bogus? If so then just ask it for its size
   // it should not be affected by cells in the grid. 
   if (row->mIsBogus)
   {
      nsSize size(0,0);
      if (box) 
      {
        size = box->GetPrefSize(aState);
        nsBox::AddMargin(box, size);
-       nsGridLayout2::AddOffset(aState, box, size);
+       nsGridLayout2::AddOffset(box, size);
      }
 
      row->mPref = GET_HEIGHT(size, aIsHorizontal);
      return row->mPref;
   }
 
   nsSize size(0,0);
 
@@ -889,27 +888,27 @@ nsGrid::GetMinRowHeight(nsBoxLayoutState
     // yep do nothing.
     if (row->mMin != -1)
       return row->mMin;
   }
 
   // get the offsets so they are cached.
   nscoord top;
   nscoord bottom;
-  GetRowOffsets(aState, aIndex, top, bottom, aIsHorizontal);
+  GetRowOffsets(aIndex, top, bottom, aIsHorizontal);
 
   // is the row bogus? If so then just ask it for its size
   // it should not be affected by cells in the grid. 
   if (row->mIsBogus)
   {
      nsSize size(0,0);
      if (box) {
        size = box->GetPrefSize(aState);
        nsBox::AddMargin(box, size);
-       nsGridLayout2::AddOffset(aState, box, size);
+       nsGridLayout2::AddOffset(box, size);
      }
 
      row->mMin = GET_HEIGHT(size, aIsHorizontal) + top + bottom;
      return row->mMin;
   }
 
   nsSize size(0,0);
 
@@ -964,27 +963,27 @@ nsGrid::GetMaxRowHeight(nsBoxLayoutState
     // yep do nothing.
     if (row->mMax != -1)
       return row->mMax;
   }
 
   // get the offsets so they are cached.
   nscoord top;
   nscoord bottom;
-  GetRowOffsets(aState, aIndex, top, bottom, aIsHorizontal);
+  GetRowOffsets(aIndex, top, bottom, aIsHorizontal);
 
   // is the row bogus? If so then just ask it for its size
   // it should not be affected by cells in the grid. 
   if (row->mIsBogus)
   {
      nsSize size(NS_INTRINSICSIZE,NS_INTRINSICSIZE);
      if (box) {
        size = box->GetPrefSize(aState);
        nsBox::AddMargin(box, size);
-       nsGridLayout2::AddOffset(aState, box, size);
+       nsGridLayout2::AddOffset(box, size);
      }
 
      row->mMax = GET_HEIGHT(size, aIsHorizontal);
      return row->mMax;
   }
 
   nsSize size(NS_INTRINSICSIZE,NS_INTRINSICSIZE);
 
@@ -1029,17 +1028,17 @@ nsGrid::IsGrid(nsIFrame* aBox)
 }
 
 /**
  * This get the flexibilty of the row at aIndex. It's not trivial. There are a few
  * things we need to look at. Specifically we need to see if any <rows> or <columns>
  * tags are around us. Their flexibilty will affect ours.
  */
 nscoord
-nsGrid::GetRowFlex(nsBoxLayoutState& aState, int32_t aIndex, bool aIsHorizontal)
+nsGrid::GetRowFlex(int32_t aIndex, bool aIsHorizontal)
 {
   RebuildIfNeeded();
 
   nsGridRow* row = GetRowAt(aIndex, aIsHorizontal);
 
   if (row->IsFlexSet()) 
     return row->mFlex;
 
@@ -1101,32 +1100,32 @@ nsGrid::GetRowFlex(nsBoxLayoutState& aSt
       parent = GetScrollBox(parent);
       parentsParent = nsBox::GetParentBox(parent);
 
       // if our parents parent is not a grid
       // the get its flex. If its 0 then we are
       // not flexible.
       if (parentsParent) {
         if (!IsGrid(parentsParent)) {
-          nscoord flex = parent->GetFlex(aState);
-          nsIFrame::AddCSSFlex(aState, parent, flex);
+          nscoord flex = parent->GetFlex();
+          nsIFrame::AddCSSFlex(parent, flex);
           if (flex == 0) {
             row->mFlex = 0;
             return row->mFlex;
           }
         } else 
           break;
       }
 
       parent = parentsParent;
     }
     
     // get the row flex.
-    row->mFlex = box->GetFlex(aState);
-    nsIFrame::AddCSSFlex(aState, box, row->mFlex);
+    row->mFlex = box->GetFlex();
+    nsIFrame::AddCSSFlex(box, row->mFlex);
   }
 
   return row->mFlex;
 }
 
 void
 nsGrid::SetLargestSize(nsSize& aSize, nscoord aHeight, bool aIsHorizontal)
 {
--- a/layout/xul/grid/nsGrid.h
+++ b/layout/xul/grid/nsGrid.h
@@ -40,22 +40,22 @@ public:
   // FIXME:  Maybe eliminate GetColumnCount and change aIsHorizontal to
   // aIsRows?  (Calling it horizontal doesn't really make sense because
   // row groups and columns have vertical orientation, whereas column
   // groups and rows are horizontal.)
 
   nsSize GetPrefRowSize(nsBoxLayoutState& aBoxLayoutState, int32_t aRowIndex, bool aIsHorizontal = true);
   nsSize GetMinRowSize(nsBoxLayoutState& aBoxLayoutState, int32_t aRowIndex, bool aIsHorizontal = true);
   nsSize GetMaxRowSize(nsBoxLayoutState& aBoxLayoutState, int32_t aRowIndex, bool aIsHorizontal = true);
-  nscoord GetRowFlex(nsBoxLayoutState& aBoxLayoutState, int32_t aRowIndex, bool aIsHorizontal = true);
+  nscoord GetRowFlex(int32_t aRowIndex, bool aIsHorizontal = true);
 
   nscoord GetPrefRowHeight(nsBoxLayoutState& aBoxLayoutState, int32_t aRowIndex, bool aIsHorizontal = true);
   nscoord GetMinRowHeight(nsBoxLayoutState& aBoxLayoutState, int32_t aRowIndex, bool aIsHorizontal = true);
   nscoord GetMaxRowHeight(nsBoxLayoutState& aBoxLayoutState, int32_t aRowIndex, bool aIsHorizontal = true);
-  void GetRowOffsets(nsBoxLayoutState& aState, int32_t aIndex, nscoord& aTop, nscoord& aBottom, bool aIsHorizontal = true);
+  void GetRowOffsets(int32_t aIndex, nscoord& aTop, nscoord& aBottom, bool aIsHorizontal = true);
 
   void RowAddedOrRemoved(nsBoxLayoutState& aBoxLayoutState, int32_t aIndex, bool aIsHorizontal = true);
   void CellAddedOrRemoved(nsBoxLayoutState& aBoxLayoutState, int32_t aIndex, bool aIsHorizontal = true);
   void DirtyRows(nsIFrame* aRowBox, nsBoxLayoutState& aState);
 #ifdef DEBUG_grid
   void PrintCellMap();
 #endif
   int32_t GetExtraColumnCount(bool aIsHorizontal = true);
@@ -67,19 +67,18 @@ public:
   nsIFrame* GetRowsBox() { return mRowsBox; }
   nsIFrame* GetColumnsBox() { return mColumnsBox; }
   int32_t GetRowCount(int32_t aIsHorizontal = true);
   int32_t GetColumnCount(int32_t aIsHorizontal = true);
 
   static nsIFrame* GetScrolledBox(nsIFrame* aChild);
   static nsIFrame* GetScrollBox(nsIFrame* aChild);
   static nsIGridPart* GetPartFromBox(nsIFrame* aBox);
-  void GetFirstAndLastRow(nsBoxLayoutState& aState, 
-                          int32_t& aFirstIndex, 
-                          int32_t& aLastIndex, 
+  void GetFirstAndLastRow(int32_t& aFirstIndex,
+                          int32_t& aLastIndex,
                           nsGridRow*& aFirstRow,
                           nsGridRow*& aLastRow,
                           bool aIsHorizontal);
 
 private:
 
   nsMargin GetBoxTotalMargin(nsIFrame* aBox, bool aIsHorizontal = true);
 
--- a/layout/xul/grid/nsGridCell.cpp
+++ b/layout/xul/grid/nsGridCell.cpp
@@ -34,26 +34,26 @@ nsGridCell::GetPrefSize(nsBoxLayoutState
   // take our 2 children and add them up.
   // we are as wide as the widest child plus its left offset
   // we are tall as the tallest child plus its top offset
 
   if (mBoxInColumn) {
     nsSize pref = mBoxInColumn->GetPrefSize(aState);
 
     nsBox::AddMargin(mBoxInColumn, pref);
-    nsGridLayout2::AddOffset(aState, mBoxInColumn, pref);
+    nsGridLayout2::AddOffset(mBoxInColumn, pref);
 
     nsBoxLayout::AddLargestSize(sum, pref);
   }
 
   if (mBoxInRow) {
     nsSize pref = mBoxInRow->GetPrefSize(aState);
 
     nsBox::AddMargin(mBoxInRow, pref);
-    nsGridLayout2::AddOffset(aState, mBoxInRow, pref);
+    nsGridLayout2::AddOffset(mBoxInRow, pref);
 
     nsBoxLayout::AddLargestSize(sum, pref);
   }
 
   return sum;
 }
 
 nsSize
@@ -64,26 +64,26 @@ nsGridCell::GetMinSize(nsBoxLayoutState&
   // take our 2 children and add them up.
   // we are as wide as the widest child plus its left offset
   // we are tall as the tallest child plus its top offset
 
   if (mBoxInColumn) {
     nsSize min = mBoxInColumn->GetMinSize(aState);
 
     nsBox::AddMargin(mBoxInColumn, min);
-    nsGridLayout2::AddOffset(aState, mBoxInColumn, min);
+    nsGridLayout2::AddOffset(mBoxInColumn, min);
 
     nsBoxLayout::AddLargestSize(sum, min);
   }
 
   if (mBoxInRow) {
     nsSize min = mBoxInRow->GetMinSize(aState);
 
     nsBox::AddMargin(mBoxInRow, min);
-    nsGridLayout2::AddOffset(aState, mBoxInRow, min);
+    nsGridLayout2::AddOffset(mBoxInRow, min);
 
     nsBoxLayout::AddLargestSize(sum, min);
   }
 
   return sum;
 }
 
 nsSize
@@ -94,26 +94,26 @@ nsGridCell::GetMaxSize(nsBoxLayoutState&
   // take our 2 children and add them up.
   // we are as wide as the smallest child plus its left offset
   // we are tall as the shortest child plus its top offset
 
   if (mBoxInColumn) {
     nsSize max = mBoxInColumn->GetMaxSize(aState);
  
     nsBox::AddMargin(mBoxInColumn, max);
-    nsGridLayout2::AddOffset(aState, mBoxInColumn, max);
+    nsGridLayout2::AddOffset(mBoxInColumn, max);
 
     nsBoxLayout::AddSmallestSize(sum, max);
   }
 
   if (mBoxInRow) {
     nsSize max = mBoxInRow->GetMaxSize(aState);
 
     nsBox::AddMargin(mBoxInRow, max);
-    nsGridLayout2::AddOffset(aState, mBoxInRow, max);
+    nsGridLayout2::AddOffset(mBoxInRow, max);
 
     nsBoxLayout::AddSmallestSize(sum, max);
   }
 
   return sum;
 }
 
 
--- a/layout/xul/grid/nsGridLayout2.cpp
+++ b/layout/xul/grid/nsGridLayout2.cpp
@@ -33,20 +33,20 @@ nsGridLayout2::nsGridLayout2(nsIPresShel
 }
 
 nsGridLayout2::~nsGridLayout2()
 {
 }
 
 // static
 void
-nsGridLayout2::AddOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsSize& aSize)
+nsGridLayout2::AddOffset(nsIFrame* aChild, nsSize& aSize)
 {
   nsMargin offset;
-  GetOffset(aState, aChild, offset);
+  GetOffset(aChild, offset);
   aSize.width += offset.left;
   aSize.height += offset.top;
 }
 
 NS_IMETHODIMP
 nsGridLayout2::Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
 {
   // XXX This should be set a better way!
@@ -119,17 +119,17 @@ nsGridLayout2::GetMinSize(nsIFrame* aBox
       for (int32_t i=0; i < columns; i++)
       {
         nscoord width = mGrid.GetMinRowHeight(aState, i, false); 
         AddWidth(total, width, true); // AddWidth
       }
     }
 
     AddMargin(aBox, total);
-    AddOffset(aState, aBox, total);
+    AddOffset(aBox, total);
     AddLargestSize(minSize, total);
   }
   
   return minSize;
 }
 
 nsSize
 nsGridLayout2::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
@@ -158,17 +158,17 @@ nsGridLayout2::GetPrefSize(nsIFrame* aBo
       for (int32_t i=0; i < columns; i++)
       {
         nscoord width = mGrid.GetPrefRowHeight(aState, i, false);
         AddWidth(total, width, true); // AddWidth
       }
     }
 
     AddMargin(aBox, total);
-    AddOffset(aState, aBox, total);
+    AddOffset(aBox, total);
     AddLargestSize(pref, total);
   }
 
   return pref;
 }
 
 nsSize
 nsGridLayout2::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
@@ -199,17 +199,17 @@ nsGridLayout2::GetMaxSize(nsIFrame* aBox
       for (int32_t i=0; i < columns; i++)
       {
         nscoord width = mGrid.GetMaxRowHeight(aState, i, false);
         AddWidth(total, width, true); // AddWidth
       }
     }
 
     AddMargin(aBox, total);
-    AddOffset(aState, aBox, total);
+    AddOffset(aBox, total);
     AddSmallestSize(maxSize, total);
   }
 
   return maxSize;
 }
 
 int32_t
 nsGridLayout2::BuildRows(nsIFrame* aBox, nsGridRow* aRows)
--- a/layout/xul/grid/nsGridLayout2.h
+++ b/layout/xul/grid/nsGridLayout2.h
@@ -54,17 +54,17 @@ public:
                                 const nsFrameList::Slice& aNewChildren) override;
   virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState,
                                nsIFrame* aChildList) override;
   virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState,
                            nsIFrame* aChildList) override;
 
   virtual nsIGridPart* AsGridPart() override { return this; }
 
-  static void AddOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsSize& aSize);
+  static void AddOffset(nsIFrame* aChild, nsSize& aSize);
 
 protected:
 
   explicit nsGridLayout2(nsIPresShell* aShell);
   virtual ~nsGridLayout2();
   nsGrid mGrid;
 
 private:
--- a/layout/xul/grid/nsGridRowGroupFrame.cpp
+++ b/layout/xul/grid/nsGridRowGroupFrame.cpp
@@ -29,34 +29,34 @@ NS_NewGridRowGroupFrame(nsIPresShell* aP
 NS_IMPL_FRAMEARENA_HELPERS(nsGridRowGroupFrame)
 
 
 /**
  * This is redefined because row groups have a funny property. If they are flexible
  * then their flex must be equal to the sum of their children's flexes.
  */
 nscoord
-nsGridRowGroupFrame::GetFlex(nsBoxLayoutState& aState)
+nsGridRowGroupFrame::GetFlex()
 {
   // if we are flexible out flexibility is determined by our columns.
   // so first get the our flex. If not 0 then our flex is the sum of
   // our columns flexes.
 
   if (!DoesNeedRecalc(mFlex))
      return mFlex;
 
-  if (nsBoxFrame::GetFlex(aState) == 0)
+  if (nsBoxFrame::GetFlex() == 0)
     return 0;
 
   // ok we are flexible add up our children
   nscoord totalFlex = 0;
   nsIFrame* child = nsBox::GetChildBox(this);
   while (child)
   {
-    totalFlex += child->GetFlex(aState);
+    totalFlex += child->GetFlex();
     child = GetNextBox(child);
   }
 
   mFlex = totalFlex;
 
   return totalFlex;
 }
 
--- a/layout/xul/grid/nsGridRowGroupFrame.h
+++ b/layout/xul/grid/nsGridRowGroupFrame.h
@@ -34,16 +34,16 @@ public:
       return MakeFrameName(NS_LITERAL_STRING("nsGridRowGroup"), aResult);
   }
 #endif
 
   nsGridRowGroupFrame(nsStyleContext* aContext,
                       nsBoxLayout* aLayoutManager):
     nsBoxFrame(aContext, false, aLayoutManager) {}
 
-  virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState) override;
+  virtual nscoord GetFlex() override;
 
 }; // class nsGridRowGroupFrame
 
 
 
 #endif
 
--- a/layout/xul/grid/nsGridRowLeafFrame.cpp
+++ b/layout/xul/grid/nsGridRowLeafFrame.cpp
@@ -45,45 +45,43 @@ nsGridRowLeafFrame::GetBorderAndPadding(
   int32_t index = 0;
   nsGrid* grid = part->GetGrid(this, &index);
 
   if (!grid) 
     return rv;
 
   bool isHorizontal = IsHorizontal();
 
-  nsBoxLayoutState state(PresContext());
-
   int32_t firstIndex = 0;
   int32_t lastIndex = 0;
   nsGridRow* firstRow = nullptr;
   nsGridRow* lastRow = nullptr;
-  grid->GetFirstAndLastRow(state, firstIndex, lastIndex, firstRow, lastRow, isHorizontal);
+  grid->GetFirstAndLastRow(firstIndex, lastIndex, firstRow, lastRow, isHorizontal);
 
   // only the first and last rows can be affected.
   if (firstRow && firstRow->GetBox() == this) {
     
     nscoord top = 0;
     nscoord bottom = 0;
-    grid->GetRowOffsets(state, firstIndex, top, bottom, isHorizontal);
+    grid->GetRowOffsets(firstIndex, top, bottom, isHorizontal);
 
     if (isHorizontal) {
       if (top > aBorderAndPadding.top)
         aBorderAndPadding.top = top;
     } else {
       if (top > aBorderAndPadding.left)
         aBorderAndPadding.left = top;
     } 
   }
 
   if (lastRow && lastRow->GetBox() == this) {
     
     nscoord top = 0;
     nscoord bottom = 0;
-    grid->GetRowOffsets(state, lastIndex, top, bottom, isHorizontal);
+    grid->GetRowOffsets(lastIndex, top, bottom, isHorizontal);
 
     if (isHorizontal) {
       if (bottom > aBorderAndPadding.bottom)
         aBorderAndPadding.bottom = bottom;
     } else {
       if (bottom > aBorderAndPadding.right)
         aBorderAndPadding.right = bottom;
     }
--- a/layout/xul/grid/nsGridRowLeafLayout.cpp
+++ b/layout/xul/grid/nsGridRowLeafLayout.cpp
@@ -122,21 +122,20 @@ nsGridRowLeafLayout::PopulateBoxSizes(ns
       // make sure the value was computed before we use it.
       // !isHorizontal is passed in to invert the behavior of these methods.
       nscoord pref =
         grid->GetPrefRowHeight(aState, i, !isHorizontal); // GetPrefColumnWidth
       nscoord min = 
         grid->GetMinRowHeight(aState, i, !isHorizontal);  // GetMinColumnWidth
       nscoord max = 
         grid->GetMaxRowHeight(aState, i, !isHorizontal);  // GetMaxColumnWidth
-      nscoord flex =
-        grid->GetRowFlex(aState, i, !isHorizontal);       // GetColumnFlex
+      nscoord flex = grid->GetRowFlex(i, !isHorizontal);  // GetColumnFlex
       nscoord left  = 0;
       nscoord right  = 0;
-      grid->GetRowOffsets(aState, i, left, right, !isHorizontal); // GetColumnOffsets
+      grid->GetRowOffsets(i, left, right, !isHorizontal); // GetColumnOffsets
       nsIFrame* box = column->GetBox();
       bool collapsed = false;
       nscoord topMargin = column->mTopMargin;
       nscoord bottomMargin = column->mBottomMargin;
 
       if (box) 
         collapsed = box->IsCollapsed();
 
@@ -148,17 +147,17 @@ nsGridRowLeafLayout::PopulateBoxSizes(ns
       // our row could have a border that could affect our left or right
       // padding from our columns. If the row has padding subtract it.
       // would should always be able to garentee that our margin is smaller
       // or equal to our left or right
       int32_t firstIndex = 0;
       int32_t lastIndex = 0;
       nsGridRow* firstRow = nullptr;
       nsGridRow* lastRow = nullptr;
-      grid->GetFirstAndLastRow(aState, firstIndex, lastIndex, firstRow, lastRow, !isHorizontal);
+      grid->GetFirstAndLastRow(firstIndex, lastIndex, firstRow, lastRow, !isHorizontal);
 
       if (i == firstIndex || i == lastIndex) {
         nsMargin offset = GetTotalMargin(aBox, isHorizontal);
 
         nsMargin border(0,0,0,0);
         // can't call GetBorderPadding we will get into recursion
         aBox->GetBorder(border);
         offset += border;
--- a/layout/xul/nsBox.cpp
+++ b/layout/xul/nsBox.cpp
@@ -197,17 +197,17 @@ nsBox::~nsBox()
 /* static */ void
 nsBox::Shutdown()
 {
   gGotTheme = false;
   NS_IF_RELEASE(gTheme);
 }
 
 nsresult
-nsBox::RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild)
+nsBox::RelayoutChildAtOrdinal(nsIFrame* aChild)
 {
   return NS_OK;
 }
 
 nsresult
 nsIFrame::GetClientRect(nsRect& aClientRect)
 {
   aClientRect = mRect;
@@ -447,21 +447,21 @@ nsBox::GetMaxSize(nsBoxLayoutState& aSta
 
   AddBorderAndPadding(maxSize);
   bool widthSet, heightSet;
   nsIFrame::AddCSSMaxSize(this, maxSize, widthSet, heightSet);
   return maxSize;
 }
 
 nscoord
-nsBox::GetFlex(nsBoxLayoutState& aState)
+nsBox::GetFlex()
 {
   nscoord flex = 0;
 
-  nsIFrame::AddCSSFlex(aState, this, flex);
+  nsIFrame::AddCSSFlex(this, flex);
 
   return flex;
 }
 
 uint32_t
 nsIFrame::GetOrdinal()
 {
   uint32_t ordinal = StyleXUL()->mBoxOrdinal;
@@ -829,17 +829,17 @@ nsIFrame::AddCSSMaxSize(nsIFrame* aBox, 
             aHeightSet = true;
         }
     }
 
     return (aWidthSet || aHeightSet);
 }
 
 bool
-nsIFrame::AddCSSFlex(nsBoxLayoutState& aState, nsIFrame* aBox, nscoord& aFlex)
+nsIFrame::AddCSSFlex(nsIFrame* aBox, nscoord& aFlex)
 {
     bool flexSet = false;
 
     // get the flexibility
     aFlex = aBox->StyleXUL()->mBoxFlex;
 
     // attribute value overrides CSS
     nsIContent* content = aBox->GetContent();
--- a/layout/xul/nsBox.h
+++ b/layout/xul/nsBox.h
@@ -17,34 +17,34 @@ public:
 
   friend class nsIFrame;
 
   static void Shutdown();
 
   virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
-  virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState) override;
+  virtual nscoord GetFlex() override;
   virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
 
   virtual nsSize GetMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState) override;
 
   virtual bool IsCollapsed() override;
 
   virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
                          bool aRemoveOverflowAreas = false) override;
 
   virtual nsresult GetBorder(nsMargin& aBorderAndPadding) override;
   virtual nsresult GetPadding(nsMargin& aBorderAndPadding) override;
   virtual nsresult GetMargin(nsMargin& aMargin) override;
 
   virtual Valignment GetVAlign() const override { return vAlign_Top; }
   virtual Halignment GetHAlign() const override { return hAlign_Left; }
 
-  virtual nsresult RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild) override;
+  virtual nsresult RelayoutChildAtOrdinal(nsIFrame* aChild) override;
 
 #ifdef DEBUG_LAYOUT
   NS_IMETHOD GetDebugBoxAt(const nsPoint& aPoint, nsIFrame** aBox);
   virtual nsresult GetDebug(bool& aDebug) override;
   virtual nsresult SetDebug(nsBoxLayoutState& aState, bool aDebug) override;
 
   virtual nsresult DumpBox(FILE* out) override;
   void PropagateDebug(nsBoxLayoutState& aState);
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -880,22 +880,22 @@ nsBoxFrame::GetMaxSize(nsBoxLayoutState&
   }
 
   mMaxSize = size;
 
   return size;
 }
 
 nscoord
-nsBoxFrame::GetFlex(nsBoxLayoutState& aBoxLayoutState)
+nsBoxFrame::GetFlex()
 {
   if (!DoesNeedRecalc(mFlex))
      return mFlex;
 
-  mFlex = nsBox::GetFlex(aBoxLayoutState);
+  mFlex = nsBox::GetFlex();
 
   return mFlex;
 }
 
 /**
  * If subclassing please subclass this method not layout. 
  * layout will call this method.
  */
@@ -1221,26 +1221,25 @@ nsBoxFrame::AttributeChanged(int32_t aNa
     else if (aAttribute == nsGkAtoms::mousethrough) {
       UpdateMouseThrough();
     }
 
     PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
   }
   else if (aAttribute == nsGkAtoms::ordinal) {
-    nsBoxLayoutState state(PresContext());
     nsIFrame* parent = GetParentBox(this);
     // If our parent is not a box, there's not much we can do... but in that
     // case our ordinal doesn't matter anyway, so that's ok.
     // Also don't bother with popup frames since they are kept on the 
     // kPopupList and RelayoutChildAtOrdinal() only handles
     // principal children.
     if (parent && !(GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
         StyleDisplay()->mDisplay != NS_STYLE_DISPLAY_POPUP) {
-      parent->RelayoutChildAtOrdinal(state, this);
+      parent->RelayoutChildAtOrdinal(this);
       // XXXldb Should this instead be a tree change on the child or parent?
       PresContext()->PresShell()->
         FrameNeedsReflow(parent, nsIPresShell::eStyleChange,
                          NS_FRAME_IS_DIRTY);
     }
   }
   // If the accesskey changed, register for the new value
   // The old value has been unregistered in nsXULElement::SetAttr
@@ -1497,18 +1496,17 @@ nsBoxFrame::PaintXULDebugOverlay(DrawTar
         spacerSize = debugBorder.top - onePixel*4;
     } else {
         cr.x = inner.x;
         x = cr.y;
         y = cr.x + onePixel;
         spacerSize = debugBorder.left - onePixel*4;
     }
 
-    nsBoxLayoutState state(GetPresContext());
-    nscoord flex = kid->GetFlex(state);
+    nscoord flex = kid->GetFlex();
 
     if (!kid->IsCollapsed()) {
       if (isHorizontal) 
           borderSize = cr.width;
       else 
           borderSize = cr.height;
 
       DrawSpacer(GetPresContext(), aDrawTarget, isHorizontal, flex, x, y, borderSize, spacerSize);
@@ -1783,22 +1781,22 @@ nsBoxFrame::DisplayDebugInfoFor(nsIFrame
                     nsSize minSizeCSS (NS_INTRINSICSIZE, NS_INTRINSICSIZE);
                     nsSize maxSizeCSS (NS_INTRINSICSIZE, NS_INTRINSICSIZE);
                     nscoord flexCSS = NS_INTRINSICSIZE;
 
                     bool widthSet, heightSet;
                     nsIFrame::AddCSSPrefSize(child, prefSizeCSS, widthSet, heightSet);
                     nsIFrame::AddCSSMinSize (state, child, minSizeCSS, widthSet, heightSet);
                     nsIFrame::AddCSSMaxSize (child, maxSizeCSS, widthSet, heightSet);
-                    nsIFrame::AddCSSFlex    (state, child, flexCSS);
+                    nsIFrame::AddCSSFlex    (child, flexCSS);
 
                     nsSize prefSize = child->GetPrefSize(state);
                     nsSize minSize = child->GetMinSize(state);
                     nsSize maxSize = child->GetMaxSize(state);
-                    nscoord flexSize = child->GetFlex(state);
+                    nscoord flexSize = child->GetFlex();
                     nscoord ascentSize = child->GetBoxAscent(state);
 
                     char min[100];
                     char pref[100];
                     char max[100];
                     char calc[100];
                     char flex[100];
                     char ascent[100];
@@ -1935,17 +1933,17 @@ nsBoxFrame::LayoutChildAt(nsBoxLayoutSta
   if (layout || (oldRect.width != aRect.width || oldRect.height != aRect.height))  {
     return aBox->Layout(aState);
   }
 
   return NS_OK;
 }
 
 nsresult
-nsBoxFrame::RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild)
+nsBoxFrame::RelayoutChildAtOrdinal(nsIFrame* aChild)
 {
   if (!SupportsOrdinalsInChildren())
     return NS_OK;
 
   uint32_t ord = aChild->GetOrdinal();
   
   nsIFrame* child = mFrames.FirstChild();
   nsIFrame* newPrevSib = nullptr;
--- a/layout/xul/nsBoxFrame.h
+++ b/layout/xul/nsBoxFrame.h
@@ -54,22 +54,22 @@ public:
                                   nsStyleContext* aContext);
 
   // gets the rect inside our border and debug border. If you wish to paint inside a box
   // call this method to get the rect so you don't draw on the debug border or outer border.
 
   virtual void SetLayoutManager(nsBoxLayout* aLayout) override { mLayoutManager = aLayout; }
   virtual nsBoxLayout* GetLayoutManager() override { return mLayoutManager; }
 
-  virtual nsresult RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild) override;
+  virtual nsresult RelayoutChildAtOrdinal(nsIFrame* aChild) override;
 
   virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
-  virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState) override;
+  virtual nscoord GetFlex() override;
   virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
 #ifdef DEBUG_LAYOUT
   virtual nsresult SetDebug(nsBoxLayoutState& aBoxLayoutState, bool aDebug) override;
   virtual nsresult GetDebug(bool& aDebug) override;
 #endif
   virtual Valignment GetVAlign() const override { return mValign; }
   virtual Halignment GetHAlign() const override { return mHalign; }
   NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) override;
--- a/layout/xul/nsLeafBoxFrame.cpp
+++ b/layout/xul/nsLeafBoxFrame.cpp
@@ -360,19 +360,19 @@ nsLeafBoxFrame::GetMinSize(nsBoxLayoutSt
 
 /* virtual */ nsSize
 nsLeafBoxFrame::GetMaxSize(nsBoxLayoutState& aState)
 {
     return nsBox::GetMaxSize(aState);
 }
 
 /* virtual */ nscoord
-nsLeafBoxFrame::GetFlex(nsBoxLayoutState& aState)
+nsLeafBoxFrame::GetFlex()
 {
-    return nsBox::GetFlex(aState);
+    return nsBox::GetFlex();
 }
 
 /* virtual */ nscoord
 nsLeafBoxFrame::GetBoxAscent(nsBoxLayoutState& aState)
 {
     return nsBox::GetBoxAscent(aState);
 }
 
--- a/layout/xul/nsLeafBoxFrame.h
+++ b/layout/xul/nsLeafBoxFrame.h
@@ -14,17 +14,17 @@ class nsLeafBoxFrame : public nsLeafFram
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
   virtual nsSize GetPrefSize(nsBoxLayoutState& aState) override;
   virtual nsSize GetMinSize(nsBoxLayoutState& aState) override;
   virtual nsSize GetMaxSize(nsBoxLayoutState& aState) override;
-  virtual nscoord GetFlex(nsBoxLayoutState& aState) override;
+  virtual nscoord GetFlex() override;
   virtual nscoord GetBoxAscent(nsBoxLayoutState& aState) override;
 
   virtual nsIAtom* GetType() const override;
   virtual bool IsFrameOfType(uint32_t aFlags) const override
   {
     // This is bogus, but it's what we've always done.
     // Note that nsLeafFrame is also eReplacedContainsBlock.
     return nsLeafFrame::IsFrameOfType(aFlags &
--- a/layout/xul/nsMenuFrame.cpp
+++ b/layout/xul/nsMenuFrame.cpp
@@ -1344,17 +1344,17 @@ nsMenuFrame::AppendFrames(ChildListID   
 
 bool
 nsMenuFrame::SizeToPopup(nsBoxLayoutState& aState, nsSize& aSize)
 {
   if (!IsCollapsed()) {
     bool widthSet, heightSet;
     nsSize tmpSize(-1, 0);
     nsIFrame::AddCSSPrefSize(this, tmpSize, widthSet, heightSet);
-    if (!widthSet && GetFlex(aState) == 0) {
+    if (!widthSet && GetFlex() == 0) {
       nsMenuPopupFrame* popupFrame = GetPopup();
       if (!popupFrame)
         return false;
       tmpSize = popupFrame->GetPrefSize(aState);
 
       // Produce a size such that:
       //  (1) the menu and its popup can be the same width
       //  (2) there's enough room in the menu for the content and its
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -414,17 +414,17 @@ nsSliderFrame::DoLayout(nsBoxLayoutState
   int32_t pageIncrement = GetPageIncrement(scrollbar);
 
   maxPos = std::max(minPos, maxPos);
   curPos = clamped(curPos, minPos, maxPos);
 
   nscoord& availableLength = IsHorizontal() ? clientRect.width : clientRect.height;
   nscoord& thumbLength = IsHorizontal() ? thumbSize.width : thumbSize.height;
 
-  if ((pageIncrement + maxPos - minPos) > 0 && thumbBox->GetFlex(aState) > 0) {
+  if ((pageIncrement + maxPos - minPos) > 0 && thumbBox->GetFlex() > 0) {
     float ratio = float(pageIncrement) / float(maxPos - minPos + pageIncrement);
     thumbLength = std::max(thumbLength, NSToCoordRound(availableLength * ratio));
   }
 
   // Round the thumb's length to device pixels.
   nsPresContext* presContext = PresContext();
   thumbLength = presContext->DevPixelsToAppUnits(
                   presContext->AppUnitsToDevPixels(thumbLength));
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -670,17 +670,17 @@ nsSplitterFrameInner::MouseDown(nsIDOMEv
         nsSize minSize = childBox->GetMinSize(state);
         nsSize maxSize = nsBox::BoundsCheckMinMax(minSize, childBox->GetMaxSize(state));
         prefSize = nsBox::BoundsCheck(minSize, prefSize, maxSize);
 
         mOuter->AddMargin(childBox, minSize);
         mOuter->AddMargin(childBox, prefSize);
         mOuter->AddMargin(childBox, maxSize);
 
-        nscoord flex = childBox->GetFlex(state);
+        nscoord flex = childBox->GetFlex();
 
         nsMargin margin(0,0,0,0);
         childBox->GetMargin(margin);
         nsRect r(childBox->GetRect());
         r.Inflate(margin);
 
         // We need to check for hidden attribute too, since treecols with
         // the hidden="true" attribute are not really hidden, just collapsed
--- a/layout/xul/nsSprocketLayout.cpp
+++ b/layout/xul/nsSprocketLayout.cpp
@@ -697,17 +697,17 @@ nsSprocketLayout::PopulateBoxSizes(nsIFr
         aBoxSizes      = new (aState) nsBoxSize();
         currentBox      = aBoxSizes;
       } else {
         currentBox->next      = new (aState) nsBoxSize();
         currentBox      = currentBox->next;
       }
     
 
-      flex = child->GetFlex(aState);
+      flex = child->GetFlex();
 
       currentBox->flex = flex;
       currentBox->collapsed = child->IsCollapsed();
     } else {
       flex = start->flex;
       start = start->next;
     }
     
@@ -781,17 +781,17 @@ nsSprocketLayout::PopulateBoxSizes(nsIFr
           maxWidth  = maxSize.width;
           prefWidth = pref.width;
       } else {
           minWidth = minSize.height;
           maxWidth = maxSize.height;
           prefWidth = pref.height;
       }
 
-      nscoord flex = child->GetFlex(aState);
+      nscoord flex = child->GetFlex();
 
       // set them if you collapsed you are not flexible.
       if (collapsed) {
         currentBox->flex = 0;
       }
       else {
         if (flex > maxFlex) {
           maxFlex = flex;
@@ -1382,17 +1382,17 @@ nsSprocketLayout::GetMinSize(nsIFrame* a
        // ignore collapsed children
       if (!child->IsCollapsed())
       {
         nsSize min = child->GetMinSize(aState);
         nsSize pref(0,0);
         
         // if the child is not flexible then
         // its min size is its pref size.
-        if (child->GetFlex(aState) == 0) {
+        if (child->GetFlex() == 0) {
             pref = child->GetPrefSize(aState);
             if (isHorizontal)
                min.width = pref.width;
             else
                min.height = pref.height;
         }
 
         if (isEqual) {
--- a/layout/xul/nsStackLayout.cpp
+++ b/layout/xul/nsStackLayout.cpp
@@ -65,17 +65,17 @@ nsStackLayout::GetPrefSize(nsIFrame* aBo
 
   nsIFrame* child = nsBox::GetChildBox(aBox);
   while (child) {
     if (child->StyleXUL()->mStretchStack) {
       nsSize pref = child->GetPrefSize(aState);
 
       AddMargin(child, pref);
       nsMargin offset;
-      GetOffset(aState, child, offset);
+      GetOffset(child, offset);
       pref.width += offset.LeftRight();
       pref.height += offset.TopBottom();
       AddLargestSize(prefSize, pref);
     }
 
     child = nsBox::GetNextBox(child);
   }
 
@@ -91,17 +91,17 @@ nsStackLayout::GetMinSize(nsIFrame* aBox
 
   nsIFrame* child = nsBox::GetChildBox(aBox);
   while (child) {
     if (child->StyleXUL()->mStretchStack) {
       nsSize min = child->GetMinSize(aState);
 
       AddMargin(child, min);
       nsMargin offset;
-      GetOffset(aState, child, offset);
+      GetOffset(child, offset);
       min.width += offset.LeftRight();
       min.height += offset.TopBottom();
       AddLargestSize(minSize, min);
     }
 
     child = nsBox::GetNextBox(child);
   }
 
@@ -120,17 +120,17 @@ nsStackLayout::GetMaxSize(nsIFrame* aBox
     if (child->StyleXUL()->mStretchStack) {
       nsSize min = child->GetMinSize(aState);
       nsSize max = child->GetMaxSize(aState);
 
       max = nsBox::BoundsCheckMinMax(min, max);
 
       AddMargin(child, max);
       nsMargin offset;
-      GetOffset(aState, child, offset);
+      GetOffset(child, offset);
       max.width += offset.LeftRight();
       max.height += offset.TopBottom();
       AddSmallestSize(maxSize, max);
     }
 
     child = nsBox::GetNextBox(child);
   }
 
@@ -156,17 +156,17 @@ nsStackLayout::GetAscent(nsIFrame* aBox,
 
     child = nsBox::GetNextBox(child);
   }
 
   return vAscent;
 }
 
 uint8_t
-nsStackLayout::GetOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsMargin& aOffset)
+nsStackLayout::GetOffset(nsIFrame* aChild, nsMargin& aOffset)
 {
   aOffset = nsMargin(0, 0, 0, 0);
 
   // get the left, right, top and bottom offsets
 
   // As an optimization, we cache the fact that we are not positioned to avoid
   // wasting time fetching attributes.
   if (aChild->IsBoxFrame() &&
@@ -282,17 +282,17 @@ nsStackLayout::Layout(nsIFrame* aBox, ns
       // only lay out dirty children or children whose sizes have changed
       if (sizeChanged || NS_SUBTREE_DIRTY(child)) {
           // add in the child's margin
           nsMargin margin;
           child->GetMargin(margin);
 
           // obtain our offset from the top left border of the stack's content box.
           nsMargin offset;
-          uint8_t offsetSpecified = GetOffset(aState, child, offset);
+          uint8_t offsetSpecified = GetOffset(child, offset);
 
           // Set the position and size based on which offsets have been specified:
           //   left only - offset from left edge, preferred width
           //   right only - offset from right edge, preferred width
           //   left and right - offset from left and right edges, width in between this
           //   neither - no offset, full width of stack
           // Vertical direction is similar.
           //
--- a/layout/xul/nsStackLayout.h
+++ b/layout/xul/nsStackLayout.h
@@ -38,17 +38,17 @@ public:
   virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
   virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) override;
 
   // get the child offsets for aChild and set them in aMargin. Returns a
   // bitfield mask of the SPECIFIED_LEFT, SPECIFIED_RIGHT, SPECIFIED_TOP and
   // SPECIFIED_BOTTOM offsets indicating which sides have been specified by
   // attributes.
-  static uint8_t GetOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsMargin& aMargin);
+  static uint8_t GetOffset(nsIFrame* aChild, nsMargin& aMargin);
 
 private:
   static nsBoxLayout* gInstance;
 
 }; // class nsStackLayout