This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
This test is checking that no zero length segments are removed when using arcTo and arc. The code for checking arc is: ctx.beginPath(); ctx.moveTo(50, 25); ctx.arc(50, 25, 10, 0, 0, false); ctx.stroke(); I think this should create a line from (50, 25) to the start of the arc, which in this case will be (60, 25): the center of the circle is (50, 25), the radius is 10 and the start angle is 0. I believe arc call should be changed to: ctx.arc(40, 25, 10, 0, 0, false);
Relevant section of the canvas spec: http://www.w3.org/TR/2dcontext/#dom-context-2d-arc
Any takers? Let me know if there is somewhere more appropriate I should log this.
The method is defined as only adding the straight line if the path already contains a subpath, which it doesn't in this case.
(In reply to comment #3) > The method is defined as only adding the straight line if the path already > contains a subpath, which it doesn't in this case. The moveTo call before the arc will create a sub path: http://www.w3.org/TR/2dcontext/#dom-context-2d-moveto "The moveTo(x, y) method must create a new subpath with the specified point as its first (and only) point." More code from the test is below. The sections with arcTo and arc are, I believe, intended to be equivalent. However as the arguments are treated slightly differently they are not. The first two arguments to arcTo describe a point on the arc. The first two arguments to arc describe the center of the arc. ctx.fillStyle = '#0f0'; ctx.fillRect(0, 0, 100, 50); ctx.strokeStyle = '#f00'; ctx.lineWidth = 100; ctx.lineCap = 'round'; ctx.lineJoin = 'round'; ctx.beginPath(); ctx.moveTo(50, 25); ctx.arcTo(50, 25, 150, 25, 10); ctx.stroke(); ctx.beginPath(); ctx.moveTo(50, 25); ctx.arc(50, 25, 10, 0, 0, false); ctx.stroke(); _assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
Created attachment 1174 [details] Fix on ctx.moveTo() Fix this issue as http://trac.webkit.org/browser/trunk/LayoutTests/canvas/philip/tests/2d.path.stroke.prune.arc.html
Please disregard comment 3, I was indeed incorrect.
I can confirm that that patch is correct per spec. (And Philip had already made that change in the unapproved version: http://dvcs.w3.org/hg/html/rev/f7e11f44274c)
Is it ok to apply zqzhang's patch on the approved test? Any objection?
Yes, please do.
Fixed at https://dvcs.w3.org/hg/html/rev/f64be2d08dcd