From 6d64d2e559ba5cc3cd408b6de9d6aa95c2db304d Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Tue, 17 Apr 2001 14:58:34 +0000 Subject: [PATCH] bug 8113 - render a cell's background and border unless its content is empty and it has "empty-cells:hide" git-svn-id: svn://10.0.0.236/trunk@92564 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/html/table/src/nsTableCellFrame.cpp | 17 ++++++----------- mozilla/layout/tables/nsTableCellFrame.cpp | 17 ++++++----------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index c98d430345c..a74203acb0a 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -292,19 +292,14 @@ NS_METHOD nsTableCellFrame::Paint(nsIPresContext* aPresContext, GetStyleData(eStyleStruct_Table, ((const nsStyleStruct *&)cellTableStyle)); nsRect rect(0, 0, mRect.width, mRect.height); - // only non empty cells render their background - if (PR_FALSE == GetContentEmpty()) { + + // bug #8113 + // as of the CSS2-errata http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html + // always draw the background and border except when the cell is empty and 'empty-cells: hide' is set + if ( !(GetContentEmpty() && NS_STYLE_TABLE_EMPTY_CELLS_HIDE == cellTableStyle->mEmptyCells) ) { nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myColor, *myBorder, 0, 0); - } - - // empty cells do not render their border - PRBool renderBorder = PR_TRUE; - if (GetContentEmpty()) { - if (NS_STYLE_TABLE_EMPTY_CELLS_HIDE == cellTableStyle->mEmptyCells) - renderBorder=PR_FALSE; - } - if (renderBorder) { + PRIntn skipSides = GetSkipSides(); nsTableFrame* tableFrame = nsnull; // I should be checking my own style context, but border-collapse isn't inheriting correctly nsresult rv = nsTableFrame::GetTableFrame(this, tableFrame); diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index c98d430345c..a74203acb0a 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -292,19 +292,14 @@ NS_METHOD nsTableCellFrame::Paint(nsIPresContext* aPresContext, GetStyleData(eStyleStruct_Table, ((const nsStyleStruct *&)cellTableStyle)); nsRect rect(0, 0, mRect.width, mRect.height); - // only non empty cells render their background - if (PR_FALSE == GetContentEmpty()) { + + // bug #8113 + // as of the CSS2-errata http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html + // always draw the background and border except when the cell is empty and 'empty-cells: hide' is set + if ( !(GetContentEmpty() && NS_STYLE_TABLE_EMPTY_CELLS_HIDE == cellTableStyle->mEmptyCells) ) { nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myColor, *myBorder, 0, 0); - } - - // empty cells do not render their border - PRBool renderBorder = PR_TRUE; - if (GetContentEmpty()) { - if (NS_STYLE_TABLE_EMPTY_CELLS_HIDE == cellTableStyle->mEmptyCells) - renderBorder=PR_FALSE; - } - if (renderBorder) { + PRIntn skipSides = GetSkipSides(); nsTableFrame* tableFrame = nsnull; // I should be checking my own style context, but border-collapse isn't inheriting correctly nsresult rv = nsTableFrame::GetTableFrame(this, tableFrame);