servo/components/layout_2020
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
..
display_list Update Stylo to 2023-10-16 (#31932) 2024-03-30 13:30:13 +00:00
flexbox layout: Use Au in ResolvedMargins and CollapsedMargin (#31848) 2024-03-28 14:20:14 +00:00
flow script: Split style and layout data in DOM nodes (#31985) 2024-04-04 07:56:51 +00:00
fragment_tree layout: Use Au in ResolvedMargins and CollapsedMargin (#31848) 2024-03-28 14:20:14 +00:00
table clippy: Allow too_many_arguments for all functions (#31962) 2024-04-01 14:53:33 +00:00
tests layout: use Au in BoxFragment (#31794) 2024-03-22 04:30:39 +00:00
Cargo.toml layout: Add support for box-shadow to Layout 2020 (#31453) 2024-03-07 11:13:57 +00:00
cell.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
context.rs Lint layout_2020 with clippy (#31169) 2024-01-25 09:03:31 +00:00
dom.rs script: Split style and layout data in DOM nodes (#31985) 2024-04-04 07:56:51 +00:00
dom_traversal.rs layout: Do not inherit node and fragment flags in anonymous boxes (#31586) 2024-03-09 09:13:19 +00:00
formatting_contexts.rs layout: Allow transforming inline replaced elements (#31833) 2024-03-27 11:57:27 +00:00
geom.rs layout: Add basic support for getClientRects() queries (#31696) 2024-03-15 17:20:47 +00:00
layout_debug.rs Lint layout_2020 with clippy (#31169) 2024-01-25 09:03:31 +00:00
lib.rs make ContainingBlock use Au for inline_size and block_size (#31370) 2024-02-20 09:14:44 +00:00
lists.rs Update Stylo to 2023-10-16 (#31932) 2024-03-30 13:30:13 +00:00
positioned.rs layout: Allow transforming inline replaced elements (#31833) 2024-03-27 11:57:27 +00:00
query.rs Update Stylo to 2023-10-16 (#31932) 2024-03-30 13:30:13 +00:00
replaced.rs Treat video elements as replaced content and render the current frame. (#31412) 2024-02-23 17:34:08 +00:00
sizing.rs layout: Add initial support for row height distribution (#31421) 2024-02-29 12:12:54 +00:00
style_ext.rs layout: Allow transforming inline replaced elements (#31833) 2024-03-27 11:57:27 +00:00
traversal.rs script: Split style and layout data in DOM nodes (#31985) 2024-04-04 07:56:51 +00:00