patch by fantasai - removing standard table background painting as our old quirks mode background

painting is now more CSS2 compliant (the w3c published a errata) bug 4510
r=karnaze sr=attinasi a=roc+moz


git-svn-id: svn://10.0.0.236/trunk@115144 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bernd.mielke%snafu.de 2002-02-21 05:36:16 +00:00
parent 26cb682311
commit 764a1f1e58
12 changed files with 64 additions and 208 deletions

View File

@ -197,6 +197,11 @@ table[rules] {
border: inherit;
-moz-opacity: inherit;
}
/* make sure backgrounds are inherited in tables -- see bug 4510*/
td, th, tr {
background: inherit;
}
/* caption inherits from table not table-outer */
caption {

View File

@ -107,10 +107,6 @@ table {
line-height: normal;
}
/* Quirk: make sure backgrounds are inherited in tables */
td, th, tr {
background: inherit;
}
/* Quirk: collapse top margin of BODY and TD and bottom margin of TD */

View File

@ -148,21 +148,9 @@ nsTableColFrame::Paint(nsIPresContext* aPresContext,
if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_FALSE, &isVisible)) && !isVisible) {
return NS_OK;
}
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_Standard == mode) {
const nsStyleVisibility* vis =
(const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if (vis->IsVisibleOrCollapsed()) {
const nsStyleBorder* border =
(const nsStyleBorder*)mStyleContext->GetStyleData(eStyleStruct_Border);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, rect, *border, 0, 0, PR_TRUE);
}
}
}
// Standards mode background painting removed. See bug 4510
return NS_OK;
}

View File

@ -410,21 +410,9 @@ nsTableColGroupFrame::Paint(nsIPresContext* aPresContext,
if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_FALSE, &isVisible)) && !isVisible) {
return NS_OK;
}
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_Standard == mode) {
const nsStyleVisibility* vis =
(const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if (vis->IsVisibleOrCollapsed()) {
const nsStyleBorder* border =
(const nsStyleBorder*)mStyleContext->GetStyleData(eStyleStruct_Border);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, rect, *border, 0, 0, PR_TRUE);
}
}
}
// Standards mode background painting removed. See bug 4510
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
return NS_OK;
}

View File

@ -584,22 +584,6 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext* aPresContext,
if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_FALSE, &isVisible)) && !isVisible) {
return NS_OK;
}
if ((NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) &&
!(aFlags && (NS_ROW_FRAME_PAINT_SKIP_ROW == aFlags))) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_Standard == mode) {
const nsStyleVisibility* vis =
(const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if (vis->IsVisibleOrCollapsed()) {
const nsStyleBorder* border =
(const nsStyleBorder*)mStyleContext->GetStyleData(eStyleStruct_Border);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, rect, *border, 0, 0, PR_TRUE);
}
}
}
#ifdef DEBUG
// for debug...
@ -608,19 +592,18 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
}
#endif
// Standards mode background painting removed. See bug 4510
if (!(aFlags && (NS_ROW_FRAME_PAINT_SKIP_CELLS == aFlags))) {
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
return NS_OK;

View File

@ -220,22 +220,6 @@ NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext* aPresContext,
return NS_OK;
}
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if ((NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) &&
(eCompatibility_Standard == mode)) {
const nsStyleVisibility* vis =
(const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if (vis->IsVisibleOrCollapsed()) {
const nsStyleBorder* border =
(const nsStyleBorder*)mStyleContext->GetStyleData(eStyleStruct_Border);
nsRect rect(0,0,mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, rect, *border, 0, 0, PR_TRUE);
}
}
#ifdef DEBUG
// for debug...
if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) && GetShowFrameBorders()) {
@ -243,34 +227,18 @@ NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
}
#endif
// Standards mode background painting removed. See bug 4510
if ((NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) &&
(eCompatibility_Standard == mode)) {
// paint the backgrouds of the rows, skipping the cells
nsIFrame* kid = mFrames.FirstChild();
while (kid) {
PaintChild(aPresContext, aRenderingContext, aDirtyRect, kid, aWhichLayer, NS_ROW_FRAME_PAINT_SKIP_CELLS);
kid->GetNextSibling(&kid);
}
// paint the backgrounds of the cells and their descendants, skipping the rows
kid = mFrames.FirstChild();
while (kid) {
PaintChild(aPresContext, aRenderingContext, aDirtyRect, kid, aWhichLayer, NS_ROW_FRAME_PAINT_SKIP_ROW);
kid->GetNextSibling(&kid);
}
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
else {
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
return NS_OK;
/*nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);*/

View File

@ -197,6 +197,11 @@ table[rules] {
border: inherit;
-moz-opacity: inherit;
}
/* make sure backgrounds are inherited in tables -- see bug 4510*/
td, th, tr {
background: inherit;
}
/* caption inherits from table not table-outer */
caption {

View File

@ -107,10 +107,6 @@ table {
line-height: normal;
}
/* Quirk: make sure backgrounds are inherited in tables */
td, th, tr {
background: inherit;
}
/* Quirk: collapse top margin of BODY and TD and bottom margin of TD */

View File

@ -148,21 +148,9 @@ nsTableColFrame::Paint(nsIPresContext* aPresContext,
if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_FALSE, &isVisible)) && !isVisible) {
return NS_OK;
}
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_Standard == mode) {
const nsStyleVisibility* vis =
(const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if (vis->IsVisibleOrCollapsed()) {
const nsStyleBorder* border =
(const nsStyleBorder*)mStyleContext->GetStyleData(eStyleStruct_Border);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, rect, *border, 0, 0, PR_TRUE);
}
}
}
// Standards mode background painting removed. See bug 4510
return NS_OK;
}

