W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

[XHR] Invoking open() from event listeners

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 20 Dec 2011 18:24:52 +0100
To: public-webapps@w3.org, "Eric Uhrhane" <ericu@google.com>, "Jonas Sicking" <jonas@sicking.cc>, "Glenn Maynard" <glenn@zewt.org>
Message-ID: <op.v6stbqiz64w2qv@annevk-macbookpro.local>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:49 GMT