Created attachment 104950 [details] Demo of path pruning when arc length = 0 WebKit incorrectly prunes the path when it contains a 0 length arc, and the 2d.path.stroke.prune.arc test is expecting/enforcing that behavior. In addition to removing the 0 length arc, we are also removing the connecting line. From the spec, at http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#complex-shapes-%28paths%29 <quote> context.arc(x,y,radius,startAngle,endAngle[,anticlockwise]) adds points to the subpath such that the arc described by the arguments .../snip/... is added to the path, connected to the previous point by a straight line. : : : The arc(x, y, radius, startAngle, endAngle, anticlockwise) method draws an arc. If the context has any subpaths, then the method must add a straight line from the last point in the subpath to the start point of the arc. In any case, it must draw the arc between the start point of the arc and the end point of the arc, and add the start and end points of the arc to the subpath. The arc and its start and end points are defined as follows: : : : If the two points are the same, or if the radius is zero, then the arc is defined as being of zero length in both directions. : : : And then under general path stuff... "Zero-length line segments must be pruned before stroking a path. Empty subpaths must be ignored." </quote> Now consider the case of several arc calls. If you follow all of the steps and construct paths you construct a series of arcs with connecting lines. If we set one arc length to 0, the current interpretation (enforced by this test) has us removing the non-zero length connecting line also. That goes beyond what the spec says, and differs from the interpretation of all other tested browsers, including: IE, Firefox, and Opera. See the attached example. Problems with the current interpretation include: * Divergence from *all* other browser engines, * Divergence from how svg handles analogous paths * Divergence from WebKit's own handling of 0 length line segments created by lineTo. * Violates principle of least surprise. Behavior at arcLen == 0 differs (discontinuously) from behavior as arcLen approaches 0. We can fix the WebKit behavior under https://bugs.webkit.org/show_bug.cgi?id=55696, but this test will start failing.
Created attachment 105042 [details] Demo of path pruning compared to path when arc is not pruned
Fixed by patch for https://bugs.webkit.org/show_bug.cgi?id=55696.