Skip to content

Commit 1ac69db

Browse files
authored
Unrolled build for #144913
Rollup merge of #144913 - GuillaumeGomez:fix-wrong-i-icon, r=fmease [rustdoc] Fix wrong `i` tooltip icon Current wrong display: <img width="334" height="37" alt="Screenshot From 2025-08-04 17-42-38" src="https://github.com/user-attachments/assets/57046475-6162-487f-998f-ebb2434c111d" /> With the fix: <img width="334" height="37" alt="image" src="https://github.com/user-attachments/assets/e761a103-dc39-4e30-8c8e-cfc7fab52fde" /> r? ``@fmease``
2 parents 8fb40f7 + 2260749 commit 1ac69db

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,6 +1838,10 @@ instead, we check that it's not a "finger" cursor.
18381838
border-right: 3px solid var(--target-border-color);
18391839
}
18401840

1841+
a.tooltip {
1842+
font-family: var(--font-family);
1843+
}
1844+
18411845
.code-header a.tooltip {
18421846
color: inherit;
18431847
margin-right: 15px;

tests/rustdoc-gui/notable-trait.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ define-function: (
88
[x, i_x],
99
block {
1010
// Checking they have the same y position.
11-
compare-elements-position: (
11+
compare-elements-position-near: (
1212
"//*[@id='method.create_an_iterator_from_read']//a[normalize-space()='NotableStructWithLongName']",
1313
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
14-
["y"],
14+
{"y": 1},
1515
)
1616
// Checking they don't have the same x position.
1717
compare-elements-position-false: (

tests/rustdoc-gui/src/test_docs/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,3 +767,17 @@ pub mod impls_indent {
767767
pub fn bar() {}
768768
}
769769
}
770+
771+
pub mod tooltips {
772+
pub struct X;
773+
774+
impl X {
775+
pub fn bar() -> Vec<u8> {
776+
Vec::new()
777+
}
778+
}
779+
780+
pub fn bar() -> Vec<u8> {
781+
Vec::new()
782+
}
783+
}

tests/rustdoc-gui/tooltips.goml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This test checks that the right font is applied to the `i` tooltip element.
2+
3+
define-function: (
4+
"check-font",
5+
[path],
6+
block {
7+
go-to: "file://" + |DOC_PATH| + "/test_docs/" + |path|
8+
assert-css: (
9+
"a.tooltip", {"font-family": '"Source Serif 4", NanumBarunGothic, serif'}, ALL,
10+
)
11+
}
12+
)
13+
14+
call-function: ("check-font", {"path": "tooltips/fn.bar.html"})
15+
call-function: ("check-font", {"path": "tooltips/struct.X.html"})

0 commit comments

Comments
 (0)