From 10035996a1b79a640ea17d1475033818ca8c2453 Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Sun, 28 Mar 1999 04:30:28 +0000 Subject: [PATCH] added transparent border support git-svn-id: svn://10.0.0.236/trunk@25345 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSRendering.cpp | 55 ++++++++++++------- .../layout/html/style/src/nsCSSRendering.cpp | 55 ++++++++++++------- 2 files changed, 68 insertions(+), 42 deletions(-) diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 1228586ca81..f767b811691 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -737,7 +737,11 @@ void nsCSSRendering::DrawDashedSides(PRIntn startSide, dashLength = DOT_LENGTH; } - aContext.SetColor(aSpacing.GetBorderColor(whichSide)); + nscolor sideColor; + if (! aSpacing.GetBorderColor(whichSide, sideColor)) { + continue; // side is transparent + } + aContext.SetColor(sideColor); switch (whichSide) { case NS_SIDE_LEFT: //XXX need to properly handle wrap around from last edge to first edge @@ -1392,33 +1396,42 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, aPresContext.GetPixelsToTwips(&p2t);/* XXX */ twipsPerPixel = (nscoord) p2t;/* XXX */ + nscolor sideColor; if (0 == (aSkipSides & (1<mBackgroundColor, inside,outside, - twipsPerPixel, aGap); + if (aBorderStyle.GetBorderColor(NS_SIDE_TOP, sideColor)) { + DrawSide(aRenderingContext, NS_SIDE_TOP, + aBorderStyle.GetBorderStyle(NS_SIDE_TOP), + sideColor, + bgColor->mBackgroundColor, inside,outside, + twipsPerPixel, aGap); + } } if (0 == (aSkipSides & (1<mBackgroundColor,inside, outside, - twipsPerPixel, aGap); + if (aBorderStyle.GetBorderColor(NS_SIDE_LEFT, sideColor)) { + DrawSide(aRenderingContext, NS_SIDE_LEFT, + aBorderStyle.GetBorderStyle(NS_SIDE_LEFT), + sideColor, + bgColor->mBackgroundColor,inside, outside, + twipsPerPixel, aGap); + } } if (0 == (aSkipSides & (1<mBackgroundColor,inside, outside, - twipsPerPixel, aGap); + if (aBorderStyle.GetBorderColor(NS_SIDE_BOTTOM, sideColor)) { + DrawSide(aRenderingContext, NS_SIDE_BOTTOM, + aBorderStyle.GetBorderStyle(NS_SIDE_BOTTOM), + sideColor, + bgColor->mBackgroundColor,inside, outside, + twipsPerPixel, aGap); + } } if (0 == (aSkipSides & (1<mBackgroundColor,inside, outside, - twipsPerPixel, aGap); + if (aBorderStyle.GetBorderColor(NS_SIDE_RIGHT, sideColor)) { + DrawSide(aRenderingContext, NS_SIDE_RIGHT, + aBorderStyle.GetBorderStyle(NS_SIDE_RIGHT), + sideColor, + bgColor->mBackgroundColor,inside, outside, + twipsPerPixel, aGap); + } } } diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index 1228586ca81..f767b811691 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -737,7 +737,11 @@ void nsCSSRendering::DrawDashedSides(PRIntn startSide, dashLength = DOT_LENGTH; } - aContext.SetColor(aSpacing.GetBorderColor(whichSide)); + nscolor sideColor; + if (! aSpacing.GetBorderColor(whichSide, sideColor)) { + continue; // side is transparent + } + aContext.SetColor(sideColor); switch (whichSide) { case NS_SIDE_LEFT: //XXX need to properly handle wrap around from last edge to first edge @@ -1392,33 +1396,42 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, aPresContext.GetPixelsToTwips(&p2t);/* XXX */ twipsPerPixel = (nscoord) p2t;/* XXX */ + nscolor sideColor; if (0 == (aSkipSides & (1<mBackgroundColor, inside,outside, - twipsPerPixel, aGap); + if (aBorderStyle.GetBorderColor(NS_SIDE_TOP, sideColor)) { + DrawSide(aRenderingContext, NS_SIDE_TOP, + aBorderStyle.GetBorderStyle(NS_SIDE_TOP), + sideColor, + bgColor->mBackgroundColor, inside,outside, + twipsPerPixel, aGap); + } } if (0 == (aSkipSides & (1<mBackgroundColor,inside, outside, - twipsPerPixel, aGap); + if (aBorderStyle.GetBorderColor(NS_SIDE_LEFT, sideColor)) { + DrawSide(aRenderingContext, NS_SIDE_LEFT, + aBorderStyle.GetBorderStyle(NS_SIDE_LEFT), + sideColor, + bgColor->mBackgroundColor,inside, outside, + twipsPerPixel, aGap); + } } if (0 == (aSkipSides & (1<mBackgroundColor,inside, outside, - twipsPerPixel, aGap); + if (aBorderStyle.GetBorderColor(NS_SIDE_BOTTOM, sideColor)) { + DrawSide(aRenderingContext, NS_SIDE_BOTTOM, + aBorderStyle.GetBorderStyle(NS_SIDE_BOTTOM), + sideColor, + bgColor->mBackgroundColor,inside, outside, + twipsPerPixel, aGap); + } } if (0 == (aSkipSides & (1<mBackgroundColor,inside, outside, - twipsPerPixel, aGap); + if (aBorderStyle.GetBorderColor(NS_SIDE_RIGHT, sideColor)) { + DrawSide(aRenderingContext, NS_SIDE_RIGHT, + aBorderStyle.GetBorderStyle(NS_SIDE_RIGHT), + sideColor, + bgColor->mBackgroundColor,inside, outside, + twipsPerPixel, aGap); + } } }