mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb: Implement partial layout tree updates
DOM nodes now have two additional flags: - Needs layout tree update - Child needs layout tree update These work similarly to the needs-style-update flags, but instead signal the need to rebuild the corresponding part of the layout tree. When a specific DOM node needs a layout tree update, we try to create a new subtree starting at that node, and then replace the subtree in the old layout tree with the newly created subtree. This required some refactoring in TreeBuilder so that we can skip over entire subtrees during a tree update. Note that no partial updates happen yet (as of this commit) since we always invalidate the full layout tree still. That will change in the next commit.
This commit is contained in:
committed by
Andreas Kling
parent
b41a490e40
commit
c01d810e5a
@@ -502,6 +502,9 @@ public:
|
||||
bool needs_full_style_update() const { return m_needs_full_style_update; }
|
||||
void set_needs_full_style_update(bool b) { m_needs_full_style_update = b; }
|
||||
|
||||
[[nodiscard]] bool needs_full_layout_tree_update() const { return m_needs_full_layout_tree_update; }
|
||||
void set_needs_full_layout_tree_update(bool b) { m_needs_full_layout_tree_update = b; }
|
||||
|
||||
void set_needs_to_refresh_scroll_state(bool b);
|
||||
|
||||
bool has_active_favicon() const { return m_active_favicon; }
|
||||
@@ -936,6 +939,7 @@ private:
|
||||
bool m_needs_layout { false };
|
||||
|
||||
bool m_needs_full_style_update { false };
|
||||
bool m_needs_full_layout_tree_update { false };
|
||||
|
||||
bool m_needs_animated_style_update { false };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user