mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Add a cache for `SameFormattingContextBlock`s: A new kind of cache is added which allows reusing fragments for `SameFormattingContextBlock` (the majority of block level elements). This can reduce the amount of fragment tree construction during incremental layout (although with a 40 byte overhead per `SameFormattingContextBlock`). Testing: This change adds a new Servo-specific WPT test that verifies that the minimal number of `Fragment`s are rebuilt after an incremental layout. Previously, when running `flexbox-deeply-nested-column-flow.html` from `tests/blink_perf_tests/perf_tests/layout/`, performance would degrade with successive test runs. This is due to how slow inline layout is. This change removes that progressive degradation, though we may be able to remove this cache with improvements to inline layout. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Luke Warlow <lwarlow@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>