Skip to content

Commit

Permalink
Renaming NodeChildrenIterator to NodeSiblingIterator, fix #5616
Browse files Browse the repository at this point in the history
  • Loading branch information
pgonda committed Apr 9, 2015
1 parent 88aa07b commit 0eace5b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions components/script/dom/node.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)),
}
}
Expand All @@ -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(),
}
}
Expand Down Expand Up @@ -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(),
}
}
Expand Down Expand Up @@ -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>> {
Expand Down

0 comments on commit 0eace5b

Please sign in to comment.