Bug 1144096 part 3 - [css-grid] Remove CellMap::ClearOccupied() since it's not needed anymore. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Fri, 11 Mar 2016 17:39:26 +0100
changeset 288295 7e7ff8ae121607a8d3c5c0439faf836a726dc552
parent 288294 3737062990186ca27ee7fd31c2afd2fabfedab5c
child 288296 035a1dd254e1e28f2a1571332a4160101d261f3d
push id30079
push userryanvm@gmail.com
push dateSat, 12 Mar 2016 20:24:19 +0000
treeherdermozilla-central@d1d47ba19ce9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1144096
milestone48.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 1144096 part 3 - [css-grid] Remove CellMap::ClearOccupied() since it's not needed anymore. r=dholbert
layout/generic/nsGridContainerFrame.cpp
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -1339,28 +1339,16 @@ struct MOZ_STACK_CLASS nsGridContainerFr
         nsTArray<Cell>& cellsInRow = mCells[i];
         cellsInRow.EnsureLengthAtLeast(numCols);
         for (auto j = aGridArea.mCols.mStart; j < numCols; ++j) {
           cellsInRow[j].mIsOccupied = true;
         }
       }
     }
 
-    void ClearOccupied()
-    {
-      const size_t numRows = mCells.Length();
-      for (size_t i = 0; i < numRows; ++i) {
-        nsTArray<Cell>& cellsInRow = mCells[i];
-        const size_t numCols = cellsInRow.Length();
-        for (size_t j = 0; j < numCols; ++j) {
-          cellsInRow[j].mIsOccupied = false;
-        }
-      }
-    }
-
     uint32_t IsEmptyCol(uint32_t aCol) const
     {
       for (auto& row : mCells) {
         if (aCol < row.Length() && row[aCol].mIsOccupied) {
           return false;
         }
       }
       return true;
@@ -2303,17 +2291,17 @@ nsGridContainerFrame::Grid::PlaceAutoAut
 void
 nsGridContainerFrame::Grid::PlaceGridItems(GridReflowState& aState,
                                            const LogicalSize& aComputedMinSize,
                                            const LogicalSize& aComputedSize,
                                            const LogicalSize& aComputedMaxSize)
 {
   mAreas = aState.mFrame->GetImplicitNamedAreas();
   const nsStylePosition* const gridStyle = aState.mGridStyle;
-  mCellMap.ClearOccupied();
+  MOZ_ASSERT(mCellMap.mCells.IsEmpty(), "unexpected entries in cell map");
 
   // http://dev.w3.org/csswg/css-grid/#grid-definition
   // Initialize the end lines of the Explicit Grid (mExplicitGridCol[Row]End).
   // This is determined by the larger of the number of rows/columns defined
   // by 'grid-template-areas' and the 'grid-template-rows'/'-columns', plus one.
   // Also initialize the Implicit Grid (mGridCol[Row]End) to the same values.
   // Note that this is for a grid with a 1,1 origin.  We'll change that
   // to a 0,0 based grid after placing definite lines.