<?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>18754</bug_id>
          
          <creation_ts>2012-08-31 20:23:54 +0000</creation_ts>
          <short_desc>In step 2, should setLineDash abort with an exception?</short_desc>
          <delta_ts>2012-09-20 23:27:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-setlinedash</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>junov</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73107</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-08-31 20:23:54 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
Multipage: http://www.whatwg.org/C#dom-context-2d-setlinedash
Complete: http://www.whatwg.org/c#dom-context-2d-setlinedash

Comment:
In step 2, should setLineDash abort with an exception?

Posted from: 2620:0:100c:0:5fb:6ba9:8a9e:6846 by junov@chromium.org
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.83 Safari/537.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73110</commentid>
    <comment_count>1</comment_count>
    <who name="Justin Novosad">junov</who>
    <bug_when>2012-08-31 20:30:13 +0000</bug_when>
    <thetext>The current wording is:
&quot;If any value in the array is not finite (e.g. an Infinity or a NaN value), or if any value is negative (less than zero), then abort these steps.&quot;

It does not specify that an exception should be thrown.  Is this intentional or an omission?
Peeking around at the spec, it looks like other functions with similar constraints are throwing an indexSizeError exception.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73112</commentid>
    <comment_count>2</comment_count>
    <who name="Justin Novosad">junov</who>
    <bug_when>2012-08-31 20:54:21 +0000</bug_when>
    <thetext>Also, if Infinity and NaN are not allowed, why doesn&apos;t the IDL specify sequence&lt;double&gt; rather than sequence&lt;unrestricted-double&gt;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73115</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-31 21:50:04 +0000</bug_when>
    <thetext>It&apos;s intentional. Most of the canvas API ignores infinities so that you can do divisions by zero and just get nothing rather than the script aborting. (Divisions by zero are not uncommon in graphics.)

If there&apos;s a reason to change it for this particular feature though, I&apos;m happy to reconsider.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73138</commentid>
    <comment_count>4</comment_count>
    <who name="Justin Novosad">junov</who>
    <bug_when>2012-09-01 03:24:54 +0000</bug_when>
    <thetext>That is fine by me. 

I understand that the specification strives to be concise and that it is not necessary to mention things that the implementation does not need to do. Still, it might be helpful if it said &quot;(...), then abort these steps without throwing an exception&quot;. I bring this up because there was a webkit patch up for review that was throwing an exception in this case, which prompted me to file this bug.

Anyhow, thanks for giving me the answer I was looking for.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74169</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-09-20 23:27:00 +0000</bug_when>
    <thetext>Happy to add such a comment, especially since someone wrote a patch to throw here!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74170</commentid>
    <comment_count>6</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-09-20 23:27:47 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7386.
Check-in comment: Clarification based on implementation experience
http://html5.org/tools/web-apps-tracker?from=7385&amp;to=7386</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>