(self, f: F)
+ where
+ Self: Sized,
+ F: FnMut(Self::Item);
+ fn filter(self, predicate: P) -> Filter
+ where
+ Self: Sized,
+ P: FnMut(&Self::Item) -> bool;
+ fn filter_map(self, f: F) -> FilterMap
+ where
+ Self: Sized,
+ F: FnMut(Self::Item) -> Option;
+ fn enumerate(self) -> Enumerate
+ where
+ Self: Sized;
+ fn peekable(self) -> Peekable
+ where
+ Self: Sized;
+ fn skip_while(self, predicate: P) -> SkipWhile
+ where
+ Self: Sized,
+ P: FnMut(&Self::Item) -> bool;
+ fn take_while(self, predicate: P) -> TakeWhile
+ where
+ Self: Sized,
+ P: FnMut(&Self::Item) -> bool;
+ fn map_while(self, predicate: P) -> MapWhile
+ where
+ Self: Sized,
+ P: FnMut(Self::Item) -> Option;
+ fn skip(self, n: usize) -> Skip
+ where
+ Self: Sized;
+ fn take(self, n: usize) -> Take
+ where
+ Self: Sized;
+ fn scan(self, initial_state: St, f: F) -> Scan
+ where
+ Self: Sized,
+ F: FnMut(&mut St, Self::Item) -> Option;
+ fn flat_map(self, f: F) -> FlatMap
+ where
+ Self: Sized,
+ U: IntoIterator,
+ F: FnMut(Self::Item) -> U;
+ fn flatten(self) -> Flatten
+ where
+ Self: Sized,
+ Self::Item: IntoIterator;
+ fn fuse(self) -> Fuse
+ where
+ Self: Sized;
+ fn inspect(self, f: F) -> Inspect
+ where
+ Self: Sized,
+ F: FnMut(&Self::Item);
+ fn by_ref(&mut self) -> &mut Self
+ where
+ Self: Sized;
+ fn collect>(self) -> B
+ where
+ Self: Sized;
+ fn collect_into>(self, collection: &mut E) -> &mut E
+ where
+ Self: Sized;
+ fn partition(self, f: F) -> (B, B)
+ where
+ Self: Sized,
+ B: Default + Extend,
+ F: FnMut(&Self::Item) -> bool;
+ fn partition_in_place<'a, T: 'a, P>(mut self, predicate: P) -> usize
+ where
+ Self: Sized + DoubleEndedIterator- ,
+ P: FnMut(&T) -> bool;
+ fn is_partitioned
(mut self, mut predicate: P) -> bool
+ where
+ Self: Sized,
+ P: FnMut(Self::Item) -> bool;
+ fn fold(mut self, init: B, mut f: F) -> B
+ where
+ Self: Sized,
+ F: FnMut(B, Self::Item) -> B;
+ fn reduce(mut self, f: F) -> Option
+ where
+ Self: Sized,
+ F: FnMut(Self::Item, Self::Item) -> Self::Item;
+ fn all(&mut self, f: F) -> bool
+ where
+ Self: Sized,
+ F: FnMut(Self::Item) -> bool;
+ fn any(&mut self, f: F) -> bool
+ where
+ Self: Sized,
+ F: FnMut(Self::Item) -> bool;
+ fn find(&mut self, predicate: P) -> Option
+ where
+ Self: Sized,
+ P: FnMut(&Self::Item) -> bool;
+ fn find_map(&mut self, f: F) -> Option
+ where
+ Self: Sized,
+ F: FnMut(Self::Item) -> Option;
+ fn position(&mut self, predicate: P) -> Option
+ where
+ Self: Sized,
+ P: FnMut(Self::Item) -> bool;
+ /// We will scroll to "string" to ensure it scrolls as expected.
+ fn this_is_a_method_with_a_long_name_returning_something() -> String;
+ }
+
+ /// This one doesn't have hidden items (because there are too many) so we can also confirm that it
+ /// scrolls as expected.
+ pub trait TraitWithLongItemsName {
+ fn this_is_a_method_with_a_long_name_returning_something() -> String;
+ }
+}
diff --git a/src/test/rustdoc-gui/type-declation-overflow.goml b/src/test/rustdoc-gui/type-declation-overflow.goml
index 9b60bc04738bf..644429c014c18 100644
--- a/src/test/rustdoc-gui/type-declation-overflow.goml
+++ b/src/test/rustdoc-gui/type-declation-overflow.goml
@@ -59,3 +59,18 @@ goto: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLon
compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y"))
goto: "file://" + |DOC_PATH| + "/lib2/index.html"
compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y"))
+
+// Now we will check that the scrolling is working.
+// First on an item with "hidden methods".
+goto: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.Iterator.html"
+
+click: ".item-decl .type-contents-toggle"
+assert-property: (".item-decl > pre", {"scrollLeft": 0})
+scroll-to: "//*[@class='item-decl']//details/a[text()='String']"
+assert-property-false: (".item-decl > pre", {"scrollLeft": 0})
+
+// Then on an item without "hidden methods".
+goto: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.TraitWithLongItemsName.html"
+assert-property: (".item-decl > pre", {"scrollLeft": 0})
+scroll-to: "//*[@class='item-decl']//code/a[text()='String']"
+assert-property-false: (".item-decl > pre", {"scrollLeft": 0})