Only do special height reflows for percentage-height children of table cells when there is a specified height on the table, row group, row, or cell in the row. b=370525 Patch by Daniel Holbert <dholbert@mozilla.com>. r+sr=dbaron

This commit is contained in:
2007-06-25 13:34:35 -07:00
parent c643cbce57
commit 2c797744ca
29 changed files with 608 additions and 36 deletions

View File

@@ -1034,6 +1034,9 @@ nsTableRowFrame::Reflow(nsPresContext* aPresContext,
// see if a special height reflow needs to occur due to having a pct height
nsTableFrame::CheckRequestSpecialHeightReflow(aReflowState);
// See if we have a cell with specified/pct height
InitHasCellWithStyleHeight(tableFrame);
rv = ReflowChildren(aPresContext, aDesiredSize, aReflowState, *tableFrame,
aStatus);
@@ -1333,6 +1336,32 @@ void nsTableRowFrame::SetContinuousBCBorderWidth(PRUint8 aForSide,
}
}
/**
* Sets the NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT bit to indicate whether
* this row has any cells that have non-auto-height. (Row-spanning
* cells are ignored.)
*/
void nsTableRowFrame::InitHasCellWithStyleHeight(nsTableFrame* aTableFrame)
{
nsTableIterator iter(*this);
for (nsIFrame* kidFrame = iter.First(); kidFrame; kidFrame = iter.Next()) {
nsIAtom* frameType = kidFrame->GetType();
if (!IS_TABLE_CELL(frameType)) {
NS_NOTREACHED("Table row has a non-cell child.");
continue;
}
nsTableCellFrame* cellFrame = NS_STATIC_CAST(nsTableCellFrame*, kidFrame);
// Ignore row-spanning cells
if (aTableFrame->GetEffectiveRowSpan(*cellFrame) == 1 &&
cellFrame->GetStylePosition()->mHeight.GetUnit() != eStyleUnit_Auto) {
AddStateBits(NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT);
return;
}
}
RemoveStateBits(NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT);
}
/* ----- global methods ----- */
nsIFrame*