(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;
+ }
+}
+
+pub struct Derefer(String);
+
+impl std::ops::Deref for Derefer {
+ type Target = str;
+
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+
+pub mod deprecated {
+ #[deprecated(since = "1.26.0", note = "deprecated")]
+ pub struct DeprecatedStruct;
+
+ pub struct NonDeprecatedStruct;
+
+ pub trait NormalTrait {
+ #[deprecated(since = "1.26.0", note = "deprecated")]
+ /// doc
+ const X: usize = 12;
+
+ #[deprecated(since = "1.26.0", note = "deprecated")]
+ /// doc
+ fn normal_deprecated_fn();
+ }
+
+ #[deprecated(since = "1.26.0", note = "deprecated")]
+ pub trait DeprecatedTrait {
+ fn depr_deprecated_fn();
+ }
+
+ impl NonDeprecatedStruct {
+ #[deprecated(since = "1.26.0", note = "deprecated")]
+ /// doc
+ pub fn deprecated_fn() {}
+
+ /// doc
+ pub fn non_deprecated_fn() {}
+
+ #[deprecated(since = "TBD", note = "deprecated")]
+ /// doc
+ pub fn future_deprecated_fn() {}
+ }
+
+ impl NormalTrait for NonDeprecatedStruct {
+ fn normal_deprecated_fn() {}
+ }
+
+ impl DeprecatedTrait for NonDeprecatedStruct {
+ fn depr_deprecated_fn() {}
+ }
+}
diff --git a/tests/rustdoc-gui/target.goml b/tests/rustdoc-gui/target.goml
new file mode 100644
index 0000000..92846f8
--- /dev/null
+++ b/tests/rustdoc-gui/target.goml
@@ -0,0 +1,35 @@
+// Check that the targeted element has the expected styles.
+include: "utils.goml"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html#method.a_method"
+show-text: true
+
+// Confirming that the method is the target.
+assert: "#method\.a_method:target"
+
+define-function: (
+ "check-style",
+ [theme, background, border],
+ block {
+ call-function: ("switch-theme", {"theme": |theme|})
+ wait-for-css: ("#method\.a_method:target", {
+ "background-color": |background|,
+ "border-right": "3px solid " + |border|,
+ })
+ },
+)
+
+call-function: ("check-style", {
+ "theme": "ayu",
+ "background": "rgba(255, 236, 164, 0.06)",
+ "border": "rgba(255, 180, 76, 0.85)",
+})
+call-function: ("check-style", {
+ "theme": "dark",
+ "background": "#494a3d",
+ "border": "#bb7410",
+})
+call-function: ("check-style", {
+ "theme": "light",
+ "background": "#fdffd3",
+ "border": "#ad7c37",
+})