Bug 16732 - Use ArrayBufferView instead of ArrayBuffer in Blob constructor
Use ArrayBufferView instead of ArrayBuffer in Blob constructor
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: File API
unspecified
PC All
: P2 normal
: ---
Assigned To: Arun
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-13 14:28 UTC by Simon Pieters
Modified: 2012-05-07 05:06 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Pieters 2012-04-13 14:28:28 UTC
XHR.send() was changed to use ArrayBufferView instead of ArrayBuffer because if you have a sliced view you may want to send that (or here create a blob), but .buffer represents the whole data, not just the sliced view.
Comment 1 Arun 2012-04-13 17:35:54 UTC
Are you sure you mean *instead* of ArrayBuffer, and not *in addition* to ArrayBuffer?  Essentially, my question is, should ArrayBufferView *replace* ArrayBuffer in the existing constructor, or should it be an additional optional invocation parameter?
Comment 2 Simon Pieters 2012-04-16 04:58:09 UTC
The XHR discussion ended up replacing ArrayBuffer with ArrayBufferView for send().

I think one argument is that authors may have a sliced view and then pass .buffer and not realize that it contains the whole data, which results in buggy code. If we support only ArrayBufferView, we prevent the buggy case from happening (at the cost of making authors create a view).
Comment 3 Arun 2012-05-07 05:06:53 UTC
Marking this fixed. http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob