diff options
author | Léo Stefanesco <leo.lveb@gmail.com> | 2016-04-20 18:38:12 +0200 |
---|---|---|
committer | Léo Stefanesco <leo.lveb@gmail.com> | 2016-04-22 13:18:50 +0200 |
commit | 00b3f7930e78226184746bdab833239565579c08 (patch) | |
tree | b52e8fc1cd5bc9db48eb192b0964325af8d3d516 /components/script/dom/node.rs | |
parent | 89b276c889ce76f8fe43c22779835af138472dac (diff) | |
download | servo-00b3f7930e78226184746bdab833239565579c08.tar.gz servo-00b3f7930e78226184746bdab833239565579c08.zip |
Implement Node::rootNode
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index d8c23b559d9..3cbe8024b9e 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -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() |