This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16732 - Use ArrayBufferView instead of ArrayBuffer in Blob constructor
Summary: Use ArrayBufferView instead of ArrayBuffer in Blob constructor
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: File API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Arun
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-13 14:28 UTC by Simon Pieters
Modified: 2012-05-07 05:06 UTC (History)
4 users (show)

See Also:


Attachments

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