work in progress for table visibility=collapse

This commit is contained in:
karnaze@netscape.com
1999-02-03 23:54:32 +00:00
parent 16f20e191e
commit 43ae593e7c
8 changed files with 64 additions and 6 deletions

View File

@@ -643,7 +643,8 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
{
const nsStyleDisplay *childDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
if ((NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay) &&
(NS_STYLE_VISIBILITY_COLLAPSE != childDisplay->mVisible))
{
// get the height of the tallest cell in the row (excluding cells that span rows)
nscoord maxCellHeight = ((nsTableRowFrame*)rowFrame)->GetTallestChild();
@@ -661,7 +662,7 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
}
// Get the next row
rowFrame->GetNextSibling(rowFrame);
}
}
/* Step 2: Now account for cells that span rows.
* A spanning cell's height is the sum of the heights of the rows it spans,
@@ -1030,6 +1031,16 @@ nsTableRowGroupFrame::Reflow(nsIPresContext& aPresContext,
}
}
// check the visibility in the final pass. If it is collapse, set our desired size to 0
if (nsTableFrame::IsFinalPass(aReflowState)) {
const nsStyleDisplay *display;
GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
if (NS_STYLE_VISIBILITY_COLLAPSE == display->mVisible) {
aDesiredSize.width = 0;
aDesiredSize.height = 0;
}
}
if (gsDebug==PR_TRUE)
{
if (nsnull!=aDesiredSize.maxElementSize)