Please sign in to comment.
Auto merge of #12700 - jeenalee:jeena-requestAPI, r=jdm
Implement the Request API <!-- Please describe your changes on the following line: --> This PR implements the [Request API](https://fetch.spec.whatwg.org/#request-class) for the Fetch API, including its attributes and constructor, and introduces changes in relevant files. This Request integrates `net_traits::request::Request` and `dom::headers`. There are few related TODOs and comments: 1. `net_traits::request::Request`'s `headers` field does not point to `dom::request::Request`'s `headers_reflector`. 2. Every Constructor step that involves `Readable Stream` object is not implemented. 3. Every Constructor step that involves `entry settings object` or `environment settings object` is not implemented. 4. `./mach build -d` does not report any error, but prints a few warnings about unused variables related to (1) and (2). 5. Enum `ReferrerPolicy` generated by `RequestBinding` does not match `net_traits::request::Request`'s implementation. 6. `Promise`s in Body webidl are commented out. --- <!-- 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 #11895 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because tests for the Request API already exists, but this commit does not implement the interface fully. <!-- 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/12700) <!-- Reviewable:end -->
- Loading branch information
Showing with 1,082 additions and 399 deletions.
- +14 −12 components/net_traits/request.rs
- +2 −0 components/script/dom/bindings/trace.rs
- +95 −59 components/script/dom/headers.rs
- +1 −0 components/script/dom/mod.rs
- +820 −0 components/script/dom/request.rs
- +19 −0 components/script/dom/webidls/Body.webidl
- +108 −0 components/script/dom/webidls/Request.webidl
- +0 −9 tests/wpt/metadata/fetch/api/headers/headers-basic.html.ini
- +0 −9 tests/wpt/metadata/fetch/api/headers/headers-casing.html.ini
- +0 −6 tests/wpt/metadata/fetch/api/headers/headers-combine.html.ini
- +0 −3 tests/wpt/metadata/fetch/api/headers/headers-errors.html.ini
- +0 −6 tests/wpt/metadata/fetch/api/headers/headers-normalize.html.ini
- +0 −57 tests/wpt/metadata/fetch/api/request/request-error.html.ini
- +0 −141 tests/wpt/metadata/fetch/api/request/request-headers.html.ini
- +0 −96 tests/wpt/metadata/fetch/api/request/request-init-001.sub.html.ini
- +21 −1 tests/wpt/metadata/fetch/api/request/request-structure.html.ini
- +1 −0 tests/wpt/mozilla/tests/mozilla/interfaces.html
- +1 −0 tests/wpt/mozilla/tests/mozilla/interfaces.worker.js
Oops, something went wrong.