Commit graph

566 commits

Author SHA1 Message Date
Josh Matthews
63714c90fb Upgrade to Spidermonkey 67. 2019-06-26 18:10:46 -04:00
Bastien Orivel
b7e10a8224 Make tidy happy 2019-05-25 23:23:42 +02:00
Bastien Orivel
0b29caa554 Add support for attributes to the inCompartments binding parameter 2019-05-25 14:43:44 +02:00
Bastien Orivel
7dbff6efb7 Add an inCompartments config for bindings 2019-05-24 23:02:38 +02:00
Josh Matthews
4328713f71 Update to SpiderMonkey 66. 2019-05-10 22:43:43 -04:00
Peter Hall
8bfd4dc1e2 #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
Anthony Ramine
4d527b20ee Simplify RootedReference and make it specifically about slicesIt's now called DomSlice<T>. 2019-03-11 16:25:39 +01:00
Anthony Ramine
1744a42dad Don't use RootedReference for Option<T> in codegen anymore 2019-03-10 18:24:35 +01:00
Anthony Ramine
5fe5e5d6de Remove most RootedReference uses
We can replace all uses of RootedReference for Option<T> by Option::deref calls.
2019-03-10 17:51:35 +01:00
Manish Goregaokar
ce635b715b Add support for default dict values being boolean, use in MediaStreamConstraints 2019-03-04 15:31:47 +05:30
Manish Goregaokar
caa05948bf Add aspect/frameRate/sampleRate parameters 2019-03-04 15:31:47 +05:30
Manish Goregaokar
7b48df53a1 Update WebIDL.py to 4166cae81546
4166cae815

Pulls in changes from https://bugzilla.mozilla.org/show_bug.cgi?id=1359269
2019-03-04 14:03:31 +05:30
Piotr Szpetkowski
abd577bfd4
Update bool pattern matching into if-else 2019-01-30 20:54:12 +01:00
Josh Matthews
644101e1e4 Update to new JS runtime creation APIs. 2019-01-15 14:00:05 -05:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Simon Sapin
9f9bf8f6bc Switch most crates to the 2018 edition 2018-11-06 16:12:04 +01:00
Simon Sapin
acabd50f03 Use 2018-style paths in generated DOM bindings 2018-11-06 15:14:17 +01:00
Keith Yeung
99589d2f2a Handle default empty sequence values 2018-11-01 14:54:23 -07:00
CYBAI
8b28921136 Make expectionCode of Promise have newline character automatically
In the `fill` method, it will check if the exception code is empty
string or has newline character in the end of string or not. However, we
didn't do any change to exceptionCode when type is Promise. Thus, we add
the newline character to make it pass the checking in `fill` method.

See more detail from the log of IRC: https://mozilla.logbot.info/servo/20180501#c14692647
2018-10-18 01:38:27 +08:00
Simon Sapin
a846ed1654 Upgrade to rustc 1.31.0-nightly (8c4ad4e9e 2018-10-04)
CC https://github.com/rust-lang/rust/issues/54846
2018-10-05 15:06:29 +02:00
Anthony Ramine
baa94702e4 Properly set desc.obj in CodegenRust.py (fixes #11868) 2018-09-04 13:57:10 +02:00
Anthony Ramine
900a19058e Support unions of objects in overloads
Part of #20513, implementing the parts useful for WebGL.
2018-08-30 16:15:40 +02:00
Alan Jeffrey
74c1e00d81 Upgraded to SM 60 2018-08-20 18:22:29 -04:00
Manish Goregaokar
cceaede96a Make (dictionary)::empty() safe
It currently works by constructing from null (which will throw a runtime
error if there are non-defaultable members).

This changes it so that we no longer need a JSContext to construct this,
so it can be safely constructed. In the case of non-defaultable members,
this method simply does not exist.
2018-07-06 13:10:56 -07:00
Manish Goregaokar
ad198993b1 Assert that DOM structs have the correct first field
DOM structs embed their parent type as their first field. This
introduces a `.parent()` method to the DOM struct that returns its first
field, and codegens a type assert that ensures that `.parent()` returns
the parent struct.

This generates:

On `#[dom_struct]`:

```rust
impl HasParent for Type {
    type Parent = ParentType;
    fn as_parent(&self) -> ParentType {
        &self.first_field
    }
}
```

In the codegen files:

```rust
impl Type {
    fn __assert_parent_type(&self) {
        let _: &ParentType = self.as_parent();
    }
}
````
2018-07-03 09:39:29 -07:00
Alan Jeffrey
d0cc9d2cd5 Updated to mozjs v0.7.1. 2018-05-30 14:44:47 -05:00
Anthony Ramine
938f1362e7 Update the WebIDL parser 2018-04-03 14:06:07 +02:00
Marcin Mielniczuk
356c57e628 Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
Igor Matuszewski
2437a8472e Unify argument auto rooting in codegen 2018-03-23 19:25:20 +01:00
Igor Matuszewski
20f21cb5f8 Adapt uniform[fv] and similar to accept typed array args 2018-03-23 19:25:19 +01:00
Igor Matuszewski
64dc0c4b9e Root any members in dictionaries 2018-03-16 16:53:38 +01:00
Igor Matuszewski
760e0a5b57 Root JS object members in dictionaries 2018-03-16 16:53:30 +01:00
Igor Matuszewski
c29fcb80f3 Use helper is_typed_array function 2018-03-14 18:43:27 +01:00
Igor Matuszewski
6beb32e28e Support nullable typed arrays in codegen 2018-03-14 18:43:27 +01:00
Igor Matuszewski
e025bbb079 WIP: Accept typed array arguments in codegen 2018-03-14 18:43:26 +01:00
Igor Matuszewski
17ecbaf8ff Support objects in WebIDL unions
Fixes #17011
2018-03-13 22:47:36 +01:00
Anthony Ramine
de426baecc Make the private callback methods taking a raw this pointer unsafe 2018-01-25 12:07:13 +01:00
Anthony Ramine
74dabbdc62 Kill dead callback codegen code 2018-01-25 11:45:17 +01:00
Anthony Ramine
f903da0a7b Make callbacks' new methods unsafe
They take raw pointers to contexts and objects.
2018-01-25 11:25:23 +01:00
Simon Sapin
52eda6082f Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject> 2018-01-22 17:41:25 +01:00
Simon Sapin
4d459bce32 Fix tyvar_behind_raw_pointer warnings
https://github.com/rust-lang/rust/issues/46906
2018-01-10 20:54:35 +01:00
Igor Matuszewski
a01d1eabef Root sequence<{any,object}> IDL arguments using CustomAutoRooter
Also pulls in mozjs 0.1.10 to support the change.
2018-01-05 18:21:25 +01:00
olmanz
83adc7b769 Moved pop_current_element_queue() and push_new_element_queue() to htmlconstructor.rs 2017-11-16 19:14:12 +01:00
olmanz
d71ff786c6 Moved function html_constructor() from interface.rs to new file htmlconstructor.rs 2017-11-16 13:06:50 +01:00
Fernando Jiménez Moreno
2974dae431 Fix binding generation for overloaded functions with optionals and default values 2017-11-11 08:41:19 +01:00
Bastien Orivel
29b4eec141 Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
Imanol Fernandez
3ed5899a64 Fix Const IDL value compilation errors in codegen 2017-10-25 12:56:39 +02:00
Gecko Backout
11c64178d8 Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18809
2017-10-19 21:26:51 +00:00
Bastien Orivel
e8e2d0a4b2 Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
2017-10-19 15:01:17 +02: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