Re: XHR.responseBlob and BlobWriter [nee FileWriter]

On Tue, 17 Aug 2010 04:05:52 +0200, Michael Nordman <michaeln@google.com>  
wrote:
> 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
http://annevankesteren.nl/

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