diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp
index 96523b110dd..fc987a06449 100644
--- a/mozilla/layout/html/table/src/nsTableFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableFrame.cpp
@@ -2960,6 +2960,9 @@ NS_METHOD nsTableFrame::ReflowMappedChildren(nsIPresContext* aPresContext
// Reflow the child into the available space
nsHTMLReflowState kidReflowState(aPresContext, aReflowState.reflowState,
kidFrame, kidAvailSize, reason);
+ // XXX fix up bad mComputedWidth for scroll frame
+ kidReflowState.mComputedWidth = PR_MAX(kidReflowState.mComputedWidth, 0);
+
if (aReflowState.firstBodySection && (kidFrame != aReflowState.firstBodySection)) {
// If this isn't the first row group frame or the header or footer, then
// we can't be at the top of the page anymore...
diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp
index 6d943b95e04..502319a5782 100644
--- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp
@@ -1174,6 +1174,7 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
nsPoint innerOrigin(0,0);
nsMargin captionMargin(0,0,0,0);
+ nsSize captionSize(0,0);
nsSize containSize = GetContainingBlockSize(aOuterRS);
PRBool reflowedCaption = PR_FALSE;
// if there is a caption and the width or height of the inner table changed
@@ -1183,7 +1184,6 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
nsMargin ignorePadding;
// XXX only need to reflow if the caption is auto width
nsHTMLReflowMetrics captionMet(nsnull); // don't ask for MES, it hasn't changed
- nsSize captionSize;
nscoord availWidth = GetCaptionAvailWidth(aPresContext, mCaptionFrame, aOuterRS,
&innerSize.width, &innerMargin);
rv = OuterReflowChild(aPresContext, mCaptionFrame, aOuterRS, captionMet, &availWidth,
@@ -1202,7 +1202,7 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
}
else {
// reposition the caption frame if necessary and set the inner's origin
- nsSize captionSize = GetFrameSize(*mCaptionFrame);
+ captionSize = GetFrameSize(*mCaptionFrame);
nsPoint captionOrigin;
nsMargin captionPadding;
GetMarginPadding(aPresContext, aOuterRS, mCaptionFrame, captionMargin,
@@ -1214,6 +1214,10 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
MoveFrameTo(aPresContext, mCaptionFrame, captionOrigin.x, captionOrigin.y);
}
}
+ else {
+ GetInnerOrigin(aPresContext, captionSide, containSize, captionSize,
+ captionMargin, innerSize, innerMargin, innerOrigin);
+ }
FinishReflowChild(mInnerTableFrame, aPresContext, innerMet,
innerOrigin.x, innerOrigin.y, 0);
diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp
index 96523b110dd..fc987a06449 100644
--- a/mozilla/layout/tables/nsTableFrame.cpp
+++ b/mozilla/layout/tables/nsTableFrame.cpp
@@ -2960,6 +2960,9 @@ NS_METHOD nsTableFrame::ReflowMappedChildren(nsIPresContext* aPresContext
// Reflow the child into the available space
nsHTMLReflowState kidReflowState(aPresContext, aReflowState.reflowState,
kidFrame, kidAvailSize, reason);
+ // XXX fix up bad mComputedWidth for scroll frame
+ kidReflowState.mComputedWidth = PR_MAX(kidReflowState.mComputedWidth, 0);
+
if (aReflowState.firstBodySection && (kidFrame != aReflowState.firstBodySection)) {
// If this isn't the first row group frame or the header or footer, then
// we can't be at the top of the page anymore...
diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp
index 6d943b95e04..502319a5782 100644
--- a/mozilla/layout/tables/nsTableOuterFrame.cpp
+++ b/mozilla/layout/tables/nsTableOuterFrame.cpp
@@ -1174,6 +1174,7 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
nsPoint innerOrigin(0,0);
nsMargin captionMargin(0,0,0,0);
+ nsSize captionSize(0,0);
nsSize containSize = GetContainingBlockSize(aOuterRS);
PRBool reflowedCaption = PR_FALSE;
// if there is a caption and the width or height of the inner table changed
@@ -1183,7 +1184,6 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
nsMargin ignorePadding;
// XXX only need to reflow if the caption is auto width
nsHTMLReflowMetrics captionMet(nsnull); // don't ask for MES, it hasn't changed
- nsSize captionSize;
nscoord availWidth = GetCaptionAvailWidth(aPresContext, mCaptionFrame, aOuterRS,
&innerSize.width, &innerMargin);
rv = OuterReflowChild(aPresContext, mCaptionFrame, aOuterRS, captionMet, &availWidth,
@@ -1202,7 +1202,7 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
}
else {
// reposition the caption frame if necessary and set the inner's origin
- nsSize captionSize = GetFrameSize(*mCaptionFrame);
+ captionSize = GetFrameSize(*mCaptionFrame);
nsPoint captionOrigin;
nsMargin captionPadding;
GetMarginPadding(aPresContext, aOuterRS, mCaptionFrame, captionMargin,
@@ -1214,6 +1214,10 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
MoveFrameTo(aPresContext, mCaptionFrame, captionOrigin.x, captionOrigin.y);
}
}
+ else {
+ GetInnerOrigin(aPresContext, captionSide, containSize, captionSize,
+ captionMargin, innerSize, innerMargin, innerOrigin);
+ }
FinishReflowChild(mInnerTableFrame, aPresContext, innerMet,
innerOrigin.x, innerOrigin.y, 0);