servo/components/script
bors-servo 5a5a76cc5d Auto merge of #13058 - malisas:malisa-responseAPI, r=Manishearth,jdm
Response API

<!-- Please describe your changes on the following line: -->
This PR adds the [dom::Response](https://fetch.spec.whatwg.org/#response-class) implementation and addresses #11896.

The relevant passing tests` expectations have been updated.

In order to allow non-UTF-8-encoded status messages, `net_traits::response::Response`'s `raw_status` field has been changed from type [`Option<RawStatus>`](https://doc.servo.org/hyper/http/struct.RawStatus.html) to type `Option<(u16, Vec<u8>)>`. As a result, a few other files which rely on the `raw_status` field were affected and updated.

TODOs:
- The `body` and `trailer` methods. Relies on implementation of `ReadableStream` and `Promise`s.
- Similarly, replace the dummy constructor `_body: Option<USVString>` argument with `body: ResponseBodyInit`.
- Currently, whenever `r's response's header list` or `r's Headers object` are mentioned, I always modify the `headers_reflector` field (of type dom::Headers, or `r's Headers object`) and not the corresponding hyper::Headers list in the net_traits::Response field. A completely accurate interpretation of the spec might consider making both of these lists the same thing via a reference. [Discussion](https://github.com/whatwg/fetch/issues/358) was [had](https://github.com/servo/servo/pull/12884).

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/13058)
<!-- Reviewable:end -->
2016-09-08 18:58:05 -05:00
..
docs
dom Auto merge of #13058 - malisas:malisa-responseAPI, r=Manishearth,jdm 2016-09-08 18:58:05 -05:00
parse script: Obtain referrer policy from header 2016-07-15 08:12:24 -07:00
task_source Implement file reading task source 2016-07-14 13:27:42 -04:00
bluetooth_blacklist.rs Add WebBluetooth Blacklist support 2016-05-31 17:05:45 +02:00
build.rs Native MSVC windows build, convert to cmake 2016-08-17 09:50:51 -04:00
Cargo.toml Update cssparser 2016-09-07 14:13:56 +08:00
clipboard_provider.rs Remove ConstellationChan. 2016-05-19 17:13:44 +02:00
CMakeLists.txt Native MSVC windows build, convert to cmake 2016-08-17 09:50:51 -04:00
devtools.rs Implement Reflectable for GlobalRef. 2016-09-07 10:52:44 +02:00
document_loader.rs Integrate service worker manager thread 2016-07-16 23:29:44 +05:30
layout_wrapper.rs Rename DeclarationBlock to ApplicableDeclarationBlock 2016-09-06 14:17:26 +08:00
lib.rs Move DOMRefCell to style. 2016-08-31 02:34:05 +02:00
mem.rs
network_listener.rs Move boxing to runnable initialization 2016-07-13 11:10:23 -06:00
origin.rs Make script origins sendable and immutable. 2016-05-27 17:16:13 +02:00
script_runtime.rs Remove mutex from Trusted 2016-08-29 11:56:28 +02:00
script_thread.rs Remove mutex from Trusted 2016-08-29 11:56:28 +02:00
serviceworker_manager.rs Remove unnecessary clone from ServiceWorkerManager::prepare_activation 2016-08-27 14:45:17 +08:00
textinput.rs Take selection direction into account when setting selection 2016-07-06 16:14:32 -06:00
timers.rs Auto merge of #11872 - eddyb:back-to-roots, r=Ms2ger 2016-07-04 11:03:35 -07:00
unpremultiplytable.rs
webdriver_handlers.rs Update rust-mozjs dependency 2016-08-24 12:56:49 +02:00