mirror of
https://github.com/servo/servo.git
synced 2025-08-14 01:45:33 +01:00
Auto merge of #13895 - lautat:dom-response-clone-step-1, r=KiChjang
Implement Step 1 of Response API Clone Method <!-- Please describe your changes on the following line: --> Implements first step of response API Clone method. Response Clone test expectations have been updated. Fixes issue #13888. --- <!-- 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 #13888. <!-- Either: --> - [X] There are tests for these changes <!-- 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/13895) <!-- Reviewable:end -->
This commit is contained in:
commit
2772626d91
2 changed files with 3 additions and 4 deletions
|
@ -298,7 +298,9 @@ impl ResponseMethods for Response {
|
|||
// https://fetch.spec.whatwg.org/#dom-response-clone
|
||||
fn Clone(&self) -> Fallible<Root<Response>> {
|
||||
// Step 1
|
||||
// TODO: This step relies on body and stream, which are still unimplemented.
|
||||
if self.is_locked() || self.body_used.get() {
|
||||
return Err(Error::Type("cannot clone a disturbed response".to_string()));
|
||||
}
|
||||
|
||||
// Step 2
|
||||
let new_response = Response::new(&self.global());
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
[Check cloned response's body]
|
||||
expected: FAIL
|
||||
|
||||
[Cannot clone a disturbed response]
|
||||
expected: FAIL
|
||||
|
||||
[Cloned responses should provide the same data]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue