Repository navigation
Implement Blob response for XMLHttpRequest: #9623 - #9629
Conversation
| } | ||
| } | ||
| XMLHttpRequestResponseType::Blob => { | ||
| match self.response_blob.get() { |
There was a problem hiding this comment.
This should really go into a separate method down there, named blob_response, with an annotation containing the corresponding link to the WHATWG specification.
|
Review status: 0 of 2 files reviewed at latest revision, 3 unresolved discussions. components/script/dom/xmlhttprequest.rs, line 126 [r1] (raw file): components/script/dom/xmlhttprequest.rs, line 757 [r1] (raw file): Comments from the review on Reviewable.io |
| type: testharness | ||
| [XMLHttpRequest: The response attribute: Blob data] | ||
| expected: FAIL | ||
| expected: PASS |
There was a problem hiding this comment.
This is not how we change test expectations. If it is expected to PASS, you can just delete the line. In fact, since there's only one expected test failure in this .ini file, you can delete the entire file.
|
Review status: 0 of 2 files reviewed at latest revision, 4 unresolved discussions. components/script/dom/xmlhttprequest.rs, line 733 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: 0 of 2 files reviewed at latest revision, 4 unresolved discussions. tests/wpt/metadata/XMLHttpRequest/response-data-blob.htm.ini, line 4 [r1] (raw file): Comments from the review on Reviewable.io |
| encoding.decode(&self.response.borrow(), DecoderTrap::Replace).unwrap().to_owned() | ||
| } | ||
|
|
||
| fn blob_response(&self) -> Root<Blob> { |
There was a problem hiding this comment.
Spec link above this function, please. (https://xhr.spec.whatwg.org/#blob-response)
| fn blob_response(&self) -> Root<Blob> { | ||
| // Step 1 | ||
| match self.response_blob.get() { | ||
| Some(response) => response, |
There was a problem hiding this comment.
We could simplify this step as if let Some(blob) = self.response_blob.get() { return blob; }
|
Review status: 0 of 2 files reviewed at latest revision, 10 unresolved discussions. components/script/dom/xmlhttprequest.rs, line 1054 [r3] (raw file): components/script/dom/xmlhttprequest.rs, line 1061 [r3] (raw file): Comments from the review on Reviewable.io |
| return response; | ||
| } | ||
| // Step 2 | ||
| let mime = match self.final_mime_type() { |
There was a problem hiding this comment.
let mime = self.fial_mime_type().unwrap_or("").to_string();
|
Almost there! r=me with that final nit. |
| return response; | ||
| } | ||
| // Step 2 | ||
| let mime = self.final_mime_type().map(|x| x.to_string()).unwrap_or("".to_owned()); |
There was a problem hiding this comment.
use std::string::ToString
and then .as_ref().map(ToString::to_string) should work.
|
Ah, brainfarted. Everything looks fine right now, thanks for working on this! @bors-servo r+ |
|
📌 Commit 5dc108b has been approved by |
Implement Blob response for XMLHttpRequest: #9623 My first attempt at implementing the Blob response for XMLHttpRequest. The expected result for the response `tests/wpt/web-platform-test/HMLHttpRequest/response-blob-data.htm` is also changed to `PASS`. Please let me know if you see any areas in which I can improve this PR! Fixes #9623 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9629) <!-- Reviewable:end -->
|
💔 Test failed - mac-dev-unit |
|
⌛ Testing commit 0b0e147 with merge 6aa908a... |
Implement Blob response for XMLHttpRequest: #9623 My first attempt at implementing the Blob response for XMLHttpRequest. The expected result for the response `tests/wpt/web-platform-test/HMLHttpRequest/response-blob-data.htm` is also changed to `PASS`. Please let me know if you see any areas in which I can improve this PR! Fixes #9623 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9629) <!-- Reviewable:end -->
|
💔 Test failed - linux-rel |
|
⌛ Testing commit 0b0e147 with merge d8e1237... |
Implement Blob response for XMLHttpRequest: #9623 My first attempt at implementing the Blob response for XMLHttpRequest. The expected result for the response `tests/wpt/web-platform-test/HMLHttpRequest/response-blob-data.htm` is also changed to `PASS`. Please let me know if you see any areas in which I can improve this PR! Fixes #9623 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9629) <!-- Reviewable:end -->
|
💔 Test failed - linux-rel |
|
⌛ Testing commit 0b0e147 with merge e8ae7e4... |
Implement Blob response for XMLHttpRequest: #9623 My first attempt at implementing the Blob response for XMLHttpRequest. The expected result for the response `tests/wpt/web-platform-test/HMLHttpRequest/response-blob-data.htm` is also changed to `PASS`. Please let me know if you see any areas in which I can improve this PR! Fixes #9623 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9629) <!-- Reviewable:end -->
|
💔 Test failed - mac-rel-css |
|
⚡ Previous build results for android, gonk, linux-dev, mac-dev-unit are reusable. Rebuilding only linux-rel, mac-rel-css, mac-rel-wpt... |
|
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt |
My first attempt at implementing the Blob response for XMLHttpRequest. The expected result for the response
tests/wpt/web-platform-test/HMLHttpRequest/response-blob-data.htmis also changed toPASS. Please let me know if you see any areas in which I can improve this PR!Fixes #9623