mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Auto merge of #24342 - petosorus:null_responseXml, r=jdm
XMLHttpRequest.responseXML returns null when a network error occurs <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24285 (GitHub issue number if applicable) <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because tests ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24342) <!-- Reviewable:end -->
This commit is contained in:
commit
d1b16afe04
5 changed files with 6 additions and 38 deletions
|
@ -1292,12 +1292,17 @@ impl XMLHttpRequest {
|
|||
|
||||
// https://xhr.spec.whatwg.org/#document-response
|
||||
fn document_response(&self) -> Option<DomRoot<Document>> {
|
||||
// Step 1
|
||||
// Caching: if we have existing response xml, redirect it directly
|
||||
let response = self.response_xml.get();
|
||||
if response.is_some() {
|
||||
return self.response_xml.get();
|
||||
}
|
||||
|
||||
// Step 1
|
||||
if self.response_status.get().is_err() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let mime_type = self.final_mime_type();
|
||||
// TODO: prescan the response to determine encoding if final charset is null
|
||||
let charset = self.final_charset().unwrap_or(UTF_8);
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
[abort-after-send.any.html]
|
||||
[XMLHttpRequest: abort() after send()]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[abort-after-send.any.worker.html]
|
|
@ -6,27 +6,6 @@
|
|||
[XMLHttpRequest: send() - Redirect to CORS-enabled resource (307 post with typed array)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: send() - Redirect to CORS-enabled resource (301 GET with explicit Content-Type)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: send() - Redirect to CORS-enabled resource (301 POST with string and explicit Content-Type)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: send() - Redirect to CORS-enabled resource (302 POST with string and explicit Content-Type)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: send() - Redirect to CORS-enabled resource (307 POST with string and explicit Content-Type)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: send() - Redirect to CORS-enabled resource (307 FOO with string and explicit Content-Type)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: send() - Redirect to CORS-enabled resource (308 POST with string and explicit Content-Type)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: send() - Redirect to CORS-enabled resource (308 FOO with string and explicit Content-Type)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: send() - Redirect to CORS-enabled resource (308 FOO with string and explicit Content-Type text/plain)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[xmlhttprequest-network-error-sync.htm]
|
||||
type: testharness
|
||||
[XMLHttpRequest: members during network errors (sync)]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[xmlhttprequest-network-error.htm]
|
||||
type: testharness
|
||||
[XMLHttpRequest: members during network errors]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue