Commit graph

126 commits

Author SHA1 Message Date
Jeena Lee
e821da81ce Remove unused use statement 2016-10-27 15:54:08 -07:00
Jeena Lee
baacc692f0 Address review comments 2016-10-27 15:42:09 -07:00
Jeena Lee
94ea24e47b Allow Request's Headers to be created with various objects
While Headers could be constructed correctly with an array or
object (open ended dictionary/MozMap), Request's Headers failed to be
created with non-Headers object (such as array or open ended
dictionary/MozMap).

Before, Request's Headers could be filled with only a Headers object in
Step 28. This has been expanded to accommodate array and open ended
dictionary.

Step 29 empties the Request's Headers list after it had been filled in
Step 28, thus resulting in an empty Headers object when it shouldn't
be. This step has been removed with a comment in this commit.

If a RequestInit Headers is *not* given, but a RequestInfo Headers is
given, RequestInfo Headers should be used to construct Request
Headers. That step has been added after Step 31.

Corresponding wpt result is updated in this commit.
2016-10-17 09:14:30 -07:00
Jeena Lee
d03167d980 Fix Request's Headers to be cloned correctly
Previously, when `Clone()` was called, Headers of the template Request
did not get cloned properly. This commit fixes that issue, and updates
the expected wpt results.
2016-10-12 12:49:02 -07:00
Corey Farwell
eee990df2f Cleanup logic, remove unnecessary allocations in Request API. 2016-10-10 15:45:31 -04:00
Anthony Ramine
d8e92bb271 Rename Reflectable::global_scope to global 2016-10-06 21:36:41 +02:00
Anthony Ramine
19108aa330 Pass a &GlobalScope to WebIDL static methods and constructors 2016-10-06 21:35:49 +02:00
Anthony Ramine
99b346ac52 Make Request::new take a &GlobalScope 2016-10-06 21:35:44 +02:00
Anthony Ramine
f38159b7d3 Introduce GlobalScope::get_url 2016-10-06 21:35:44 +02:00
Anthony Ramine
ae6af5172b Introduce Reflectable::global_scope 2016-10-06 21:35:38 +02:00
Anthony Ramine
27f100b1d4 Introduce GlobalScope::pipeline_id 2016-10-06 20:59:13 +02:00
Anthony Ramine
fcb59d3057 Make reflect_dom_object take a &GlobalScope 2016-10-06 20:59:09 +02:00
Ms2ger
cb7e6715fb Provide the fetched data to fetch() consumers. 2016-10-06 14:21:03 +02:00
Simon Sapin
fbde392c3d Revert "Make DOMRefCell use style’s copy of RefCell"
This reverts commit ec723057b2.
2016-10-04 18:35:01 +02:00
Tom Huibregtse
abfbcfe9c4 Rename hyper import and update as HttpMethod 2016-10-01 20:38:45 -05:00
Jan Zerebecki
95a7482d26 Remove same-origin-data-url flag from fetch implementation
The spec removed it. Check the scheme instead, data is always same origin now,
except for workers.
This also updates the comments to make step numbers match the spec.
Closes #13362
2016-10-01 00:27:03 -07:00
Jeena Lee
3216009731 Implement the Fetch method 2016-09-29 08:19:41 -07:00
Malisa Smith
a5e5cd0e9e impl Body mixin for dom::Response and dom::Request 2016-09-28 22:10:53 -07:00
Jeena Lee
3b75d223f1 Enable OpenEndedDictionary in Headers
Expected wpt results are updated as well.
2016-09-22 15:01:34 -07:00
Nicolas
924136ee0c Fix most typoes for: "referer" -> "referrer" 2016-09-16 12:40:17 -04:00
Aneesh Agrawal
9d097e7d15 Use fn pipeline_id consistently, not fn pipeline
Consistently use the name 'pipeline_id' to refer to a function that
returns an (optional) PipelineId.

This was prompted by discovering both fn pipeline and fn pipeline_id
doing the same job in htmliframeelement.rs.

Note that there is fn pipeline in components/compositing/compositor.rs,
but that actually returns an Option<&CompositionPipeline>, not any kind
of PipelineId.
2016-09-13 15:17:40 -04:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
bors-servo
882872897e Auto merge of #12851 - jeenalee:request, r=nox
Fix step 31 of the Request constructor.

<!-- Please describe your changes on the following line: -->
This PR fixes the step 31 of the Request constructor to fill Request's Headers object and rethrow any exceptions. Additionally, it removes unnecessary line breaks, comments, and redundant function.

---
<!-- 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 #12845 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this PR does not change the behavior of the Request constructor.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

In addition to fixing step 31 of the Request constructor, this
commit also:
- remove `get_current_url` function, and use `net_request::request`'s
built-in `current_url` method
- clean up unnecessary line breaks and comments

<!-- 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/12851)
<!-- Reviewable:end -->
2016-08-13 15:26:15 -05:00
Jeena Lee
2693027727 Fix step 31 of the Request constructor.
In addition to fixing step 31 of the Request constructor, this
commit also:
- remove get_current_url function, and use net_request::request's
built-in current_url method
- clean up unnecessary line breaks and comments
2016-08-13 13:14:07 -07:00
Anthony Ramine
fc6faf72ee Update Rust to 1.12.0-nightly (1deb02ea6 2016-08-12) 2016-08-13 18:34:44 +02:00
Jeena Lee
fabe2b8f7e Implement the Request API for the Fetch API.
This commit adds new files related to implementing the [Request
API](https://fetch.spec.whatwg.org/#request-class). This commit also
changes the expected web platform tests results. It also modifies the
following files:

components/net_traits/request.rs
HeapSizeOf is implemented in net_traits/request so that dom::request can
be used as a wrapper around net_traits::request::Request.

components/script/dom/headers.rs
Several methods are added to Headers so that request can access and
modify some of the headers fields.
2016-08-12 15:39:40 -07:00