Bugzilla – Bug 16732
Use ArrayBufferView instead of ArrayBuffer in Blob constructor
Last modified: 2012-05-07 05:06:53 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.
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?
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).
Marking this fixed. http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob