mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 368840 - Ensure gradients without stops are transparent rather than the fallback colour. r+sr=tor,a1.9=mtschrep
This commit is contained in:
parent
b4a426f21e
commit
babfdc0aaa
@ -328,19 +328,21 @@ nsSVGGradientFrame::SetupPaintServer(gfxContext *aContext,
|
||||
nsSVGGeometryFrame *aSource,
|
||||
float aGraphicOpacity)
|
||||
{
|
||||
PRUint32 nStops = GetStopCount();
|
||||
|
||||
// SVG specification says that no stops should be treated like
|
||||
// the corresponding fill or stroke had "none" specified.
|
||||
if (nStops == 0)
|
||||
return PR_FALSE;
|
||||
|
||||
// Get the transform list (if there is one)
|
||||
gfxMatrix patternMatrix = GetGradientTransform(aSource);
|
||||
|
||||
if (patternMatrix.IsSingular())
|
||||
return PR_FALSE;
|
||||
|
||||
PRUint32 nStops = GetStopCount();
|
||||
|
||||
// SVG specification says that no stops should be treated like
|
||||
// the corresponding fill or stroke had "none" specified.
|
||||
if (nStops == 0) {
|
||||
aContext->SetColor(gfxRGBA(0, 0, 0, 0));
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
patternMatrix.Invert();
|
||||
|
||||
nsRefPtr<gfxPattern> gradient = CreateGradient();
|
||||
|
@ -835,8 +835,10 @@ nsSVGPatternFrame::SetupPaintServer(gfxContext *aContext,
|
||||
nsSVGGeometryFrame *aSource,
|
||||
float aGraphicOpacity)
|
||||
{
|
||||
if (aGraphicOpacity == 0.0f)
|
||||
return PR_FALSE;
|
||||
if (aGraphicOpacity == 0.0f) {
|
||||
aContext->SetColor(gfxRGBA(0, 0, 0, 0));
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
gfxMatrix matrix = aContext->CurrentMatrix();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user