1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibWeb: Make the paint tree a proper standalone tree

Until now, paint trees have been piggybacking on the layout tree for
traversal, and paintables didn't actually have their own parent/child
pointers.

This patch changes that by making Paintable inherit from TreeNode, and
adding a new pass to LayoutState::commit() where we recursively build
the new paint tree.
This commit is contained in:
Andreas Kling 2023-08-18 12:30:27 +02:00
parent 4d4dbacfc3
commit 216bd513fa
5 changed files with 33 additions and 46 deletions

View file

@ -1003,7 +1003,7 @@ void Document::update_layout()
Layout::AvailableSize::make_definite(viewport_rect.height())));
}
layout_state.commit();
layout_state.commit(*m_layout_root);
// Broadcast the current viewport rect to any new paintables, so they know whether they're visible or not.
browsing_context()->inform_all_viewport_clients_about_the_current_viewport_rect();