mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:47:34 +00:00
LibWeb: Add simple implementation of Node.removeChild()
This commit is contained in:
parent
5a58f42e3c
commit
a0bcfa30bf
3 changed files with 8 additions and 1 deletions
|
@ -183,6 +183,12 @@ RefPtr<Node> Node::append_child(NonnullRefPtr<Node> node, bool notify)
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RefPtr<Node> Node::remove_child(NonnullRefPtr<Node> node)
|
||||||
|
{
|
||||||
|
TreeNode<Node>::remove_child(node);
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
RefPtr<Node> Node::insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool notify)
|
RefPtr<Node> Node::insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool notify)
|
||||||
{
|
{
|
||||||
if (!child)
|
if (!child)
|
||||||
|
|
|
@ -82,6 +82,7 @@ public:
|
||||||
|
|
||||||
RefPtr<Node> append_child(NonnullRefPtr<Node>, bool notify = true);
|
RefPtr<Node> append_child(NonnullRefPtr<Node>, bool notify = true);
|
||||||
RefPtr<Node> insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool notify = true);
|
RefPtr<Node> insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool notify = true);
|
||||||
|
RefPtr<Node> remove_child(NonnullRefPtr<Node>);
|
||||||
|
|
||||||
virtual RefPtr<Layout::Node> create_layout_node();
|
virtual RefPtr<Layout::Node> create_layout_node();
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,6 @@ interface Node : EventTarget {
|
||||||
|
|
||||||
Node appendChild(Node node);
|
Node appendChild(Node node);
|
||||||
Node insertBefore(Node node, Node? child);
|
Node insertBefore(Node node, Node? child);
|
||||||
|
Node removeChild(Node child);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue