1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

LibWeb: Implement Node.removeChild() in terms of "pre-remove"

This is what the spec wants us to do.
This commit is contained in:
Andreas Kling 2022-02-21 22:21:59 +01:00
parent 8b2499b112
commit 19b5033dc4
2 changed files with 9 additions and 1 deletions

View file

@ -348,6 +348,12 @@ ExceptionOr<NonnullRefPtr<Node>> Node::pre_insert(NonnullRefPtr<Node> node, RefP
return node;
}
// https://dom.spec.whatwg.org/#dom-node-removechild
ExceptionOr<NonnullRefPtr<Node>> Node::remove_child(NonnullRefPtr<Node> child)
{
return pre_remove(child);
}
// https://dom.spec.whatwg.org/#concept-node-pre-remove
ExceptionOr<NonnullRefPtr<Node>> Node::pre_remove(NonnullRefPtr<Node> child)
{
@ -383,7 +389,7 @@ void Node::remove(bool suppress_observers)
// FIXME: Let oldPreviousSibling be nodes previous sibling. (Currently unused so not included)
// FIXME: Let oldNextSibling be nodes next sibling. (Currently unused so not included)
parent->remove_child(*this);
parent->TreeNode::remove_child(*this);
// FIXME: If node is assigned, then run assign slottables for nodes assigned slot.