mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +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
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()
|
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_layout_root = nullptr;
|
||||||
|
|
||||||
m_paintable = nullptr;
|
m_paintable = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue