servo/components/layout
Martin Robinson 53be79a5b5
layout: Resolve canvas background properties during painting (#36917)
Instead of resolving the canvas background properties (essentially
keeping a possible reference to the `<body>`'s style) during fragment
tree construction, wait until painting to possibly find the style on an
appropriate `<body>` fragment. This is possible now because `Fragment`
keeps a list of flags with relevant information about the root and
`<body>` elements.

A benefit of this approach is that styles aren't cached in the fragment
tree, which would be problematic for incremental layout. In addition,
the old code was making an effort to transform the `<body>`'s background
by the root element's transform. Only Safari does this and there was
a resolution the WG that this should not happen in
https://github.com/w3c/csswg-drafts/issues/6683.

Testing:
 - `/css/css-transforms/transform-translate-background-001.html`
 - `/css/css-transforms/transform-translate-background-002.html`
 - `/css/CSS2/floats/float-root.html`
 
Fixes: #30475.
Closes: #30569.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-05-09 10:36:53 +00:00
..
display_list layout: Resolve canvas background properties during painting (#36917) 2025-05-09 10:36:53 +00:00
flexbox layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
flow layout: Resolve canvas background properties during painting (#36917) 2025-05-09 10:36:53 +00:00
fragment_tree layout: Resolve canvas background properties during painting (#36917) 2025-05-09 10:36:53 +00:00
stylesheets Embed user agent stylesheets and media control resouces in libservo (#36803) 2025-05-04 18:48:09 +00:00
table layout: Store shared styles for table backgrounds in SharedBackgroundStyle (#36893) 2025-05-07 11:44:59 +00:00
taffy layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
tests layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
Cargo.toml layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
cell.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
construct_modern.rs layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
context.rs devtools: Allow highlighting elements from the inspector (#35822) 2025-05-05 10:10:25 +00:00
dom.rs layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
dom_traversal.rs layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
formatting_contexts.rs layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
geom.rs Upgrade Stylo to 2025-05-01 (#36835) 2025-05-05 14:08:49 +00:00
layout_box_base.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
layout_impl.rs Various memory measurement improvements (#36834) 2025-05-07 04:00:12 +00:00
lib.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
lists.rs layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
positioned.rs layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
query.rs layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
quotes.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
replaced.rs layout: Use ServoLayoutNode directly instead of a generic impl (#36876) 2025-05-06 14:27:51 +00:00
sizing.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
style_ext.rs Upgrade Stylo to 2025-05-01 (#36835) 2025-05-05 14:08:49 +00:00
traversal.rs layout: Structure reflow code to make it more modular (#36597) 2025-04-23 07:34:35 +00:00