servo/components/layout/fragment_tree
Martin Robinson 8808f9a468
layout: Add a repaint-only incremental layout mode (#36978)
This change adds the simplest kind of incremental layout. When Servo
detects that all style changes only require a repaint, only run stacking
context tree and WebRender display list generation. This means that
these kind of restyles do not need a re-layout. Instead, the existing
box and fragment trees will be used and the styles of damaged nodes will
be updated in their box and fragment tree nodes.

This requires a new style repair DOM traversal for nodes that have had
their style damaged. In addition, careful accounting of all the places
where we store style must happen in order ot update those styles.

Testing: This is covered by existing WPT tests as it should not change
observable behavior.

We have created a test case which shows a 50% speedup when run
in Servo, even though there still a long way to go to match the speed
of other browsers:
https://gist.github.com/mrobinson/44ec87d028c0198917a7715a06dd98a0

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-05-12 17:03:50 +00:00
..
base_fragment.rs layout: Resolve canvas background properties during painting (#36917) 2025-05-09 10:36:53 +00:00
box_fragment.rs layout: Share styles to inline box children via SharedInlineStyles (#36896) 2025-05-12 09:38:50 +00:00
containing_block.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
fragment.rs layout: Add a repaint-only incremental layout mode (#36978) 2025-05-12 17:03:50 +00:00
fragment_tree.rs layout: Resolve canvas background properties during painting (#36917) 2025-05-09 10:36:53 +00:00
hoisted_shared_fragment.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
mod.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
positioning_fragment.rs layout: Add a repaint-only incremental layout mode (#36978) 2025-05-12 17:03:50 +00:00