Rollup merge of #107336 - notriddle:notriddle/import-item-module-item, r=GuillaumeGomez

rustdoc: remove mostly-unused CSS classes `import-item` and `module-item`
This commit is contained in:
Yuki Okushi 2023-01-27 12:57:57 +09:00 committed by GitHub
commit 17a2e1fef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 26 additions and 27 deletions

View File

@ -391,7 +391,7 @@ fn cmp(
};
write!(
w,
"<div class=\"item-left {stab}{add}import-item\"{id}>\
"<div class=\"item-left{add}{stab}\"{id}>\
<code>{vis}{imp}</code>\
</div>\
{stab_tags_before}{stab_tags}{stab_tags_after}",
@ -437,7 +437,7 @@ fn cmp(
};
write!(
w,
"<div class=\"item-left {stab}{add}module-item\">\
"<div class=\"item-left{add}{stab}\">\
<a class=\"{class}\" href=\"{href}\" title=\"{title}\">{name}</a>\
{visibility_emoji}\
{unsafety_flag}\

View File

@ -977,8 +977,7 @@ so that we can apply CSS-filters to change the arrow color in themes */
0 -1px 0 black;
}
.module-item.unstable,
.import-item.unstable {
.item-left.unstable {
opacity: 0.65;
}

View File

@ -20,7 +20,7 @@ assert-css: (
// table like view
assert-css: (".item-right.docblock-short", { "padding-left": "0px" })
compare-elements-position-near: (
"//*[@class='item-left module-item']//a[text()='replaced_function']",
"//*[@class='item-left']//a[text()='replaced_function']",
".item-left .stab.deprecated",
{"y": 2},
)
@ -32,7 +32,7 @@ compare-elements-position: (
// Ensure no wrap
compare-elements-position: (
"//*[@class='item-left module-item']//a[text()='replaced_function']/..",
"//*[@class='item-left']//a[text()='replaced_function']/..",
"//*[@class='item-right docblock-short'][text()='a thing with a label']",
("y"),
)
@ -43,7 +43,7 @@ size: (600, 600)
// staggered layout with 2em spacing
assert-css: (".item-right.docblock-short", { "padding-left": "32px" })
compare-elements-position-near: (
"//*[@class='item-left module-item']//a[text()='replaced_function']",
"//*[@class='item-left']//a[text()='replaced_function']",
".item-left .stab.deprecated",
{"y": 2},
)
@ -55,7 +55,7 @@ compare-elements-position: (
// Ensure wrap
compare-elements-position-false: (
"//*[@class='item-left module-item']//a[text()='replaced_function']/..",
"//*[@class='item-left']//a[text()='replaced_function']/..",
"//*[@class='item-right docblock-short'][text()='a thing with a label']",
("y"),
)

View File

@ -1,7 +1,7 @@
// This test checks that the correct font is used on module items (in index.html pages).
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-css: (
".item-table .module-item a",
".item-table .item-left > a",
{"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'},
ALL,
)

View File

@ -5,8 +5,8 @@
#![no_core]
// @has 'foo/index.html'
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'foobar'
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'bar'
// @has - '//*[@class="item-left"]/*[@class="stab portability"]' 'foobar'
// @has - '//*[@class="item-left"]/*[@class="stab portability"]' 'bar'
#[doc(cfg(feature = "foobar"))]
mod imp_priv {

View File

@ -1,4 +1,4 @@
// @has deprecated/index.html '//*[@class="item-left module-item"]/span[@class="stab deprecated"]' \
// @has deprecated/index.html '//*[@class="item-left"]/span[@class="stab deprecated"]' \
// 'Deprecated'
// @has - '//*[@class="item-right docblock-short"]' 'Deprecated docs'

View File

@ -12,7 +12,7 @@
// @has doc_cfg/unix_only/index.html \
// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
// 'Available on Unix only.'
// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\AARM\Z'
// @matches - '//*[@class="item-left"]//*[@class="stab portability"]' '\AARM\Z'
// @count - '//*[@class="stab portability"]' 2
#[doc(cfg(unix))]
pub mod unix_only {
@ -42,7 +42,7 @@ fn unix_and_arm_only_function() {}
// @has doc_cfg/wasi_only/index.html \
// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
// 'Available on WASI only.'
// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\AWebAssembly\Z'
// @matches - '//*[@class="item-left"]//*[@class="stab portability"]' '\AWebAssembly\Z'
// @count - '//*[@class="stab portability"]' 2
#[doc(cfg(target_os = "wasi"))]
pub mod wasi_only {
@ -74,7 +74,7 @@ fn wasi_and_wasm32_only_function() {}
// the portability header is different on the module view versus the full view
// @has doc_cfg/index.html
// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\Aavx\Z'
// @matches - '//*[@class="item-left"]//*[@class="stab portability"]' '\Aavx\Z'
// @has doc_cfg/fn.uses_target_feature.html
// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \

View File

@ -2,8 +2,8 @@
#![feature(doc_cfg)]
// @has 'foo/index.html'
// @matches '-' '//*[@class="item-left module-item"]//*[@class="stab portability"]' '^sync$'
// @has '-' '//*[@class="item-left module-item"]//*[@class="stab portability"]/@title' 'Available on crate feature `sync` only'
// @matches '-' '//*[@class="item-left"]//*[@class="stab portability"]' '^sync$'
// @has '-' '//*[@class="item-left"]//*[@class="stab portability"]/@title' 'Available on crate feature `sync` only'
// @has 'foo/struct.Foo.html'
// @has '-' '//*[@class="stab portability"]' 'sync'

View File

@ -1,5 +1,5 @@
// @has 'glob_shadowing/index.html'
// @count - '//div[@class="item-left module-item"]' 6
// @count - '//div[@class="item-left"]' 6
// @!has - '//div[@class="item-right docblock-short"]' 'sub1::describe'
// @has - '//div[@class="item-right docblock-short"]' 'sub2::describe'

View File

@ -6,9 +6,9 @@
extern crate macros;
// @has foo/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab deprecated"]' \
// @has foo/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab deprecated"]' \
// Deprecated
// @has - '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab unstable"]' \
// @has - '//*[@class="item-left unstable deprecated"]/span[@class="stab unstable"]' \
// Experimental
// @has foo/macro.my_macro.html

View File

@ -2,9 +2,9 @@
#![doc(issue_tracker_base_url = "https://issue_url/")]
#![unstable(feature = "test", issue = "32374")]
// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab deprecated"]' \
// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab deprecated"]' \
// 'Deprecated'
// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated module-item"]/span[@class="stab unstable"]' \
// @matches issue_32374/index.html '//*[@class="item-left unstable deprecated"]/span[@class="stab unstable"]' \
// 'Experimental'
// @matches issue_32374/index.html '//*[@class="item-right docblock-short"]/text()' 'Docs'

View File

@ -29,8 +29,8 @@ pub fn bar() {}
// @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.foo.html"]' 'foo'
// @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.bar.html"]' 'bar'
// Though there should be such links later
// @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left module-item"]/a[@class="fn"][@href="fn.foo.html"]' 'foo'
// @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left module-item"]/a[@class="fn"][@href="fn.bar.html"]' 'bar'
// @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left"]/a[@class="fn"][@href="fn.foo.html"]' 'foo'
// @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left"]/a[@class="fn"][@href="fn.bar.html"]' 'bar'
/// See either [foo] or [bar].
pub mod subtwo {

View File

@ -1,2 +1,2 @@
// @has issue_95873/index.html "//*[@class='item-left import-item']" "pub use ::std as x;"
// @has issue_95873/index.html "//*[@class='item-left']" "pub use ::std as x;"
pub use ::std as x;

View File

@ -4,12 +4,12 @@
extern crate reexport_check;
// @!has 'foo/index.html' '//code' 'pub use self::i32;'
// @has 'foo/index.html' '//div[@class="item-left deprecated module-item"]' 'i32'
// @has 'foo/index.html' '//div[@class="item-left deprecated"]' 'i32'
// @has 'foo/i32/index.html'
#[allow(deprecated, deprecated_in_future)]
pub use std::i32;
// @!has 'foo/index.html' '//code' 'pub use self::string::String;'
// @has 'foo/index.html' '//div[@class="item-left module-item"]' 'String'
// @has 'foo/index.html' '//div[@class="item-left"]' 'String'
pub use std::string::String;
// @has 'foo/index.html' '//div[@class="item-right docblock-short"]' 'Docs in original'