Commit graph

23 commits

Author SHA1 Message Date
Josh Matthews
c94ac5bccb
Move various reflector types and traits to script_bindings (#35279)
* script: Move Reflector to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Extract global() helper from DomObject into new trait. Move DomObject and related traits to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-02-04 06:58:08 +00:00
Josh Matthews
c94d909a86
script: Limit public exports. (#34915)
* script: Restrict reexport visibility of DOM types.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Mass pub->pub(crate) conversion.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Hide existing dead code warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix unit tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* More formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-10 08:19:19 +00:00
Josh Matthews
e956f3124c
Generate a trait abstracting over all known DOM interfaces (#34357)
* script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Update trait implementations with new generic type.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-11-24 07:35:14 +00:00
tanishka
cfd15dd14d
CanGc fixes originating from gamepadevent.rs & stereopannernode.rs (#33828)
* CanGc fixes originating from gamepadevent.rs & stereopannernode.rs

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

* Revert changes within task! macro

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

---------

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-14 13:22:08 +00:00
Josh Matthews
7d931e673a
script: Include constructors and static methods in generated DOM traits (#33665)
* Add all constructors, special operations, and static methods to generated DOM interface traits.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Move all constructors and static methods defined in bare impl blocks inside FooMethods trait impls.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Add missing doc links.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-10-08 01:51:58 +00:00
Josh Matthews
60ef6bc461
Start marking functions that can transitively trigger a GC (#33144)
* Mark JS reflector wrappers as CanGc.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Propagate CanGc from reflect_dom_object_with_proto.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Mark DOM constructors as GC operations.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-22 11:42:36 +00:00
Oluwatobi Sofela
3e63f8d6ee
clippy: Fix needless borrow warnings (#31813) 2024-03-21 17:48:54 +00:00
Samson
ebd41d4101
Use Foo_Binding instead of FooBinding for namespace modules (#30447)
* Update Codegen.py to emit Foo_Binding instead of FooBinding

* s/FooBinding/Foo_Binding/g
2023-09-30 00:52:04 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Josh Matthews
cc07e27864 Rename reflect_dom_object2. 2023-05-31 23:03:32 -04:00
Josh Matthews
0e8ac3fdac Formatting. 2023-05-28 23:54:02 -04:00
Josh Matthews
dbff26bce0 Support arbitrary protos when wrapping DOM objects with constructors. 2023-05-28 23:23:12 -04:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Kunal Mohan
f7db4b7f80
Modify script to prevent further violations of snake_case 2020-01-18 14:22:15 +05:30
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
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04: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
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
Imanol Fernandez
0158b5b2af Implement Gamepad API 2017-04-12 15:43:14 +02:00