Commit graph

38 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
Martin Robinson
a1cf0cbf86
libservo: Stop using script_traits in the embedding layer (#35185)
Many types used directly in the `libservo` API are in the
`script_traits` crate, which was created to break circular dependencies.
Move all API exposed types to `embedder_traits` which now contains types
exposed via the `libservo` embedding API. Also expose these at the root
of the `libservo` `servo` crate so that the API won't break when they
move around in the future.

The idea with `embedder_traits` in the future is that it contains types
that are available throughout servo because they are used in the
embedding API and thus should have minimal dependencies on other Servo
crates (a bit like `base`).

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-28 11:15:36 +00:00
Josh Matthews
875e387004
script: Feature-gate all crown support. (#35055)
* script: Feature-gate all crown support.

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

* script: Use cfg(crown) instead of a cargo feature.

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

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-18 21:36:15 +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
Domenico Rizzo
0e9746fbbe
Add CanGc argument to reflect_dom_object (#34606)
* applied mach fmt

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>

Refinements

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>

Modified reflect_dom_object signature and all its calls

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>

* fix function calls when parameter is passed up

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>

---------

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2024-12-13 15:51:59 +00:00
Josh Matthews
e0cbab2fbb
Rewrite From/TryFrom conversions on generated types to avoid future orphan rule violations (#34554)
* script: Add traits to allow converting between types that are not defined in the script crate.

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

* script: Rewrite all From/TryFrom implementations on generated WebIDL types to use new Convert/TryConvert traits.

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

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-12-11 05:52:48 +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
a2f81d69c1
CanGc fixes (#33852)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-16 02:50:28 +00:00
Andriy Sultanov
e5150dbda1
Propagate CanGc from Document::new() (#33386)
* Add canGc as a parameter to autogenerated trait methods

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>

* Propagate CanGc from Document::new()

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>

---------

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
2024-09-09 22:38:01 +00:00
Oluwatobi Sofela
c7b73e1ef4
clippy: Fix let_and_return warnings (#31964) 2024-04-01 15:43:24 +00:00
Rosemary Ajayi
af358f51db
clippy: Fix another batch of clippy warnings in components/scripts (#31912)
* boolean can be simplified

* boolean can be simplified

* boolean can be simplified
2024-03-28 11:28:33 +00:00
Azhar Ismagulova
ff95ce5abd
fix: omitted the let bindings (#31908) 2024-03-27 20:22:51 +00:00
Oluwatobi Sofela
02a0cdd6fa
clippy: Fix dereferenced warnings (#31770) 2024-03-20 08:07:22 +00:00
Martin Robinson
5c1723c983
rustdoc: Fix many rustdoc errors (#31147)
This fixes many rustdoc errors that occur due to raw URLs in rustdoc
comments as well as unescaped Rust code that should be in backticks.
2024-01-22 13:13:48 +00:00
Samson
604979e367
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins

* Use crown instead of script_plugins

* crown_is_not_used

* Use crown in command base

* bootstrap crown

* tidy happy

* disable sccache

* Bring crown in tree

* Install crown from tree

* fix windows ci

* fix warning

* fix mac

libscript_plugins.dylib is not available anymore

* Update components/script/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update for nightly-2023-03-18

Mostly just based off https://github.com/servo/servo/pull/30630

* Always install crown

it's slow only when there is new version

* Run crown test with `mach test-unit`

* Small fixups; better trace_in_no_trace tests

* Better doc

* crown in config.toml

* Fix tidy for real

* no sccache on rustc_wrapper

* document rustc overrides

* fixup of compiletest

* Make a few minor comment adjustments

* Fix a typo in python/servo/platform/base.py

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

* Proper test types

* Ignore tidy on crown/tests

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-12-01 15:50:52 +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
Samson
9514f670d1
No tracing of nop traceable fields (#29926)
* Add `no_trace` option to JSTraceable derive

* NoTrace wrapper

* Port some types to no_trace schematics

* Fixing my unsafe mistakes (not tracing traceables)

* Add docs & safety guards for no_trace

Safety guards (trait shenanigans) guarantees safety usage of `no_trace`

* Port canvas_traits to no_trace

* Port servo_media to no_trace

* Port net_traits to no_trace

* Port style to no_trace

* Port webgpu to no_trace

* Port script_traits to no_trace

* Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace

* unrooted_must_root lint in seperate file

* Add trace_in_no_trace_lint as script_plugin

* Composable types in must_not_have_traceable

* Introduced HashMapTracedValues wrapper

* `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>`

* Port rest of servo's types to no_trace

* Port html5ever, euclid, mime and http to no_trace

* Port remaining externals to no_trace

* Port webxr and Arc<Mutex<_>>

* Fix spelling in notrace doc
2023-08-04 10:17:43 +00:00
Josh Matthews
c6049eda7b Enter a realm when handling mediasession commands. 2020-08-06 14:09:38 -04:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Josh Matthews
f02e516f32 Remove unnecessary Option. 2020-02-24 15:58:58 -05:00
Kunal Mohan
5a3e1b8e69
rename compartment to realm 2020-01-24 20:52:36 +05:30
Shinichi Morimoto
274d4d2303 implement MediaSession.setPositionState method 2019-12-03 07:39:03 +09:00
Fernando Jiménez Moreno
35c4c35416 Fix metadata update 2019-11-20 13:34:31 +01:00
Fernando Jiménez Moreno
6ee21af0c4 Update media session metadata according to media player 2019-11-20 13:34:30 +01:00
Fernando Jiménez Moreno
b5b8c6c2a8 Remove prev and next track action buttons for now 2019-11-20 13:34:29 +01:00
Fernando Jiménez Moreno
b048d7faf7 Fix media session action handling 2019-11-20 13:34:29 +01:00
Fernando Jiménez Moreno
9da1dd3592 Default media session actions 2019-11-20 13:34:29 +01:00
Fernando Jiménez Moreno
85ec66b43e Move active media session logic to constellation 2019-11-20 13:33:51 +01:00
Fernando Jiménez Moreno
08f9f17ed3 Send MediaSessionAction from Android 2019-11-20 13:33:51 +01:00
Fernando Jiménez Moreno
89d9e3ad78 Introduce embedder MediaSessionEvent and move active session to Servo 2019-11-20 13:33:15 +01:00
Fernando Jiménez Moreno
4d147d2c56 Register media instance with session and prepare communication with embedder 2019-11-20 13:33:14 +01:00
Fernando Jiménez Moreno
31ce7a2b5c Handle media session action, no default handling yet 2019-11-20 13:32:38 +01:00
Fernando Jiménez Moreno
ec7a4bf32d MediaSession: update action handler algorithm 2019-11-20 13:32:38 +01:00
Fernando Jiménez Moreno
fa61191405 Make MediaSession handle embedder requested action 2019-11-20 13:32:11 +01:00
Fernando Jiménez Moreno
7101a9d070 Use BrowsingContextId for MediaSession registration 2019-11-20 13:32:10 +01:00
Fernando Jiménez Moreno
f8246801ba MediaSession registration 2019-11-20 13:32:10 +01:00
Fernando Jiménez Moreno
1ab65005ae Set MediaMetadata MediaSession owner 2019-11-20 13:32:10 +01:00
Fernando Jiménez Moreno
4b5b4d19bf MediaSession API DOM bindings 2019-11-20 13:32:10 +01:00