servo/components
Tim van der Lippe dcc88b53aa
Implement "Create a Trusted Type" algorithm (#36454)
This algorithm is quite straightforward written in the specification,
but leads to some type awkwardness in Rust. Most notably, the callbacks
have different types and cannot be unified easily. They also return
different string types. Similarly, the returning objects are all unique
types and don't have a common denominator.

Therefore, rather than implementing it in 1-to-1 fashion with the
specification text, it instead uses callbacks to instruct the type
system of what to call when.

This is further complicated by the fact that the callback can exist
or not, as well as return a value or not. This requires multiple
unwrangling, combined with the fact that the algorithm should throw
or not.

All in all, the number of lines is relatively low compared to the
specification algorithm and the Rust compiler does a lot of heavy
lifting figuring out which type is what.

Part of https://github.com/servo/servo/issues/36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-04-13 03:55:23 +00:00
..
allocator Organize component Cargo.toml dependencies (#36224) 2025-03-30 19:03:54 +00:00
background_hang_monitor Organize component Cargo.toml dependencies (#36224) 2025-03-30 19:03:54 +00:00
bluetooth Replace bluetooth Readme with corrected version from devices repository (#36429) 2025-04-10 18:02:45 +00:00
canvas compositing: Combine webrender_traits and compositing_traits (#36372) 2025-04-06 17:34:18 +00:00
compositing compositor: Unify the cross process and in-process API (#36443) 2025-04-12 21:38:22 +00:00
config dom: Implement ClipboardItem (#36336) 2025-04-06 23:47:57 +00:00
constellation compositor: Unify the cross process and in-process API (#36443) 2025-04-12 21:38:22 +00:00
deny_public_fields Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
devtools Devtools: initial Debugger > Sources panel (#36164) 2025-04-08 09:22:53 +00:00
dom_struct script: Feature-gate all crown support. (#35055) 2025-01-18 21:36:15 +00:00
domobject_derive Update rustfmt to the 2024 style edition (#35764) 2025-03-03 11:26:53 +00:00
fonts compositing: Combine webrender_traits and compositing_traits (#36372) 2025-04-06 17:34:18 +00:00
geometry servoshell: Allow overriding screen resolution with a command-line argument (#34038) 2024-10-30 11:54:13 +00:00
hyper_serde Update rustfmt to the 2024 style edition (#35764) 2025-03-03 11:26:53 +00:00
jstraceable_derive Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
layout_2020 layout: Enforce min-content min main size of flex-level tables (#36469) 2025-04-12 14:22:37 +00:00
layout_thread_2020 compositing: Combine webrender_traits and compositing_traits (#36372) 2025-04-06 17:34:18 +00:00
malloc_size_of Cleanup Stylo dependencies (#36046) 2025-03-19 08:53:26 +00:00
media compositing: Combine webrender_traits and compositing_traits (#36372) 2025-04-06 17:34:18 +00:00
metrics Move ScriptToConstellationMsg to constellation_traits (#36364) 2025-04-05 22:13:29 +00:00
net Manually concatenate ACRH headers to not include a space (#36455) 2025-04-11 17:01:55 +00:00
pixels Organize component Cargo.toml dependencies (#36224) 2025-03-30 19:03:54 +00:00
profile Make the memory reporting multi-process aware (#35863) 2025-04-05 05:42:12 +00:00
rand Migrate to the 2024 edition (#35755) 2025-03-13 10:28:11 +00:00
range Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
script Implement "Create a Trusted Type" algorithm (#36454) 2025-04-13 03:55:23 +00:00
script_bindings Implement "Create a Trusted Type" algorithm (#36454) 2025-04-13 03:55:23 +00:00
servo compositor: Unify the cross process and in-process API (#36443) 2025-04-12 21:38:22 +00:00
shared compositor: Unify the cross process and in-process API (#36443) 2025-04-12 21:38:22 +00:00
timers Update rustfmt to the 2024 style edition (#35764) 2025-03-03 11:26:53 +00:00
url Check all ancestor navigable trustworthiness for mixed content (#36157) 2025-04-05 05:38:24 +00:00
webdriver_server constellation: Rename messages sent to the Constellation (#36341) 2025-04-04 19:39:38 +00:00
webgpu compositing: Combine webrender_traits and compositing_traits (#36372) 2025-04-06 17:34:18 +00:00
webxr Use Window in new methods instead of GlobalScope for interfaces with … (#36133) 2025-04-02 14:50:56 +00:00