<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>14421</bug_id>
          
          <creation_ts>2011-10-11 05:52:25 +0000</creation_ts>
          <short_desc>Possible error in canvas Philip test 2d.path.stroke.prune.arc</short_desc>
          <delta_ts>2012-08-15 12:36:20 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>testsuite</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ben Wells">benwells</reporter>
          <assigned_to name="zqzhang">zhiqiang.zhang</assigned_to>
          <cc>bugs</cc>
    
    <cc>excors</cc>
    
    <cc>ian</cc>
    
    <cc>jorritv</cc>
    
    <cc>mike</cc>
    
    <cc>mikelawther</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>noel.gordon</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>tmpsantos</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>58034</commentid>
    <comment_count>0</comment_count>
    <who name="Ben Wells">benwells</who>
    <bug_when>2011-10-11 05:52:25 +0000</bug_when>
    <thetext>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);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58035</commentid>
    <comment_count>1</comment_count>
    <who name="Ben Wells">benwells</who>
    <bug_when>2011-10-11 05:54:16 +0000</bug_when>
    <thetext>Relevant section of the canvas spec: http://www.w3.org/TR/2dcontext/#dom-context-2d-arc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59768</commentid>
    <comment_count>2</comment_count>
    <who name="Ben Wells">benwells</who>
    <bug_when>2011-11-09 01:44:20 +0000</bug_when>
    <thetext>Any takers? Let me know if there is somewhere more appropriate I should log this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63195</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-01-27 18:26:21 +0000</bug_when>
    <thetext>The method is defined as only adding the straight line if the path already contains a subpath, which it doesn&apos;t in this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66146</commentid>
    <comment_count>4</comment_count>
    <who name="Ben Wells">benwells</who>
    <bug_when>2012-03-27 22:49:21 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; The method is defined as only adding the straight line if the path already
&gt; contains a subpath, which it doesn&apos;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

&quot;The moveTo(x, y) method must create a new subpath with the specified point as its first (and only) point.&quot;

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 = &apos;#0f0&apos;;
ctx.fillRect(0, 0, 100, 50);

ctx.strokeStyle = &apos;#f00&apos;;
ctx.lineWidth = 100;
ctx.lineCap = &apos;round&apos;;
ctx.lineJoin = &apos;round&apos;;

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, &quot;50,25&quot;, &quot;0,255,0,255&quot;);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72164</commentid>
    <comment_count>5</comment_count>
      <attachid>1174</attachid>
    <who name="zqzhang">zhiqiang.zhang</who>
    <bug_when>2012-08-14 15:37:13 +0000</bug_when>
    <thetext>Created attachment 1174
Fix on ctx.moveTo()

Fix this issue as http://trac.webkit.org/browser/trunk/LayoutTests/canvas/philip/tests/2d.path.stroke.prune.arc.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72173</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-14 23:46:47 +0000</bug_when>
    <thetext>Please disregard comment 3, I was indeed incorrect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72196</commentid>
    <comment_count>7</comment_count>
    <who name="">jorritv</who>
    <bug_when>2012-08-15 11:46:08 +0000</bug_when>
    <thetext>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)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72198</commentid>
    <comment_count>8</comment_count>
    <who name="Thiago Marcos P. Santos">tmpsantos</who>
    <bug_when>2012-08-15 12:08:57 +0000</bug_when>
    <thetext>Is it ok to apply zqzhang&apos;s patch on the approved test? Any objection?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72199</commentid>
    <comment_count>9</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-08-15 12:20:04 +0000</bug_when>
    <thetext>Yes, please do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72200</commentid>
    <comment_count>10</comment_count>
    <who name="Thiago Marcos P. Santos">tmpsantos</who>
    <bug_when>2012-08-15 12:36:20 +0000</bug_when>
    <thetext>Fixed at https://dvcs.w3.org/hg/html/rev/f64be2d08dcd</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>1174</attachid>
            <date>2012-08-14 15:37:13 +0000</date>
            <delta_ts>2012-08-14 15:37:13 +0000</delta_ts>
            <desc>Fix on ctx.moveTo()</desc>
            <filename>FixtoBug14421.patch</filename>
            <type>text/plain</type>
            <size>869</size>
            <attacher name="zqzhang">zhiqiang.zhang</attacher>
            
              <data encoding="base64">IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIFpoaXFpYW5nIFpoYW5nIDx6aGlxaWFuZy56aGFu
Z0BpbnRlbC5jb20+CiMgRGF0ZSAxMzQ0OTUyMjczIC0yODgwMAojIE5vZGUgSUQgZmIwZTU3Mjk2
ZmJhNjYyZDdmZTdiODQ0N2Q2ZWQ5ZmIwYmI2ZTBhNAojIFBhcmVudCAgMGE5MzAyNWQzYTIzNjMz
NGM0YmY5NmQ5ZGNiM2M2MzUwY2ZhMzVmZApGaXggQnVnIDE0NDIxIC0gUG9zc2libGUgZXJyb3Ig
aW4gY2FudmFzIFBoaWxpcCB0ZXN0IDJkLnBhdGguc3Ryb2tlLnBydW5lLmFyYwoKZGlmZiAtLWdp
dCBhL3Rlc3RzL2FwcHJvdmVkL2NhbnZhcy8yZC5wYXRoLnN0cm9rZS5wcnVuZS5hcmMuaHRtbCBi
L3Rlc3RzL2FwcHJvdmVkL2NhbnZhcy8yZC5wYXRoLnN0cm9rZS5wcnVuZS5hcmMuaHRtbAotLS0g
YS90ZXN0cy9hcHByb3ZlZC9jYW52YXMvMmQucGF0aC5zdHJva2UucHJ1bmUuYXJjLmh0bWwKKysr
IGIvdGVzdHMvYXBwc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