Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upXMLHttpRequest.responseXML should return null when a network error occurs #24285
Comments
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
Hi!
Thanks for putting up these tasks marked as Easy :) |
|
|
Hi @petosorus , thanks for looking into this!
I think it might be worth mentioning that, with reading the commit of So, as @jdm answered, yes, the check of response_status should be done between Maybe it's worth updating the comment of Ex. - // Step 1
+ // Caching: if we have existing response xml, redirect it directly
let response = self.response_xml.get();
...
+ // Step 1.
<!-- the response_status check --> |
|
Yes, that would be an improvement! |
|
Ok, that's cool with me! I'll start tonight then. @highfive: assign me |
|
Hey @petosorus! Thanks for your interest in working on this issue. It's now assigned to you! |
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 -->
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 -->
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 -->
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 -->
Spec: https://xhr.spec.whatwg.org/#document-response step 1
Code:
components/script/dom/xmlhttprequest.rsTest:
./mach test-wpt tests/wpt/web-platform-tests/xhr/xmlhttprequest-network-error.htm./mach test-wpt tests/wpt/web-platform-tests/xhr/xmlhttprequest-network-error-sync.htmWe fail the
assert_equals(client.responseXML, null, "responseXML")check, because we don't check ifself.response_statusis an Err value in thedocument_responsemethod before creating a document response to return.