aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/worklet.rs
Commit message (Collapse)AuthorAgeFilesLines
* Generate a trait abstracting over all known DOM interfaces (#34357)Josh Matthews2024-11-241-1/+1
| | | | | | | | | | | | | | | | | * 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>
* CanGc fixes from EventTarget::fire_event (#33985)tanishka2024-10-231-0/+1
| | | Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* CanGc fixes in `errorevent.rs` (#33960)tanishka2024-10-221-4/+6
| | | | | | | | | | | | | * CanGc fixes in errorevent.rs Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Allow too_many_arguments to avoid lint error Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> --------- Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Mark promise creation methods with CanGc (#33928)Josh Matthews2024-10-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add CanGc annotations to promise constructor. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc arguments for Promise::new_in_current_realm. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix out-of-order entries. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from Promise::new. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Suppress clippy warning. 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>
* clippy: Add safety documentation and clean up unsafe methods (#33748)Martin Robinson2024-10-161-2/+2
| | | | | | | | | | | This change: 1. Adds safety documentation where it was missing. 2. Limits the scope of unsafe code in some cases to where it is actually unsafe. 3. Converts some free functions to associated functions and methods, thereby making them more likely to be called safely. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Rename various methods and members to conform to naming guidelines ↵Martin Robinson2024-10-101-1/+2
| | | | | | | | | (#33762) This ensure that methods named `new()` do not take `&self` or return `Box<Self>`. In addition, method are renamed (or removed when not necessary) to avoid being prefixed with `from_`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* clippy: Allow `too_many_arguments` for all functions (#31962)komuhangi2024-04-011-0/+2
| | | | | This is the start of preventing this in the future. Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix option_map_unit_fn warnings (#31906)Oluwatobi Sofela2024-03-271-2/+2
|
* clippy: Fix `explicit_auto_deref` warnings in `components/script` (#31837)Oluwatobi Sofela2024-03-231-1/+1
| | | | | | | | | * clippy: Fix explicit auto-deref warnings * clippy: Fix explicit auto-deref warnings * refactor: Tidy up code * refactor: Fix method not found errors
* Fixed the .clone() warnings. (#31819)Aarya Khandelwal2024-03-221-1/+1
|
* clippy: Fix redundant field names warnings (#31793)Oluwatobi Sofela2024-03-201-2/+2
|
* clippy: Fix dereferenced warnings (#31770)Oluwatobi Sofela2024-03-201-1/+1
|
* clippy: Fix many warnings in `components/script` (#31717)Richard Dushime2024-03-191-2/+2
| | | | | | | | | | | | | | | | | * Fix Several clippy warnings * Fix Build errors * Fix Unused import * Fix requested changes * Fix rustfmt * Minor fixes --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix some warnings in the `script` crate (#31719)Rosemary Ajayi2024-03-181-15/+15
| | | | | | | | | | | | | | | | | | | | | * Fix InlineFormatting error * BoxFrament * fix clippy error * clippy:fix clipy errors * fix clippy errors * fix clippy errors * fix clippy errors * Remove changes to `layout_2020` --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* fix: missing thread name when spawning (#31656)Ngo Iok Ui (Wu Yu Wei)2024-03-141-28/+34
| | | | | * Add missing thread name when spawning * Update namings
* script: Do not run layout in a thread (#31346)Martin Robinson2024-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Do not run layout in a thread Instead of spawning a thread for layout that almost always runs synchronously with script, simply run layout in the script thread. This is a resurrection of #28708, taking just the bits that remove the layout thread. It's a complex change and thus is just a first step toward cleaning up the interface between script and layout. Messages are still passed from script to layout via a `process()` method and script proxies some messages to layout from other threads as well. Big changes: 1. Layout is created in the script thread on Document load, thus every live document is guaranteed to have a layout. This isn't completely hidden in the interface, but we can safely `unwrap()` on a Document's layout. 2. Layout configuration is abstracted away into a LayoutConfig struct and the LayoutFactory is a struct passed around by the Constellation. This is to avoid having to monomorphize the entire script thread for each layout. 3. Instead of having the Constellation block on the layout thread to figure out the current epoch and whether there are pending web fonts loading, updates are sent synchronously to the Constellation when rendering to a screenshot. This practically only used by the WPT. A couple tests start to fail, which is probably inevitable since removing the layout thread has introduced timing changes in "exit after load" and screenshot behavior. Co-authored-by: Josh Matthews <josh@joshmatthews.net> * Update test expectations * Fix some issues found during review * Clarify some comments * Address review comments --------- Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix intermittent crashes in paint worklets (#30671)Martin Robinson2023-11-021-19/+34
| | | | | | | | | | Garbage collection means that the worklets might drop after the script head has been cleaned up. The worklet now caches the thread pool in the DOM object itself which should prevent it from needing to access script thread TLS when being cleaned up. The value is stored as a OnceCell to maintain the same lazy thread pool creation pattern as before. Fixes #25838. Fixes #25258.
* Use Foo_Binding instead of FooBinding for namespace modules (#30447)Samson2023-09-301-1/+1
| | | | | * Update Codegen.py to emit Foo_Binding instead of FooBinding * s/FooBinding/Foo_Binding/g
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-40/+26
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+1
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* No tracing of nop traceable fields (#29926)Samson2023-08-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Remove global argument from Promise::new_in_current_realm.Josh Matthews2023-05-201-2/+1
|
* 26488 Move worklet drop implementation into single droppable memberBenjamin Freist2023-02-131-11/+18
| | | | Signed-off-by: Benjamin Freist <bfreist@soundhound.com>
* Make url for "client" referrer mandatoryMatthias Deiml2020-06-171-5/+8
|
* Add trait DomObjectWrap to provide WRAP functionYUAN LYU2020-03-201-2/+0
|
* rename compartment to realmKunal Mohan2020-01-241-3/+3
|
* Bind runnable dispatching in script_runtimeAkash-Pateria2019-11-191-1/+1
|
* Use `#![register_tool]` instead of `#![register_attr]`Simon Sapin2019-11-151-1/+1
| | | | CC https://github.com/rust-lang/rust/issues/66079
* Use the newly added inCompartments option everywhere it can beBastien Orivel2019-05-251-7/+8
|
* Update to SpiderMonkey 66.Josh Matthews2019-05-101-2/+2
|
* Create resource timing entry for sync network fetchpylbrecht2019-05-081-4/+8
|
* Pass InCompartment by valueAron Zwaan2019-04-251-1/+1
|
* Add proof parameter to Promise::new_in_current_compartmentAron Zwaan2019-04-241-2/+7
|
* Implementing the builder pattern for RequestInitLucas Fantacuci2019-04-101-9/+7
|
* Rename Promise::new to Promise::new_in_current_compartmentAron Zwaan2019-04-031-1/+2
|
* Reintroduce parent runtimes for worker threads.Josh Matthews2019-01-151-1/+1
|
* Remove now-unnecessary must_root and allow(unrooted_must_root) annotationsManish Goregaokar2019-01-041-1/+0
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Update crossbeam-channel to 0.3Bastien Orivel2018-11-181-6/+6
|
* Remove useless `use crate_name;` imports.Simon Sapin2018-11-081-1/+0
| | | | A `crate_name::foo` path always works in 2018
* Reorder importsPyfisch2018-11-061-8/+8
|
* Format remaining filesPyfisch2018-11-061-1/+5
|
* Sort `use` statementsSimon Sapin2018-11-061-7/+7
|
* `cargo fix --edition`Simon Sapin2018-11-061-29/+29
|
* Auto merge of #21647 - AgustinCB:fix-space-leak-when-pipeline-is-closed, ↵bors-servo2018-09-201-4/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r=asajeffrey Fix space leak when pipeline is closed Add a new control message to drop remove worklets. Implement `Drop` for `Worklet` and get the worklet thread pool. Use that pool to send `ExitWorklet` to all the threads with the id of the `Worklet` that it's dropping. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #17442 - [ ] There are tests for these changes OR - [x] These changes do not require tests because I don't know how to add a test for this :( If you consider this needs a test, could you point me out on how to write (and run!) one in this project? I gave this a couple tries, but I wasn't very successful. <!-- 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/21647) <!-- Reviewable:end -->
| * Fix space leak when pipeline is closedAgustin Chiappe Berrini2018-09-081-4/+26
| | | | | | | | | | | | | | | | Add a new control message to drop remove worklets. Implement `Drop` for `Worklet` and get the worklet thread pool. Use that pool to send `ExitWorklet` to all the threads with the id of the `Worklet` that it's dropping.
* | Format script componentchansuke2018-09-191-70/+117
| |
* | Replace mpsc with crossbeam/servo channel, update ipc-channelSimon Sapin2018-09-121-8/+6
|/ | | | Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>