servo/components/script
Martin Robinson 08ef158d4e
script: Split style and layout data in DOM nodes (#31985)
This change splits the style and layout data in DOM nodes that is
populated by style and layout passes. This makes Servo's data design
more like Gecko's. This allows:

1. Removing the various `StyleAndLayout` data structures used by layout.
2. Removing the `GetStyleAndLayoutData` and
   `GetStyleAndOpaqueLayoutData` traits. Accessing style and layout data
   are now just functions on the `LayoutNode` and `ThreadSafeLayoutNode`
   traits.
3. Styling now doesn't populate layout data. This is is postponed until
   layout itself.
4. Allows the DOM wrappers to no longer have to be generic over the
   layout data. This data was already stored using `std::any::Any` and
   the new code just makes layout responsible for downcasting. Cleaning
   up the generic type parameter in the DOM wrappers can happen in a
   followup change.

The main benefit to all of this is that we should be able to remove
unsafe creation of `ServoLayoutNode` in layout and
`TrustedLayoutNodeAddress` entirely, because `ServoLayoutNode` will be
able to be passed directly from script to layout. In addition, this
removes one more abstraction layer from the layout DOM wrappers, making
the code a lot more understandable.

Note: This increases the measured size of DOM types, but the same data
is stored. It's simply that before that data was stored behind a heap
pointer.
2024-04-04 07:56:51 +00:00
..
docs Update branch name to main (#30877) 2023-12-16 09:32:20 +00:00
dom script: Split style and layout data in DOM nodes (#31985) 2024-04-04 07:56:51 +00:00
layout_dom script: Split style and layout data in DOM nodes (#31985) 2024-04-04 07:56:51 +00:00
task_source clippy: Fix redundant field names warnings (#31793) 2024-03-20 23:05:29 +00:00
animation_timeline.rs script: Start replacing time with std::time and chrono (#30639) 2024-01-16 12:23:18 +00:00
animations.rs clippy: Fix mem_replace_with_default warnings (#31921) 2024-03-28 13:10:37 +00:00
body.rs clippy: Fix let_and_return warnings (#31964) 2024-04-01 15:43:24 +00:00
build.rs Update python detection in codegen (#31873) 2024-03-26 10:14:06 +00:00
canvas_state.rs clippy: Allow too_many_arguments for existing functions (#31974) 2024-04-02 12:50:45 +00:00
Cargo.toml Update phf_codegen and phf_shared to 0.11 (#31537) 2024-03-08 07:25:12 +00:00
clipboard_provider.rs
devtools.rs clippy: fixed some warnings in components/script (#31888) 2024-03-26 21:25:42 +00:00
document_loader.rs clippy: fixed some warnings in components/script (#31888) 2024-03-26 21:25:42 +00:00
euclidext.rs
fetch.rs clippy: Fix dereferenced warnings (#31770) 2024-03-20 08:07:22 +00:00
image_listener.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
init.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
layout_image.rs clippy: Fix some warnings in the script crate (#31719) 2024-03-18 10:05:18 +00:00
lib.rs crown: Do not warn about crown for rustdoc or clippy (#31805) 2024-03-21 15:33:06 +00:00
mem.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
microtask.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
network_listener.rs clippy: Fix redundant field names warnings (#31793) 2024-03-20 23:05:29 +00:00
realms.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
script_module.rs clippy: Allow too_many_arguments for all functions (#31962) 2024-04-01 14:53:33 +00:00
script_runtime.rs clippy: Fix all errors in components/script (#31911) 2024-03-28 09:03:18 +00:00
script_thread.rs clippy: Allow too_many_arguments for all functions (#31962) 2024-04-01 14:53:33 +00:00
serviceworker_manager.rs clippy: Fix redundant field names warnings (#31793) 2024-03-20 23:05:29 +00:00
stylesheet_loader.rs fonts: Add support for WOFF2 and properly load web fonts from @imports (#31879) 2024-03-26 20:31:52 +00:00
stylesheet_set.rs
task.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
task_manager.rs clippy: Allow too_many_arguments for all functions (#31962) 2024-04-01 14:53:33 +00:00
task_queue.rs clippy: Fix some clippy problems in components/script (#31778) 2024-03-20 18:41:07 +00:00
test.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
textinput.rs clippy: Fix collapsible_else_if warnings (#31853) 2024-03-26 09:15:04 +00:00
timers.rs clippy: Fix some warnings in components/script/timers.rs (#31878) 2024-03-27 10:15:15 +00:00
unpremultiplytable.rs
webdriver_handlers.rs Fix some clippy warnings in components/script/webdriver_handlers.rs (#31784) 2024-03-22 11:08:07 +00:00
window_named_properties.rs clippy: Fix several warnings (#31710) 2024-03-18 08:33:43 +00:00