Renaming NodeChildrenIterator to NodeSiblingIterator, fix #5616

This commit is contained in:
Peter 2015-04-09 10:41:02 -04:00
parent 88aa07b7e0
commit 0eace5bed8

View file

@ -411,10 +411,10 @@ impl<'a> Iterator for QuerySelectorIterator<'a> {
pub trait NodeHelpers<'a> { pub trait NodeHelpers<'a> {
fn ancestors(self) -> AncestorIterator; fn ancestors(self) -> AncestorIterator;
fn inclusive_ancestors(self) -> AncestorIterator; fn inclusive_ancestors(self) -> AncestorIterator;
fn children(self) -> NodeChildrenIterator; fn children(self) -> NodeSiblingIterator;
fn rev_children(self) -> ReverseChildrenIterator; fn rev_children(self) -> ReverseChildrenIterator;
fn child_elements(self) -> ChildElementIterator; fn child_elements(self) -> ChildElementIterator;
fn following_siblings(self) -> NodeChildrenIterator; fn following_siblings(self) -> NodeSiblingIterator;
fn is_in_doc(self) -> bool; fn is_in_doc(self) -> bool;
fn is_inclusive_ancestor_of(self, parent: JSRef<Node>) -> bool; fn is_inclusive_ancestor_of(self, parent: JSRef<Node>) -> bool;
fn is_parent_of(self, child: 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 debug_str(self) -> String;
fn traverse_preorder(self) -> TreeIterator<'a>; 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; fn to_trusted_node_address(self) -> TrustedNodeAddress;
@ -748,8 +748,8 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
TreeIterator::new(self) TreeIterator::new(self)
} }
fn inclusively_following_siblings(self) -> NodeChildrenIterator { fn inclusively_following_siblings(self) -> NodeSiblingIterator {
NodeChildrenIterator { NodeSiblingIterator {
current: Some(Temporary::from_rooted(self)), 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) self == parent || parent.ancestors().any(|ancestor| ancestor.root().r() == self)
} }
fn following_siblings(self) -> NodeChildrenIterator { fn following_siblings(self) -> NodeSiblingIterator {
NodeChildrenIterator { NodeSiblingIterator {
current: self.next_sibling(), current: self.next_sibling(),
} }
} }
@ -860,8 +860,8 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
self.owner_doc().root().r().is_html_document() self.owner_doc().root().r().is_html_document()
} }
fn children(self) -> NodeChildrenIterator { fn children(self) -> NodeSiblingIterator {
NodeChildrenIterator { NodeSiblingIterator {
current: self.first_child.get(), current: self.first_child.get(),
} }
} }
@ -1112,14 +1112,14 @@ impl RawLayoutNodeHelpers for Node {
// //
pub type ChildElementIterator = pub type ChildElementIterator =
Peekable<FilterMap<NodeChildrenIterator, Peekable<FilterMap<NodeSiblingIterator,
fn(Temporary<Node>) -> Option<Temporary<Element>>>>; fn(Temporary<Node>) -> Option<Temporary<Element>>>>;
pub struct NodeChildrenIterator { pub struct NodeSiblingIterator {
current: Option<Temporary<Node>>, current: Option<Temporary<Node>>,
} }
impl Iterator for NodeChildrenIterator { impl Iterator for NodeSiblingIterator {
type Item = Temporary<Node>; type Item = Temporary<Node>;
fn next(&mut self) -> Option<Temporary<Node>> { fn next(&mut self) -> Option<Temporary<Node>> {