diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp
index 5a3e6e3b4e3..7ef9cdf207e 100644
--- a/mozilla/layout/html/table/src/nsTableFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableFrame.cpp
@@ -4249,6 +4249,13 @@ void nsTableFrame::DistributeSpaceToRows(nsIPresContext& aPresContext,
y += excessForRow+rowRect.height;
aExcessForRowGroup += excessForRow;
}
+ else
+ {
+ nsRect rowRect;
+ rowFrame->GetRect(rowRect);
+ y += rowRect.height;
+ }
+
rowFrame = iter.Next();
}
nsRect rowGroupRect;
@@ -4261,6 +4268,27 @@ void nsTableFrame::DistributeSpaceToRows(nsIPresContext& aPresContext,
DistributeSpaceToCells(aPresContext, aReflowState, aRowGroupFrame);
}
+NS_IMETHODIMP nsTableFrame::GetTableSpecifiedHeight(nscoord& aResult, const nsHTMLReflowState& aReflowState)
+{
+ const nsStylePosition* tablePosition;
+ GetStyleData(eStyleStruct_Position, (const nsStyleStruct *&)tablePosition);
+
+ const nsStyleTable* tableStyle;
+ GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
+ nscoord tableSpecifiedHeight=-1;
+ if (eStyleUnit_Coord == tablePosition->mHeight.GetUnit())
+ tableSpecifiedHeight = tablePosition->mHeight.GetCoordValue();
+ else if (eStyleUnit_Percent == tablePosition->mHeight.GetUnit())
+ {
+ float percent = tablePosition->mHeight.GetPercentValue();
+ nscoord parentHeight = GetEffectiveContainerHeight(aReflowState);
+ if (NS_UNCONSTRAINEDSIZE!=parentHeight && 0!=parentHeight)
+ tableSpecifiedHeight = NSToCoordRound((float)parentHeight * percent);
+ }
+ aResult = tableSpecifiedHeight;
+ return NS_OK;
+}
+
nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState,
nscoord aDefaultHeight)
diff --git a/mozilla/layout/html/table/src/nsTableFrame.h b/mozilla/layout/html/table/src/nsTableFrame.h
index 1e08e82200d..aebe2b8a602 100644
--- a/mozilla/layout/html/table/src/nsTableFrame.h
+++ b/mozilla/layout/html/table/src/nsTableFrame.h
@@ -453,6 +453,9 @@ public:
nsReflowReason aReason,
PRBool aDoSiblings);
+ NS_IMETHOD GetTableSpecifiedHeight(nscoord& aHeight, const nsHTMLReflowState& aReflowState);
+
+
protected:
/** second pass of ResizeReflow.
* lays out all table content with aMaxSize(computed_table_width, given_table_height)
diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp
index 5fe32fec1ef..3e4c747de2f 100644
--- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp
@@ -1023,6 +1023,9 @@ nsTableRowGroupFrame::Reflow(nsIPresContext& aPresContext,
else if (tableFrame == nsnull)
return NS_ERROR_NULL_POINTER;
+ nscoord tableSpecifiedHeight;
+ tableFrame->GetTableSpecifiedHeight(tableSpecifiedHeight, aReflowState);
+
RowGroupReflowState state(aPresContext, aReflowState, tableFrame);
if (eReflowReason_Incremental == aReflowState.reason) {