This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
XHR should say that an XHR object is not to be garbage collected if it can still get events and has listeners for those events. Compare with WebSocket API.
I think something along the following: UNSENT, OPENED with send() flag false can be GC (no need to mention in the spec) OPENED with send() flag true must not be GC if there are any listeners for readystatechange, loadstart, progress, abort, error, load, timeout, loadend HEADERS_RECEIVED must not be GC if there are any listeners for readystatechange, progress, abort, error, load, timeout, loadend LOADING must not be GC if there are any listeners for readystatechange, progress, abort, error, load, timeout, loadend DONE can be GC (no need to mention in the spec) If an XHR object is GC when it is in OPENED with send() flag true, HEADERS_RECEIVED, or LOADING, then the UA must act as if the user aborted the request.
websocket has: "A WebSocket object with an established connection that has data queued to be transmitted to the network must not be garbage collected." Possible that XHR should say something similar.
EventSource has a much simpler garbage collection policy. Would be interesting to know why that is not sufficient here.
Done: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#garbage-collection