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
chickenleaf
9c893c7f4d
More CanGc fixes ( #33888 )
...
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-17 19:36:42 +00:00
chickenleaf
a2f81d69c1
CanGc fixes ( #33852 )
...
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-16 02:50:28 +00:00
Simon Wülker
fc2c77be83
Use NaN-safe comparisons in DOMQuad::GetBounds ( #33794 )
...
* Use nan-safe comparison in DOMQuad::GetBounds
This fixes at least the following WPT test:
* css/geometry/DOMQuad-nan.html
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-10-11 02:43:44 +00:00
tanishka
39133a5478
Replace CanGc::note() calls with arguments in components/script/dom
( #33692 )
...
* Replace CanGc::note() calls with arguments in components/script/dom
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Add methods to Bindings.conf
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Modify existing interface sections
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Resolve conflicts
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
---------
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-08 12:58:09 +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
3c05b58221
clippy: Fix explicit_auto_deref
warnings in components/script
( #31837 )
...
* clippy: Fix explicit auto-deref warnings
* clippy: Fix explicit auto-deref warnings
* refactor: Tidy up code
* refactor: Fix method not found errors
2024-03-23 11:29:20 +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
Anthony Ramine
31e9d81c0f
Make #[dom_struct] a proc_macro attribute
2017-02-24 01:50:51 +01:00
Corey Farwell
449f6337d4
Rename Reflectable
to DomObject
.
...
Fixes https://github.com/servo/servo/issues/8473 .
2016-12-08 08:50:35 -10: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
ae6af5172b
Introduce Reflectable::global_scope
2016-10-06 21:35:38 +02:00
Anthony Ramine
fcb59d3057
Make reflect_dom_object take a &GlobalScope
2016-10-06 20:59:09 +02:00
Josh Matthews
3cb8af20c2
Remove empty lines following braces.
2016-05-27 13:32:05 -04:00
Cullen Rhodes
40acd24e8f
Report use statements that use {} with only one entry
2016-05-27 10:18:44 +01:00
Per Lundberg
2f7ed1d73e
Removed unused imports
...
This fixes #11185 .
2016-05-15 22:24:26 +03:00
Chad Kimes
ce6075825d
Add global default method for Reflectable trait
2016-01-11 20:23:47 -05:00
Guillaume Gomez
823e1b96c3
Add DOMQuad element
2015-12-18 17:37:10 +01:00