diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp
index d35872870db..6a76a2de85d 100644
--- a/mozilla/layout/html/table/src/nsTableFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableFrame.cpp
@@ -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);
}
diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp
index 1bf004e4c03..561492ecd9a 100644
--- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp
@@ -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,
diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.h b/mozilla/layout/html/table/src/nsTableRowGroupFrame.h
index 31290a8b805..b8c97d50b43 100644
--- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.h
+++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.h
@@ -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 */
diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp
index d35872870db..6a76a2de85d 100644
--- a/mozilla/layout/tables/nsTableFrame.cpp
+++ b/mozilla/layout/tables/nsTableFrame.cpp
@@ -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);
}
diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp
index 1bf004e4c03..561492ecd9a 100644
--- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp
+++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp
@@ -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,
diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.h b/mozilla/layout/tables/nsTableRowGroupFrame.h
index 31290a8b805..b8c97d50b43 100644
--- a/mozilla/layout/tables/nsTableRowGroupFrame.h
+++ b/mozilla/layout/tables/nsTableRowGroupFrame.h
@@ -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 */