mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb: Add TreeNode::remove()
This allows for easy child removal similar to `DOM::Node::remove()`.
This commit is contained in:
parent
b4ebade9c2
commit
c0e861e2fa
Notes:
github-actions[bot]
2025-01-23 08:34:37 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/c0e861e2fa2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3276 Reviewed-by: https://github.com/kalenikaliaksandr ✅
1 changed files with 5 additions and 0 deletions
|
@ -50,6 +50,11 @@ public:
|
|||
void remove_child(GC::Ref<T> node);
|
||||
|
||||
void replace_child(GC::Ref<T> new_child, GC::Ref<T> old_child);
|
||||
void remove()
|
||||
{
|
||||
VERIFY(m_parent);
|
||||
m_parent->remove_child(*static_cast<T*>(this));
|
||||
}
|
||||
|
||||
T* next_in_pre_order()
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue