From dad0359487238d5dd54607ec9a9cddc4dfd159e2 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Wed, 27 Mar 2013 23:33:19 -0700 Subject: [PATCH] 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 | 31 ++++++++----------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 00935dfa70ca..23eacbba9ca4 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -604,17 +604,14 @@ nsFlexContainerFrame::AppendFlexItemForChild( // 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" @@ -629,9 +626,8 @@ nsFlexContainerFrame::AppendFlexItemForChild( 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 @@ -639,8 +635,7 @@ nsFlexContainerFrame::AppendFlexItemForChild( // (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; } @@ -667,13 +662,7 @@ nsFlexContainerFrame::AppendFlexItemForChild( childRS.mComputedBorderPadding.TopBottom(); childDesiredHeight = std::max(0, childDesiredHeight); - if (isMainSizeAuto) { - flexBaseSize = childDesiredHeight; - } - if (isMainMinSizeAuto) { - mainMinSize = childDesiredHeight; - mainMaxSize = std::max(mainMaxSize, mainMinSize); - } + flexBaseSize = childDesiredHeight; } }