mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +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;
|
return;
|
||||||
auto& paintable = const_cast<Painting::Paintable&>(*node.paintable());
|
auto& paintable = const_cast<Painting::Paintable&>(*node.paintable());
|
||||||
if (parent_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.
|
VERIFY(!paintable.parent());
|
||||||
if (auto* old_parent = paintable.parent()) {
|
|
||||||
old_parent->remove_child(paintable);
|
|
||||||
}
|
|
||||||
parent_paintable->append_child(paintable);
|
parent_paintable->append_child(paintable);
|
||||||
}
|
}
|
||||||
paintable.set_dom_node(node.dom_node());
|
paintable.set_dom_node(node.dom_node());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue