Bug 1291110 Part 2 - Rename availableSpaceHeight to availableSpaceBSize. draft
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 08 Nov 2016 13:42:14 +0800
changeset 435284 fa7a8ff8b85cb627c3a2ec9dfda832a076169ea9
parent 435283 7376c3f56d3e94897839a10fa5ba5752e7d2a887
child 435285 584598ca97442ab0580303c5e83e85a691490d32
child 435291 e8ee671b9961ffb251f971203c112c16aecdddff
child 435351 59193163f313a575eb69cfdeddefac7b753fa0b6
child 435363 6745ac90ab4c82085a2f5ffe2e3803604149d84a
child 436963 07cf7b6315f2b8360f8e8cb052d37fdbeb34c40f
push id34984
push userbmo:tlin@mozilla.com
push dateTue, 08 Nov 2016 09:37:37 +0000
bugs1291110
milestone52.0a1
Bug 1291110 Part 2 - Rename availableSpaceHeight to availableSpaceBSize. 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,