Move ScriptToConstellationMsg to constellation_traits (#36364)

This is the last big change necessary to create the
`constellation_traits` crate. This moves the data structure for messages
that originate from the `ScriptThread` and are sent to the
`Contellation` to `constellation_traits`, effectively splitting
`script_traits` in half. Before, `script_traits` was responsible for
exposing the API of both the `ScriptThread` and the `Constellation` to
the rest of Servo.

- Data structures that are used by `ScriptToConstellationMsg` are moved
  to `constellation_traits`. The dependency graph looks a bit like this:
  `script_layout_interface` depends on `script_traits` depends on
  `constellation_traits` depends on `embedder_traits`.
- Data structures that are used in the embedding layer
  (`UntrustedNodeAddress`, `CompositorHitTestResult`, `TouchEventResult`
  and `AnimationState`) are moved to embedder_traits, to avoid a
  dependency cycle between `webrender_traits` and
  `constellation_traits`.
- Types dealing with MessagePorts and serialization are moved to
  `constellation_traits::message_port`.

Testing: This is covered by existing tests as it just moves types
around.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-04-06 00:13:29 +02:00 committed by GitHub
parent a67409fb25
commit 6031a12fd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 1224 additions and 1222 deletions

22
Cargo.lock generated
View file

@ -1186,16 +1186,26 @@ version = "0.0.1"
dependencies = [
"base",
"bitflags 2.9.0",
"canvas_traits",
"devtools_traits",
"embedder_traits",
"euclid",
"http 1.3.1",
"hyper_serde",
"ipc-channel",
"log",
"malloc_size_of_derive",
"net_traits",
"profile_traits",
"serde",
"servo_malloc_size_of",
"servo_url",
"strum",
"strum_macros",
"stylo_traits",
"uuid",
"webgpu_traits",
"webrender_api",
"wgpu-core",
]
[[package]]
@ -4627,6 +4637,7 @@ name = "metrics"
version = "0.0.1"
dependencies = [
"base",
"constellation_traits",
"ipc-channel",
"log",
"malloc_size_of_derive",
@ -6478,21 +6489,16 @@ version = "0.0.1"
dependencies = [
"background_hang_monitor_api",
"base",
"bitflags 2.9.0",
"bluetooth_traits",
"canvas_traits",
"constellation_traits",
"cookie 0.18.1",
"crossbeam-channel",
"devtools_traits",
"embedder_traits",
"euclid",
"http 1.3.1",
"hyper_serde",
"ipc-channel",
"keyboard-types",
"libc",
"log",
"malloc_size_of_derive",
"media",
"net_traits",
@ -6505,13 +6511,10 @@ dependencies = [
"strum_macros",
"stylo_atoms",
"stylo_traits",
"uuid",
"webdriver",
"webgpu_traits",
"webrender_api",
"webrender_traits",
"webxr-api",
"wgpu-core",
]
[[package]]
@ -8675,7 +8678,6 @@ name = "webrender_traits"
version = "0.0.1"
dependencies = [
"base",
"constellation_traits",
"dpi",
"embedder_traits",
"euclid",