diff options
author | Peter <ptrgonda@gmail.com> | 2015-04-09 10:41:02 -0400 |
---|---|---|
committer | Peter <ptrgonda@gmail.com> | 2015-04-09 10:41:02 -0400 |
commit | 0eace5bed82359a602fc93b6da14070f0a09b679 (patch) | |
tree | a93c0080f6bc3aca04505bc31128958f69ee3dcb /components/script/dom/node.rs | |
parent | 88aa07b7e0076c249283cc33235d0380a093bc6e (diff) | |
download | servo-0eace5bed82359a602fc93b6da14070f0a09b679.tar.gz servo-0eace5bed82359a602fc93b6da14070f0a09b679.zip |
Renaming NodeChildrenIterator to NodeSiblingIterator, fix #5616
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 14823d4622e..b67056836e6 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -411,10 +411,10 @@ impl<'a> Iterator for QuerySelectorIterator<'a> { pub trait NodeHelpers<'a> { fn ancestors(self) -> AncestorIterator; fn inclusive_ancestors(self) -> AncestorIterator; - fn children(self) -> NodeChildrenIterator; + fn children(self) -> NodeSiblingIterator; fn rev_children(self) -> ReverseChildrenIterator; fn child_elements(self) -> ChildElementIterator; - fn following_siblings(self) -> NodeChildrenIterator; + fn following_siblings(self) -> NodeSiblingIterator; 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; @@ -485,7 +485,7 @@ pub trait NodeHelpers<'a> { fn debug_str(self) -> String; fn traverse_preorder(self) -> TreeIterator<'a>; - fn inclusively_following_siblings(self) -> NodeChildrenIterator; + fn inclusively_following_siblings(self) -> NodeSiblingIterator; fn to_trusted_node_address(self) -> TrustedNodeAddress; @@ -748,8 +748,8 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { TreeIterator::new(self) } - fn inclusively_following_siblings(self) -> NodeChildrenIterator { - NodeChildrenIterator { + fn inclusively_following_siblings(self) -> NodeSiblingIterator { + NodeSiblingIterator { current: Some(Temporary::from_rooted(self)), } } @@ -758,8 +758,8 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { self == parent || parent.ancestors().any(|ancestor| ancestor.root().r() == self) } - fn following_siblings(self) -> NodeChildrenIterator { - NodeChildrenIterator { + fn following_siblings(self) -> NodeSiblingIterator { + NodeSiblingIterator { current: self.next_sibling(), } } @@ -860,8 +860,8 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { self.owner_doc().root().r().is_html_document() } - fn children(self) -> NodeChildrenIterator { - NodeChildrenIterator { + fn children(self) -> NodeSiblingIterator { + NodeSiblingIterator { current: self.first_child.get(), } } @@ -1112,14 +1112,14 @@ impl RawLayoutNodeHelpers for Node { // pub type ChildElementIterator = - Peekable<FilterMap<NodeChildrenIterator, + Peekable<FilterMap<NodeSiblingIterator, fn(Temporary<Node>) -> Option<Temporary<Element>>>>; -pub struct NodeChildrenIterator { +pub struct NodeSiblingIterator { current: Option<Temporary<Node>>, } -impl Iterator for NodeChildrenIterator { +impl Iterator for NodeSiblingIterator { type Item = Temporary<Node>; fn next(&mut self) -> Option<Temporary<Node>> { |