[XHR] Invoking open() from event listeners

Sorry for restarting this thread, but it seems we did not reach any  
conclusions last time around.

On Thu, 03 Nov 2011 00:07:48 +0100, Eric U <ericu@google.com> wrote:
> I think I may have missed something important.  XHR2 specs just this
> behavior w.r.t. abort [another open will stop the abort's loadend] but
> /doesn't/ spec that for error or load.  That is, an open() in onerror
> or onload does not appear to cancel the pending loadend.  Anne, can
> you comment on why?

I think I did not consider that scenario closely enough when I added  
support for these progress events.

open() does terminate both abort() and send() (the way it does so is not  
very clear), but maybe it would be clearer if invoking open() set some  
kind of flag that is checked by both send() and abort() from the moment  
they start dispatching events.

http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html

Glenn suggested not allowing open() at all, but I think for XMLHttpRequest  
we are past that (we have e.g. the readystatechange event which has been  
around since XMLHttpRequest support was added and open() is definitely  
called from it in the wild).


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Tuesday, 20 December 2011 17:25:24 UTC