diff options
| author | bors <bors@rust-lang.org> | 2021-05-22 07:07:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-05-22 07:07:38 +0000 |
| commit | 70cb58ce279444ac0191c4aa6df79becbaf2bdc1 (patch) | |
| tree | c310bb699602c1c39b8bea570de8187b0e36da11 | |
| parent | 21e1cd9b95854bec31a4d05992561ef47c0c8b07 (diff) | |
| parent | 45fd4bc118267c2be23f6d843ad85432832048c4 (diff) | |
| download | rust-70cb58ce279444ac0191c4aa6df79becbaf2bdc1.tar.gz rust-70cb58ce279444ac0191c4aa6df79becbaf2bdc1.zip | |
Auto merge of #85568 - GuillaumeGomez:search-result-extra-info, r=jsha
Search result extra info The CSS rule was not updated when we updated the search result, this fixes it: Before:  After:  r? `@jsha`
| -rw-r--r-- | src/librustdoc/html/static/rustdoc.css | 4 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/search-result-keyword.goml | 11 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/src/lib.rs | 4 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 6d581108836..9c5e3e8bfb2 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -780,12 +780,12 @@ a { float: left; } -tr.result span.primitive::after { +.result-name span.primitive::after { content: ' (primitive type)'; font-style: italic; } -tr.result span.keyword::after { +.result-name span.keyword::after { content: ' (keyword)'; font-style: italic; } diff --git a/src/test/rustdoc-gui/search-result-keyword.goml b/src/test/rustdoc-gui/search-result-keyword.goml new file mode 100644 index 00000000000..23552c8ce89 --- /dev/null +++ b/src/test/rustdoc-gui/search-result-keyword.goml @@ -0,0 +1,11 @@ +goto: file://|DOC_PATH|/test_docs/index.html +write: (".search-input", "CookieMonster") +// Waiting for the search results to appear... +wait-for: "#titles" +// Note: The two next assert commands could be merged as one but readability would be +// less good. +// +// Checking that the CSS is displaying " (keyword)"... +assert: (".result-name span.keyword::after", {"content": '" (keyword)"'}) +// ... in italic. +assert: (".result-name span.keyword::after", {"font-style": "italic"}) diff --git a/src/test/rustdoc-gui/src/lib.rs b/src/test/rustdoc-gui/src/lib.rs index eeba3e3f907..7b247a19b8e 100644 --- a/src/test/rustdoc-gui/src/lib.rs +++ b/src/test/rustdoc-gui/src/lib.rs @@ -2,6 +2,7 @@ //! documentation generated so we can test each different features. #![crate_name = "test_docs"] +#![feature(doc_keyword)] use std::fmt; @@ -91,3 +92,6 @@ pub fn check_list_code_block() {} pub enum AnEnum { WithVariants { and: usize, sub: usize, variants: usize }, } + +#[doc(keyword = "CookieMonster")] +pub mod keyword {} |
