Bug 1291110 Part 2 - Rename availableSpaceHeight to availableSpaceBSize. r=dbaron
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 08 Nov 2016 13:42:14 +0800
changeset 351906 0ddd1de392d811da6cf3497a42f2b833e53c093e
parent 351905 0bc5e1c941a21a32668adae737030887a7865fba
child 351907 5ebd8aebc99f26443b596cb026ab025585a9260d
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1291110
milestone52.0a1
Bug 1291110 Part 2 - Rename availableSpaceHeight to availableSpaceBSize. r=dbaron Rename to make the variable name consistent with the writing-mode terminology used in PlaceLine(). MozReview-Commit-ID: AvhwHyHz7hV
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockFrame.h
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -3760,17 +3760,17 @@ nsBlockFrame::ReflowInlineFrames(BlockRe
   // into. Apply a previous block frame's block-end margin first.
   if (ShouldApplyBStartMargin(aState, aLine, aLine->mFirstChild)) {
     aState.mBCoord += aState.mPrevBEndMargin.get();
   }
   nsFlowAreaRect floatAvailableSpace = aState.GetFloatAvailableSpace();
 
   LineReflowStatus lineReflowStatus;
   do {
-    nscoord availableSpaceHeight = 0;
+    nscoord availableSpaceBSize = 0;
     do {
       bool allowPullUp = true;
       nsIFrame* forceBreakInFrame = nullptr;
       int32_t forceBreakOffset = -1;
       gfxBreakPriority forceBreakPriority = gfxBreakPriority::eNoBreak;
       do {
         nsFloatManager::SavedState floatManagerState;
         aState.mReflowInput.mFloatManager->PushState(&floatManagerState);
@@ -3785,17 +3785,17 @@ nsBlockFrame::ReflowInlineFrames(BlockRe
         nsLineLayout lineLayout(aState.mPresContext,
                                 aState.mReflowInput.mFloatManager,
                                 &aState.mReflowInput, &aLine, nullptr);
         lineLayout.Init(&aState, aState.mMinLineHeight, aState.mLineNumber);
         if (forceBreakInFrame) {
           lineLayout.ForceBreakAtPosition(forceBreakInFrame, forceBreakOffset);
         }
         DoReflowInlineFrames(aState, lineLayout, aLine,
-                             floatAvailableSpace, availableSpaceHeight,
+                             floatAvailableSpace, availableSpaceBSize,
                              &floatManagerState, aKeepReflowGoing,
                              &lineReflowStatus, allowPullUp);
         lineLayout.EndLineReflow();
 
         if (LineReflowStatus::RedoNoPull == lineReflowStatus ||
             LineReflowStatus::RedoMoreFloats == lineReflowStatus ||
             LineReflowStatus::RedoNextBand == lineReflowStatus) {
           if (lineLayout.NeedsBackup()) {
@@ -3832,17 +3832,17 @@ nsBlockFrame::PushTruncatedLine(BlockRef
   NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
 }
 
 void
 nsBlockFrame::DoReflowInlineFrames(BlockReflowInput& aState,
                                    nsLineLayout& aLineLayout,
                                    LineIterator aLine,
                                    nsFlowAreaRect& aFloatAvailableSpace,
-                                   nscoord& aAvailableSpaceHeight,
+                                   nscoord& aAvailableSpaceBSize,
                                    nsFloatManager::SavedState*
                                      aFloatStateBeforeLine,
                                    bool* aKeepReflowGoing,
                                    LineReflowStatus* aLineReflowStatus,
                                    bool aAllowPullUp)
 {
   // Forget all of the floats on the line
   aLine->FreeFloats(aState.mFloatCacheFreeList);
@@ -4039,17 +4039,17 @@ nsBlockFrame::DoReflowInlineFrames(Block
     // past the float.
   }
   else if (LineReflowStatus::Truncated != lineReflowStatus &&
            LineReflowStatus::RedoNoPull != lineReflowStatus) {
     // If we are propagating out a break-before status then there is
     // no point in placing the line.
     if (!NS_INLINE_IS_BREAK_BEFORE(aState.mReflowStatus)) {
       if (!PlaceLine(aState, aLineLayout, aLine, aFloatStateBeforeLine,
-                     aFloatAvailableSpace.mRect, aAvailableSpaceHeight,
+                     aFloatAvailableSpace.mRect, aAvailableSpaceBSize,
                      aKeepReflowGoing)) {
         lineReflowStatus = LineReflowStatus::RedoMoreFloats;
         // PlaceLine already called GetAvailableSpaceForBSize for us.
       }
     }
   }
 #ifdef DEBUG
   if (gNoisyReflow) {
@@ -4427,22 +4427,22 @@ nsBlockFrame::IsLastLine(BlockReflowInpu
   }
 
   // This is the last line - so don't allow justification
   return true;
 }
 
 bool
 nsBlockFrame::PlaceLine(BlockReflowInput& aState,
-                        nsLineLayout&       aLineLayout,
-                        LineIterator       aLine,
+                        nsLineLayout& aLineLayout,
+                        LineIterator aLine,
                         nsFloatManager::SavedState *aFloatStateBeforeLine,
-                        LogicalRect&        aFloatAvailableSpace,
-                        nscoord&            aAvailableSpaceHeight,
-                        bool*             aKeepReflowGoing)
+                        LogicalRect& aFloatAvailableSpace,
+                        nscoord& aAvailableSpaceBSize,
+                        bool* aKeepReflowGoing)
 {
   // Trim extra white-space from the line before placing the frames
   aLineLayout.TrimTrailingWhiteSpace();
 
   // Vertically align the frames on this line.
   //
   // According to the CSS2 spec, section 12.6.1, the "marker" box
   // participates in the height calculation of the list-item box's
@@ -4465,35 +4465,35 @@ nsBlockFrame::PlaceLine(BlockReflowInput
     NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
                  "empty bullet took up space");
     aLineLayout.AddBulletFrame(bullet, metrics);
     addedBullet = true;
   }
   aLineLayout.VerticalAlignLine();
 
   // We want to compare to the available space that we would have had in
-  // the line's height *before* we placed any floats in the line itself.
+  // the line's BSize *before* we placed any floats in the line itself.
   // Floats that are in the line are handled during line reflow (and may
   // result in floats being pushed to below the line or (I HOPE???) in a
   // reflow with a forced break position).
   LogicalRect oldFloatAvailableSpace(aFloatAvailableSpace);
-  // As we redo for floats, we can't reduce the amount of height we're
+  // As we redo for floats, we can't reduce the amount of BSize we're
   // checking.
-  aAvailableSpaceHeight = std::max(aAvailableSpaceHeight, aLine->BSize());
+  aAvailableSpaceBSize = std::max(aAvailableSpaceBSize, aLine->BSize());
   aFloatAvailableSpace =
     aState.GetFloatAvailableSpaceForBSize(aLine->BStart(),
-                                          aAvailableSpaceHeight,
+                                          aAvailableSpaceBSize,
                                           aFloatStateBeforeLine).mRect;
   NS_ASSERTION(aFloatAvailableSpace.BStart(wm) ==
                oldFloatAvailableSpace.BStart(wm), "yikes");
-  // Restore the height to the position of the next band.
+  // Restore the BSize to the position of the next band.
   aFloatAvailableSpace.BSize(wm) = oldFloatAvailableSpace.BSize(wm);
   // If the available space between the floats is smaller now that we
-  // know the height, return false (and cause another pass with
-  // LineReflowStatus::RedoMoreFloats).  We ensure aAvailableSpaceHeight
+  // know the BSize, return false (and cause another pass with
+  // LineReflowStatus::RedoMoreFloats).  We ensure aAvailableSpaceBSize
   // never decreases, which means that we can't reduce the set of floats
   // we intersect, which means that the available space cannot grow.
   if (AvailableSpaceShrunk(wm, oldFloatAvailableSpace, aFloatAvailableSpace,
                            false)) {
     return false;
   }
 
 #ifdef DEBUG
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -654,17 +654,17 @@ protected:
   // Return false if it needs another reflow because of reduced space
   // between floats that are next to it (but not next to its top), and
   // return true otherwise.
   bool PlaceLine(BlockReflowInput& aState,
                  nsLineLayout& aLineLayout,
                  LineIterator aLine,
                  nsFloatManager::SavedState* aFloatStateBeforeLine,
                  mozilla::LogicalRect& aFloatAvailableSpace, //in-out
-                 nscoord& aAvailableSpaceHeight, // in-out
+                 nscoord& aAvailableSpaceBSize, // in-out
                  bool* aKeepReflowGoing);
 
   /**
     * If NS_BLOCK_LOOK_FOR_DIRTY_FRAMES is set, call MarkLineDirty
     * on any line with a child frame that is dirty.
     */
   void LazyMarkLinesDirty();
 
@@ -700,19 +700,18 @@ protected:
   void ReflowInlineFrames(BlockReflowInput& aState,
                           LineIterator aLine,
                           bool* aKeepLineGoing);
 
   void DoReflowInlineFrames(BlockReflowInput& aState,
                             nsLineLayout& aLineLayout,
                             LineIterator aLine,
                             nsFlowAreaRect& aFloatAvailableSpace,
-                            nscoord& aAvailableSpaceHeight,
-                            nsFloatManager::SavedState*
-                            aFloatStateBeforeLine,
+                            nscoord& aAvailableSpaceBSize,
+                            nsFloatManager::SavedState* aFloatStateBeforeLine,
                             bool* aKeepReflowGoing,
                             LineReflowStatus* aLineReflowStatus,
                             bool aAllowPullUp);
 
   void ReflowInlineFrame(BlockReflowInput& aState,
                          nsLineLayout& aLineLayout,
                          LineIterator aLine,
                          nsIFrame* aFrame,