mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibWeb: Remove unnecessary layout tree disconnection during teardown
This code appears to be leftover from times when layout and paintable trees were not GC-allocated.
This commit is contained in:
parent
e8b5055349
commit
b9bbe4c166
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/b9bbe4c166 Pull-request: https://github.com/SerenityOS/serenity/pull/22913 Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 0 additions and 19 deletions
|
@ -842,26 +842,7 @@ WebIDL::ExceptionOr<void> Document::set_title(String const& title)
|
|||
|
||||
void Document::tear_down_layout_tree()
|
||||
{
|
||||
if (!m_layout_root)
|
||||
return;
|
||||
|
||||
// Gather up all the layout nodes in a vector and detach them from parents
|
||||
// while the vector keeps them alive.
|
||||
|
||||
Vector<JS::Handle<Layout::Node>> layout_nodes;
|
||||
|
||||
m_layout_root->for_each_in_inclusive_subtree([&](auto& layout_node) {
|
||||
layout_nodes.append(layout_node);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
for (auto& layout_node : layout_nodes) {
|
||||
if (layout_node->parent())
|
||||
layout_node->parent()->remove_child(*layout_node);
|
||||
}
|
||||
|
||||
m_layout_root = nullptr;
|
||||
|
||||
m_paintable = nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue