address dbaron review comment: s/nscoord_MIN/0/ for variables whose initial values don't matter.
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 10 Aug 2012 11:29:18 -0700
changeset 1690 34f5a9365e3483c4d88651baaea1d003c8d8bf96
parent 1689 b07d882593ae433bebb5a11a9f363d23f30c3b93
child 1691 c1c1cde70e5e7b22bcc25ef08783d6202c9f3a09
push id1376
push userdholbert@mozilla.com
push dateFri, 10 Aug 2012 18:30:01 +0000
address dbaron review comment: s/nscoord_MIN/0/ for variables whose initial values don't matter.
flexbox-mainImpl.patch
--- a/flexbox-mainImpl.patch
+++ b/flexbox-mainImpl.patch
@@ -1,17 +1,17 @@
 # HG changeset patch
 # Parent a691847962bff5e52f18cb93e907410c46296b0f
 # User Daniel Holbert <dholbert@cs.stanford.edu>
 Bug 666041 patch 7: implementation of flex container class for CSS3 flexbox. r?dbaron
 
 diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp
 --- a/layout/generic/nsFlexContainerFrame.cpp
 +++ b/layout/generic/nsFlexContainerFrame.cpp
-@@ -3,56 +3,2071 @@
+@@ -3,56 +3,2072 @@
  
  /* This Source Code is subject to the terms of the Mozilla Public License
   * version 2.0 (the "License"). You can obtain a copy of the License at
   * http://mozilla.org/MPL/2.0/. */
  
  /* rendering object for CSS display: -moz-flex */
  
  #include "nsFlexContainerFrame.h"
@@ -596,20 +596,20 @@ diff --git a/layout/generic/nsFlexContai
 +    mFlexBaseSize(aFlexBaseSize),
 +    mMainMinSize(aMainMinSize),
 +    mMainMaxSize(aMainMaxSize),
 +    mCrossMinSize(aCrossMinSize),
 +    mCrossMaxSize(aCrossMaxSize),
 +    // Init main-size to 'hypothetical main size', which is flex base size
 +    // clamped to [min,max] range:
 +    mMainSize(NS_CSS_MINMAX(aFlexBaseSize, aMainMinSize, aMainMaxSize)),
-+    mMainPosn(nscoord_MIN),
-+    mCrossSize(nscoord_MIN),
-+    mCrossPosn(nscoord_MIN),
-+    mAscent(nscoord_MIN),
++    mMainPosn(0),
++    mCrossSize(0),
++    mCrossPosn(0),
++    mAscent(0),
 +    mIsFrozen(false),
 +    mHadMinViolation(false),
 +    mHadMaxViolation(false),
 +    mIsStretched(false),
 +    mAlignSelf(aChildFrame->GetStylePosition()->mAlignSelf)
 +{
 +  NS_ABORT_IF_FALSE(aChildFrame, "expecting a non-null child frame");
 +
@@ -1367,18 +1367,19 @@ diff --git a/layout/generic/nsFlexContai
 +  EnterMargin(aReflowState.mComputedBorderPadding);
 +}
 +
 +SingleLineCrossAxisPositionTracker::
 +  SingleLineCrossAxisPositionTracker(nsFlexContainerFrame* aFlexContainerFrame,
 +                                     const FlexboxAxisTracker& aAxisTracker,
 +                                     const nsTArray<FlexItem>& aItems)
 +  : PositionTracker(aAxisTracker.GetCrossAxis()),
-+    mLineCrossSize(nscoord_MIN),
-+    mCrossStartToFurthestBaseline(nscoord_MIN)
++    mLineCrossSize(0),
++    mCrossStartToFurthestBaseline(nscoord_MIN) // Starts at -infinity, and then
++                                               // we progressively increase it.
 +{
 +}
 +
 +void
 +SingleLineCrossAxisPositionTracker::
 +  ComputeLineCrossSize(const nsTArray<FlexItem>& aItems)
 +{
 +  // NOTE: mCrossStartToFurthestBaseline is a member var rather than a local