Commit graph

36 commits

Author SHA1 Message Date
Patrick Shaughnessy
67827debd8 Now just one is_cors_safelisted_request_header, with closer spec alignment 2019-12-16 09:07:02 -05:00
Kagami Sascha Rosylight
b697621b05 Support WebIDL record<> 2019-10-15 17:14:00 +09:00
Simon Sapin
1d38bc0419 Fix some new warnings 2019-06-22 14:59:09 +02:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Bastien Orivel
024b40b39d Update hyper to 0.12 2018-11-01 19:17:36 +01:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Gregory Terzian
d196f3de62 copy headers from script request to net request 2017-11-15 19:28:03 +08:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
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
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
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02: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
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Anthony Ramine
19108aa330 Pass a &GlobalScope to WebIDL static methods and constructors 2016-10-06 21:35:49 +02:00
Anthony Ramine
fcb59d3057 Make reflect_dom_object take a &GlobalScope 2016-10-06 20:59:09 +02:00
Jeena Lee
3216009731 Implement the Fetch method 2016-09-29 08:19:41 -07:00
Jeena Lee
3b75d223f1 Enable OpenEndedDictionary in Headers
Expected wpt results are updated as well.
2016-09-22 15:01:34 -07:00
bors-servo
7264592397 Auto merge of #13004 - jeenalee:combine-headers, r=jdm
Update DOM headers `append` and `delete`

<!-- Please describe your changes on the following line: -->
Two changes are included in this PR:
1. A resolved TODO comment in `delete` is removed.
2. `append` method adds a space after a comma when combining header values. Expected wpt results are updated with this change.

---
<!-- 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/13004)
<!-- Reviewable:end -->
2016-09-12 09:21:52 -05:00
Malisa Smith
faf32a7cfb dom::Response implementation 2016-09-06 19:58:32 -07:00
Jeena Lee
8946a65c5a Refactor combine method, and update expected wpt results
Instead of creating an array with length of 1 of `b','`, then pushing
the first element of that array to `combined_value`, push a `b','`
directly to `combined_value`.

The web platform test for combining headers has been updated to reflect
the Fetch
spec (https://github.com/w3c/web-platform-tests/pull/3646). The expected
web platform test results that will be affected by this change are updated.
2016-09-06 11:31:39 -07:00
Jeena Lee
e3624edbf6 Implement iterable for Headers.
This commit implements iterable in DOM Headers based on iterable
implementation from #12819. Expected wpt results are updated as well.
2016-08-24 13:12:35 -07:00
Jeena Lee
2c4b268a45 Remove TODO from step 4 of delete
The confusion around step 4 of `delete` method has been resolved through https://github.com/whatwg/fetch/issues/372.
2016-08-23 15:49:03 -07:00
Jeena Lee
cc7b1c508a Include "content-type" in cors safelisted request headers.
This commit allows headers with "content-type" name to be classified as valid header name, depending on its value according to [the Fetch spec](https://fetch.spec.whatwg.org/#cors-safelisted-request-header). As a result of this change, more request web platform tests pass, whose expected test results are updated with this commit.
2016-08-22 11:06:53 -07:00
Jeena Lee
69f4cf6808 Modify Headers API to correctly validate value.
This commit modifies the headers API script to correctly validate value. As a result of this change, more wpt tests pass. The commit also changes the expected test results.
2016-08-12 15:40:09 -07: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
Malisa Smith
e631d3a5f6 Headers API constructor and methods
- Reworked the append method to support the inner `hyper::header::Headers`'s HashMap `insert` method, which overwrites entries instead of appending.
- Filled out constructor as well as delete, get, has, and set methods.
- Updated relevant test expectations
2016-07-30 10:32:51 -07:00
Malisa Smith
272d12da26 Small changes to Headers.webidl and headers.rs
Expose the Headers interface to the Window scope and to Workers
Move Append function inside HeadersMethods trait
2016-07-20 11:41:35 -07:00
Malisa Smith
60549c47ba makes XMLHttpRequest::SetRequestHeader call dom::headers::is_forbidden_header_name 2016-07-19 13:43:50 -07:00
Jeena Lee
530b02790b Add the append method for the Headers API for the Fetch API
This commit will add the append method and associated helper functions, and introduce any necessary changes for it.
2016-07-19 13:40:31 -07:00