Skip to content

Commit 84a725e

Browse files
authored
Rollup merge of rust-lang#105639 - notriddle:notriddle/text-css, r=GuillaumeGomez
rustdoc: remove `type="text/css" from stylesheet links MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>, since "CSS is the only stylesheet language used on the web." Like 07a243b, but a few places that were missed the first time.
2 parents 8ba9c21 + 46b4a3b commit 84a725e

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/librustdoc/html/render/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
637637
You need to enable Javascript be able to update your settings.\
638638
</section>\
639639
</noscript>\
640-
<link rel=\"stylesheet\" type=\"text/css\" \
640+
<link rel=\"stylesheet\" \
641641
href=\"{static_root_path}{settings_css}\">\
642642
<script defer src=\"{static_root_path}{settings_js}\"></script>",
643643
static_root_path = page.get_static_root_path(),

src/librustdoc/html/static/js/main.js

-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ function browserSupportsHistoryApi() {
184184
function loadCss(cssUrl) {
185185
const link = document.createElement("link");
186186
link.href = cssUrl;
187-
link.type = "text/css";
188187
link.rel = "stylesheet";
189188
document.getElementsByTagName("head")[0].appendChild(link);
190189
}

src/librustdoc/markdown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub(crate) fn render<P: AsRef<Path>>(
5353

5454
let mut css = String::new();
5555
for name in &options.markdown_css {
56-
write!(css, r#"<link rel="stylesheet" type="text/css" href="{name}">"#)
56+
write!(css, r#"<link rel="stylesheet" href="{name}">"#)
5757
.expect("Writing to a String can't fail");
5858
}
5959

0 commit comments

Comments
 (0)