Bug 434733: Don't apply width on colgroups to columns that have their own width. r=dbaron

This commit is contained in:
Makoto Kato
2009-08-01 08:53:40 -07:00
parent 53dc5ba228
commit 13484c5fe3
6 changed files with 62 additions and 8 deletions

View File

@@ -273,14 +273,18 @@ BasicTableLayoutStrategy::ComputeColumnIntrinsicWidths(nsIRenderingContext* aRen
// Consider the widths on the column-group. Note that we follow
// what the HTML spec says here, and make the width apply to
// each column in the group, not the group as a whole.
// XXX Should we be doing this when we have widths on the column?
NS_ASSERTION(colFrame->GetParent()->GetType() ==
nsGkAtoms::tableColGroupFrame,
"expected a column-group");
colInfo = GetColWidthInfo(aRenderingContext, colFrame->GetParent());
colFrame->AddCoords(colInfo.minCoord, colInfo.prefCoord,
colInfo.hasSpecifiedWidth);
colFrame->AddPrefPercent(colInfo.prefPercent);
// If column has width, column-group doesn't override width.
if (colInfo.minCoord == 0 && colInfo.prefCoord == 0 &&
colInfo.prefPercent == 0.0f) {
NS_ASSERTION(colFrame->GetParent()->GetType() ==
nsGkAtoms::tableColGroupFrame,
"expected a column-group");
colInfo = GetColWidthInfo(aRenderingContext, colFrame->GetParent());
colFrame->AddCoords(colInfo.minCoord, colInfo.prefCoord,
colInfo.hasSpecifiedWidth);
colFrame->AddPrefPercent(colInfo.prefPercent);
}
// Consider the contents of and the widths on the cells without
// colspans.