Closed
Bug 1110761
Opened 10 years ago
Closed 9 years ago
InvalidStateError raised when setting XMLHttpRequest.responseType while in state UNSENT
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 707484
People
(Reporter: zigarn+mozilla, Unassigned)
References
()
Details
(Keywords: reproducible, testcase, Whiteboard: [tw-dom])
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
Comment 1•10 years ago
|
||
This reproduces on Nightly on OS X as well.
Status: UNCONFIRMED → NEW
Component: General → DOM
Ever confirmed: true
Keywords: reproducible,
testcase
OS: Windows 7 → All
Product: Firefox → Core
Hardware: x86_64 → All
Comment 2•10 years ago
|
||
Comment 3•10 years ago
|
||
Or <http://w3c-test.org/XMLHttpRequest/responsetype.html> online.
Comment 4•10 years ago
|
||
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.
Whiteboard: [tw-dom]
Comment 5•9 years ago
|
||
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.
Updated•9 years ago
|
Assignee: nobody → sshih
Comment 7•9 years ago
|
||
Let's call it a dupe.
Assignee: sshih → nobody
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(sshih)
Resolution: --- → DUPLICATE
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•