<?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>25672</bug_id>
          
          <creation_ts>2014-05-12 23:55:44 +0000</creation_ts>
          <short_desc>Need to define what happens when putImageData is passed an ImageData whose .data&apos;s ArrayBuffer has been neutered</short_desc>
          <delta_ts>2014-05-15 18:40:20 +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-putimagedata</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>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105786</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-05-12 23:55:44 +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-putimagedata
Complete: http://www.whatwg.org/c#dom-context-2d-putimagedata
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
Need to define what happens when putImageData is passed an ImageData whose
.data&apos;s ArrayBuffer has been neutered

Posted from: 63.245.221.34 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105790</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-05-12 23:58:32 +0000</bug_when>
    <thetext>In particular, putImageData seems to assume that the width and height of the ImageData argument determine how much data is available (in particular, that there are width*height*4 bytes of data), but if the ArrayBuffer as been neutered that&apos;s just not the case.

This is not handled by the behavior ES6 defines for neutered ArrayBuffers, because the only spec text here is:

  copy the four channels of the pixel with coordinate (x, y) in the imagedata
  data structure to the pixel with coordinate (dx+x, dy+y)

which doesn&apos;t actually define how the &quot;four channels of the pixel&quot; are extracted from the ImageData...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105887</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-13 18:33:49 +0000</bug_when>
    <thetext>That text is referencing the earlier text definign &quot;a Canvas Pixel ArrayBuffer&quot;. I&apos;ve tried to make that mildly clearer.

But yeah, either way neutered ImageData data isn&apos;t mentioned.

I&apos;ve updated putImageData() and createImageBitmap() to throw in this particular situation. I left the createImageData() method that takes an ImageData alone since it doesn&apos;t actually reference the data.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105890</commentid>
    <comment_count>3</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-05-13 18:39:43 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8629.
Check-in comment: Define how to handle neutered ImageData objects
http://html5.org/tools/web-apps-tracker?from=8628&amp;to=8629</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105891</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-05-13 18:43:09 +0000</bug_when>
    <thetext>Thanks!

&quot;A Canvas Pixel ArrayBuffer is an ArrayBuffer that whose data &quot; has a stray &quot;that&quot;, I think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106068</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-15 18:39:52 +0000</bug_when>
    <thetext>Oops. Thanks. Fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106069</commentid>
    <comment_count>6</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-05-15 18:40:20 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8637.
Check-in comment: Typo in canvas section
http://html5.org/tools/web-apps-tracker?from=8636&amp;to=8637</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>