Back out a38f82d29d97 (bug 652914) for causing reftest failures.

This commit is contained in:
Timothy Nikkel 2011-09-06 15:19:31 -05:00
parent d50edc2277
commit a14c147d1b
3 changed files with 28 additions and 20 deletions

View File

@ -1700,12 +1700,12 @@ DrawBackgroundColor(BackgroundClipState& aClipState, gfxContext *aCtx,
aCtx->Restore();
}
nscolor
nsCSSRendering::DetermineBackgroundColor(nsPresContext* aPresContext,
nsStyleContext* aStyleContext,
nsIFrame* aFrame,
PRBool& aDrawBackgroundImage,
PRBool& aDrawBackgroundColor)
static nscolor
DetermineBackgroundColorInternal(nsPresContext* aPresContext,
nsStyleContext* aStyleContext,
nsIFrame* aFrame,
PRBool& aDrawBackgroundImage,
PRBool& aDrawBackgroundColor)
{
aDrawBackgroundImage = PR_TRUE;
aDrawBackgroundColor = PR_TRUE;
@ -1737,6 +1737,20 @@ nsCSSRendering::DetermineBackgroundColor(nsPresContext* aPresContext,
return bgColor;
}
nscolor
nsCSSRendering::DetermineBackgroundColor(nsPresContext* aPresContext,
nsStyleContext* aStyleContext,
nsIFrame* aFrame)
{
PRBool drawBackgroundImage;
PRBool drawBackgroundColor;
return DetermineBackgroundColorInternal(aPresContext,
aStyleContext,
aFrame,
drawBackgroundImage,
drawBackgroundColor);
}
static gfxFloat
ConvertGradientValueToPixels(const nsStyleCoord& aCoord,
gfxFloat aFillLength,
@ -2304,11 +2318,11 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
PRBool drawBackgroundImage;
PRBool drawBackgroundColor;
nscolor bgColor = DetermineBackgroundColor(aPresContext,
aBackgroundSC,
aForFrame,
drawBackgroundImage,
drawBackgroundColor);
nscolor bgColor = DetermineBackgroundColorInternal(aPresContext,
aBackgroundSC,
aForFrame,
drawBackgroundImage,
drawBackgroundColor);
// At this point, drawBackgroundImage and drawBackgroundColor are
// true if and only if we are actually supposed to paint an image or

View File

@ -211,9 +211,7 @@ struct nsCSSRendering {
static nscolor
DetermineBackgroundColor(nsPresContext* aPresContext,
nsStyleContext* aStyleContext,
nsIFrame* aFrame,
PRBool& aDrawBackgroundImage,
PRBool& aDrawBackgroundColor);
nsIFrame* aFrame);
/**
* Render the background for an element using css rendering rules

View File

@ -5846,14 +5846,10 @@ void PresShell::UpdateCanvasBackground()
// style frame but we don't have access to the canvasframe here. It isn't
// a problem because only a few frames can return something other than true
// and none of them would be a canvas frame or root element style frame.
PRBool drawBackgroundImage;
PRBool drawBackgroundColor;
mCanvasBackgroundColor =
nsCSSRendering::DetermineBackgroundColor(mPresContext, bgStyle,
rootStyleFrame,
drawBackgroundImage,
drawBackgroundColor);
if (drawBackgroundColor && GetPresContext()->IsRootContentDocument() &&
rootStyleFrame);
if (GetPresContext()->IsRootContentDocument() &&
!IsTransparentContainerElement(mPresContext)) {
mCanvasBackgroundColor =
NS_ComposeColors(mPresContext->DefaultBackgroundColor(), mCanvasBackgroundColor);