[Bug 27033] XHR request termination doesn't terminate queued tasks

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27033

--- Comment #19 from Anne <annevk@annevk.nl> ---
Okay, so let's approach this from a different angle. These are the ways
XMLHttpRequest can be terminated:

* open()
* abort()
* timeout (thanks Mukilan)
* navigating the "containing" browsing context
* user pressing "ESC"

Each of these can trigger a sequence of events. The question is whether all
those events need to be dispatched if you invoke one of these from a handler.

open() changes the state from anything to OPENED.

abort() changes the state to DONE first, then dispatches events, then changes
to UNSENT.

timeout changes the state to DONE first, then dispatches events.

The last two behave roughly similar to timeout.


Here is my proposal:

* open() keeps doing what it does.
* abort() and timeout check the state of the object after each dispatched
event. If it is no longer DONE, they terminate those steps. (This way when
open() is invoked the events stop. If abort() is invoked (perhaps again) they
stop too.)
* abort() only changes to UNSENT in the end if the state is DONE.


(And yes, it does seem like open() should unset the send() flag. Will fix that
now.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 21 October 2014 15:16:21 UTC