Bug 785754. Fix handling of max-height for frame classes that still seem to think that the mComputedMinHeight/mComputedMaxHeight of a reflow state are border-box heights, not content-box heights. r=mats
This commit is contained in:
@@ -226,23 +226,24 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
aDesiredSize.width = aReflowState.ComputedWidth();
|
||||
|
||||
// If computed use the computed value.
|
||||
if (aReflowState.ComputedHeight() != NS_INTRINSICSIZE)
|
||||
if (aReflowState.ComputedHeight() != NS_INTRINSICSIZE) {
|
||||
aDesiredSize.height = aReflowState.ComputedHeight();
|
||||
else
|
||||
} else {
|
||||
aDesiredSize.height += focusPadding.TopBottom();
|
||||
|
||||
|
||||
// Make sure we obey min/max-height in the case when we're doing intrinsic
|
||||
// sizing (we get it for free when we have a non-intrinsic
|
||||
// aReflowState.ComputedHeight()). Note that we do this before adjusting
|
||||
// for borderpadding, since mComputedMaxHeight and mComputedMinHeight are
|
||||
// content heights.
|
||||
aDesiredSize.height = NS_CSS_MINMAX(aDesiredSize.height,
|
||||
aReflowState.mComputedMinHeight,
|
||||
aReflowState.mComputedMaxHeight);
|
||||
}
|
||||
|
||||
aDesiredSize.width += aReflowState.mComputedBorderPadding.LeftRight();
|
||||
aDesiredSize.height += aReflowState.mComputedBorderPadding.TopBottom();
|
||||
|
||||
// Make sure we obey min/max-height. Note that we do this after adjusting
|
||||
// for borderpadding, since buttons have border-box sizing...
|
||||
|
||||
// XXXbz unless someone overrides that, of course! We should really consider
|
||||
// exposing nsHTMLReflowState::AdjustComputed* or something.
|
||||
aDesiredSize.height = NS_CSS_MINMAX(aDesiredSize.height,
|
||||
aReflowState.mComputedMinHeight,
|
||||
aReflowState.mComputedMaxHeight);
|
||||
|
||||
aDesiredSize.ascent +=
|
||||
aReflowState.mComputedBorderPadding.top + focusPadding.top;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user