From 1a959d659adf4e8a3b6cd553f8f79f2ad32aa62a Mon Sep 17 00:00:00 2001 From: buster Date: Mon, 13 Jul 1998 20:41:38 +0000 Subject: [PATCH] for Nav compatibility, 0-width cells do not have insets git-svn-id: svn://10.0.0.236/trunk@5411 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/html/table/src/BasicTableLayoutStrategy.cpp | 2 +- mozilla/layout/html/table/src/nsTableCellFrame.cpp | 8 ++++++-- mozilla/layout/tables/BasicTableLayoutStrategy.cpp | 2 +- mozilla/layout/tables/nsTableCellFrame.cpp | 8 ++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp index 34be3091e71..16da2e777ae 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -30,7 +30,7 @@ NS_DEF_PTR(nsIStyleContext); #ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; +static PRBool gsDebug = PR_TRUE; static PRBool gsDebugCLD = PR_FALSE; #else static const PRBool gsDebug = PR_FALSE; diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index bc83a182226..f579a668d5e 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -369,8 +369,12 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext, if (nsnull!=aDesiredSize.maxElementSize) { *aDesiredSize.maxElementSize = *pMaxElementSize; - aDesiredSize.maxElementSize->height += topInset + bottomInset; - aDesiredSize.maxElementSize->width += leftInset + rightInset; + // NAV4 compatibility: only add insets if cell content was not 0 min height + if (0!=pMaxElementSize->height) + aDesiredSize.maxElementSize->height += topInset + bottomInset; + // NAV4 compatibility: only add insets if cell content was not 0 min width + if (0!=pMaxElementSize->width) + aDesiredSize.maxElementSize->width += leftInset + rightInset; } SetDesiredSize(aDesiredSize); if (nsnull!=aDesiredSize.maxElementSize) diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp index 34be3091e71..16da2e777ae 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp @@ -30,7 +30,7 @@ NS_DEF_PTR(nsIStyleContext); #ifdef NS_DEBUG -static PRBool gsDebug = PR_FALSE; +static PRBool gsDebug = PR_TRUE; static PRBool gsDebugCLD = PR_FALSE; #else static const PRBool gsDebug = PR_FALSE; diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index bc83a182226..f579a668d5e 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -369,8 +369,12 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext, if (nsnull!=aDesiredSize.maxElementSize) { *aDesiredSize.maxElementSize = *pMaxElementSize; - aDesiredSize.maxElementSize->height += topInset + bottomInset; - aDesiredSize.maxElementSize->width += leftInset + rightInset; + // NAV4 compatibility: only add insets if cell content was not 0 min height + if (0!=pMaxElementSize->height) + aDesiredSize.maxElementSize->height += topInset + bottomInset; + // NAV4 compatibility: only add insets if cell content was not 0 min width + if (0!=pMaxElementSize->width) + aDesiredSize.maxElementSize->width += leftInset + rightInset; } SetDesiredSize(aDesiredSize); if (nsnull!=aDesiredSize.maxElementSize)