aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/documentorshadowroot.rs
Commit message (Collapse)AuthorAgeFilesLines
* Create a `constellation_traits` crate (#36088)Martin Robinson2025-03-221-1/+1
| | | | | | | | | | | | | | This change creates a `constellation_traits` crate. Previously messages to the `Constellation` were in the `compositing_traits` crate, which came about organically. This change moves these to a new crate which also contains data types that are used in both compositing/libservo and script (ie types that cross the process boundary). The idea is similar to `embedding_traits`, but this is meant for types not exposed to the API. This change allows deduplicating `UntrustedNodeAddress`, which previously had two versions to avoid circular dependencies. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Cleanup Stylo dependencies (#36046)Oriol Brufau2025-03-191-2/+2
| | | | | | | | | Now that Stylo considers `servo` as the default feature, Servo doesn't need to specify `features = ["servo"]`. Also use the same crate names as Stylo, rather than renaming them with `package`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Use new stylo crate renames (#35898)Nico Burns2025-03-121-1/+1
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* script: Avoid unwraps in DocumentOrShadowRoot::element_from_point. (#35130)Josh Matthews2025-01-231-1/+11
| | | | | | | | | | | | | * script: Handle shadow roots in DocumentOrShadowRoot::element_from_point. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Clippy fixes. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- 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-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add shadow tree flags to Bind/UnbindContext (#34863)Simon Wülker2025-01-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rename IS_IN_DOC flag to IS_IN_A_DOCUMENT_TREE Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add BindContext::is_in_a_shadow_tree Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add UnbindContext::tree_is_in_shadow_tree Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * ./mach fmt Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update test expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * fix build after rebasing Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Ensure Element ID modifications inside disconnected shadow roots are ↵Simon Wülker2025-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | registered (#34834) * Add test for modifying element IDs in disconnected shadow roots Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Register element ID modifications inside disconnected shadow roots Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Don't crash when registering named elements in disconnected shadow roots Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix test title Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fork Stylo's `malloc_size_of` into Servo (#34332)Martin Robinson2024-11-221-0/+8
| | | | | | | | | | | | | | | | This is unfortuante, but it's the only way to stop making Stylo's `malloc_size_of` depend on so many of Servo's dependencies. This is an important step on the way toward releasing Stylo as standalone software. When possible, we defer to the implementation of `MallocSizeOf` that is in the base class. One benefit of this change is that we start properly measure the size of WebRender types, which before were always set to zero. In addition the `Measurable` class is removed in favor of simply manually implementing `MallocSizeOf`, which doesn't require uncomfortably modifying the shape of data structures. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* CanGc changes from fontfaceset.rs (#33920)chickenleaf2024-10-211-3/+10
| | | | | | | | | | | | | | | | * CanGc changes from fontfaceset.rs Signed-off-by: L Ashwin B <lashwinib@gmail.com> * Update components/script/dom/bindings/codegen/Bindings.conf Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: chickenleaf <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com> Signed-off-by: chickenleaf <lashwinib@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* Upgrade stylo to 2024-05-31 (#32474)Oriol Brufau2024-06-241-0/+5
| | | | | | | | | | | * Upgrade stylo to 2024-05-31 * Fixup for https://phabricator.services.mozilla.com/D211731 * Fixup for https://phabricator.services.mozilla.com/D207779 * Fixup for https://phabricator.services.mozilla.com/D207781 * Update test expectations
* script: Have `Document` own `Layout` (#32316)Martin Robinson2024-05-201-2/+2
| | | | | | Have `Document` own `Layout`. This makes it impossible to have a `Document` without `Layout`, which was true, but now the compiler checks it. In addition, `Layout` is now released when the `Document` is, avoiding leaking the entire `Layout`.
* script_layout: Remove script to layout messages (#32081)Martin Robinson2024-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of communicating with layout via messages, script can simply call methods on the layout trait. This simplifies the way that script communicates with layout and opens the path to sharing more data structures between the two systems. This is part of a continuing series of cleanups after removing the layout thread. <!-- Please describe your changes on the following line: --> --- <!-- 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. -->
* layout: Remove LayoutRPC and query layout via the `Layout` trait (#31937)Martin Robinson2024-03-291-6/+5
| | | | | | | | | | | | | | | | | Instead of the tricky `LayoutRPC` interface, query layout using the `Layout` trait. This means that now queries will requires calling layout and then running the query. During layout an enum is used to indicate what kind of layout is necessary. This change also removes the mutex-locked `rw_data` from both layout threads. It's no longer necessary since layout runs synchronously. The one downside here is that for resolved style queries, we now have to create two StyleContexts. One for layout and one for the query itself. The creation of this context should not be very expensive though. `LayoutRPC` used to be necessary because layout used to run asynchronously from script, but that no longer happens. With this change, it becomes possible to safely pass nodes to layout from script -- a cleanup that can happen in a followup change.
* clippy: Fix another set of clippy problems in `components/script/dom` (#31909)Rosemary Ajayi2024-03-281-1/+1
| | | | | | | | | * a reference to a reference * length comparison to zero * length comparison to zero * length comparison to zero
* clippy: Fix needless borrow warnings (#31813)Oluwatobi Sofela2024-03-211-2/+2
|
* 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-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* 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-11/+12
| | | | | * strict imports formatting * Reformat all imports
* No tracing of nop traceable fields (#29926)Samson2023-08-041-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-8/+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.
* Further changes required by ServoOriol Brufau2023-05-161-13/+4
|
* fmtteymour-aldridge2021-02-051-3/+1
|
* Remove unused arguments from methods.teymour-aldridge2021-02-051-6/+2
|
* Doc named getter improvementsPatrick Shaughnessy2020-02-131-2/+2
|
* Use `#![register_tool]` instead of `#![register_attr]`Simon Sapin2019-11-151-2/+2
| | | | CC https://github.com/rust-lang/rust/issues/66079
* Modify *::get_cx methods to return a safe JSContext instead of a raw onemarmeladema2019-07-241-2/+2
|
* Update euclid.Emilio Cobos Álvarez2019-07-231-1/+1
| | | | | | | | There are a few canvas2d-related dependencies that haven't updated, but they only use euclid internally so that's not blocking landing the rest of the changes. Given the size of this patch, I think it's useful to get this landed as-is.
* Move StylesheetSetRef to scriptFernando Jiménez Moreno2019-04-261-1/+1
|
* Rename StylesheetSet to StylesheetSetRefFernando Jiménez Moreno2019-04-261-3/+3
|
* Minor tweaks: rename composed_parent_node_ref, remove or update outdated ↵Fernando Jiménez Moreno2019-04-261-28/+17
| | | | comments...
* Register named elements in either the document or shadow treeFernando Jiménez Moreno2019-04-261-1/+59
|
* Make StylesheetSet an enum instead of a trait objectFernando Jiménez Moreno2019-04-261-4/+2
|
* Do not send RemoveStyleSheet message for shadow rootsFernando Jiménez Moreno2019-04-261-6/+1
|
* Retarget result of shadowRoot.element(s)FromPointFernando Jiménez Moreno2019-04-261-1/+1
|
* Fix Document.Element(s)FromPointFernando Jiménez Moreno2019-04-261-1/+1
|
* Do not add shadow tree styles to stylistFernando Jiménez Moreno2019-04-261-8/+0
|
* Implement TShadowRoot::style_dataFernando Jiménez Moreno2019-04-261-0/+7
|
* Remove stylesheets ownership from DocumentOrShadowRootFernando Jiménez Moreno2019-04-261-48/+14
|
* Move stylesheets related code to DocumentOrShadowRootFernando Jiménez Moreno2019-04-261-32/+151
|
* Always get browsing context from documentFernando Jiménez Moreno2019-04-261-16/+5
|
* Unify DocumentOrShadowRoot implementationFernando Jiménez Moreno2019-04-261-0/+159
|
* Partial ShadowRoot implementation of DocumentOrShadowRootFernando Jiménez Moreno2019-04-261-0/+40