Skip to content

Commit 29698dc

Browse files
authored
Rollup merge of #103592 - notriddle:notriddle/notable-traits-notable, r=GuillaumeGomez
rustdoc: remove redundant CSS selector `.notable-traits .notable` The margin was already being set to 0 only a few lines lower.
2 parents bf53e71 + a7a0b36 commit 29698dc

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ h3.variant {
12931293
content: "\00a0\00a0\00a0";
12941294
}
12951295

1296-
.notable-traits .notable, .notable-traits .docblock {
1296+
.notable-traits .docblock {
12971297
margin: 0;
12981298
}
12991299

src/test/rustdoc-gui/notable-trait.goml

+38-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,23 @@ assert-position: (
2424
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
2525
{"x": 951},
2626
)
27-
27+
// The tooltip should be beside the `i`
28+
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']"
29+
compare-elements-position-near: (
30+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
31+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
32+
{"y": 2}
33+
)
34+
compare-elements-position-false: (
35+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
36+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
37+
("x")
38+
)
39+
// The docblock should be flush with the border.
40+
assert-css: (
41+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
42+
{"margin-left": "0px"}
43+
)
2844

2945
// Now only the `i` should be on the next line.
3046
size: (1055, 600)
@@ -81,6 +97,27 @@ assert-position: (
8197
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
8298
{"x": 289},
8399
)
100+
// The tooltip should be below `i`
101+
compare-elements-position-near-false: (
102+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
103+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
104+
{"y": 2}
105+
)
106+
compare-elements-position-false: (
107+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
108+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
109+
("x")
110+
)
111+
compare-elements-position-near: (
112+
"//*[@id='method.create_an_iterator_from_read']/parent::*",
113+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
114+
{"x": 5}
115+
)
116+
// The docblock should be flush with the border.
117+
assert-css: (
118+
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
119+
{"margin-left": "0px"}
120+
)
84121

85122
// Checking on very small mobile. The `i` should be on its own line.
86123
size: (365, 600)

0 commit comments

Comments
 (0)