[Webkit-unassigned] [Bug 66832] New: canvas/philip/tests/2d.path.stroke.prune.arc.html misinterprets pruning requirement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 23 18:06:01 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=66832

           Summary: canvas/philip/tests/2d.path.stroke.prune.arc.html
                    misinterprets pruning requirement
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Tools / Tests
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: tomz at codeaurora.org
            Blocks: 55696


Created an attachment (id=104950)
 --> (https://bugs.webkit.org/attachment.cgi?id=104950&action=review)
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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list