b=23707. Made sure HR frame correctly computes max-element-size

when it has an 'auto' width
This commit is contained in:
troy%netscape.com 2000-01-12 04:52:19 +00:00
Родитель 244a57d9b2
Коммит 0cba827c69
3 изменённых файлов: 6 добавлений и 5 удалений

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

@ -230,9 +230,10 @@ HRuleFrame::Reflow(nsIPresContext* aPresContext,
if (nsnull != aDesiredSize.maxElementSize) {
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) {
if (eStyleUnit_Percent ==
aReflowState.mStylePosition->mWidth.GetUnit()) {
// When the HR is using a percentage width, make sure it
nsStyleUnit widthUnit = aReflowState.mStylePosition->mWidth.GetUnit();
if ((eStyleUnit_Percent == widthUnit) ||
(eStyleUnit_Auto == widthUnit)) {
// When the HR is using an 'auto' or percentage width, make sure it
// remains springy.
aDesiredSize.maxElementSize->width = onePixel;
}

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

@ -1278,7 +1278,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
// layout strategy will compute a different maximum content width than we
// computed for the initial reflow. That's because the table layout
// strategy doesn't check whether the cell is auto-width...
desiredSize.mMaximumWidth = desiredSize.width;
desiredSize.mMaximumWidth = PR_MIN(desiredSize.mMaximumWidth, desiredSize.width);
}
((nsTableCellFrame *)aNextFrame)->SetMaximumWidth(desiredSize.mMaximumWidth);
if (oldMaximumWidth != desiredSize.mMaximumWidth) {

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

@ -1278,7 +1278,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
// layout strategy will compute a different maximum content width than we
// computed for the initial reflow. That's because the table layout
// strategy doesn't check whether the cell is auto-width...
desiredSize.mMaximumWidth = desiredSize.width;
desiredSize.mMaximumWidth = PR_MIN(desiredSize.mMaximumWidth, desiredSize.width);
}
((nsTableCellFrame *)aNextFrame)->SetMaximumWidth(desiredSize.mMaximumWidth);
if (oldMaximumWidth != desiredSize.mMaximumWidth) {