aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorLéo Stefanesco <leo.lveb@gmail.com>2016-04-20 18:38:12 +0200
committerLéo Stefanesco <leo.lveb@gmail.com>2016-04-22 13:18:50 +0200
commit00b3f7930e78226184746bdab833239565579c08 (patch)
treeb52e8fc1cd5bc9db48eb192b0964325af8d3d516 /components/script/dom/node.rs
parent89b276c889ce76f8fe43c22779835af138472dac (diff)
downloadservo-00b3f7930e78226184746bdab833239565579c08.tar.gz
servo-00b3f7930e78226184746bdab833239565579c08.zip
Implement Node::rootNode
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs5
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()