Skip to content

Commit 0f3c98a

Browse files
Rollup merge of #85631 - GuillaumeGomez:move-keywrod-primitive-css-dom, r=jsha
Move keyword primitive css dom Fixes #85569. r? ``@jsha``
2 parents ad72247 + a06829c commit 0f3c98a

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

src/librustdoc/html/static/rustdoc.css

-10
Original file line numberDiff line numberDiff line change
@@ -796,16 +796,6 @@ a {
796796
display: inline-block;
797797
}
798798

799-
.result-name span.primitive::after {
800-
content: ' (primitive type)';
801-
font-style: italic;
802-
}
803-
804-
.result-name span.keyword::after {
805-
content: ' (keyword)';
806-
font-style: italic;
807-
}
808-
809799
body.blur > :not(#help) {
810800
filter: blur(8px);
811801
-webkit-filter: blur(8px);

src/librustdoc/html/static/search.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -975,26 +975,32 @@ window.initSearch = function(rawSearchIndex) {
975975
output = "<div class=\"search-results " + extraClass + "\">";
976976

977977
array.forEach(function(item) {
978-
var name, type;
979-
980-
name = item.name;
981-
type = itemTypes[item.ty];
982-
983978
if (item.is_alias !== true) {
984979
if (duplicates[item.fullPath]) {
985980
return;
986981
}
987982
duplicates[item.fullPath] = true;
988983
}
984+
985+
var name = item.name;
986+
var type = itemTypes[item.ty];
987+
989988
length += 1;
990989

990+
var extra = "";
991+
if (type === "primitive") {
992+
extra = " <i>(primitive type)</i>";
993+
} else if (type === "keyword") {
994+
extra = " <i>(keyword)</i>";
995+
}
996+
991997
output += "<a class=\"result-" + type + "\" href=\"" + item.href + "\">" +
992998
"<div><div class=\"result-name\">" +
993999
(item.is_alias === true ?
9941000
("<span class=\"alias\"><b>" + item.alias + " </b></span><span " +
9951001
"class=\"grey\"><i>&nbsp;- see&nbsp;</i></span>") : "") +
9961002
item.displayPath + "<span class=\"" + type + "\">" +
997-
name + "</span></div><div class=\"desc\">" +
1003+
name + extra + "</span></div><div class=\"desc\">" +
9981004
"<span>" + item.desc +
9991005
"&nbsp;</span></div></div></a>";
10001006
});

src/test/rustdoc-gui/search-result-keyword.goml

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ wait-for: "#titles"
55
// Note: The two next assert commands could be merged as one but readability would be
66
// less good.
77
//
8-
// Checking that the CSS is displaying " (keyword)"...
9-
assert: (".result-name span.keyword::after", {"content": '" (keyword)"'})
10-
// ... in italic.
11-
assert: (".result-name span.keyword::after", {"font-style": "italic"})
8+
// Checking that the CSS is displaying " (keyword)" in italic.
9+
assert: (".result-name span.keyword > i", "(keyword)")
10+
assert: (".result-name span.keyword", "CookieMonster (keyword)")

0 commit comments

Comments
 (0)