about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-13 01:17:12 +0100
committerGitHub <noreply@github.com>2022-12-13 01:17:12 +0100
commit84a725e4e360d6e4856c34cb231f995ea775dbba (patch)
treea888037ce50e79ca59a25e463d778234d42a0dfc
parent8ba9c211bb4f649ff6fcf5705b717e47065dd2ac (diff)
parent46b4a3b83148192fa4dc50bf1a751357ec7393aa (diff)
downloadrust-84a725e4e360d6e4856c34cb231f995ea775dbba.tar.gz
rust-84a725e4e360d6e4856c34cb231f995ea775dbba.zip
Rollup merge of #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 07a243b2a46384235d7e2c08688978b7cf018973, but a few places that were missed the first time.
-rw-r--r--src/librustdoc/html/render/context.rs2
-rw-r--r--src/librustdoc/html/static/js/main.js1
-rw-r--r--src/librustdoc/markdown.rs2
3 files changed, 2 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs
index 73690c86f4f..d4d3e4f6ea7 100644
--- a/src/librustdoc/html/render/context.rs
+++ b/src/librustdoc/html/render/context.rs
@@ -637,7 +637,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
                             You need to enable Javascript be able to update your settings.\
                         </section>\
                      </noscript>\
-                     <link rel=\"stylesheet\" type=\"text/css\" \
+                     <link rel=\"stylesheet\" \
                          href=\"{static_root_path}{settings_css}\">\
                      <script defer src=\"{static_root_path}{settings_js}\"></script>",
                     static_root_path = page.get_static_root_path(),
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index 152116089c7..3f97e4e2e39 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -184,7 +184,6 @@ function browserSupportsHistoryApi() {
 function loadCss(cssUrl) {
     const link = document.createElement("link");
     link.href = cssUrl;
-    link.type = "text/css";
     link.rel = "stylesheet";
     document.getElementsByTagName("head")[0].appendChild(link);
 }
diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs
index 044e051440c..5f4ad6d2aea 100644
--- a/src/librustdoc/markdown.rs
+++ b/src/librustdoc/markdown.rs
@@ -53,7 +53,7 @@ pub(crate) fn render<P: AsRef<Path>>(
 
     let mut css = String::new();
     for name in &options.markdown_css {
-        write!(css, r#"<link rel="stylesheet" type="text/css" href="{name}">"#)
+        write!(css, r#"<link rel="stylesheet" href="{name}">"#)
             .expect("Writing to a String can't fail");
     }