Bug 848539 part 3: Back out part of 076d87bf30d0, bug 666041 part 7 (flexbox frame class impl -- just removing the code that deals with min-height:auto). r=dbaron
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 27 Mar 2013 23:33:19 -0700
changeset 136930 7a289f49170f58373d94a39507b5b916560e6589
parent 136929 1eae876d6c3afda2db30b2f41dd935d58e28ac16
child 136931 5db313632268579f5b66e6728cb08985148ff1a7
push id2452
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 16:59:38 +0000
treeherdermozilla-beta@d4b152d29d8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs848539, 666041
milestone22.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 848539 part 3: Back out part of 076d87bf30d0, bug 666041 part 7 (flexbox frame class impl -- just removing the code that deals with min-height:auto). r=dbaron
layout/generic/nsFlexContainerFrame.cpp
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -599,53 +599,48 @@ nsFlexContainerFrame::AppendFlexItemForC
                                          childRS.mComputedMaxHeight));
   // This is enforced by the nsHTMLReflowState where these values come from:
   MOZ_ASSERT(mainMinSize <= mainMaxSize, "min size is larger than max size");
 
   // SPECIAL MAIN-SIZING FOR VERTICAL FLEX CONTAINERS
   // If we're vertical and our main size ended up being unconstrained
   // (e.g. because we had height:auto), we need to instead use our
   // "max-content" height, which is what we get from reflowing into our
-  // available width.  This is the same as our "min-content" height --
-  // so if we have "min-height:auto", we need to use this value as our
-  // min-height.
+  // available width.
   bool needToMeasureMaxContentHeight = false;
   if (!IsAxisHorizontal(aAxisTracker.GetMainAxis())) {
-    bool isMainSizeAuto = (NS_UNCONSTRAINEDSIZE == flexBaseSize);
-    bool isMainMinSizeAuto =
-      (eStyleUnit_Auto ==
-       aChildFrame->StylePosition()->mMinHeight.GetUnit());
-
-    needToMeasureMaxContentHeight = isMainSizeAuto || isMainMinSizeAuto;
+    // NOTE: If & when we handle "min-height: min-content" for flex items,
+    // this is probably the spot where we'll want to resolve it to the
+    // actual intrinsic height given our computed width. It'll be the same
+    // auto-height that we determine here.
+    needToMeasureMaxContentHeight = (NS_AUTOHEIGHT == flexBaseSize);
 
     if (needToMeasureMaxContentHeight) {
       // Give the item a special reflow with "mIsFlexContainerMeasuringHeight"
       // set.  This tells it to behave as if it had "height: auto", regardless
       // of what the "height" property is actually set to.
       nsHTMLReflowState
         childRSForMeasuringHeight(aPresContext, aParentReflowState,
                                   aChildFrame,
                                   nsSize(aParentReflowState.ComputedWidth(),
                                          NS_UNCONSTRAINEDSIZE),
                                   -1, -1, false);
       childRSForMeasuringHeight.mFlags.mIsFlexContainerMeasuringHeight = true;
       childRSForMeasuringHeight.Init(aPresContext);
 
-      // If this item is flexible (vertically), or if we're measuring the
-      // 'auto' min-height and our main-size is something else, then we assume
-      // that the computed-height we're reflowing with now could be different
+      // If this item is flexible (vertically), then we assume that the
+      // computed-height we're reflowing with now could be different
       // from the one we'll use for this flex item's "actual" reflow later on.
       // In that case, we need to be sure the flex item treats this as a
       // vertical resize, even though none of its ancestors are necessarily
       // being vertically resized.
       // (Note: We don't have to do this for width, because InitResizeFlags
       // will always turn on mHResize on when it sees that the computed width
       // is different from current width, and that's all we need.)
-      if (flexGrow != 0.0f || flexShrink != 0.0f ||  // Are we flexible?
-          !isMainSizeAuto) {  // Are we *only* measuring this for min-height?
+      if (flexGrow != 0.0f || flexShrink != 0.0f) {  // Are we flexible?
         childRSForMeasuringHeight.mFlags.mVResize = true;
       }
 
       nsHTMLReflowMetrics childDesiredSize;
       nsReflowStatus childReflowStatus;
       nsresult rv = ReflowChild(aChildFrame, aPresContext,
                                 childDesiredSize, childRSForMeasuringHeight,
                                 0, 0, NS_FRAME_NO_MOVE_FRAME,
@@ -662,23 +657,17 @@ nsFlexContainerFrame::AppendFlexItemForC
       NS_ENSURE_SUCCESS(rv, rv);
 
       // Subtract border/padding in vertical axis, to get _just_
       // the effective computed value of the "height" property.
       nscoord childDesiredHeight = childDesiredSize.height -
         childRS.mComputedBorderPadding.TopBottom();
       childDesiredHeight = std::max(0, childDesiredHeight);
 
-      if (isMainSizeAuto) {
-        flexBaseSize = childDesiredHeight;
-      }
-      if (isMainMinSizeAuto) {
-        mainMinSize = childDesiredHeight;
-        mainMaxSize = std::max(mainMaxSize, mainMinSize);
-      }
+      flexBaseSize = childDesiredHeight;
     }
   }
 
   // CROSS MIN/MAX SIZE
   // ------------------
 
   nscoord crossMinSize =
     aAxisTracker.GetCrossComponent(nsSize(childRS.mComputedMinWidth,