bug 28811, 29459, 32507 - added flag to reflow state to handle table cells.

changed table min and max width calculations to include percent and proportional cells.
Include border and padding in min table width calc.
This commit is contained in:
karnaze@netscape.com
2000-05-16 22:55:34 +00:00
parent 89b088a4e9
commit 8cd5df6549
7 changed files with 99 additions and 21 deletions

View File

@@ -1186,6 +1186,9 @@ nscoord BasicTableLayoutStrategy::GetTableMinWidth() const
for (PRInt32 colX = 0; colX < numCols; colX++) {
nsTableColFrame* colFrame = mTableFrame->GetColFrame(colX);
minWidth += PR_MAX(colFrame->GetMinWidth(), colFrame->GetWidth(MIN_ADJ));
if (mTableFrame->GetNumCellsOriginatingInCol(colX) > 0) {
minWidth += spacingX;
}
}
// if it is not a degenerate table, add the last spacing on the right
if (minWidth > 0) {
@@ -1201,10 +1204,17 @@ nscoord BasicTableLayoutStrategy::GetTableMaxWidth() const
nscoord maxWidth = 0;
for (PRInt32 colX = 0; colX < numCols; colX++) {
nsTableColFrame* colFrame = mTableFrame->GetColFrame(colX);
nscoord max = PR_MAX(colFrame->GetDesWidth(), colFrame->GetFixWidth());
max = PR_MAX(max, colFrame->GetPctWidth());
max = PR_MAX(max, colFrame->GetWidth(MIN_PRO));
maxWidth += max;
nscoord width = colFrame->GetPctWidth();
if (width <= 0) {
width = colFrame->GetFixWidth();
if (width <= 0) {
width = colFrame->GetWidth(MIN_PRO);
if (width <= 0) {
width = colFrame->GetDesWidth();
}
}
}
maxWidth += width;
if (mTableFrame->GetNumCellsOriginatingInCol(colX) > 0) {
maxWidth += spacingX;
}