Skip to content

Commit 855fc02

Browse files
committed
Auto merge of #97489 - GuillaumeGomez:settings-js-disabled, r=notriddle
Add sentence in case JS is disabled on settings.html page Instead of having an empty page, it'll look like this: ![Screenshot from 2022-05-28 17-46-23](https://user-images.githubusercontent.com/3050060/170833333-e1a59c2b-27ca-47da-9c08-2356e4a689cb.png) r? `@notriddle`
2 parents 6999ef2 + bfb16b9 commit 855fc02

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/librustdoc/html/render/context.rs

+5
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,11 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
609609
</a>\
610610
</span>\
611611
</div>\
612+
<noscript>\
613+
<section>\
614+
You need to enable Javascript be able to update your settings.\
615+
</section>\
616+
</noscript>\
612617
<link rel=\"stylesheet\" type=\"text/css\" \
613618
href=\"{root_path}settings{suffix}.css\">\
614619
<script defer src=\"{root_path}settings{suffix}.js\"></script>",

src/test/rustdoc-gui/settings.goml

+6
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,9 @@ assert-local-storage: {"rustdoc-disable-shortcuts": "true"}
6565
goto: file://|DOC_PATH|/settings.html
6666
wait-for: "#settings"
6767
assert-css: (".setting-line .toggle .slider", {"width": "45px", "margin-right": "20px"})
68+
69+
// We now check the display with JS disabled.
70+
assert-false: "noscript section"
71+
javascript: false
72+
reload:
73+
assert-css: ("noscript section", {"display": "block"})

0 commit comments

Comments
 (0)