Skip to content

Commit 66a2bba

Browse files
authored
Rollup merge of #103088 - GuillaumeGomez:fix-settings-page, r=notriddle
Fix settings page Thanks to #103060, I discovered that the settings page was badly rendered. This PR fixes it. Before: ![Screenshot from 2022-10-15 16-02-41](https://user-images.githubusercontent.com/3050060/195990668-42e0b16b-3146-4864-b822-6f6a80fb77a5.png) After: ![Screenshot from 2022-10-15 16-02-31](https://user-images.githubusercontent.com/3050060/195990664-20f967df-8989-4336-bca9-be52baab8e81.png) r? ```@notriddle```
2 parents b495c12 + 11a40ec commit 66a2bba

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/librustdoc/html/static/js/settings.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@
216216
const innerHTML = `<div class="settings">${buildSettingsPageSections(settings)}</div>`;
217217
const el = document.createElement(elementKind);
218218
el.id = "settings";
219-
el.className = "popover";
219+
if (!isSettingsPage) {
220+
el.className = "popover";
221+
}
220222
el.innerHTML = innerHTML;
221223

222224
if (isSettingsPage) {

src/test/rustdoc-gui/settings.goml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// This test ensures that the settings menu display is working as expected.
1+
// This test ensures that the settings menu display is working as expected and that
2+
// the settings page is also rendered as expected.
23
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
34
show-text: true // needed when we check for colors below.
45
// First, we check that the settings page doesn't exist.
@@ -140,7 +141,13 @@ assert-css: ("#settings-menu .popover", {"display": "none"})
140141
// Now we go to the settings page to check that the CSS is loaded as expected.
141142
goto: "file://" + |DOC_PATH| + "/settings.html"
142143
wait-for: "#settings"
143-
assert-css: (".setting-line .toggle .slider", {"width": "45px", "margin-right": "20px"})
144+
assert-css: (
145+
".setting-line .toggle .slider",
146+
{"width": "45px", "margin-right": "20px", "border": "0px none rgb(0, 0, 0)"},
147+
)
148+
149+
assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS)
150+
compare-elements-position: (".sub-container", "#settings", ("x"))
144151

145152
// We now check the display with JS disabled.
146153
assert-false: "noscript section"

0 commit comments

Comments
 (0)