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
This commit is contained in:
karnaze%netscape.com
2001-04-17 14:58:34 +00:00
parent 1b3d508646
commit 6d64d2e559
2 changed files with 12 additions and 22 deletions

View File

@@ -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);

View File

@@ -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);