mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +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
Notes:
sideshowbarker
2024-07-16 20:21:48 +09:00
Author: https://github.com/awesomekling
Commit: ae3958f640
Pull-request: https://github.com/SerenityOS/serenity/pull/20823
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