mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
More nested row group work.
This commit is contained in:
parent
5853a4243b
commit
815e81f837
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user