Fix nsLayoutUtils::ComputeSizeWithIntrinsicDimensions to produce correct results when one of the tentative height/width (i.e., the intrinsic height/width) is 0. (Bug 677091) r=roc

When either the intrinsic width or the intrinsic height is 0, the
element does not have an intrinsic ratio, and thus the table that
ComputeAutoSizeWithIntrinsicDimensions is implementing technically
doesn't apply.  However, it can quite straightforwardly produce the
correct results despite that, if we correctly apply the
min/max-width/height properties.
This commit is contained in:
L. David Baron 2011-08-17 17:54:59 -07:00
Родитель f96aaa3b4e
Коммит ef98f8f848
1 изменённых файлов: 2 добавлений и 4 удалений

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

@ -2762,8 +2762,7 @@ nsLayoutUtils::ComputeAutoSizeWithIntrinsicDimensions(nscoord minWidth, nscoord
if (heightAtMinWidth > maxHeight)
heightAtMinWidth = maxHeight;
} else {
heightAtMaxWidth = tentHeight;
heightAtMinWidth = tentHeight;
heightAtMaxWidth = heightAtMinWidth = NS_CSS_MINMAX(tentHeight, minHeight, maxHeight);
}
if (tentHeight > 0) {
@ -2774,8 +2773,7 @@ nsLayoutUtils::ComputeAutoSizeWithIntrinsicDimensions(nscoord minWidth, nscoord
if (widthAtMinHeight > maxWidth)
widthAtMinHeight = maxWidth;
} else {
widthAtMaxHeight = tentWidth;
widthAtMinHeight = tentWidth;
widthAtMaxHeight = widthAtMinHeight = NS_CSS_MINMAX(tentWidth, minWidth, maxWidth);
}
// The table at http://www.w3.org/TR/CSS21/visudet.html#min-max-widths :