BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-12 Thread Boris Zbarsky
This should make it easier to append limited views; appending the .buffer is a footgun because it appends the whole buffer. -Boris

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-12 Thread Anne van Kesteren
On Thu, 12 Apr 2012 21:26:24 +0200, Boris Zbarsky wrote: This should make it easier to append limited views; appending the .buffer is a footgun because it appends the whole buffer. Why are we still discussing BlobBuilder? I thought we discussed long ago it should be removed in favor of a co

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-12 Thread Boris Zbarsky
On 4/12/12 3:44 PM, Anne van Kesteren wrote: On Thu, 12 Apr 2012 21:26:24 +0200, Boris Zbarsky wrote: This should make it easier to append limited views; appending the .buffer is a footgun because it appends the whole buffer. Why are we still discussing BlobBuilder? Because it's still in th

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-12 Thread Anne van Kesteren
On Thu, 12 Apr 2012 21:48:12 +0200, Boris Zbarsky wrote: Because it's still in the current editor's draft and it's still in the Gecko code and I was just reviewing a patch to it and saw the API? ;) Eric, the plan is to remove that from File Writer, no? I thought we discussed long ago it sh

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-12 Thread Boris Zbarsky
On 4/12/12 3:54 PM, Anne van Kesteren wrote: Blob with constructor is in http://dev.w3.org/2006/webapi/FileAPI/ Right. I'd ended up at the File Writer spec. I thought the idea was to not have BlobBuilder at all. Dunno. Is there content depending on it? -Boris

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-12 Thread Anne van Kesteren
On Thu, 12 Apr 2012 21:58:00 +0200, Boris Zbarsky wrote: On 4/12/12 3:54 PM, Anne van Kesteren wrote: I thought the idea was to not have BlobBuilder at all. Dunno. Is there content depending on it? Maybe some browser specific demos or content, it's not implemented by everyone: http:/

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-12 Thread Eric U
On Thu, Apr 12, 2012 at 12:54 PM, Anne van Kesteren wrote: > On Thu, 12 Apr 2012 21:48:12 +0200, Boris Zbarsky wrote: >> >> Because it's still in the current editor's draft and it's still in the >> Gecko code and I was just reviewing a patch to it and saw the API?  ;) > > > Eric, the plan is to r

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-12 Thread Arun Ranganathan
> On Thu, Apr 12, 2012 at 12:54 PM, Anne van Kesteren > wrote: > > Eric, the plan is to remove that from File Writer, no? > > Yes. The next draft I publish will mark it deprecated, and it will > eventually go away. However, currently at least Gecko and WebKit > support BlobBuilder, and WebKit d

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-12 Thread Simon Pieters
On Thu, 12 Apr 2012 22:11:38 +0200, Eric U wrote: On Thu, Apr 12, 2012 at 12:54 PM, Anne van Kesteren wrote: On Thu, 12 Apr 2012 21:48:12 +0200, Boris Zbarsky wrote: Because it's still in the current editor's draft and it's still in the Gecko code and I was just reviewing a patch to it a

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-24 Thread David Herman
On Apr 12, 2012, at 2:48 PM, Arun Ranganathan wrote: > I intend to add ArrayBufferView as a parameter to the Blob constructor . Would it be possible also to allow passing an ArrayBuffer with an offset and length as an additional alternative? This would eliminate the need to create a view when y

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-24 Thread David Herman
On Apr 24, 2012, at 3:53 PM, David Herman wrote: > On Apr 12, 2012, at 2:48 PM, Arun Ranganathan wrote: > >> I intend to add ArrayBufferView as a parameter to the Blob constructor . > > Would it be possible also to allow passing an ArrayBuffer with an offset and > length as an additional altern

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-26 Thread Arun Ranganathan
On Apr 24, 2012, at 7:00 PM, David Herman wrote: > On Apr 24, 2012, at 3:53 PM, David Herman wrote: > >> On Apr 12, 2012, at 2:48 PM, Arun Ranganathan wrote: >> >>> I intend to add ArrayBufferView as a parameter to the Blob constructor . >> >> Would it be possible also to allow passing an Arra

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-26 Thread Anne van Kesteren
On Fri, 27 Apr 2012 00:13:42 +0200, Arun Ranganathan wrote: The constructor will switch to use ArrayBufferView in lieu of ArrayBuffer, but the read method exposed on FileReader and FileReaderSync will read files into memory as ArrayBuffers. Since the constructor is not widely deployed yet

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-27 Thread Glenn Maynard
On Fri, Apr 27, 2012 at 12:28 AM, Anne van Kesteren wrote: > On Fri, 27 Apr 2012 00:13:42 +0200, Arun Ranganathan < > aranganat...@mozilla.com> wrote: > >> The constructor will switch to use ArrayBufferView in lieu of >> ArrayBuffer, but the read method exposed on FileReader and FileReaderSync >>

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-27 Thread Arun Ranganathan
On Apr 27, 2012, at 1:28 AM, Anne van Kesteren wrote: > On Fri, 27 Apr 2012 00:13:42 +0200, Arun Ranganathan > wrote: >> The constructor will switch to use ArrayBufferView in lieu of ArrayBuffer, >> but the read method exposed on FileReader and FileReaderSync will read files >> into memory as

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-28 Thread Jonas Sicking
On Fri, Apr 27, 2012 at 10:57 AM, Arun Ranganathan wrote: > > On Apr 27, 2012, at 1:28 AM, Anne van Kesteren wrote: > >> On Fri, 27 Apr 2012 00:13:42 +0200, Arun Ranganathan >> wrote: >>> The constructor will switch to use ArrayBufferView in lieu of ArrayBuffer, >>> but the read method exposed

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-28 Thread Glenn Maynard
On Sat, Apr 28, 2012 at 3:45 AM, Jonas Sicking wrote: > We should not have readAsArryBufferView since there's a ton of > different types of ArrayBufferViews. Instead we should just return an > ArrayBuffer and let people construct ArrayBufferViews or DataViews > into that as they see fit. > It wo

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-29 Thread Jonas Sicking
On Sat, Apr 28, 2012 at 7:54 AM, Glenn Maynard wrote: > On Sat, Apr 28, 2012 at 3:45 AM, Jonas Sicking wrote: >> >> We should not have readAsArryBufferView since there's a ton of >> different types of ArrayBufferViews. Instead we should just return an >> ArrayBuffer and let people construct Array

Re: BlobBuilder.append() should take ArrayBufferView in addition to ArrayBuffer

2012-04-29 Thread Glenn Maynard
On Sun, Apr 29, 2012 at 2:41 PM, Jonas Sicking wrote: > I don't know what you are using as basis for the "it's probably by far > the most common actual data type" statement. > Every multibyte string is an array of bytes. Compressed data is an arrays of bytes (or rather bitstreams, which are acc