Commit graph

57 commits

Author SHA1 Message Date
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
bors-servo
1282e0d808 Auto merge of #18635 - servo:RENAME-ALL-THE-THINGS, r=emilio
Rename JS<T> to Dom<T>, Root<T> to DomRoot<T>, and other things

<!-- 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/18635)
<!-- Reviewable:end -->
2017-09-26 03:20:05 -05:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
577370746e Rename DOMRefCell<T> to DomRefCell<T>
I don't want to do such a gratuitous rename, but with all the other types
now having "Dom" as part of their name, and especially with "DomOnceCell",
I feel like the other cell type that we already have should also follow
the convention. That argument loses weight though when we realise there
is still DOMString and other things.
2017-09-26 09:49:08 +02:00
Anthony Ramine
c52fd0a780 Rename MutNullableJS<T> to MutNullableDom<T> 2017-09-26 09:49:02 +02:00
Anthony Ramine
7be32fb237 Rename JS<T> to Dom<T> 2017-09-26 09:48:55 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Daniel Kolsoi
96f9cc77e6 Removed integrity check and test for no-cors requests
Also updated request-headers.html manifest hash
2017-09-25 19:11:30 -04:00
Corey Farwell
befe538472 Utilize match_ignore_ascii_case! in more places. 2017-07-29 09:58:09 +00:00
Keith Yeung
6adc653083 Introduce service-worker mode 2017-06-22 23:48:07 -07:00
Simon Sapin
7af5a7fd54 Untry script 2017-06-18 13:21:49 +02:00
Anthony Ramine
e566bc7b1c Update the WebIDL parser 2017-06-09 13:57:30 +02:00
Anthony Ramine
9394469ede Kill Request::omit_origin_header 2017-04-07 12:52:50 +02:00
Anthony Ramine
cb2eb81208 Remove all internal mutability from Request 2017-04-03 12:39:07 +02:00
bors-servo
a204c4176d Auto merge of #15715 - nox:custom-derive, r=SimonSapin
Make #[dom_struct] a proc_macro attribute

The rustup is needed for https://github.com/rust-lang/rust/pull/40039.

<!-- 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/15715)
<!-- Reviewable:end -->
2017-02-24 05:56:30 -08:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Mathieu Hordesseaux
6f97ce826b Make Request throw less often (fixes #13457) 2017-02-23 18:55:52 -05:00
Ms2ger
f7e2f0e641 Use RootedTraceableBox for dictionaries. 2017-02-16 11:03:26 +01:00
Ms2ger
8ce9ca6243 Use Heap for dictionary and union members. 2017-02-16 11:03:21 +01:00
Dowon Cha
8bf924dc79 Added Websocket to RequestMode enum
set unreachable in dom/request.rs for websocket

fixed imports
2017-01-08 09:17:53 -05:00
Ms2ger
75be03041c Use the API base URL in Fetch APIs. 2016-12-19 19:43:26 +01:00
Anthony Ramine
1327ebd52f Remove HeapGCValue
It could be used to have mutable JSVal fields without GC barriers.
With the removal of that trait, MutHeap and MutNullableHeap can respectively
be replaced by MutJS and MutNullableJS.
2016-12-12 10:47:54 -10:00
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -10:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
bors-servo
e3f07dfa16 Auto merge of #14156 - frewsxcv:cors-capitalization, r=KiChjang
Update CORS naming from 'CORS' to 'Cors'.

As per:

https://aturon.github.io/style/naming/README.html#general-conventions-[rfc-#430]

Acronyms should be considered one word and not all caps.

<!-- 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/14156)
<!-- Reviewable:end -->
2016-11-10 14:43:36 -06:00
Corey Farwell
bf8752ac9e Update CORS naming from 'CORS' to 'Cors'.
As per:

https://aturon.github.io/style/naming/README.html#general-conventions-[rfc-#430]

Acronyms should be considered one word and not all caps.
2016-11-09 18:30:30 -05:00
bors-servo
9a7559fd82 Auto merge of #13802 - jeenalee:request-headers, r=jdm
Allow Request's Headers to be created with various objects

<!-- Please describe your changes on the following line: -->

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.
---

<!-- 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 #13758 (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/13802)

<!-- Reviewable:end -->
2016-11-09 15:04:10 -06:00
Jeena Lee
bfd999f71e Fill r's headers with headers_copy when HeadersInit::Headers is given
Instead of filling request's headers whenever a `HeadersInit` is given, this
patch fills request's headers only when `HeadersInit` with a type of
`Headers` is given. Previously, the constructor tried to fill request's headers
with itself, causing Servo to crash.
2016-11-07 21:56:45 -08:00
Raghav
26dac98546 Code review comments and upstream merge conflicts
Incorporated code review comments in components/net/http_loader.rs
Resolved merge conflicts in cargo.lock file. Updated ReferrerPolicy in
lib.rs
2016-11-04 11:18:22 -04:00
Ms2ger
277c6d0154 Move ReferrerPolicy to net_traits. 2016-11-04 10:43:37 +01:00
Raghav
c24aa56377 Network Security : Implement StrictOrigin and StrictOriginWhenCrossOrigin
Referer policy strict-origin and strict-origin-when-cross-origin changes have been implemented. Relevant unit test cases have been added. Enum for RefererPolicy has been added to hyper codebase and v 0.9.11 of hyper contains these changes.

This commit also contains changes related to upgrade of hyper from v0.9.10 to v0.9.11. Other dependencies changed are rayon, utils, num_cpus.
2016-11-04 03:17:04 -04:00
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