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

This commit is contained in:
Daniel Holbert 2013-03-27 23:33:19 -07:00
Родитель de3f64fa29
Коммит dad0359487
1 изменённых файлов: 10 добавлений и 21 удалений

Просмотреть файл

@ -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,14 +662,8 @@ nsFlexContainerFrame::AppendFlexItemForChild(
childRS.mComputedBorderPadding.TopBottom();
childDesiredHeight = std::max(0, childDesiredHeight);
if (isMainSizeAuto) {
flexBaseSize = childDesiredHeight;
}
if (isMainMinSizeAuto) {
mainMinSize = childDesiredHeight;
mainMaxSize = std::max(mainMaxSize, mainMinSize);
}
}
}
// CROSS MIN/MAX SIZE