W3C home > Mailing lists > Public > public-webapi@w3.org > July 2007

[XHR2] XMLHttpRequest and progress events

From: Anne van Kesteren <annevk@opera.com>
Date: Fri, 27 Jul 2007 18:00:40 +0200
To: "Web API WG (public)" <public-webapi@w3.org>
Message-ID: <op.tv4r3eyx64w2qv@annevk-t60.oslo.opera.com>

I've been looking into integrating progress events into XMLHttpRequest. In  
general it is pretty trivial to do for the request non-uploading scenario.  
loadstart is dispatched right after the first readystatechange event is  
dispatched in the send() algorithm and progress is dispatched while  
downloading. (abort, error and load are pretty obvious). I decided to only  
dispatch them for synchronous requests. load, as exception, is also  
dispatched in the synchronous case. (For abort and error the synchronous  
case throws an exception and loadstart and progress are not useful after  
the request has already completed.)

The main problem is probably the XMLHttpRequestUpload object  
(XMLHttpRequest.upload) which we decided to use for data going to the  
server. Can someone explain to me how the user agent knows how much  
content it already has uploaded? Should we dispatch a loadstart event on  
that object as well even though it will be at the same moment it is  
dispatched on the XMLHttpRequest object? When to dispatch the progress  
events and abort, error, etc?

Anne van Kesteren
Received on Friday, 27 July 2007 16:01:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:24 UTC