diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-04-08 22:30:54 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-04-09 15:43:05 +0200 |
commit | 3d68a46fee3a33e76889f76350913128ae816ba9 (patch) | |
tree | fca5fdf298b34491a8457675006d41628fa3195b /components/script/dom/node.rs | |
parent | f8d0237956480dd4c76527f834581c77888a1ef2 (diff) | |
download | servo-3d68a46fee3a33e76889f76350913128ae816ba9.tar.gz servo-3d68a46fee3a33e76889f76350913128ae816ba9.zip |
Implement NonDocumentTypeChildNode::*ElementSibling()
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 55d60966b27..5368a012846 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -415,6 +415,7 @@ pub trait NodeHelpers<'a> { fn rev_children(self) -> ReverseChildrenIterator; fn child_elements(self) -> ChildElementIterator; fn following_siblings(self) -> NodeChildrenIterator; + fn preceding_siblings(self) -> ReverseChildrenIterator; fn is_in_doc(self) -> bool; fn is_inclusive_ancestor_of(self, parent: JSRef<Node>) -> bool; fn is_parent_of(self, child: JSRef<Node>) -> bool; @@ -764,6 +765,12 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { } } + fn preceding_siblings(self) -> ReverseChildrenIterator { + ReverseChildrenIterator { + current: self.prev_sibling(), + } + } + fn is_parent_of(self, child: JSRef<Node>) -> bool { match child.parent_node() { Some(ref parent) if parent == &Temporary::from_rooted(self) => true, |