From 76cf6abfab45a996cdfe7584838d02a3f8d2f8dd Mon Sep 17 00:00:00 2001 From: "bmlk%gmx.de" Date: Tue, 23 Dec 2003 07:22:16 +0000 Subject: [PATCH] tables can be used as rectangular items without content, bug 227123 r/sr=bzbarsky --- layout/html/table/src/nsTableFrame.cpp | 9 ++++++++- layout/tables/nsTableFrame.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/layout/html/table/src/nsTableFrame.cpp b/layout/html/table/src/nsTableFrame.cpp index b2d20186eb20..43b99a231c63 100644 --- a/layout/html/table/src/nsTableFrame.cpp +++ b/layout/html/table/src/nsTableFrame.cpp @@ -3441,7 +3441,14 @@ nsTableFrame::CalcDesiredHeight(nsIPresContext* aPresContext, nsAutoVoidArray rowGroups; PRUint32 numRowGroups; OrderRowGroups(rowGroups, numRowGroups, nsnull); - if (numRowGroups <= 0) return 0; + if (numRowGroups <= 0) { + // tables can be used as rectangular items without content + nscoord tableSpecifiedHeight = CalcBorderBoxHeight(aPresContext, aReflowState); + if ((NS_UNCONSTRAINEDSIZE != tableSpecifiedHeight) && + (tableSpecifiedHeight > 0)) + return tableSpecifiedHeight; + return 0; + } nscoord desiredHeight = borderPadding.top + cellSpacingY + borderPadding.bottom; for (PRUint32 rgX = 0; rgX < numRowGroups; rgX++) { diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index b2d20186eb20..43b99a231c63 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -3441,7 +3441,14 @@ nsTableFrame::CalcDesiredHeight(nsIPresContext* aPresContext, nsAutoVoidArray rowGroups; PRUint32 numRowGroups; OrderRowGroups(rowGroups, numRowGroups, nsnull); - if (numRowGroups <= 0) return 0; + if (numRowGroups <= 0) { + // tables can be used as rectangular items without content + nscoord tableSpecifiedHeight = CalcBorderBoxHeight(aPresContext, aReflowState); + if ((NS_UNCONSTRAINEDSIZE != tableSpecifiedHeight) && + (tableSpecifiedHeight > 0)) + return tableSpecifiedHeight; + return 0; + } nscoord desiredHeight = borderPadding.top + cellSpacingY + borderPadding.bottom; for (PRUint32 rgX = 0; rgX < numRowGroups; rgX++) {