Bug 1149516 - Draw continuous stroke if stroke-dasharray = 0. r=jwatt, a=sledru
authorRobert Longson <longsonr@gmail.com>
Fri, 03 Apr 2015 18:58:05 +0100
changeset 258372 1dc6d70e9022
parent 258371 ac9862939f3e
child 258373 58b20f079d4f
push id4654
push userryanvm@gmail.com
push date2015-04-08 19:02 +0000
treeherdermozilla-beta@01cf08a90d44 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, sledru
bugs1149516
milestone38.0
Bug 1149516 - Draw continuous stroke if stroke-dasharray = 0. r=jwatt, a=sledru
dom/svg/SVGContentUtils.cpp
layout/reftests/svg/stroke-linecap-round-w-zero-length-segs-01.svg
--- 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>