diff options
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 2837e25c08a..d248028cc2b 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -752,14 +752,18 @@ impl Node { TreeIterator::new(self, shadow_including) } - pub(crate) fn inclusively_following_siblings(&self) -> impl Iterator<Item = DomRoot<Node>> { + pub(crate) fn inclusively_following_siblings( + &self, + ) -> impl Iterator<Item = DomRoot<Node>> + use<> { SimpleNodeIterator { current: Some(DomRoot::from_ref(self)), next_node: |n| n.GetNextSibling(), } } - pub(crate) fn inclusively_preceding_siblings(&self) -> impl Iterator<Item = DomRoot<Node>> { + pub(crate) fn inclusively_preceding_siblings( + &self, + ) -> impl Iterator<Item = DomRoot<Node>> + use<> { SimpleNodeIterator { current: Some(DomRoot::from_ref(self)), next_node: |n| n.GetPreviousSibling(), @@ -799,14 +803,14 @@ impl Node { .any(|ancestor| &*ancestor == self) } - pub(crate) fn following_siblings(&self) -> impl Iterator<Item = DomRoot<Node>> { + pub(crate) fn following_siblings(&self) -> impl Iterator<Item = DomRoot<Node>> + use<> { SimpleNodeIterator { current: self.GetNextSibling(), next_node: |n| n.GetNextSibling(), } } - pub(crate) fn preceding_siblings(&self) -> impl Iterator<Item = DomRoot<Node>> { + pub(crate) fn preceding_siblings(&self) -> impl Iterator<Item = DomRoot<Node>> + use<> { SimpleNodeIterator { current: self.GetPreviousSibling(), next_node: |n| n.GetPreviousSibling(), @@ -827,7 +831,7 @@ impl Node { } } - pub(crate) fn descending_last_children(&self) -> impl Iterator<Item = DomRoot<Node>> { + pub(crate) fn descending_last_children(&self) -> impl Iterator<Item = DomRoot<Node>> + use<> { SimpleNodeIterator { current: self.GetLastChild(), next_node: |n| n.GetLastChild(), @@ -1090,7 +1094,7 @@ impl Node { Ok(NodeList::new_simple_list(&window, iter, CanGc::note())) } - pub(crate) fn ancestors(&self) -> impl Iterator<Item = DomRoot<Node>> { + pub(crate) fn ancestors(&self) -> impl Iterator<Item = DomRoot<Node>> + use<> { SimpleNodeIterator { current: self.GetParentNode(), next_node: |n| n.GetParentNode(), @@ -1101,7 +1105,7 @@ impl Node { pub(crate) fn inclusive_ancestors( &self, shadow_including: ShadowIncluding, - ) -> impl Iterator<Item = DomRoot<Node>> { + ) -> impl Iterator<Item = DomRoot<Node>> + use<> { SimpleNodeIterator { current: Some(DomRoot::from_ref(self)), next_node: move |n| { @@ -1143,21 +1147,21 @@ impl Node { self.is_connected() && self.owner_doc().browsing_context().is_some() } - pub(crate) fn children(&self) -> impl Iterator<Item = DomRoot<Node>> { + pub(crate) fn children(&self) -> impl Iterator<Item = DomRoot<Node>> + use<> { SimpleNodeIterator { current: self.GetFirstChild(), next_node: |n| n.GetNextSibling(), } } - pub(crate) fn rev_children(&self) -> impl Iterator<Item = DomRoot<Node>> { + pub(crate) fn rev_children(&self) -> impl Iterator<Item = DomRoot<Node>> + use<> { SimpleNodeIterator { current: self.GetLastChild(), next_node: |n| n.GetPreviousSibling(), } } - pub(crate) fn child_elements(&self) -> impl Iterator<Item = DomRoot<Element>> { + pub(crate) fn child_elements(&self) -> impl Iterator<Item = DomRoot<Element>> + use<> { self.children() .filter_map(DomRoot::downcast as fn(_) -> _) .peekable() |