W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

Re: [XHR2] responseType and response properties

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 21 Jun 2011 17:51:42 +0200
To: "Webapps WG" <public-webapps@w3.org>, "Jonas Sicking" <jonas@sicking.cc>
Message-ID: <op.vxfnogie64w2qv@anne-van-kesterens-macbook-pro.local>
On Sat, 21 May 2011 09:36:51 +0200, Jonas Sicking <jonas@sicking.cc> wrote:
> First, should it return a new ArrayBuffer every time the property is
> accessed (This is how the mozResponseArrayBuffer property in FF4
> behaves), or should it return the same buffer every time? Since
> arraybuffers are mutable, there's a risk that one consumer will modify
> the response such that all other consumers see a modified result. On
> the other hand creating a new buffer every time can be quite expensive
> (at least without complex/slow copy-on-write implementations). It also
> would result in the surprising property that xhr.response !=
> xhr.response.

Per the specification you always get the same ArrayBuffer/Blob/Document.


> Second, what should .response return before the download finishes? It
> would be nice if you could access partial results. However
> ArrayBuffers are fixed size and we won't know the total size until the
> whole download is finished. We could return a copy on each access, but
> again that would be somewhat expensive.
>
> For now we're going to return null during loading in FF6 when
> .responseType is set to "arraybuffer".

That is what the specification requires...


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Tuesday, 21 June 2011 15:52:22 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:45 GMT