aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/trace.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move generated bindings to script_bindings (#36323)Josh Matthews2025-04-041-70/+0
| | | | | | | | | | | | | | | | | | | | | This is the final step of #1799, where the majority of the generated code for the JS bindings is now compiled as part of the script_bindings build step. The remaining pieces in script must live there because they refer to concrete DOM types; all code in script_bindings is generic over the [DomTypes](https://doc.servo.org/script/dom/bindings/codegen/DomTypes/trait.DomTypes.html) trait. My testing with incremental builds shows me a 12 second reduction in build times on my 2024 M4 Macbook Pro when modifying code in the script crate after these changes. Before this PR those changes took 20 seconds to rebuild Servo, and now they take 8 seconds. Testing: Existing WPT tests ensure no regressions. Fixes: #1799 --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Remove redundant `rooted_vec` macro (#36214)Greg Morenz2025-03-291-1/+0
| | | | | | | | | | This macro was copied into mozjs in 2023, in servo/mozjs#352 The two versions are identical, and rooting infrastructure generally lives in mozjs. Let's not keep this redundant copy around. The mozjs version is already imported evyerwhere via `#[macro_use]`. Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
* Move CustomTraceable to script_bindings. (#35988)Josh Matthews2025-03-161-190/+0
| | | | | | | | | | | | | | | | | * script: Move CustomTraceable to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move record binding support to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Address clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-031-2/+2
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Move more bindings types to script_bindings (#35620)Josh Matthews2025-02-231-2/+0
| | | | | | | | | | | | | | | | | | | | | * Move weak references implementation to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move maplike/setlike definitions to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move base error types to script_bindings. 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>
* Move more bindings code to script_bindings (#35578)Josh Matthews2025-02-221-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move JSContext wrapper to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move webidl constant bindings to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move CanGc to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move Dom<T> and Root<T> types to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Extra docs for new traits. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Move various reflector types and traits to script_bindings (#35279)Josh Matthews2025-02-041-2/+0
| | | | | | | | | | | | | * 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>
* bindings: Move string-related bindings code to script_bindings. (#35172)Josh Matthews2025-01-291-3/+0
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Feature-gate all crown support. (#35055)Josh Matthews2025-01-181-4/+4
| | | | | | | | | | | | | * 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>
* script: Limit public exports. (#34915)Josh Matthews2025-01-101-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* script: Use `enum`s for event loop senders and receivers (#34896)Martin Robinson2025-01-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Previously, senders and receivers to different kinds of event loops (the main `ScriptThread`, different types of workers) used a rust `trait` mechanism to implement dynamic behavior. This led to having many unused implementations of this `trait`. This change moves to using an `enum` based approach for these senders and receivers and removes all of the dead code. In addition, to allowing for use of rust's dead code detection, it simplifies the code a great deal. All of these generic senders and receivers are moved to the `messaging.rs` file and given proper documentation. Finally, empty an `JSTraceable` implementation is made for all crossbeam `Sender<...>`s to avoid having to manually skip them everytime they are included in structs. The pre-existing empty `MallocSizeOf` implementation is used more thoroughly. Other unecessary wrappers around these senders and receivers are removed as well. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Replace unsafe uses of HandleValueArray. (#34588)Josh Matthews2024-12-131-76/+1
| | | | | | | | | | | | | * Replace unsafe uses of HandleValueArray. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy lint. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Filter out webidl files based on special comments, and feature-gate webxr ↵Josh Matthews2024-11-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interfaces. (#34348) * Filter out webidl files based on skip-if directives. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Don't build XR functionality without webxr feature. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix tidy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Adjust imports for file movement. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Clean up webxr module import. Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
* clippy: Add safety documentation and clean up unsafe methods (#33748)Martin Robinson2024-10-161-0/+11
| | | | | | | | | | | 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>
* use `ThreadSafeJSContext` instead of `ContextForRequestInterrupt` (#33769)Samson2024-10-101-2/+1
| | | | | | | | | | | | | * use `ThreadSafeJSContext` instead of `ContextForRequestInterrupt` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * use servo/mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Factor out swapchain to separate file (#33367)Samson2024-09-091-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move some stuff to swapchain.rs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Use typed WebGPUContextId instead of u64 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Extract create_swapchain function and move more stuff in it Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * extract destroy_swapchain Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * extract swapchain_present Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * extract update_wr_image callback Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Sync `GPUBuffer` (#33154)Samson2024-08-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * More helpers on `Promise` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Sync `GPUBuffer` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set some good expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Some bad expect also on firefox Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Extract DataBlock, DataView impl from GPUBuffer Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix size check to work on 32bit platforms Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* fix: Memory leak from CreateProxyWindowHandler (#32773)Erik Hennig2024-08-011-1/+1
| | | | | | | | | | | | | | | | | * fix: Memory leak from CreateProxyWindowHandler Signed-off-by: ede1998 <online@erik-hennig.me> * fix: memory leak in WindowProxy Signed-off-by: ede1998 <online@erik-hennig.me> * fix: Memory leak in WindowProxyHandler through static Signed-off-by: ede1998 <online@erik-hennig.me> --------- Signed-off-by: ede1998 <online@erik-hennig.me>
* Fix more clippy (#32740)石蕊 (Pi-Cla)2024-07-091-2/+2
|
* clippy: Fix a bunch of warnings in `script` (#32680)Martin Robinson2024-07-041-6/+3
| | | This is just a portion of the errors that are remaining to be fixed.
* webgpu: Update wgpu and revamp computepass (#32575)Samson2024-06-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Do not wait on drop, but rather wake poller thread * Update wgpu and render stuff * Set some good expectations * Update wgpu again * handle IPC error as warning * More good expectations * Some more expectations CTS does not match the spec: https://github.com/gpuweb/cts/issues/3806 * This expectations are due to other changes in servo also happening on main * Explain error_command_encoders and remove RefCell around it * fixup * store validness of passes * More good expectations * More docs * this assert is wrong * This is even more right per CTS/spec Only Command encoder state errors are allowed here, but wgpu does not exposes them. * More good expectations * One bad expectation * Fix my english
* clippy: Fix option_map_unit_fn warnings (#31906)Oluwatobi Sofela2024-03-271-1/+3
|
* fixes dereferencing on an immutable reference (#31864)Aarya Khandelwal2024-03-261-1/+1
|
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-1/+1
| | | | 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.
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-0/+7
| | | | | | | | | | 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.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-27/+24
| | | | | * strict imports formatting * Reformat all imports
* Use mozjs tracing infrastructure (#29918)Samson2023-08-101-336/+50
| | | | | | | * Update mozjs https://github.com/servo/mozjs/commit/64711ec2e6dc4595df691bffc7f1e5052ab86c8d also fixes https://github.com/servo/servo/issues/30043 * Move to mozjs Traceable and introduce CustomTraceable
* No tracing of nop traceable fields (#29926)Samson2023-08-041-482/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* It was removed from the spec and it's disabled everywhere.Emilio Cobos Álvarez2023-06-301-7/+1
| | | | This also removes the meta viewport support (which was implemented on top), but that also had a single test and is disabled everywhere, so I'm not too concerned, it can be implemented again if / when needed.
* Changes for spidermomkey upgrade.Josh Matthews2022-11-231-1/+2
|
* Upgrade HyperNaveen Gattu2022-01-161-2/+2
|
* Change ErrorScopeId type to NonZeroU64Kunal Mohan2020-08-031-0/+2
| | | | And extract it from WebGPURequest
* Refactor and improve GPUErrorScopesKunal Mohan2020-07-301-2/+0
| | | | Remove use of equivalent BGLs
* Implement GPURenderBundleEncoder and GPURenderBundleKunal Mohan2020-07-241-3/+5
|
* Added off thread compilationAbhishekSharma1022020-07-211-2/+25
| | | | | Co-authored-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com> Co-authored-by: Abhishek Sharma <20724848+AbhishekSharma102@users.noreply.github.com>
* Auto merge of #27026 - CYBAI:dynamic-module, r=jdmbors-servo2020-07-191-3/+39
|\ | | | | | | | | | | | | | | | | | | Introduce dynamic module --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #25439 - [x] There are tests for these changes
| * Set private reference for classic scriptCYBAI2020-07-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Web developers can use `Dynamic Import` in a classic script; thus, we need to save the script's private reference so that we can reuse it when we're going to fetch a dynamic import module for a classic script. Besides, because it's possible to use different executing context for a dynamic import module (like `dynamic-import/string-compilation-other-document.html` WPT test), we can't initialize a module owner at the timing of `SetScriptPrivate`; thus, if the private module script doesn't hold an owner, we'll use a DynamicImport owner for it.
| * checkpoint - dynamic load inside of a module and classic script works.Josh Matthews2020-07-181-2/+36
| |
* | Use existing BindGroupLayout if an equivalent BGL already existsKunal Mohan2020-07-161-0/+2
|/
* Auto merge of #27016 - gterzian:fix_closing_window, r=jdm,paulrougetbors-servo2020-06-301-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure clean shutdown of JS threads <!-- Please describe your changes on the following line: --> FIX https://github.com/servo/servo/issues/26685 FIX https://github.com/servo/servo/issues/26996 FIX https://github.com/servo/servo/issues/9672 FIX #27027 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
| * ensure clean shutdown of all threads running JSGregory Terzian2020-06-301-1/+2
| |
* | Support for webxr layer managementAlan Jeffrey2020-06-281-5/+1
| |
* | address review commentsKunal Mohan2020-06-271-1/+2
| |
* | Implement GPUBuffer.mapAsync and update wgpu-coreKunal Mohan2020-06-271-5/+7
| |
* | Auto merge of #26984 - kunalmohan:gpu-bind-group, r=kvarkbors-servo2020-06-221-5/+5
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add GPUSampler and GPUTextureView to BindingResources and update wgpu-core <!-- Please describe your changes on the following line: --> This also completes validation for `GPUBindGroup` and `GPUBindGroupLayout`. `entry_map` is stored in `GPUBindGroupLayout` for validating `createBindGroup()`. r?@kvark --- <!-- 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 - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
| * Update wgpu-core and wgpu-typesKunal Mohan2020-06-191-5/+5
| |
* | Auto merge of #26955 - gterzian:fix_parser_borrow, r=jdmbors-servo2020-06-171-0/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not trace pending parsers <!-- Please describe your changes on the following line: --> FIX https://github.com/servo/servo/issues/26857 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
| * | do not trace pending parsersGregory Terzian2020-06-171-0/+3
| | |
* | | Auto merge of #26921 - mrobinson:animation-set-key, r=jdmbors-servo2020-06-161-2/+2
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add DocumentAnimationSet and AnimationSetKey This will be used in order to hold animations for pseudo elements in the DocumentAnimationSet. Also no longer store the OpaqueNode in the animation and transition data structures. This is already part of the DocumentAnimationSet key. --- <!-- 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 do not require tests because they should not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->