mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement Node::rootNode
This commit is contained in:
parent
89b276c889
commit
00b3f7930e
4 changed files with 7 additions and 66 deletions
|
@ -1858,6 +1858,11 @@ impl NodeMethods for Node {
|
|||
}
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-node-rootnode
|
||||
fn RootNode(&self) -> Root<Node> {
|
||||
self.inclusive_ancestors().last().unwrap()
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-node-parentnode
|
||||
fn GetParentNode(&self) -> Option<Root<Node>> {
|
||||
self.parent_node.get()
|
||||
|
|
|
@ -32,6 +32,8 @@ interface Node : EventTarget {
|
|||
[Pure]
|
||||
readonly attribute Document? ownerDocument;
|
||||
[Pure]
|
||||
readonly attribute Node rootNode;
|
||||
[Pure]
|
||||
readonly attribute Node? parentNode;
|
||||
[Pure]
|
||||
readonly attribute Element? parentElement;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue