diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp
index bebe80dd74f..12419e671ec 100644
--- a/mozilla/layout/html/table/src/nsTableFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableFrame.cpp
@@ -3894,11 +3894,14 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext
NS_ASSERTION(mCellMap, "never ever call me until the cell map is built!");
nscoord result = aDefaultHeight;
- nscoord tableSpecifiedHeight;
+ const nsStyleTable* tableStyle;
+ GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
+ nscoord tableSpecifiedHeight=-1;
GetTableSpecifiedHeight(tableSpecifiedHeight, aReflowState);
- if (-1 != tableSpecifiedHeight) {
- if (tableSpecifiedHeight > aDefaultHeight) {
- // proportionately distribute the excess height to each row
+ if (-1!=tableSpecifiedHeight)
+ {
+ if (tableSpecifiedHeight>aDefaultHeight)
+ { // proportionately distribute the excess height to each row
result = tableSpecifiedHeight;
nscoord excess = tableSpecifiedHeight - aDefaultHeight;
nscoord sumOfRowHeights = 0;
@@ -4940,6 +4943,12 @@ PRBool nsTableFrame::TableIsAutoWidth(nsTableFrame *aTableFrame,
const nsHTMLReflowState& aReflowState,
nscoord& aSpecifiedTableWidth)
{
+ if (aReflowState.mComputedWidth > 0 &&
+ aReflowState.mComputedWidth != NS_UNCONSTRAINEDSIZE) {
+ aSpecifiedTableWidth = aReflowState.mComputedWidth;
+ return PR_FALSE;
+ }
+
NS_ASSERTION(nsnull != aTableStyle, "bad arg - aTableStyle");
PRBool result = PR_TRUE; // the default
if (aTableStyle) {
diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp
index ce87c805bd9..040401fa1df 100644
--- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp
@@ -915,6 +915,9 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
// First reflow the inner table
nsHTMLReflowState innerReflowState(aPresContext, aReflowState, mInnerTableFrame,
nsSize(tableWidth, aReflowState.availableHeight));
+ innerReflowState.mComputedWidth = aReflowState.mComputedWidth;
+ innerReflowState.mComputedHeight = aReflowState.mComputedHeight;
+
nsHTMLReflowMetrics innerSize(aDesiredSize.maxElementSize);
rv = ReflowChild(mInnerTableFrame, aPresContext, innerSize, innerReflowState, aStatus);
diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp
index bebe80dd74f..12419e671ec 100644
--- a/mozilla/layout/tables/nsTableFrame.cpp
+++ b/mozilla/layout/tables/nsTableFrame.cpp
@@ -3894,11 +3894,14 @@ nscoord nsTableFrame::ComputeDesiredHeight(nsIPresContext& aPresContext
NS_ASSERTION(mCellMap, "never ever call me until the cell map is built!");
nscoord result = aDefaultHeight;
- nscoord tableSpecifiedHeight;
+ const nsStyleTable* tableStyle;
+ GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
+ nscoord tableSpecifiedHeight=-1;
GetTableSpecifiedHeight(tableSpecifiedHeight, aReflowState);
- if (-1 != tableSpecifiedHeight) {
- if (tableSpecifiedHeight > aDefaultHeight) {
- // proportionately distribute the excess height to each row
+ if (-1!=tableSpecifiedHeight)
+ {
+ if (tableSpecifiedHeight>aDefaultHeight)
+ { // proportionately distribute the excess height to each row
result = tableSpecifiedHeight;
nscoord excess = tableSpecifiedHeight - aDefaultHeight;
nscoord sumOfRowHeights = 0;
@@ -4940,6 +4943,12 @@ PRBool nsTableFrame::TableIsAutoWidth(nsTableFrame *aTableFrame,
const nsHTMLReflowState& aReflowState,
nscoord& aSpecifiedTableWidth)
{
+ if (aReflowState.mComputedWidth > 0 &&
+ aReflowState.mComputedWidth != NS_UNCONSTRAINEDSIZE) {
+ aSpecifiedTableWidth = aReflowState.mComputedWidth;
+ return PR_FALSE;
+ }
+
NS_ASSERTION(nsnull != aTableStyle, "bad arg - aTableStyle");
PRBool result = PR_TRUE; // the default
if (aTableStyle) {
diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp
index ce87c805bd9..040401fa1df 100644
--- a/mozilla/layout/tables/nsTableOuterFrame.cpp
+++ b/mozilla/layout/tables/nsTableOuterFrame.cpp
@@ -915,6 +915,9 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
// First reflow the inner table
nsHTMLReflowState innerReflowState(aPresContext, aReflowState, mInnerTableFrame,
nsSize(tableWidth, aReflowState.availableHeight));
+ innerReflowState.mComputedWidth = aReflowState.mComputedWidth;
+ innerReflowState.mComputedHeight = aReflowState.mComputedHeight;
+
nsHTMLReflowMetrics innerSize(aDesiredSize.maxElementSize);
rv = ReflowChild(mInnerTableFrame, aPresContext, innerSize, innerReflowState, aStatus);