Implement Node::rootNode

This commit is contained in:
Léo Stefanesco 2016-04-20 18:38:12 +02:00
parent 89b276c889
commit 00b3f7930e
4 changed files with 7 additions and 66 deletions

View file

@ -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()

View file

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