LibWeb: Add a couple child node operations to Node and add node types

This commit is contained in:
Luke
2021-03-06 17:06:25 +00:00
committed by Andreas Kling
parent a013a38e24
commit ed139bee7f
3 changed files with 44 additions and 2 deletions

View File

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