Don't do arithmetic on NS_UNCONSTRAINEDSIZE. But 371348, r+sr=dbaron

This commit is contained in:
bzbarsky@mit.edu
2007-02-25 21:29:17 +00:00
parent bdef942e0f
commit f621efcb47

View File

@@ -1471,9 +1471,13 @@ nsHTMLReflowState::InitConstraints(nsPresContext* aPresContext,
mComputedWidth = availableWidth - mComputedBorderPadding.LeftRight();
if (mComputedWidth < 0)
mComputedWidth = 0;
mComputedHeight = availableHeight - mComputedBorderPadding.TopBottom();
if (mComputedHeight < 0)
mComputedHeight = 0;
if (availableHeight != NS_UNCONSTRAINEDSIZE) {
mComputedHeight = availableHeight - mComputedBorderPadding.TopBottom();
if (mComputedHeight < 0)
mComputedHeight = 0;
} else {
mComputedHeight = NS_UNCONSTRAINEDSIZE;
}
mComputedMinWidth = mComputedMinHeight = 0;
mComputedMaxWidth = mComputedMaxHeight = NS_UNCONSTRAINEDSIZE;