VOOZH about

URL: https://bugzilla.mozilla.org/show_bug.cgi?id=1110761

⇱ 1110761 - InvalidStateError raised when setting XMLHttpRequest.responseType while in state UNSENT


Closed Bug 1110761 Opened 11 years ago Closed 10 years ago

InvalidStateError raised when setting XMLHttpRequest.responseType while in state UNSENT

InvalidStateError raised when setting XMLHttpRequest.responseType while in state UNSENT
Core
DOM: Core & HTML
34 Branch
All
All
defect
Not set
normal
Points:
---
RESOLVED DUPLICATE of bug 707484
RESOLVED
DUPLICATE
of
Iteration:
---
a11y-review
Accessibility Severity
Performance Impact
Size Estimate
Webcompat Priority
Webcompat Score
Tracking Status
relnote-firefox
thunderbird_esr115
thunderbird_esr140
thunderbird_esr153
firefox-esr115
firefox-esr140
firefox-esr153
firefox152
firefox153
firefox154
---
[tw-dom]
QA Whiteboard:
---
Has STR:
---
Change Request:
---
Bug Flags:
Signature:
None
This bug is publicly visible.

 
Reporter

Description

11 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0 Build ID: 20141125180439 Steps to reproduce: Set XMLHttpRequest.responseType while in UNSENT Actual results: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable Expected results: No error. Accordinlgy to http://www.w3.org/TR/XMLHttpRequest/#the-responsetype-attribute, this error should be thrown only in LOADING or DONE state. Please see http://www.zigarn.com/test-set-responseType.html for trying to set 'responseType' on different states of XMLHttpRequest. Result on Firefox 34.0: XHR state: UNSENT ==> exception: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable XHR state: OPENED ==> no exception XHR state: HEADERS_RECEIVED ==> no exception XHR state: LOADING ==> exception: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable XHR state: DONE ==> exception: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable Result on Chrome 39.0.2171.71m: XHR state: UNSENT ==> no exception XHR state: OPENED ==> no exception XHR state: HEADERS_RECEIVED ==> no exception XHR state: LOADING ==> exception: InvalidStateError: Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be set if the object's state is LOADING or DONE. XHR state: DONE ==> exception: InvalidStateError: Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be set if the object's state is LOADING or DONE. Result on Internet Explorer 11.0.14: XHR state: UNSENT ==> exception: InvalidStateError XHR state: OPENED ==> no exception XHR state: OPENED ==> no exception XHR state: HEADERS_RECEIVED ==> no exception XHR state: LOADING ==> exception: InvalidStateError XHR state: DONE ==> exception: InvalidStateError
This reproduces on Nightly on OS X as well.
Status: UNCONFIRMED → NEW
Component: General → DOM
Ever confirmed: true
OS: Windows 7 → All
Product: Firefox → Core
Hardware: x86_64 → All
The workaround is described in e.g. http://forums.udacity.com/questions/100022122/cross-browser-xmlhttprequestresponsetype — do not try to set `.responseType` before calling `.open()` lest you hit this out-of-spec behavior.
It seems this bug was resolved by https://hg.mozilla.org/mozilla-central/rev/b5bec86469c8#l1.38 I verified the test case responsetype.html with my local build and it passed.
Assignee: nobody → sshih
Shouldn't this be marked as fixed as of 38, then?
Flags: needinfo?(sshih)
Let's call it a dupe.
Assignee: sshih → nobody
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(sshih)
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.