mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 20:29:42 +00:00
LibWeb: Add ParentNode::remove_all_children()
This safely removes all children from a Node.
This commit is contained in:
@@ -26,3 +26,13 @@
|
||||
|
||||
#include <LibWeb/DOM/ParentNode.h>
|
||||
|
||||
namespace Web {
|
||||
|
||||
void ParentNode::remove_all_children()
|
||||
{
|
||||
while (RefPtr<Node> child = first_child()) {
|
||||
remove_child(*child);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user