WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
66832
LayoutTests/canvas/philip/tests/2d.path.stroke.prune.arc.html misinterprets pruning requirement
https://bugs.webkit.org/show_bug.cgi?id=66832
Summary
LayoutTests/canvas/philip/tests/2d.path.stroke.prune.arc.html misinterprets p...
Tom Zakrajsek
Reported
2011-08-23 18:06:01 PDT
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.
Attachments
Demo of path pruning when arc length = 0
(416 bytes, text/html)
2011-08-23 18:06 PDT
,
Tom Zakrajsek
no flags
Details
Demo of path pruning compared to path when arc is not pruned
(610 bytes, text/html)
2011-08-24 12:28 PDT
,
Tom Zakrajsek
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Tom Zakrajsek
Comment 1
2011-08-24 12:28:16 PDT
Created
attachment 105042
[details]
Demo of path pruning compared to path when arc is not pruned
Tom Zakrajsek
Comment 2
2011-08-29 11:20:53 PDT
Fixed by patch for
https://bugs.webkit.org/show_bug.cgi?id=55696
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug