diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp
index a191d50ab0f..e5e1d506526 100644
--- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp
@@ -84,6 +84,7 @@ nsTableCellFrame::nsTableCellFrame()
SetNeedSpecialReflow(PR_FALSE);
SetHadSpecialReflow(PR_FALSE);
SetHasPctOverHeight(PR_FALSE);
+ SetNeedPass2Reflow(PR_TRUE);
#ifdef DEBUG_TABLE_REFLOW_TIMING
mTimer = new nsReflowTimer(this);
@@ -1120,6 +1121,14 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aReflowState, &aDesiredSize, aStatus);
#endif
+ if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) {
+ SetNeedPass2Reflow(PR_TRUE);
+ }
+ else if ((eReflowReason_Initial == aReflowState.reason) ||
+ (eReflowReason_Resize == aReflowState.reason)) {
+ SetNeedPass2Reflow(PR_FALSE);
+ }
+
return NS_OK;
}
diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.h b/mozilla/layout/html/table/src/nsTableCellFrame.h
index 5298561720c..e452dcb7599 100644
--- a/mozilla/layout/html/table/src/nsTableCellFrame.h
+++ b/mozilla/layout/html/table/src/nsTableCellFrame.h
@@ -55,6 +55,7 @@ class nsHTMLValue;
#define NS_TABLE_CELL_NEED_SPECIAL_REFLOW 0x40000000
#define NS_TABLE_CELL_HAD_SPECIAL_REFLOW 0x20000000
#define NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT 0x10000000
+#define NS_TABLE_CELL_NEED_PASS2_REFLOW 0x08000000
/**
* nsTableCellFrame
@@ -259,6 +260,9 @@ public:
PRBool HasPctOverHeight();
void SetHasPctOverHeight(PRBool aValue);
+ PRBool NeedPass2Reflow() const;
+ void SetNeedPass2Reflow(PRBool aValue);
+
nscoord GetLastBlockHeight();
void SetLastBlockHeight(nscoord aValue);
@@ -420,6 +424,21 @@ inline void nsTableCellFrame::SetHasPctOverHeight(PRBool aValue)
}
}
+inline PRBool nsTableCellFrame::NeedPass2Reflow() const
+{
+ return (mState & NS_TABLE_CELL_NEED_PASS2_REFLOW) ==
+ NS_TABLE_CELL_NEED_PASS2_REFLOW;
+}
+
+inline void nsTableCellFrame::SetNeedPass2Reflow(PRBool aValue)
+{
+ if (aValue) {
+ mState |= NS_TABLE_CELL_NEED_PASS2_REFLOW;
+ } else {
+ mState &= ~NS_TABLE_CELL_NEED_PASS2_REFLOW;
+ }
+}
+
inline nscoord nsTableCellFrame::GetLastBlockHeight()
{
return (nscoord)mBits.mLastBlockHeight;
diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.cpp b/mozilla/layout/html/table/src/nsTableRowFrame.cpp
index a37f9d45e38..1a22c1d069e 100644
--- a/mozilla/layout/html/table/src/nsTableRowFrame.cpp
+++ b/mozilla/layout/html/table/src/nsTableRowFrame.cpp
@@ -986,6 +986,8 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext,
(cellDesiredSize.width > cellFrame->GetPriorAvailWidth()) ||
(eReflowReason_StyleChange == aReflowState.reason) ||
isPaginated ||
+ (cellFrame->NeedPass2Reflow() &&
+ NS_UNCONSTRAINEDSIZE != aReflowState.availableWidth) ||
(aReflowState.mFlags.mSpecialHeightReflow && cellFrame->NeedSpecialReflow()) ||
(!aReflowState.mFlags.mSpecialHeightReflow && cellFrame->HadSpecialReflow()) ||
HasPctHeight() ||
diff --git a/mozilla/layout/html/tests/table/bugs/bug141021.html b/mozilla/layout/html/tests/table/bugs/bug141021.html
new file mode 100644
index 00000000000..44bb9bccf42
--- /dev/null
+++ b/mozilla/layout/html/tests/table/bugs/bug141021.html
@@ -0,0 +1,36 @@
+
+ Bug 141021
+
+
+
+ |
+ foo
+ |
+
+
+
+
+
+
+
+
+ |
+ In Office-Dateien steckt mehr als nur der reine
+ Dokumenteninhalt. Wer Daten austauscht, kann so
+ unwissentlich heikle Zusatzinformationen
+ weitergeben. Wir erklären, wie Sie das Risiko
+ minimieren.
+ |
+
+
+
+ foo
+ |
+
+
+
+ |
+
+
+
+
\ No newline at end of file
diff --git a/mozilla/layout/html/tests/table/bugs/bug141021.js b/mozilla/layout/html/tests/table/bugs/bug141021.js
new file mode 100644
index 00000000000..97fc627ad07
--- /dev/null
+++ b/mozilla/layout/html/tests/table/bugs/bug141021.js
@@ -0,0 +1 @@
+document.write('foo');
diff --git a/mozilla/layout/html/tests/table/bugs/file_list2.txt b/mozilla/layout/html/tests/table/bugs/file_list2.txt
index 3e31cc38923..d7528bfd165 100644
--- a/mozilla/layout/html/tests/table/bugs/file_list2.txt
+++ b/mozilla/layout/html/tests/table/bugs/file_list2.txt
@@ -1,5 +1,6 @@
file:///s|/mozilla/layout/html/tests/table/bugs/bug14007-1.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug14007-2.html
+file:///s|/mozilla/layout/html/tests/table/bugs/bug141021.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug14159-1.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug14159-2.html
file:///s|/mozilla/layout/html/tests/table/bugs/bug14159-3.html