abort event listener no longer called on nsIXMLHttpRequest

RESOLVED FIXED

Status

P2
normal
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: irakli, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

In jetpack we observe regression on nightlies with nsIXMLHttpRequest, abort event listeners are no longer called when requests are aborted. Here is a simple test case:

var aborted = false;
var xhr = Components.classes['@mozilla.org/xmlextras/xmlhttprequest;1'].
          createInstance(Ci.nsIXMLHttpRequest);
xhr.addEventListener('abort', function() { aborted = true }, false);
aborted // is false (on nightly) while expected to be true
Blocks: 705011, 697775
Regression range?
Component: Networking: HTTP → DOM
QA Contact: networking.http → general
I don't know when regression has been introduced, but it seems to work as expected on aurora.
> I don't know when regression has been introduced,

Are you willing to figure that out using http://harthur.github.com/mozregression/ ?
We had a recent change to abort event dispatch in bug 703380.  That bug was about abort events firing after a load or error event fired, which is incorrect behavior.  Could this be related to that?
Yeah, I think it's definitely related.  The XHR2 spec states that if the request is in an UNSENT state, then the event should not be fired:

http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-abort-method

The testcase in comment 3 does not reflect that:  it checks the event count before and after the abort call, but send is never called.
Yeah, it's intentional and expected that "abort" event will not be fired in UNSENT state. The test should be fixed.
Component: DOM → General
Product: Core → Add-on SDK
QA Contact: general → general
Version: Trunk → unspecified

Comment 9

7 years ago
Commit pushed to https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/604069d1d7277025b062372682da5e02a8be04fd
Disable failing XHR test until platform bug 707256 is fixed.(cherry picked from commit 8a927261d7fd06bf0c5a1ae62f2b236ca8305bad)

Updated

7 years ago
Priority: -- → P2

Comment 10

7 years ago
Commit pushed to https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/604069d1d7277025b062372682da5e02a8be04fd
Disable failing XHR test until platform bug 707256 is fixed.(cherry picked from commit 8a927261d7fd06bf0c5a1ae62f2b236ca8305bad)

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.