mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
LibWeb: Remove incorrect hack in build_paint_tree()
If a paintable already has a parent when we're building a paint tree, that's a bug we should catch, not something that needs a workaround.
This commit is contained in:
parent
ad1853cbf5
commit
ae3958f640
1 changed files with 1 additions and 4 deletions
|
@ -202,10 +202,7 @@ static void build_paint_tree(Node& node, Painting::Paintable* parent_paintable =
|
|||
return;
|
||||
auto& paintable = const_cast<Painting::Paintable&>(*node.paintable());
|
||||
if (parent_paintable) {
|
||||
// In case this was a relayout of an existing tree, we need to remove the paintable from its old parent first.
|
||||
if (auto* old_parent = paintable.parent()) {
|
||||
old_parent->remove_child(paintable);
|
||||
}
|
||||
VERIFY(!paintable.parent());
|
||||
parent_paintable->append_child(paintable);
|
||||
}
|
||||
paintable.set_dom_node(node.dom_node());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue