This commit is contained in:
hyatt%netscape.com 1999-06-14 08:22:47 +00:00
Родитель 7f5d322554
Коммит cd319bb4eb
6 изменённых файлов: 66 добавлений и 32 удалений

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

@ -4236,22 +4236,8 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowGroupDisplay));
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{ // the rows in rowGroupFrame need to be expanded by rowHeightDelta[i]
// and the rowgroup itself needs to be expanded by SUM(row height deltas)
nsIFrame * rowFrame=nsnull;
rv = rowGroupFrame->FirstChild(nsnull, &rowFrame);
while ((NS_SUCCEEDED(rv)) && (nsnull!=rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{ // the row needs to be expanded by the proportion this row contributed to the original height
nsRect rowRect;
rowFrame->GetRect(rowRect);
sumOfRowHeights += rowRect.height;
}
rowFrame->GetNextSibling(&rowFrame);
}
{
((nsTableRowGroupFrame*)rowGroupFrame)->GetHeightOfRows(sumOfRowHeights);
}
rowGroupFrame->GetNextSibling(&rowGroupFrame);
}

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

@ -1294,6 +1294,31 @@ PRBool nsTableRowGroupFrame::NoRowsFollow()
return result;
}
NS_METHOD nsTableRowGroupFrame::GetHeightOfRows(nscoord& aResult)
{
// the rows in rowGroupFrame need to be expanded by rowHeightDelta[i]
// and the rowgroup itself needs to be expanded by SUM(row height deltas)
nsIFrame * rowFrame=nsnull;
nsresult rv = FirstChild(nsnull, &rowFrame);
while ((NS_SUCCEEDED(rv)) && (nsnull!=rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{
nsRect rowRect;
rowFrame->GetRect(rowRect);
aResult += rowRect.height;
}
else if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == rowDisplay->mDisplay)
{
((nsTableRowGroupFrame*)rowFrame)->GetHeightOfRows(aResult);
}
rowFrame->GetNextSibling(&rowFrame);
}
return NS_OK;
}
// since we know we're doing an append here, we can optimize
NS_METHOD nsTableRowGroupFrame::IR_RowAppended(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,

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

@ -123,6 +123,12 @@ public:
*/
nsresult InitRepeatedFrame(nsTableRowGroupFrame* aHeaderFooterFrame);
/**
* Get the total height of all the row rects
*/
NS_METHOD GetHeightOfRows(nscoord& aResult);
protected:
/** implement abstract method on nsHTMLContainerFrame */

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

@ -4236,22 +4236,8 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
const nsStyleDisplay *rowGroupDisplay;
rowGroupFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowGroupDisplay));
if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay))
{ // the rows in rowGroupFrame need to be expanded by rowHeightDelta[i]
// and the rowgroup itself needs to be expanded by SUM(row height deltas)
nsIFrame * rowFrame=nsnull;
rv = rowGroupFrame->FirstChild(nsnull, &rowFrame);
while ((NS_SUCCEEDED(rv)) && (nsnull!=rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{ // the row needs to be expanded by the proportion this row contributed to the original height
nsRect rowRect;
rowFrame->GetRect(rowRect);
sumOfRowHeights += rowRect.height;
}
rowFrame->GetNextSibling(&rowFrame);
}
{
((nsTableRowGroupFrame*)rowGroupFrame)->GetHeightOfRows(sumOfRowHeights);
}
rowGroupFrame->GetNextSibling(&rowGroupFrame);
}

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

@ -1294,6 +1294,31 @@ PRBool nsTableRowGroupFrame::NoRowsFollow()
return result;
}
NS_METHOD nsTableRowGroupFrame::GetHeightOfRows(nscoord& aResult)
{
// the rows in rowGroupFrame need to be expanded by rowHeightDelta[i]
// and the rowgroup itself needs to be expanded by SUM(row height deltas)
nsIFrame * rowFrame=nsnull;
nsresult rv = FirstChild(nsnull, &rowFrame);
while ((NS_SUCCEEDED(rv)) && (nsnull!=rowFrame))
{
const nsStyleDisplay *rowDisplay;
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)rowDisplay));
if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay)
{
nsRect rowRect;
rowFrame->GetRect(rowRect);
aResult += rowRect.height;
}
else if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == rowDisplay->mDisplay)
{
((nsTableRowGroupFrame*)rowFrame)->GetHeightOfRows(aResult);
}
rowFrame->GetNextSibling(&rowFrame);
}
return NS_OK;
}
// since we know we're doing an append here, we can optimize
NS_METHOD nsTableRowGroupFrame::IR_RowAppended(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,

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

@ -123,6 +123,12 @@ public:
*/
nsresult InitRepeatedFrame(nsTableRowGroupFrame* aHeaderFooterFrame);
/**
* Get the total height of all the row rects
*/
NS_METHOD GetHeightOfRows(nscoord& aResult);
protected:
/** implement abstract method on nsHTMLContainerFrame */