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

Re: [XHR2] XMLHttpRequest and progress events

From: Anne van Kesteren <annevk@opera.com>
Date: Thu, 02 Aug 2007 15:20:14 +0200
To: "Maciej Stachowiak" <mjs@apple.com>
Cc: "Web API WG (public)" <public-webapi@w3.org>
Message-ID: <op.twfon0qe64w2qv@annevk-t60.oslo.opera.com>

On Sun, 29 Jul 2007 03:04:14 +0200, Maciej Stachowiak <mjs@apple.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?
> It would need the network layer to tell it.

Any suggestions on how to describe this in the specification?

>> 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?
> Don't know the answers to these, but I think it would be helpful to get  
> a complete set of events for an upload, in other words, the same set  
> you'd get for the corresponding download.

I suppose that makes sense. I suppose abort would be dispatched when  
abort() is invoked and data is still being uploaded or when the user  
aborts the upload while data is being uploaded. error would be dispatched  
because of some network error and load would be dispatched whenever the  
"network layer" (however we're going to translate that into specification  
terminology) says it's done.

Anne van Kesteren
Received on Thursday, 2 August 2007 13:20:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:09:57 UTC