LibWeb: Store visual context nodes in arena-based tree

Replace per-node heap-allocated AtomicRefCounted
AccumulatedVisualContext objects with a single contiguous Vector inside
AccumulatedVisualContextTree. All nodes for a frame are now stored in
one allocation, using type-safe VisualContextIndex instead of RefPtr
pointers.

This reduces allocation churn, improves cache locality, and opens the
door for future snapshotting of visual context state — similar to how
scroll offsets are snapshotted today.
This commit is contained in:
Aliaksandr Kalenik
2026-03-11 00:21:46 +01:00
committed by Alexander Kalenik
parent 834675aea3
commit 9d2ebe90ed
Notes: github-actions[bot] 2026-03-11 10:17:47 +00:00
20 changed files with 258 additions and 207 deletions

View File

@@ -2587,7 +2587,7 @@ CSSPixelPoint Navigable::to_top_level_position(CSSPixelPoint a_position)
return {};
if (auto const* paintable_box = as_if<Painting::PaintableBox>(*paintable);
paintable_box && paintable_box->accumulated_visual_context()) {
paintable_box && paintable_box->accumulated_visual_context_index().value()) {
auto point = paintable_box->absolute_position();
point.translate_by(position);
position = paintable_box->transform_rect_to_viewport({ point, { 0, 0 } }).location();