mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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:
committed by
Alexander Kalenik
parent
834675aea3
commit
9d2ebe90ed
Notes:
github-actions[bot]
2026-03-11 10:17:47 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/9d2ebe90edb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8361
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user