1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:25:06 +00:00

LibWeb: Add ParentNode::remove_all_children()

This safely removes all children from a Node.
This commit is contained in:
Andreas Kling 2020-03-25 18:52:03 +01:00
parent 1146ab0fae
commit 632cc53e2c
2 changed files with 12 additions and 0 deletions

View file

@ -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);
}
}
}