Bug 848539 part 4: Back out 82f73bdb2237, bug 763689 part 3 (style-system handling for min-height:auto). r=dbaron

This commit is contained in:
Daniel Holbert 2013-03-27 23:33:19 -07:00
parent 3bcdb3c7b7
commit 32bce336fe
8 changed files with 19 additions and 39 deletions

View File

@ -45,7 +45,7 @@ asserts(6-12) load 265986-1.html # Bug 512405
load 265999-1.html
load 266222-1.html
asserts(3-7) load 266360-1.html # bug 575011 / bug 576358
asserts(4) load 266445-1.html # Bug 575011
asserts(3) load 266445-1.html # Bug 575011
load 268157-1.html
load 269566-1.html
load 272647-1.html

View File

@ -2586,8 +2586,7 @@ GetPercentHeight(const nsStyleCoord& aStyle,
if (minh > h)
h = minh;
} else {
NS_ASSERTION(pos->mMinHeight.HasPercent() ||
pos->mMinHeight.GetUnit() == eStyleUnit_Auto,
NS_ASSERTION(pos->mMinHeight.HasPercent(),
"unknown min-height unit");
}
@ -2745,18 +2744,12 @@ nsLayoutUtils::IntrinsicForContainer(nsRenderingContext *aRenderingContext,
// Handle elements with an intrinsic ratio (or size) and a specified
// height, min-height, or max-height.
// NOTE: We treat "min-height:auto" as "0" for the purpose of this code,
// since that's what it means in all cases except for on flex items -- and
// even there, we're supposed to ignore it (i.e. treat it as 0) until the
// flex container explicitly considers it.
const nsStyleCoord &styleHeight = stylePos->mHeight;
const nsStyleCoord &styleMinHeight = stylePos->mMinHeight;
const nsStyleCoord &styleMaxHeight = stylePos->mMaxHeight;
if (styleHeight.GetUnit() != eStyleUnit_Auto ||
!(styleMinHeight.GetUnit() == eStyleUnit_Auto ||
(styleMinHeight.GetUnit() == eStyleUnit_Coord &&
styleMinHeight.GetCoordValue() == 0)) ||
!(styleMinHeight.GetUnit() == eStyleUnit_Coord &&
styleMinHeight.GetCoordValue() == 0) ||
styleMaxHeight.GetUnit() != eStyleUnit_None) {
nsSize ratio = aFrame->GetIntrinsicRatio();

View File

@ -24,7 +24,7 @@ load 321224.xul
load 322780-1.xul
load 323381-1.html
load 323381-2.html
asserts-if(gtk2Widget,13-15) load 323386-1.html # Bug 575011
asserts-if(gtk2Widget,14-15) load 323386-1.html # Bug 575011
load 323389-1.html
load 323389-2.html
load 323493-1.html
@ -330,7 +330,7 @@ load 495875-1.html
load 495875-2.html
load 499862-1.html
load 499857-1.html
asserts(4-90) asserts-if(winWidget,3-108) load 499885-1.xhtml # nscoord_MAX assertions (bug 575011), plus bug 570436 on some versions of windows
asserts(10-90) asserts-if(winWidget,3-108) load 499885-1.xhtml # nscoord_MAX assertions (bug 575011), plus bug 570436 on some versions of windows
load 501535-1.html
load 503961-1.xhtml
load 503961-2.html

View File

@ -2537,13 +2537,8 @@ nsHTMLReflowState::ComputeMinMaxValues(nscoord aContainingBlockWidth,
// Likewise, if we're a child of a flex container who's measuring our
// intrinsic height, then we want to disregard our min-height.
// NOTE: We treat "min-height:auto" as "0" for the purpose of this code,
// since that's what it means in all cases except for on flex items -- and
// even there, we're supposed to ignore it (i.e. treat it as 0) until the
// flex container explicitly considers it.
const nsStyleCoord &minHeight = mStylePosition->mMinHeight;
if (eStyleUnit_Auto == minHeight.GetUnit() ||
(NS_AUTOHEIGHT == aContainingBlockHeight &&
if ((NS_AUTOHEIGHT == aContainingBlockHeight &&
minHeight.HasPercent()) ||
(mFrameType == NS_CSS_FRAME_TYPE_INTERNAL_TABLE &&
minHeight.IsCalcUnit() && minHeight.CalcHasPercent()) ||

View File

@ -3409,17 +3409,7 @@ CSSValue*
nsComputedDOMStyle::DoGetMinHeight()
{
nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
nsStyleCoord minHeight = StylePosition()->mMinHeight;
if (eStyleUnit_Auto == minHeight.GetUnit()) {
// In non-flexbox contexts, "min-height: auto" means "min-height: 0"
// XXXdholbert For flex items, we should set |minHeight| to the
// -moz-min-content keyword, instead of 0, once we support -moz-min-content
// as a height value.
minHeight.SetCoordValue(0);
}
SetValueToCoord(val, minHeight, true,
SetValueToCoord(val, StylePosition()->mMinHeight, true,
&nsComputedDOMStyle::GetCBContentHeight);
return val;
}

View File

@ -6493,6 +6493,11 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
SETCOORD_LPOH | SETCOORD_INITIAL_NONE | SETCOORD_STORE_CALC,
aContext, mPresContext, canStoreInRuleTree);
// Make 'auto' values for min-height compute to 0
if (pos->mMinHeight.GetUnit() == eStyleUnit_Auto) {
pos->mMinHeight.SetCoordValue(0);
}
// box-sizing: enum, inherit, initial
SetDiscrete(*aRuleData->ValueForBoxSizing(),
pos->mBoxSizing, canStoreInRuleTree,

View File

@ -1080,7 +1080,7 @@ nsStylePosition::nsStylePosition(void)
mMinWidth.SetAutoValue();
mMaxWidth.SetNoneValue();
mHeight.SetAutoValue();
mMinHeight.SetAutoValue();
mMinHeight.SetCoordValue(0);
mMaxHeight.SetNoneValue();
#ifdef MOZ_FLEXBOX
mFlexBasis.SetAutoValue();

View File

@ -1132,13 +1132,7 @@ struct nsStylePosition {
// FIXME: We should probably change the assumption to be the other way
// around.
bool HeightDependsOnContainer() const
{
return mHeight.GetUnit() == eStyleUnit_Auto || // CSS 2.1, 10.6.4, item (5)
HeightCoordDependsOnContainer(mHeight);
}
// NOTE: The comment above MinWidthDependsOnContainer about flex items
// applies here, too.
{ return HeightCoordDependsOnContainer(mHeight); }
bool MinHeightDependsOnContainer() const
{ return HeightCoordDependsOnContainer(mMinHeight); }
bool MaxHeightDependsOnContainer() const
@ -1152,7 +1146,10 @@ struct nsStylePosition {
private:
static bool WidthCoordDependsOnContainer(const nsStyleCoord &aCoord);
static bool HeightCoordDependsOnContainer(const nsStyleCoord &aCoord)
{ return aCoord.HasPercent(); }
{
return aCoord.GetUnit() == eStyleUnit_Auto || // CSS 2.1, 10.6.4, item (5)
aCoord.HasPercent();
}
};
struct nsStyleTextOverflowSide {