Closed
Bug 707484
Opened 14 years ago
Closed 11 years ago
[XHR2] Allow setting XHR responseType and withCredentials before open
[XHR2] Allow setting XHR responseType and withCredentials before open
---
---
---
---
QA Whiteboard:
---
Has STR:
---
Change Request:
---
0
Bug Flags:
|
1.32 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
|
4.71 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
|
9.56 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
| Reporter | |
Description•14 years ago
|
The latest XHR2 spec allows setting responseType and withCredentials in UNSENT or OPENED state.
| Reporter | |
Updated•14 years ago
|
Summary: Allow setting XHR responseType and withCredentials before send. → Allow setting XHR responseType and withCredentials before open.
Comment 1•13 years ago
|
Attachment #707601 -
Flags: review?(jonas)
Comment on attachment 707601 [details] [diff] [review]
Allow setting XHR.responseType before open()
Review of attachment 707601 [details] [diff] [review]:
-----------------------------------------------------------------
r=me if you also add a test.
Attachment #707601 -
Flags: review?(jonas) → review+
Comment 3•13 years ago
|
HRs were not asynchronous by default. I also added a test.
Attachment #707601 -
Attachment is obsolete: true
Attachment #708091 -
Flags: review?(jonas)
Comment on attachment 708091 [details] [diff] [review]
Allow setting XHR.responseType before open()
Review of attachment 708091 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with that fixed.
::: content/base/test/test_XHR.html
@@ +90,5 @@
> try { xhr.responseXML } catch (e) { didthrow = true; }
> ok(didthrow, "should have thrown when accessing responseXML");
> }
> +function checkSetResponseTypeThrows(xhr, type, shouldThrow) {
> + var shouldThrow = shouldThrow === undefined ? true : shouldThrow;
shouldThrow = !!shouldThrow;
@@ +101,3 @@
> }
> +function checkOpenThrows(xhr, method, url, async, shouldThrow) {
> + var shouldThrow = shouldThrow === undefined ? true : shouldThrow;
Same
@@ +118,5 @@
> +checkSetResponseTypeThrows(xhr, "moz-chunked-text", false);
> +checkSetResponseTypeThrows(xhr, "moz-chunked-arraybuffer", false);
> +checkOpenThrows(xhr, "GET", "file_XHR_pass2.txt", false, true);
> +checkSetResponseTypeThrows(xhr, "", false);
> +checkOpenThrows(xhr, "GET", "file_XHR_pass2.txt", false, false);
Also add a test that checks that setting the reponseType to something before calling .open() actually works. I.e. that it interprets the response according to the set responseType.
Attachment #708091 -
Flags: review?(jonas) → review+
| Reporter | |
Comment 5•13 years ago
|
Is it safe to change .responseType in HEADER_RECEIVED state?
yup, that should already work fine.
Comment 7•12 years ago
|
Setting responseType throws an unexpected error in these test cases:
http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/open-method-responsetype-set-sync.htm
http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/response-json.htm
http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/responsexml-non-document-types.htm
I'm going to assume this bug is the reason.
Blocks: xhr2pass
Comment 8•12 years ago
|
Here's a withCredentials test case:
http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/withcredentials-set.htm
Updated•12 years ago
|
Summary: Allow setting XHR responseType and withCredentials before open. → [XHR2] Allow setting XHR responseType and withCredentials before open
| Reporter | |
Comment 9•12 years ago
|
Tillmann, could you post a new patch with review comments resolved?
Flags: needinfo?(tilkax)
| Assignee | |
Comment 10•11 years ago
|
| Assignee | |
Comment 11•11 years ago
|
| Assignee | |
Comment 12•11 years ago
|
Attachment #8547725 -
Flags: review?(bugs)
| Assignee | |
Updated•11 years ago
|
Assignee: nobody → Ms2ger
Status: NEW → ASSIGNED
| Assignee | |
Comment 13•11 years ago
|
This is Tillmann's patch rebased to trunk. I removed the
> checkSetResponseTypeThrows(xhr, "", false);
> checkOpenThrows(xhr, "GET", "file_XHR_pass2.txt", false, false);
bit from the test; it's already covered by the wpt tests. I left the rest in because it also tests proprietary values that the wpt tests can't.
Flags: needinfo?(tilkax)
Updated•11 years ago
|
Keywords: dev-doc-needed
Updated•11 years ago
|
Attachment #8547725 -
Flags: review?(bugs) → review+
| Assignee | |
Comment 14•11 years ago
|
Comment 15•11 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
| Assignee | |
Comment 16•11 years ago
|
Tillmann, thanks for the patch!
You need to log in
before you can comment on or make changes to this bug.
