Commit graph

680 commits

Author SHA1 Message Date
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
Simon Sapin
49e4540ece Update rust-mozjs 2017-10-16 20:20:21 +02:00
Simon Sapin
3bb76a5be5 Don’t rely on unstable 'const fn's in rust-mozjs, so we can remove them. 2017-10-16 20:20:00 +02:00
Simon Sapin
99b052d3a6 Move remaining uses of NonZero to our nonzero crate 2017-10-16 20:19:59 +02:00
Simon Sapin
e2fafd2dfc Replace NonZero<*mut JSObject> with a wrapper to enable local trait impls. 2017-10-16 20:19:56 +02:00
Guillaume Gomez
3d0b7fbc41 Implement EventListenerOptions for EventTarget
For now, only "capture" is supported.
2017-09-30 02:12:35 +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
e2dac78d36 Rename LayoutJS<T> to LayoutDom<T> 2017-09-26 09:49:04 +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
Josh Matthews
44822c364c Use more named string interpolation. 2017-09-25 16:11:49 -04:00
Josh Matthews
77b3e911c1 Remove almost all uses of Heap::new. 2017-09-25 16:11:49 -04:00
Josh Matthews
f5eb8445b0 Initialize rooted dictionaries to a stable value before setting fields. 2017-09-25 16:11:48 -04:00
Josh Matthews
16166d6673 Derive the Default trait for dictionaries containing GC values. 2017-09-25 16:10:58 -04:00
Josh Matthews
b169689f32 Store rootable dictionary members of dictionaries in RootedTraceableBox. 2017-09-25 16:10:58 -04:00
Josh Matthews
da65698c5c Be more conservative about safety of dictionary and union values.
Mark dictionaries containing GC values as must_root, and wrap them in
RootedTraceableBox in automatically-generated APIs. To accommodate
union variants that are now flagged as unsafe, add RootedTraceableBox
to union variants that need to be rooted, rather than wrapping the
entire union value.
2017-09-25 16:10:58 -04:00
Josh Matthews
e481e8934a Don't generate union conversion functions for object variants. 2017-09-25 16:10:57 -04:00
Anthony Ramine
658dc8a501 Rename a couple of Promise methods 2017-09-21 15:35:04 +02:00
Emilio Cobos Álvarez
90fb284720
script: Properly implement LegacyPlatformGetOwnProperty in WebIDL.
We were missing the "ignoreNamedProperties" bit, which my previous patch
uncovers.
2017-09-18 09:15:14 +02:00
Emilio Cobos Álvarez
6edefb829c
script: remove unused function. 2017-09-18 09:15:13 +02:00
Emilio Cobos Álvarez
f5d16fc069
script: Fix integer-JSID handling in named getters.
Fixes #10686
2017-09-18 09:15:13 +02:00
Emilio Cobos Álvarez
b29e56eefc
script: Fix code generation for named getters.
Fixes part of #18535
2017-09-17 18:42:23 +02:00
Connor Brewster
1a9f4cad08 Fix compartment mismatch issue 2017-08-09 14:36:14 -06:00
Fernando Jiménez Moreno
354d94059b Generate DOM bindings imports for webidl typedefs 2017-08-02 13:15:45 +02:00
Connor Brewster
438191e0b2 Implement CEReactions codegen 2017-07-18 08:18:22 -06:00
Connor Brewster
2333b39569 Implement HTMLConstructor 2017-06-15 21:32:22 -06:00
Connor Brewster
0713257add Generate GetConstructorObject for all interfaces 2017-06-13 15:24:03 -06:00
Anthony Ramine
e566bc7b1c Update the WebIDL parser 2017-06-09 13:57:30 +02:00
Alan Jeffrey
43ca260689 Renamed BrowsingContext to WindowProxy in script. 2017-05-12 15:02:35 -05:00
ddh
aa7b4f6162 changed to use globalscope origin 2017-04-26 00:42:15 +01:00
Aaron Cunningham
f03ddf6c6c Fix various build warnings
This should remove six separate warnings when building servo. One of
the warnings was an unused mut, and the other were various dead code
warnings
2017-04-24 22:54:06 -07:00
mckaymatt
63f9ad022f Add way to get c_void ptr or c_char from caller 2017-04-04 16:46:52 -04:00
bors-servo
af6353df87 Auto merge of #15659 - gregkatz:eliminate_transmute_find_enum, r=Ms2ger
Eliminate a mem::transmute in CodeGen

<!-- Please describe your changes on the following line: -->
Eliminate a mem::transmute in CodeGen by changing the find_enum_string_index function to take a slice of pairs and return an enum value.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] 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/15659)
<!-- Reviewable:end -->
2017-02-21 04:28:32 -08:00
Gregory Katz
214db8d9f0 Eliminate a mem::transmute in CodeGen 2017-02-20 12:24:45 -05:00
bors-servo
e52eb2a5e3 Auto merge of #15585 - servo:CGConstant, r=nox
Simplify CGConstant.

<!-- 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/15585)
<!-- Reviewable:end -->
2017-02-20 04:12:08 -08:00
bors-servo
28698dc8ba Auto merge of #15589 - servo:RootedTraceable-union, r=nox
Use RootedTraceableBox for unions.

<!-- 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/15589)
<!-- Reviewable:end -->
2017-02-19 05:56:01 -08:00
Gregory Katz
4d205f00b0 Adds an as_str() method to WebIDL enums to hide slice of strings from callers. Uses the new method in two places. 2017-02-16 10:59:07 -05:00
Ms2ger
d5f8b35a5f Use RootedTraceableBox for unions. 2017-02-16 15:27:16 +01:00