Re: [XHR2] Progress events during synchronous requests

On Wed, 11 Feb 2009 22:44:17 +0100, Jonas Sicking <jonas@sicking.cc> wrote:
> Is there a reason why the spec says to not send progress events
> (upload and download) during synchronous requests, while still saying
> that readystatechange events should be fired?
>
> I guess it can be argued that progress events (especially the load
> event) is less useful for synchronous loads and that not dispatching
> them is a performance optimization. Is that the reason?
>
> I don't really feel strongly either way, though I do think that from a
> web developers point of view it would be more useful to dispatch the
> events than not to dispatch them. And being consistent with regards to
> readystatechange is always nice.

It is a performance optimization, yes. Firing a lot of progress events for  
a large file that is synchronously downloaded in a Web Worker seems like  
waste. The reason readystatechange events are dispatched is because  
Internet Explorer already did that.


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Thursday, 12 February 2009 09:20:37 UTC