Skip to content

Commit 17a2e1f

Browse files
authored
Rollup merge of #107336 - notriddle:notriddle/import-item-module-item, r=GuillaumeGomez
rustdoc: remove mostly-unused CSS classes `import-item` and `module-item`
2 parents aac937a + 97f8189 commit 17a2e1f

File tree

14 files changed

+26
-27
lines changed

14 files changed

+26
-27
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
391391
};
392392
write!(
393393
w,
394-
"<div class=\"item-left {stab}{add}import-item\"{id}>\
394+
"<div class=\"item-left{add}{stab}\"{id}>\
395395
<code>{vis}{imp}</code>\
396396
</div>\
397397
{stab_tags_before}{stab_tags}{stab_tags_after}",
@@ -437,7 +437,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
437437
};
438438
write!(
439439
w,
440-
"<div class=\"item-left {stab}{add}module-item\">\
440+
"<div class=\"item-left{add}{stab}\">\
441441
<a class=\"{class}\" href=\"{href}\" title=\"{title}\">{name}</a>\
442442
{visibility_emoji}\
443443
{unsafety_flag}\

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,8 +977,7 @@ so that we can apply CSS-filters to change the arrow color in themes */
977977
0 -1px 0 black;
978978
}
979979

980-
.module-item.unstable,
981-
.import-item.unstable {
980+
.item-left.unstable {
982981
opacity: 0.65;
983982
}
984983

tests/rustdoc-gui/label-next-to-symbol.goml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ assert-css: (
2020
// table like view
2121
assert-css: (".item-right.docblock-short", { "padding-left": "0px" })
2222
compare-elements-position-near: (
23-
"//*[@class='item-left module-item']//a[text()='replaced_function']",
23+
"//*[@class='item-left']//a[text()='replaced_function']",
2424
".item-left .stab.deprecated",
2525
{"y": 2},
2626
)
@@ -32,7 +32,7 @@ compare-elements-position: (
3232

3333
// Ensure no wrap
3434
compare-elements-position: (
35-
"//*[@class='item-left module-item']//a[text()='replaced_function']/..",
35+
"//*[@class='item-left']//a[text()='replaced_function']/..",
3636
"//*[@class='item-right docblock-short'][text()='a thing with a label']",
3737
("y"),
3838
)
@@ -43,7 +43,7 @@ size: (600, 600)
4343
// staggered layout with 2em spacing
4444
assert-css: (".item-right.docblock-short", { "padding-left": "32px" })
4545
compare-elements-position-near: (
46-
"//*[@class='item-left module-item']//a[text()='replaced_function']",
46+
"//*[@class='item-left']//a[text()='replaced_function']",
4747
".item-left .stab.deprecated",
4848
{"y": 2},
4949
)
@@ -55,7 +55,7 @@ compare-elements-position: (
5555

5656
// Ensure wrap
5757
compare-elements-position-false: (
58-
"//*[@class='item-left module-item']//a[text()='replaced_function']/..",
58+
"//*[@class='item-left']//a[text()='replaced_function']/..",
5959
"//*[@class='item-right docblock-short'][text()='a thing with a label']",
6060
("y"),
6161
)

tests/rustdoc-gui/module-items-font.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test checks that the correct font is used on module items (in index.html pages).
22
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
33
assert-css: (
4-
".item-table .module-item a",
4+
".item-table .item-left > a",
55
{"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'},
66
ALL,
77
)

tests/rustdoc/cfg_doc_reexport.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#![no_core]
66

77
// @has 'foo/index.html'
8-
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'foobar'
9-
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'bar'
8+
// @has - '//*[@class="item-left"]/*[@class="stab portability"]' 'foobar'
9+
// @has - '//*[@class="item-left"]/*[@class="stab portability"]' 'bar'
1010

1111
#[doc(cfg(feature = "foobar"))]
1212
mod imp_priv {

tests/rustdoc/deprecated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @has deprecated/index.html '//*[@class="item-left module-item"]/span[@class="stab deprecated"]' \
1+
// @has deprecated/index.html '//*[@class="item-left"]/span[@class="stab deprecated"]' \
22
// 'Deprecated'
33
// @has - '//*[@class="item-right docblock-short"]' 'Deprecated docs'
44

tests/rustdoc/doc-cfg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Portable;
1212
// @has doc_cfg/unix_only/index.html \
1313
// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
1414
// 'Available on Unix only.'
15-
// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\AARM\Z'
15+
// @matches - '//*[@class="item-left"]//*[@class="stab portability"]' '\AARM\Z'
1616
// @count - '//*[@class="stab portability"]' 2
1717
#[doc(cfg(unix))]
1818
pub mod unix_only {
@@ -42,7 +42,7 @@ pub mod unix_only {
4242
// @has doc_cfg/wasi_only/index.html \
4343
// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
4444
// 'Available on WASI only.'
45-
// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\AWebAssembly\Z'
45+
// @matches - '//*[@class="item-left"]//*[@class="stab portability"]' '\AWebAssembly\Z'
4646
// @count - '//*[@class="stab portability"]' 2
4747
#[doc(cfg(target_os = "wasi"))]
4848
pub mod wasi_only {
@@ -74,7 +74,7 @@ pub mod wasi_only {
7474

7575
// the portability header is different on the module view versus the full view
7676
// @has doc_cfg/index.html
77-
// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\Aavx\Z'
77+
// @matches - '//*[@class="item-left"]//*[@class="stab portability"]' '\Aavx\Z'
7878

7979
// @has doc_cfg/fn.uses_target_feature.html
8080
// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \

tests/rustdoc/duplicate-cfg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#![feature(doc_cfg)]
33

44
// @has 'foo/index.html'
5-
// @matches '-' '//*[@class="item-left module-item"]//*[@class="stab portability"]' '^sync$'
6-
// @has '-' '//*[@class="item-left module-item"]//*[@class="stab portability"]/@title' 'Available on crate feature `sync` only'
5+
// @matches '-' '//*[@class="item-left"]//*[@class="stab portability"]' '^sync$'
6+
// @has '-' '//*[@class="item-left"]//*[@class="stab portability"]/@title' 'Available on crate feature `sync` only'
77

88
// @has 'foo/struct.Foo.html'
99
// @has '-' '//*[@class="stab portability"]' 'sync'

tests/rustdoc/glob-shadowing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @has 'glob_shadowing/index.html'
2-
// @count - '//div[@class="item-left module-item"]' 6
2+
// @count - '//div[@class="item-left"]' 6
33
// @!has - '//div[@class="item-right docblock-short"]' 'sub1::describe'
44
// @has - '//div[@class="item-right docblock-short"]' 'sub2::describe'
55

tests/rustdoc/inline_cross/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
extern crate macros;
88

9-
// @has foo/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab deprecated"]' \
9+
// @has foo/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab deprecated"]' \
1010
// Deprecated
11-
// @has - '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab unstable"]' \
11+
// @has - '//*[@class="item-left unstable deprecated"]/span[@class="stab unstable"]' \
1212
// Experimental
1313

1414
// @has foo/macro.my_macro.html

0 commit comments

Comments
 (0)