mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-27 21:42:53 +00:00
LibWeb: Detach all paintables when building/committing layout tree
Instead of trying to be clever and detaching the paint tree lazily, just detach all paintables from both DOM and layout tree when building and committing respectively.
This commit is contained in:
parent
b0afe8463a
commit
ba286781b4
Notes:
sideshowbarker
2024-07-17 18:46:57 +09:00
Author: https://github.com/awesomekling
Commit: ba286781b4
2 changed files with 4 additions and 3 deletions
|
@ -388,8 +388,8 @@ void LayoutState::commit(Box& root)
|
|||
// NOTE: In case this is a relayout of an existing tree, we start by detaching the old paint tree
|
||||
// from the layout tree. This is done to ensure that we don't end up with any old-tree pointers
|
||||
// when text paintables shift around in the tree.
|
||||
root.for_each_in_inclusive_subtree_of_type<Layout::TextNode>([&](Layout::TextNode& text_node) {
|
||||
text_node.set_paintable(nullptr);
|
||||
root.for_each_in_inclusive_subtree([&](Layout::Node& node) {
|
||||
node.set_paintable(nullptr);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue