mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:37:43 +00:00
LibWeb: Add a couple child node operations to Node and add node types
This commit is contained in:
parent
a013a38e24
commit
ed139bee7f
3 changed files with 44 additions and 2 deletions
|
@ -266,4 +266,15 @@ ParentNode* Node::parent_or_shadow_host()
|
|||
return downcast<ParentNode>(parent());
|
||||
}
|
||||
|
||||
NonnullRefPtrVector<Node> Node::child_nodes() const
|
||||
{
|
||||
NonnullRefPtrVector<Node> nodes;
|
||||
|
||||
for_each_child([&](auto& child) {
|
||||
nodes.append(child);
|
||||
});
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue