<?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>28327</bug_id>
          
          <creation_ts>2015-03-24 19:46:11 +0000</creation_ts>
          <short_desc>&lt;canvas&gt;: CanvasRenderingContext2D.putImageData cannot throw a NotSupportedError exception under ECMAScript binding *even if* any of the arguments are not finite.</short_desc>
          <delta_ts>2016-01-24 06:16:18 +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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc>https://html.spec.whatwg.org/multipage/scripting.html#pixel-manipulation</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          <dependson>28064</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tetsuharu OHZEKI">saneyuki.s.snyk</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>contributor</cc>
    
    <cc>d</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>118915</commentid>
    <comment_count>0</comment_count>
    <who name="Tetsuharu OHZEKI">saneyuki.s.snyk</who>
    <bug_when>2015-03-24 19:46:11 +0000</bug_when>
    <thetext># related specs

- CanvasRenderingContext2D
  - https://html.spec.whatwg.org/multipage/scripting.html#canvasrenderingcontext2d
  - https://html.spec.whatwg.org/multipage/scripting.html#pixel-manipulation
 - WebIDL
  - http://heycam.github.io/webidl/#es-double

# description

1. `CanvasRenderingContext2D.putImageData` says that to throw a NotSupportedError exception if any of the arguments are not finite, and the methods takes `double` as its arguments.

2. On the other hand, by WebIDL spec, `double` value type raises `TypeError` if the value is not finite when conversioning from ECMAScript to IDL Value.

3. By the above, `CanvasRenderingContext2D.putImageData` cannot throw a `NotSupportedError` because WebIDL conversion steps will raise a `TypeError` before arguments are passed to `CanvasRenderingContext2D.putImageData`, if values of arguments are not finite.

4. I found the same spec issue with &quot;HTML Canvas 2D Context Editor&apos;s Draft 13 November 2014&quot;: http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas_CR/#dom-context-2d-putimagedata</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122865</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-08-28 16:03:21 +0000</bug_when>
    <thetext>Thank for reporting this, do you know what implementations do?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123161</commentid>
    <comment_count>2</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2015-09-10 20:18:22 +0000</bug_when>
    <thetext>Firefox and Chrome do TypeError. Edge does NotSupportedError.

Seems best to go with TypeError. Will PR.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123162</commentid>
    <comment_count>3</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2015-09-10 20:24:31 +0000</bug_when>
    <thetext>https://github.com/whatwg/html/pull/133</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124701</commentid>
    <comment_count>4</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2016-01-24 06:16:18 +0000</bug_when>
    <thetext>*** Bug 28064 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>