Bug 828246 - Prevent stroke from drawing, on SVG text with a stroke-width of 0. r=dholbert

This commit is contained in:
Robert Longson 2013-01-11 22:08:37 +00:00
parent 4bdff069b2
commit 6d76cd33e9
4 changed files with 17 additions and 8 deletions

View File

@ -292,6 +292,7 @@ fuzzy-if(cocoaWidget&&layersGPUAccelerated,1,3) == text-layout-06.svg text-layou
== text-style-01d.svg text-style-01-ref.svg
== text-style-01e.svg text-style-01-ref.svg
== thin-stroke-01.svg pass.svg
== zero-stroke-01.svg pass.svg
== tspan-dxdy-01.svg tspan-dxdy-ref.svg
== tspan-dxdy-02.svg tspan-dxdy-ref.svg
== tspan-dxdy-03.svg tspan-dxdy-ref.svg

View File

@ -0,0 +1,12 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Testcase for stroke-width="0"</title>
<rect width="100%" height="100%" fill="lime"/>
<text font-size="50" fill="lime" x="100" y="100" stroke="red" stroke-width="0">should not see this</text>
</svg>

After

Width:  |  Height:  |  Size: 379 B

View File

@ -966,12 +966,11 @@ nsSVGGlyphFrame::SetupCairoStroke(gfxContext *aContext,
gfxTextObjectPaint *aOuterObjectPaint,
SVGTextObjectPaint *aThisObjectPaint)
{
const nsStyleSVG *style = GetStyleSVG();
if (style->mStroke.mType == eStyleSVGPaintType_None) {
aThisObjectPaint->SetStrokeOpacity(0.0f);
if (!nsSVGUtils::HasStroke(this, aOuterObjectPaint)) {
return false;
}
const nsStyleSVG *style = GetStyleSVG();
nsSVGUtils::SetupCairoStrokeHitGeometry(this, aContext, aOuterObjectPaint);
float opacity = nsSVGUtils::GetOpacity(style->mStrokeOpacitySource,
style->mStrokeOpacity,

View File

@ -595,11 +595,8 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext)
gfx->Fill();
}
if (nsSVGUtils::HasStroke(this, objectPaint)) {
nsSVGUtils::SetupCairoStrokeHitGeometry(this, gfx, objectPaint);
if (nsSVGUtils::SetupCairoStrokePaint(this, gfx, objectPaint)) {
gfx->Stroke();
}
if (nsSVGUtils::SetupCairoStroke(this, gfx, objectPaint)) {
gfx->Stroke();
}
gfx->NewPath();