W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2010

Re: XHR responseArrayBuffer attribute: suggestion to replace "asBlob" with "responseType"

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 10 Nov 2010 13:38:11 -0800
Message-ID: <AANLkTimxX52=-3kb1ex_VMMxB+rgc4xYzzamhDeP8pzd@mail.gmail.com>
To: Chris Rogers <crogers@google.com>
Cc: David Flanagan <david@davidflanagan.com>, Boris Zbarsky <bzbarsky@mit.edu>, public-webapps@w3.org, Jonas Sicking <jonas@sicking.cc>, Maciej Stachowiak <mjs@apple.com>, Geoffrey Garen <ggaren@apple.com>, Darin Fisher <darin@chromium.org>, Anne van Kesteren <annevk@opera.com>, Eric Uhrhane <ericu@google.com>, michaeln@google.com, Alexey Proskuryakov <ap@webkit.org>, jorlow@google.com, jamesr@chromium.org
On Tue, Nov 9, 2010 at 12:03 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Tue, Nov 9, 2010 at 11:54 AM, Chris Rogers <crogers@google.com> wrote:
>> Hi David,
>> Sorry for the delayed response.  I think the idea of BinaryHttpRequest is a
>> reasonable one.  As you point out, it simply side-steps any potential
>> performance and compatibility issues.  Are you imagining that the API is
>> effectively the same as XMLHttpRequest, except without the text and XML
>> part?
>> How do other people feel about David's proposal?
>
> I'm in favor a new constructor.  It seems silly to first hack
> ourselves into a corner by extending an API designed for text or XML,
> then try to hack our way out of the problems that causes.  A new
> object that does what's needed seems like the cleanest and most
> correct solution to the problem.

After discussion with Anne and James, I retract my support for a new
constructor.  I'm in favor of .responseType.

Specifically, .responseType would take values like "" (for legacy
treatment) / "text" / "document" / "arraybuffer" / "blob" / etc.  If
the value is "", then .responseText and .responseXML are filled
appropriately, while .response is empty.  Otherwise, .responseText and
.responseXML are empty (or throw or something), while .response
contains the value in the chosen format.  .responseType must be set at
some appropriately early time; after the response is received, changes
to .responseType are ignored or throw.

~TJ
Received on Wednesday, 10 November 2010 21:39:04 GMT

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