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:
parent
1146ab0fae
commit
632cc53e2c
2 changed files with 12 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue