diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 54b342ea476..dbc6ed9dd45 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -125,7 +125,7 @@ void nsCSSRendering::FillPolygon (nsIRenderingContext& aContext, */ nscolor nsCSSRendering::MakeBevelColor(PRIntn whichSide, PRUint8 style, nscolor aBackgroundColor, - nscolor aElementColor, + nscolor aBorderColor, PRBool printing,PRBool aSpecialCase) { @@ -144,7 +144,7 @@ nscolor nsCSSRendering::MakeBevelColor(PRIntn whichSide, PRUint8 style, // Given a background color and a border color // calculate the color used for the shading if(aSpecialCase) - NS_GetSpecial3DColors(colors, aBackgroundColor, aElementColor); + NS_GetSpecial3DColors(colors, aBackgroundColor, aBorderColor); else NS_Get3DColors(colors, aBackgroundColor); } @@ -360,7 +360,6 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, PRIntn whichSide, const PRUint8 borderStyle, const nscolor borderColor, - const nscolor aElementColor, const nscolor aBackgroundColor, const nsRect& borderOutside, const nsRect& borderInside, @@ -389,7 +388,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, ((theStyle == NS_STYLE_BORDER_STYLE_RIDGE) ? NS_STYLE_BORDER_STYLE_GROOVE : NS_STYLE_BORDER_STYLE_RIDGE), - aBackgroundColor, aElementColor, + aBackgroundColor, theColor, printing, PR_TRUE)); if (2 == np) { //aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y); @@ -401,7 +400,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, BORDER_OUTSIDE, 0.5f, twipsPerPixel); aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor, - aElementColor, printing, PR_TRUE)); + theColor, printing, PR_TRUE)); if (2 == np) { //aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y); DrawLine (aContext, theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y, aGap); @@ -451,7 +450,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, BORDER_FULL, 1.0f, twipsPerPixel); aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor, - aElementColor,printing, PR_FALSE)); + theColor,printing, PR_FALSE)); if (2 == np) { //aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y); DrawLine (aContext, theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y, aGap); @@ -465,7 +464,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, BORDER_FULL, 1.0f, twipsPerPixel); aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor, - aElementColor,printing, PR_TRUE)); + theColor,printing, PR_TRUE)); if (2 == np) { //aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y); DrawLine (aContext, theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y, aGap); @@ -1368,7 +1367,6 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, PRIntn cnt; nsMargin border; PRBool printing = nsGlobalVariables::Instance()->GetPrinting(&aPresContext); - const nsStyleColor* elemColor = (const nsStyleColor*)aStyleContext->GetStyleData(eStyleStruct_Color); const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); aBorderStyle.CalcBorderFor(aForFrame, border); @@ -1406,29 +1404,29 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, DrawSide(aRenderingContext, NS_SIDE_TOP, aBorderStyle.GetBorderStyle(NS_SIDE_TOP), aBorderStyle.GetBorderColor(NS_SIDE_TOP), - elemColor->mColor, bgColor->mBackgroundColor, - inside,outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor, inside,outside, + printing,twipsPerPixel, aGap); } if (0 == (aSkipSides & (1<mColor, bgColor->mBackgroundColor, - inside, outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor,inside, outside, + printing,twipsPerPixel, aGap); } if (0 == (aSkipSides & (1<mColor, bgColor->mBackgroundColor, - inside, outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor,inside, outside, + printing,twipsPerPixel, aGap); } if (0 == (aSkipSides & (1<mColor, bgColor->mBackgroundColor, - inside, outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor,inside, outside, + printing,twipsPerPixel, aGap); } } @@ -1452,7 +1450,6 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, PRIntn aSkipSides, nsRect* aGap) { - const nsStyleColor* elemColor = (const nsStyleColor*)aStyleContext->GetStyleData(eStyleStruct_Color); const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); PRBool printing = nsGlobalVariables::Instance()->GetPrinting(&aPresContext); @@ -1494,8 +1491,9 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, DrawSide(aRenderingContext, NS_SIDE_TOP, borderEdge->mStyle, borderEdge->mColor, - elemColor->mColor, bgColor->mBackgroundColor, - inside, outside,printing, twipsPerPixel, aGap); + bgColor->mBackgroundColor, + inside, outside,printing, + twipsPerPixel, aGap); } } if (0 == (aSkipSides & (1<mStyle, borderEdge->mColor, - elemColor->mColor, bgColor->mBackgroundColor, - inside, outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor, + inside, outside, printing, + twipsPerPixel, aGap); } } if (0 == (aSkipSides & (1<mStyle, borderEdge->mColor, - elemColor->mColor, bgColor->mBackgroundColor, - inside, outside,printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor, + inside, outside,printing, + twipsPerPixel, aGap); } } if (0 == (aSkipSides & (1<mStyle, borderEdge->mColor, - elemColor->mColor, bgColor->mBackgroundColor, - inside, outside,printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor, + inside, outside,printing, + twipsPerPixel, aGap); } } } diff --git a/mozilla/layout/base/nsCSSRendering.h b/mozilla/layout/base/nsCSSRendering.h index 8ecc59bd73e..3e643aef8bb 100644 --- a/mozilla/layout/base/nsCSSRendering.h +++ b/mozilla/layout/base/nsCSSRendering.h @@ -110,7 +110,7 @@ public: protected: static nscolor MakeBevelColor(PRIntn whichSide, PRUint8 style, nscolor aBackgroundColor, - nscolor aElementColor, + nscolor aBorderColor, PRBool printing,PRBool aSpecialCase); static PRIntn MakeSide(nsPoint aPoints[], @@ -134,8 +134,7 @@ protected: PRIntn whichSide, const PRUint8 borderStyle, const nscolor borderColor, - const nscolor aElementColor, - const nscolor aBackgroundColor, + const nscolor aBackgroundColor, const nsRect& borderOutside, const nsRect& borderInside, PRBool printing, diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index 54b342ea476..dbc6ed9dd45 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -125,7 +125,7 @@ void nsCSSRendering::FillPolygon (nsIRenderingContext& aContext, */ nscolor nsCSSRendering::MakeBevelColor(PRIntn whichSide, PRUint8 style, nscolor aBackgroundColor, - nscolor aElementColor, + nscolor aBorderColor, PRBool printing,PRBool aSpecialCase) { @@ -144,7 +144,7 @@ nscolor nsCSSRendering::MakeBevelColor(PRIntn whichSide, PRUint8 style, // Given a background color and a border color // calculate the color used for the shading if(aSpecialCase) - NS_GetSpecial3DColors(colors, aBackgroundColor, aElementColor); + NS_GetSpecial3DColors(colors, aBackgroundColor, aBorderColor); else NS_Get3DColors(colors, aBackgroundColor); } @@ -360,7 +360,6 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, PRIntn whichSide, const PRUint8 borderStyle, const nscolor borderColor, - const nscolor aElementColor, const nscolor aBackgroundColor, const nsRect& borderOutside, const nsRect& borderInside, @@ -389,7 +388,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, ((theStyle == NS_STYLE_BORDER_STYLE_RIDGE) ? NS_STYLE_BORDER_STYLE_GROOVE : NS_STYLE_BORDER_STYLE_RIDGE), - aBackgroundColor, aElementColor, + aBackgroundColor, theColor, printing, PR_TRUE)); if (2 == np) { //aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y); @@ -401,7 +400,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, BORDER_OUTSIDE, 0.5f, twipsPerPixel); aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor, - aElementColor, printing, PR_TRUE)); + theColor, printing, PR_TRUE)); if (2 == np) { //aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y); DrawLine (aContext, theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y, aGap); @@ -451,7 +450,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, BORDER_FULL, 1.0f, twipsPerPixel); aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor, - aElementColor,printing, PR_FALSE)); + theColor,printing, PR_FALSE)); if (2 == np) { //aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y); DrawLine (aContext, theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y, aGap); @@ -465,7 +464,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext, np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, BORDER_FULL, 1.0f, twipsPerPixel); aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor, - aElementColor,printing, PR_TRUE)); + theColor,printing, PR_TRUE)); if (2 == np) { //aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y); DrawLine (aContext, theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y, aGap); @@ -1368,7 +1367,6 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, PRIntn cnt; nsMargin border; PRBool printing = nsGlobalVariables::Instance()->GetPrinting(&aPresContext); - const nsStyleColor* elemColor = (const nsStyleColor*)aStyleContext->GetStyleData(eStyleStruct_Color); const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); aBorderStyle.CalcBorderFor(aForFrame, border); @@ -1406,29 +1404,29 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, DrawSide(aRenderingContext, NS_SIDE_TOP, aBorderStyle.GetBorderStyle(NS_SIDE_TOP), aBorderStyle.GetBorderColor(NS_SIDE_TOP), - elemColor->mColor, bgColor->mBackgroundColor, - inside,outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor, inside,outside, + printing,twipsPerPixel, aGap); } if (0 == (aSkipSides & (1<mColor, bgColor->mBackgroundColor, - inside, outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor,inside, outside, + printing,twipsPerPixel, aGap); } if (0 == (aSkipSides & (1<mColor, bgColor->mBackgroundColor, - inside, outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor,inside, outside, + printing,twipsPerPixel, aGap); } if (0 == (aSkipSides & (1<mColor, bgColor->mBackgroundColor, - inside, outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor,inside, outside, + printing,twipsPerPixel, aGap); } } @@ -1452,7 +1450,6 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, PRIntn aSkipSides, nsRect* aGap) { - const nsStyleColor* elemColor = (const nsStyleColor*)aStyleContext->GetStyleData(eStyleStruct_Color); const nsStyleColor* bgColor = nsStyleUtil::FindNonTransparentBackground(aStyleContext); PRBool printing = nsGlobalVariables::Instance()->GetPrinting(&aPresContext); @@ -1494,8 +1491,9 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, DrawSide(aRenderingContext, NS_SIDE_TOP, borderEdge->mStyle, borderEdge->mColor, - elemColor->mColor, bgColor->mBackgroundColor, - inside, outside,printing, twipsPerPixel, aGap); + bgColor->mBackgroundColor, + inside, outside,printing, + twipsPerPixel, aGap); } } if (0 == (aSkipSides & (1<mStyle, borderEdge->mColor, - elemColor->mColor, bgColor->mBackgroundColor, - inside, outside, printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor, + inside, outside, printing, + twipsPerPixel, aGap); } } if (0 == (aSkipSides & (1<mStyle, borderEdge->mColor, - elemColor->mColor, bgColor->mBackgroundColor, - inside, outside,printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor, + inside, outside,printing, + twipsPerPixel, aGap); } } if (0 == (aSkipSides & (1<mStyle, borderEdge->mColor, - elemColor->mColor, bgColor->mBackgroundColor, - inside, outside,printing,twipsPerPixel, aGap); + bgColor->mBackgroundColor, + inside, outside,printing, + twipsPerPixel, aGap); } } } diff --git a/mozilla/layout/html/style/src/nsCSSRendering.h b/mozilla/layout/html/style/src/nsCSSRendering.h index 8ecc59bd73e..3e643aef8bb 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.h +++ b/mozilla/layout/html/style/src/nsCSSRendering.h @@ -110,7 +110,7 @@ public: protected: static nscolor MakeBevelColor(PRIntn whichSide, PRUint8 style, nscolor aBackgroundColor, - nscolor aElementColor, + nscolor aBorderColor, PRBool printing,PRBool aSpecialCase); static PRIntn MakeSide(nsPoint aPoints[], @@ -134,8 +134,7 @@ protected: PRIntn whichSide, const PRUint8 borderStyle, const nscolor borderColor, - const nscolor aElementColor, - const nscolor aBackgroundColor, + const nscolor aBackgroundColor, const nsRect& borderOutside, const nsRect& borderInside, PRBool printing,