Bug 1149516 - Draw continuous stroke if stroke-dasharray = 0. r=jwatt, a=sledru
--- a/dom/svg/SVGContentUtils.cpp
+++ b/dom/svg/SVGContentUtils.cpp
@@ -139,19 +139,16 @@ GetStrokeDashData(SVGContentUtils::AutoS
}
// Stroking using dashes is much slower than stroking a continuous line
// (see bug 609361 comment 40), and much, much slower than not stroking the
// line at all. Here we check for cases when the dash pattern causes the
// stroke to essentially be continuous or to be nonexistent in which case
// we can avoid expensive stroking operations (the underlying platform
// graphics libraries don't seem to optimize for this).
- if (totalLengthOfDashes <= 0 && totalLengthOfGaps <= 0) {
- return eNoStroke;
- }
if (totalLengthOfGaps <= 0) {
return eContinuousStroke;
}
// We can only return eNoStroke if the value of stroke-linecap isn't
// adding caps to zero length dashes.
if (totalLengthOfDashes <= 0 &&
aStyleSVG->mStrokeLinecap == NS_STYLE_STROKE_LINECAP_BUTT) {
return eNoStroke;
--- a/layout/reftests/svg/stroke-linecap-round-w-zero-length-segs-01.svg
+++ b/layout/reftests/svg/stroke-linecap-round-w-zero-length-segs-01.svg
@@ -147,9 +147,15 @@ path.coverer {
<!-- Column 5: test stroke-dasharray -->
<g transform="translate(525,25)">
<circle cy="0" r="8"/>
<circle cy="40" r="8"/>
<circle cy="80" r="8"/>
<path class="circles-expected" d="M0,0v81" stroke-dasharray="0 40" />
</g>
+ <g transform="translate(575,25)">
+ <circle cy="0" r="8"/>
+ <circle cy="40" r="8"/>
+ <circle cy="80" r="8"/>
+ <path class="circles-expected" d="M0,0v81" stroke-dasharray="0" />
+ </g>
</svg>