View File

@ -410,21 +410,9 @@ nsTableColGroupFrame::Paint(nsIPresContext* aPresContext,
if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_FALSE, &isVisible)) && !isVisible) {
return NS_OK;
}
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_Standard == mode) {
const nsStyleVisibility* vis =
(const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if (vis->IsVisibleOrCollapsed()) {
const nsStyleBorder* border =
(const nsStyleBorder*)mStyleContext->GetStyleData(eStyleStruct_Border);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, rect, *border, 0, 0, PR_TRUE);
}
}
}
// Standards mode background painting removed. See bug 4510
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
return NS_OK;
}

View File

@ -584,22 +584,6 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext* aPresContext,
if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_FALSE, &isVisible)) && !isVisible) {
return NS_OK;
}
if ((NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) &&
!(aFlags && (NS_ROW_FRAME_PAINT_SKIP_ROW == aFlags))) {
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if (eCompatibility_Standard == mode) {
const nsStyleVisibility* vis =
(const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if (vis->IsVisibleOrCollapsed()) {
const nsStyleBorder* border =
(const nsStyleBorder*)mStyleContext->GetStyleData(eStyleStruct_Border);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, rect, *border, 0, 0, PR_TRUE);
}
}
}
#ifdef DEBUG
// for debug...
@ -608,19 +592,18 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
}
#endif
// Standards mode background painting removed. See bug 4510
if (!(aFlags && (NS_ROW_FRAME_PAINT_SKIP_CELLS == aFlags))) {
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
return NS_OK;

View File

@ -220,22 +220,6 @@ NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext* aPresContext,
return NS_OK;
}
nsCompatibility mode;
aPresContext->GetCompatibilityMode(&mode);
if ((NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) &&
(eCompatibility_Standard == mode)) {
const nsStyleVisibility* vis =
(const nsStyleVisibility*)mStyleContext->GetStyleData(eStyleStruct_Visibility);
if (vis->IsVisibleOrCollapsed()) {
const nsStyleBorder* border =
(const nsStyleBorder*)mStyleContext->GetStyleData(eStyleStruct_Border);
nsRect rect(0,0,mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, rect, *border, 0, 0, PR_TRUE);
}
}
#ifdef DEBUG
// for debug...
if ((NS_FRAME_PAINT_LAYER_DEBUG == aWhichLayer) && GetShowFrameBorders()) {
@ -243,34 +227,18 @@ NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
}
#endif
// Standards mode background painting removed. See bug 4510
if ((NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) &&
(eCompatibility_Standard == mode)) {
// paint the backgrouds of the rows, skipping the cells
nsIFrame* kid = mFrames.FirstChild();
while (kid) {
PaintChild(aPresContext, aRenderingContext, aDirtyRect, kid, aWhichLayer, NS_ROW_FRAME_PAINT_SKIP_CELLS);
kid->GetNextSibling(&kid);
}
// paint the backgrounds of the cells and their descendants, skipping the rows
kid = mFrames.FirstChild();
while (kid) {
PaintChild(aPresContext, aRenderingContext, aDirtyRect, kid, aWhichLayer, NS_ROW_FRAME_PAINT_SKIP_ROW);
kid->GetNextSibling(&kid);
}
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
else {
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
return NS_OK;
/*nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);*/