Bug 1501145 Part 2 - Assign default values to ColumnBalanceData fields. r=mats
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 23 Oct 2018 13:09:16 +0000
changeset 490960 fb761199e41a36b3adee582df40508acebca25c8
parent 490959 aa716a3cae86d41a1e40b1068549de2f303d2be8
child 490961 6cbe19bd77f352cc1eb0e3270bff2ed20cc7ad5f
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersmats
bugs1501145
milestone65.0a1
Bug 1501145 Part 2 - Assign default values to ColumnBalanceData fields. r=mats Depends on D9467 Differential Revision: https://phabricator.services.mozilla.com/D9468
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsColumnSetFrame.h
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -1235,17 +1235,16 @@ nsColumnSetFrame::Reflow(nsPresContext* 
   // what the average column height should be, because we can measure
   // the heights of all the columns and sum them up. But don't do this
   // if we have a next in flow because we don't want to suck all its
   // content back here and then have to push it out again!
   nsIFrame* nextInFlow = GetNextInFlow();
   bool unboundedLastColumn = config.mIsBalancing && !nextInFlow;
   nsCollapsingMargin carriedOutBottomMargin;
   ColumnBalanceData colData;
-  colData.mHasExcessBSize = false;
 
   bool feasible = ReflowColumns(aDesiredSize, aReflowInput, aStatus, config,
                                 unboundedLastColumn, &carriedOutBottomMargin,
                                 colData);
 
   // If we're not balancing, then we're already done, since we should have
   // reflown all of our children, and there is no need for a binary search to
   // determine proper column height.
--- a/layout/generic/nsColumnSetFrame.h
+++ b/layout/generic/nsColumnSetFrame.h
@@ -140,28 +140,32 @@ protected:
     nscoord mConsumedBSize = 0;
   };
 
   /**
    * Some data that is better calculated during reflow
    */
   struct ColumnBalanceData {
     // The maximum "content block-size" of any column
-    nscoord mMaxBSize;
+    nscoord mMaxBSize = 0;
+
     // The sum of the "content block-size" for all columns
-    nscoord mSumBSize;
+    nscoord mSumBSize = 0;
+
     // The "content block-size" of the last column
-    nscoord mLastBSize;
+    nscoord mLastBSize = 0;
+
     // The maximum "content block-size" of all columns that overflowed
     // their available block-size
-    nscoord mMaxOverflowingBSize;
+    nscoord mMaxOverflowingBSize = 0;
+
     // This flag determines whether the last reflow of children exceeded the
     // computed block-size of the column set frame. If so, we set the bSize to
     // this maximum allowable bSize, and continue reflow without balancing.
-    bool mHasExcessBSize;
+    bool mHasExcessBSize = false;
 
     void Reset() {
       mMaxBSize = mSumBSize = mLastBSize = mMaxOverflowingBSize = 0;
       mHasExcessBSize = false;
     }
   };
 
   bool ReflowColumns(ReflowOutput& aDesiredSize,