1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

LibWeb: Implement Node.getRootNode

This commit is contained in:
Luke Wilde 2021-10-16 03:04:55 +01:00 committed by Andreas Kling
parent 1f4a6e7c22
commit 1ea3f34823
3 changed files with 21 additions and 0 deletions

View file

@ -890,4 +890,14 @@ bool Node::in_a_document_tree() const
return root().is_document();
}
// https://dom.spec.whatwg.org/#dom-node-getrootnode
NonnullRefPtr<Node> Node::get_root_node(GetRootNodeOptions const& options)
{
// The getRootNode(options) method steps are to return thiss shadow-including root if options["composed"] is true; otherwise thiss root.
if (options.composed)
return shadow_including_root();
return root();
}
}