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:
parent
1f4a6e7c22
commit
1ea3f34823
3 changed files with 21 additions and 0 deletions
|
@ -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 this’s shadow-including root if options["composed"] is true; otherwise this’s root.
|
||||
if (options.composed)
|
||||
return shadow_including_root();
|
||||
|
||||
return root();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue