mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement NonDocumentTypeChildNode::*ElementSibling()
This commit is contained in:
parent
f8d0237956
commit
3d68a46fee
12 changed files with 44 additions and 141 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue