diff --git a/mozilla/content/shared/public/nsCSSKeywordList.h b/mozilla/content/shared/public/nsCSSKeywordList.h index 139538b8839..91008cf4dff 100644 --- a/mozilla/content/shared/public/nsCSSKeywordList.h +++ b/mozilla/content/shared/public/nsCSSKeywordList.h @@ -330,6 +330,7 @@ CSS_KEY(semi-condensed, semi_condensed) CSS_KEY(semi-expanded, semi_expanded) CSS_KEY(separate, separate) CSS_KEY(show, show) +CSS_KEY(-moz-show-background, show_background) CSS_KEY(silent, silent) CSS_KEY(-moz-simp-chinese-formal, _moz_simp_chinese_formal) CSS_KEY(-moz-simp-chinese-informal, _moz_simp_chinese_informal) diff --git a/mozilla/content/shared/src/nsCSSProps.cpp b/mozilla/content/shared/src/nsCSSProps.cpp index 8bf38dcd2f3..87922b1b036 100644 --- a/mozilla/content/shared/src/nsCSSProps.cpp +++ b/mozilla/content/shared/src/nsCSSProps.cpp @@ -349,8 +349,9 @@ const PRInt32 nsCSSProps::kElevationKTable[] = { }; const PRInt32 nsCSSProps::kEmptyCellsKTable[] = { - eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW, - eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE, + eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW, + eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE, + eCSSKeyword_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND, -1,-1 }; diff --git a/mozilla/content/shared/src/nsStyleStruct.cpp b/mozilla/content/shared/src/nsStyleStruct.cpp index 276d114fc69..81f15c90aed 100644 --- a/mozilla/content/shared/src/nsStyleStruct.cpp +++ b/mozilla/content/shared/src/nsStyleStruct.cpp @@ -765,7 +765,7 @@ nsStyleTableBorder::nsStyleTableBorder(nsIPresContext* aPresContext) if (aPresContext) aPresContext->GetCompatibilityMode(&compatMode); mEmptyCells = (compatMode == eCompatibility_NavQuirks - ? NS_STYLE_TABLE_EMPTY_CELLS_HIDE // bug 33244 + ? NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND : NS_STYLE_TABLE_EMPTY_CELLS_SHOW); mCaptionSide = NS_SIDE_TOP; mBorderSpacingX.Reset(); diff --git a/mozilla/layout/base/nsStyleConsts.h b/mozilla/layout/base/nsStyleConsts.h index 39edb5ab114..e9d395d6673 100644 --- a/mozilla/layout/base/nsStyleConsts.h +++ b/mozilla/layout/base/nsStyleConsts.h @@ -582,8 +582,9 @@ #define NS_STYLE_TABLE_LAYOUT_AUTO 0 #define NS_STYLE_TABLE_LAYOUT_FIXED 1 -#define NS_STYLE_TABLE_EMPTY_CELLS_HIDE 0 -#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW 1 +#define NS_STYLE_TABLE_EMPTY_CELLS_HIDE 0 +#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW 1 +#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND 2 // CAPTION_SIDE uses NS_SIDE_* diff --git a/mozilla/layout/base/public/nsStyleConsts.h b/mozilla/layout/base/public/nsStyleConsts.h index 39edb5ab114..e9d395d6673 100644 --- a/mozilla/layout/base/public/nsStyleConsts.h +++ b/mozilla/layout/base/public/nsStyleConsts.h @@ -582,8 +582,9 @@ #define NS_STYLE_TABLE_LAYOUT_AUTO 0 #define NS_STYLE_TABLE_LAYOUT_FIXED 1 -#define NS_STYLE_TABLE_EMPTY_CELLS_HIDE 0 -#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW 1 +#define NS_STYLE_TABLE_EMPTY_CELLS_HIDE 0 +#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW 1 +#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND 2 // CAPTION_SIDE uses NS_SIDE_* diff --git a/mozilla/layout/html/document/src/quirk.css b/mozilla/layout/html/document/src/quirk.css index 2307a512b65..a7db7f5e751 100644 --- a/mozilla/layout/html/document/src/quirk.css +++ b/mozilla/layout/html/document/src/quirk.css @@ -111,9 +111,6 @@ table { td, th, tr { background: inherit; } -td, th { - empty-cells: show; -} /* Quirk: collapse top margin of BODY and TD and bottom margin of TD */ diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index 523dcb2637b..de86cd0129d 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -382,14 +382,16 @@ nsTableCellFrame::Paint(nsIPresContext* aPresContext, GetStyleData(eStyleStruct_TableBorder, ((const nsStyleStruct *&)cellTableStyle)); nsRect rect(0, 0, mRect.width, mRect.height); - - // 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) ) { + // draw the background except when the cell is empty and 'empty-cells: hide' is set + if (!GetContentEmpty() || + NS_STYLE_TABLE_EMPTY_CELLS_SHOW == cellTableStyle->mEmptyCells || + NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND == cellTableStyle->mEmptyCells) { nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myColor, *myBorder, 0, 0); - + } + // draw the border except when the cell is empty and 'empty-cells: hide || -moz-show-background' is set + if (!GetContentEmpty() || + NS_STYLE_TABLE_EMPTY_CELLS_SHOW == cellTableStyle->mEmptyCells) { 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/style/nsCSSKeywordList.h b/mozilla/layout/style/nsCSSKeywordList.h index 139538b8839..91008cf4dff 100644 --- a/mozilla/layout/style/nsCSSKeywordList.h +++ b/mozilla/layout/style/nsCSSKeywordList.h @@ -330,6 +330,7 @@ CSS_KEY(semi-condensed, semi_condensed) CSS_KEY(semi-expanded, semi_expanded) CSS_KEY(separate, separate) CSS_KEY(show, show) +CSS_KEY(-moz-show-background, show_background) CSS_KEY(silent, silent) CSS_KEY(-moz-simp-chinese-formal, _moz_simp_chinese_formal) CSS_KEY(-moz-simp-chinese-informal, _moz_simp_chinese_informal) diff --git a/mozilla/layout/style/nsCSSProps.cpp b/mozilla/layout/style/nsCSSProps.cpp index 8bf38dcd2f3..87922b1b036 100644 --- a/mozilla/layout/style/nsCSSProps.cpp +++ b/mozilla/layout/style/nsCSSProps.cpp @@ -349,8 +349,9 @@ const PRInt32 nsCSSProps::kElevationKTable[] = { }; const PRInt32 nsCSSProps::kEmptyCellsKTable[] = { - eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW, - eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE, + eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW, + eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE, + eCSSKeyword_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND, -1,-1 }; diff --git a/mozilla/layout/style/nsStyleStruct.cpp b/mozilla/layout/style/nsStyleStruct.cpp index 276d114fc69..81f15c90aed 100644 --- a/mozilla/layout/style/nsStyleStruct.cpp +++ b/mozilla/layout/style/nsStyleStruct.cpp @@ -765,7 +765,7 @@ nsStyleTableBorder::nsStyleTableBorder(nsIPresContext* aPresContext) if (aPresContext) aPresContext->GetCompatibilityMode(&compatMode); mEmptyCells = (compatMode == eCompatibility_NavQuirks - ? NS_STYLE_TABLE_EMPTY_CELLS_HIDE // bug 33244 + ? NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND : NS_STYLE_TABLE_EMPTY_CELLS_SHOW); mCaptionSide = NS_SIDE_TOP; mBorderSpacingX.Reset(); diff --git a/mozilla/layout/style/quirk.css b/mozilla/layout/style/quirk.css index 2307a512b65..a7db7f5e751 100644 --- a/mozilla/layout/style/quirk.css +++ b/mozilla/layout/style/quirk.css @@ -111,9 +111,6 @@ table { td, th, tr { background: inherit; } -td, th { - empty-cells: show; -} /* Quirk: collapse top margin of BODY and TD and bottom margin of TD */ diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index 523dcb2637b..de86cd0129d 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -382,14 +382,16 @@ nsTableCellFrame::Paint(nsIPresContext* aPresContext, GetStyleData(eStyleStruct_TableBorder, ((const nsStyleStruct *&)cellTableStyle)); nsRect rect(0, 0, mRect.width, mRect.height); - - // 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) ) { + // draw the background except when the cell is empty and 'empty-cells: hide' is set + if (!GetContentEmpty() || + NS_STYLE_TABLE_EMPTY_CELLS_SHOW == cellTableStyle->mEmptyCells || + NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND == cellTableStyle->mEmptyCells) { nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myColor, *myBorder, 0, 0); - + } + // draw the border except when the cell is empty and 'empty-cells: hide || -moz-show-background' is set + if (!GetContentEmpty() || + NS_STYLE_TABLE_EMPTY_CELLS_SHOW == cellTableStyle->mEmptyCells) { 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);