diff --git a/mozilla/layout/html/table/src/nsCellMap.cpp b/mozilla/layout/html/table/src/nsCellMap.cpp
index 11ea1372da0..3098842597e 100644
--- a/mozilla/layout/html/table/src/nsCellMap.cpp
+++ b/mozilla/layout/html/table/src/nsCellMap.cpp
@@ -17,8 +17,7 @@
*/
#include "nsCRT.h"
#include "nsCellMap.h"
-#include "nsTablePart.h"
-#include /* XXX */ // for printf
+#include "nsTableFrame.h"
#ifdef NS_DEBUG
static PRBool gsDebug1 = PR_FALSE;
diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp
index 00676145a18..a66a2fcbe6c 100644
--- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp
@@ -60,6 +60,8 @@ nsTableCellFrame::nsTableCellFrame(nsIContent* aContent,
mColSpan=1;
mColIndex=0;
mPriorAvailWidth=0;
+ mPriorDesiredSize.width=0;
+ mPriorDesiredSize.height=0;
}
nsTableCellFrame::~nsTableCellFrame()
@@ -289,6 +291,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
mFirstChild->WillReflow(*aPresContext);
mFirstChild->MoveTo(leftInset, topInset);
aStatus = ReflowChild(mFirstChild, aPresContext, kidSize, kidReflowState);
+ SetPriorDesiredSize(kidSize);
if (PR_TRUE==gsDebug || PR_TRUE==gsDebugNT)
{
diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.h b/mozilla/layout/html/table/src/nsTableCellFrame.h
index 1d86f6be1c6..ecdf04fce00 100644
--- a/mozilla/layout/html/table/src/nsTableCellFrame.h
+++ b/mozilla/layout/html/table/src/nsTableCellFrame.h
@@ -84,6 +84,10 @@ public:
virtual void SetPriorAvailWidth(nscoord aPriorAvailWidth);
+ virtual nsSize GetPriorDesiredSize();
+
+ virtual void SetPriorDesiredSize(const nsReflowMetrics & aDesiredSize);
+
virtual ~nsTableCellFrame();
// Get the TableFrame that contains this cell frame
@@ -128,6 +132,8 @@ protected:
/** the available width we were given in our previous reflow */
nscoord mPriorAvailWidth;
+ nsSize mPriorDesiredSize;
+
nsCellLayoutData *mCellLayoutData;
};
@@ -169,4 +175,13 @@ inline nscoord nsTableCellFrame::GetPriorAvailWidth()
inline void nsTableCellFrame::SetPriorAvailWidth(nscoord aPriorAvailWidth)
{ mPriorAvailWidth = aPriorAvailWidth;}
+inline nsSize nsTableCellFrame::GetPriorDesiredSize()
+{ return mPriorDesiredSize; }
+
+inline void nsTableCellFrame::SetPriorDesiredSize(const nsReflowMetrics & aDesiredSize)
+{
+ mPriorDesiredSize.width = aDesiredSize.width;
+ mPriorDesiredSize.height = aDesiredSize.height;
+}
+
#endif
diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.cpp b/mozilla/layout/html/table/src/nsTableRowFrame.cpp
index eda17101fc1..c38c0fd6b9f 100644
--- a/mozilla/layout/html/table/src/nsTableRowFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableRowFrame.cpp
@@ -410,7 +410,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
// Compute the x-origin for the child, taking into account straddlers (cells from prior
// rows with rowspans > 1)
- nscoord x = 0;
+ nscoord x = kidMargin.left;
PRInt32 cellColIndex = ((nsTableCellFrame *)kidFrame)->GetColIndex();
for (PRInt32 colIndex=0; colIndexGetRect(cellRect);
- desiredSize.width = cellRect.width;
- desiredSize.height = cellRect.height;
+ nsSize priorSize = ((nsTableCellFrame *)kidFrame)->GetPriorDesiredSize();
+ desiredSize.width = priorSize.width;
+ desiredSize.height = priorSize.height;
status = NS_FRAME_COMPLETE; // XXX: in paginated world, this doesn't work!
}
diff --git a/mozilla/layout/tables/nsCellMap.cpp b/mozilla/layout/tables/nsCellMap.cpp
index 11ea1372da0..3098842597e 100644
--- a/mozilla/layout/tables/nsCellMap.cpp
+++ b/mozilla/layout/tables/nsCellMap.cpp
@@ -17,8 +17,7 @@
*/
#include "nsCRT.h"
#include "nsCellMap.h"
-#include "nsTablePart.h"
-#include /* XXX */ // for printf
+#include "nsTableFrame.h"
#ifdef NS_DEBUG
static PRBool gsDebug1 = PR_FALSE;
diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp
index 00676145a18..a66a2fcbe6c 100644
--- a/mozilla/layout/tables/nsTableCellFrame.cpp
+++ b/mozilla/layout/tables/nsTableCellFrame.cpp
@@ -60,6 +60,8 @@ nsTableCellFrame::nsTableCellFrame(nsIContent* aContent,
mColSpan=1;
mColIndex=0;
mPriorAvailWidth=0;
+ mPriorDesiredSize.width=0;
+ mPriorDesiredSize.height=0;
}
nsTableCellFrame::~nsTableCellFrame()
@@ -289,6 +291,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
mFirstChild->WillReflow(*aPresContext);
mFirstChild->MoveTo(leftInset, topInset);
aStatus = ReflowChild(mFirstChild, aPresContext, kidSize, kidReflowState);
+ SetPriorDesiredSize(kidSize);
if (PR_TRUE==gsDebug || PR_TRUE==gsDebugNT)
{
diff --git a/mozilla/layout/tables/nsTableCellFrame.h b/mozilla/layout/tables/nsTableCellFrame.h
index 1d86f6be1c6..ecdf04fce00 100644
--- a/mozilla/layout/tables/nsTableCellFrame.h
+++ b/mozilla/layout/tables/nsTableCellFrame.h
@@ -84,6 +84,10 @@ public:
virtual void SetPriorAvailWidth(nscoord aPriorAvailWidth);
+ virtual nsSize GetPriorDesiredSize();
+
+ virtual void SetPriorDesiredSize(const nsReflowMetrics & aDesiredSize);
+
virtual ~nsTableCellFrame();
// Get the TableFrame that contains this cell frame
@@ -128,6 +132,8 @@ protected:
/** the available width we were given in our previous reflow */
nscoord mPriorAvailWidth;
+ nsSize mPriorDesiredSize;
+
nsCellLayoutData *mCellLayoutData;
};
@@ -169,4 +175,13 @@ inline nscoord nsTableCellFrame::GetPriorAvailWidth()
inline void nsTableCellFrame::SetPriorAvailWidth(nscoord aPriorAvailWidth)
{ mPriorAvailWidth = aPriorAvailWidth;}
+inline nsSize nsTableCellFrame::GetPriorDesiredSize()
+{ return mPriorDesiredSize; }
+
+inline void nsTableCellFrame::SetPriorDesiredSize(const nsReflowMetrics & aDesiredSize)
+{
+ mPriorDesiredSize.width = aDesiredSize.width;
+ mPriorDesiredSize.height = aDesiredSize.height;
+}
+
#endif
diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp
index eda17101fc1..c38c0fd6b9f 100644
--- a/mozilla/layout/tables/nsTableRowFrame.cpp
+++ b/mozilla/layout/tables/nsTableRowFrame.cpp
@@ -410,7 +410,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
// Compute the x-origin for the child, taking into account straddlers (cells from prior
// rows with rowspans > 1)
- nscoord x = 0;
+ nscoord x = kidMargin.left;
PRInt32 cellColIndex = ((nsTableCellFrame *)kidFrame)->GetColIndex();
for (PRInt32 colIndex=0; colIndexGetRect(cellRect);
- desiredSize.width = cellRect.width;
- desiredSize.height = cellRect.height;
+ nsSize priorSize = ((nsTableCellFrame *)kidFrame)->GetPriorDesiredSize();
+ desiredSize.width = priorSize.width;
+ desiredSize.height = priorSize.height;
status = NS_FRAME_COMPLETE; // XXX: in paginated world, this doesn't work!
}