W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2010

Re: XHR.responseBlob and BlobWriter [nee FileWriter]

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 17 Aug 2010 08:34:26 +0200
To: "Web Applications Working Group WG" <public-webapps@w3.org>, "Michael Nordman" <michaeln@google.com>
Cc: "Eric Uhrhane" <ericu@google.com>, "Jonas Sicking" <jonas@sicking.cc>, "Darin Fisher" <darin@chromium.org>, "James Robinson" <jamesr@google.com>, "Thomas Broyer" <t.broyer@gmail.com>
Message-ID: <op.vhkkjngq64w2qv@anne-van-kesterens-macbook-pro.local>
On Tue, 17 Aug 2010 04:05:52 +0200, Michael Nordman <michaeln@google.com>  
> I'm interested in adding support for XHR.responseBlob to webkit and  
> chrome. It sounds like we have a general consensus to add two new  
> members to the
> XmlHttpRequest interface:
>   attribute boolean asBlob;  // at least for the sake of discussion,  
> calling
> it that for now
>   readonly attribute Blob responseBlob;
> Another name option could be 'downloadAsBlob'. Personally, I like  
> 'asBlob' for its brevity and its naming similarity to  'withCredentials'.
> Looks like the semantics of when its valid to call setRequestHeaders also
> applies setting the asBlob attribute; after open() but before send() has
> been called. An attempt to set the value at some inappropriate time  
> should throw an INVALID_STATE exception. Also the asBlob attribute value  
> should
> probably be reset to 'false' upon return from open(), again similar to  
> how the request headers are cleared out upon return from open().
> Anne, have you been following this discussion, wdyt?

Yeah I have. This design looks rather good. We should also define what  
happens to responseText and responseXML in this scenario. I suppose  
throwing INVALID_STATE_ERR makes the most sense to make it clear they are  
not available. Nothing else should be affected right?

(I think you also found a bug in that the "credentials flag" and "request  
timeout" are not reset when open() is invoked.)

Anne van Kesteren
Received on Tuesday, 17 August 2010 06:35:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:10 UTC