From e10cb148c5684b99e7286c36bd4bed06be44ca70 Mon Sep 17 00:00:00 2001 From: "attinasi%netscape.com" Date: Thu, 10 Feb 2000 19:22:00 +0000 Subject: [PATCH] PaintBorder and RenderSide now tell the StyleUtil function FindNonTransparentBackground to use the parent of the context to find the bgcolor in Quirks mode. r=karnaze b=8524 git-svn-id: svn://10.0.0.236/trunk@60329 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSRendering.cpp | 12 +++++++++--- mozilla/layout/html/style/src/nsCSSRendering.cpp | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index ba09a700f5c..c0de0e44a9e 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -1372,10 +1372,16 @@ void nsCSSRendering::PaintBorder(nsIPresContext* aPresContext, { PRIntn cnt; nsMargin border; -const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); nsStyleCoord bordStyleRadius[4]; PRInt16 borderRadii[4],i; float percent; +nsCompatibility compatMode; +aPresContext->GetCompatibilityMode(&compatMode); +// in NavQuirks mode we want to use the parent's context as a starting point +// for determining the background color +const nsStyleColor* bgColor = + nsStyleUtil::FindNonTransparentBackground(aStyleContext, + compatMode == eCompatibility_NavQuirks ? PR_TRUE : PR_FALSE); if (aHardBorderSize > 0) { border.SizeTo(aHardBorderSize, aHardBorderSize, aHardBorderSize, aHardBorderSize); @@ -2592,7 +2598,7 @@ PRInt16 thickness; case NS_STYLE_BORDER_STYLE_OUTSET: case NS_STYLE_BORDER_STYLE_INSET: { - const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); + const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); aBorderStyle.GetBorderColor(aSide,sideColor); aRenderingContext.SetColor ( MakeBevelColor (aSide, border_Style, bgColor->mBackgroundColor,sideColor, PR_TRUE)); } @@ -2637,7 +2643,7 @@ PRInt16 thickness; case NS_STYLE_BORDER_STYLE_RIDGE: case NS_STYLE_BORDER_STYLE_GROOVE: { - const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); + const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); aBorderStyle.GetBorderColor(aSide,sideColor); aRenderingContext.SetColor ( MakeBevelColor (aSide, border_Style, bgColor->mBackgroundColor,sideColor, PR_TRUE)); diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index ba09a700f5c..c0de0e44a9e 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -1372,10 +1372,16 @@ void nsCSSRendering::PaintBorder(nsIPresContext* aPresContext, { PRIntn cnt; nsMargin border; -const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); nsStyleCoord bordStyleRadius[4]; PRInt16 borderRadii[4],i; float percent; +nsCompatibility compatMode; +aPresContext->GetCompatibilityMode(&compatMode); +// in NavQuirks mode we want to use the parent's context as a starting point +// for determining the background color +const nsStyleColor* bgColor = + nsStyleUtil::FindNonTransparentBackground(aStyleContext, + compatMode == eCompatibility_NavQuirks ? PR_TRUE : PR_FALSE); if (aHardBorderSize > 0) { border.SizeTo(aHardBorderSize, aHardBorderSize, aHardBorderSize, aHardBorderSize); @@ -2592,7 +2598,7 @@ PRInt16 thickness; case NS_STYLE_BORDER_STYLE_OUTSET: case NS_STYLE_BORDER_STYLE_INSET: { - const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); + const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); aBorderStyle.GetBorderColor(aSide,sideColor); aRenderingContext.SetColor ( MakeBevelColor (aSide, border_Style, bgColor->mBackgroundColor,sideColor, PR_TRUE)); } @@ -2637,7 +2643,7 @@ PRInt16 thickness; case NS_STYLE_BORDER_STYLE_RIDGE: case NS_STYLE_BORDER_STYLE_GROOVE: { - const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); + const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); aBorderStyle.GetBorderColor(aSide,sideColor); aRenderingContext.SetColor ( MakeBevelColor (aSide, border_Style, bgColor->mBackgroundColor,sideColor, PR_TRUE));