Rollup merge of #103088 - GuillaumeGomez:fix-settings-page, r=notriddle

Fix settings page

Thanks to https://github.com/rust-lang/rust/pull/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```
This commit is contained in:
Yuki Okushi 2022-10-16 11:41:14 +09:00 committed by GitHub
commit 66a2bba309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -216,7 +216,9 @@
const innerHTML = `<div class="settings">${buildSettingsPageSections(settings)}</div>`; const innerHTML = `<div class="settings">${buildSettingsPageSections(settings)}</div>`;
const el = document.createElement(elementKind); const el = document.createElement(elementKind);
el.id = "settings"; el.id = "settings";
el.className = "popover"; if (!isSettingsPage) {
el.className = "popover";
}
el.innerHTML = innerHTML; el.innerHTML = innerHTML;
if (isSettingsPage) { if (isSettingsPage) {

View File

@ -1,4 +1,5 @@
// This test ensures that the settings menu display is working as expected. // This test ensures that the settings menu display is working as expected and that
// the settings page is also rendered as expected.
goto: "file://" + |DOC_PATH| + "/test_docs/index.html" goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true // needed when we check for colors below. show-text: true // needed when we check for colors below.
// First, we check that the settings page doesn't exist. // First, we check that the settings page doesn't exist.
@ -140,7 +141,13 @@ assert-css: ("#settings-menu .popover", {"display": "none"})
// Now we go to the settings page to check that the CSS is loaded as expected. // Now we go to the settings page to check that the CSS is loaded as expected.
goto: "file://" + |DOC_PATH| + "/settings.html" goto: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings" wait-for: "#settings"
assert-css: (".setting-line .toggle .slider", {"width": "45px", "margin-right": "20px"}) assert-css: (
".setting-line .toggle .slider",
{"width": "45px", "margin-right": "20px", "border": "0px none rgb(0, 0, 0)"},
)
assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS)
compare-elements-position: (".sub-container", "#settings", ("x"))
// We now check the display with JS disabled. // We now check the display with JS disabled.
assert-false: "noscript section" assert-false: "noscript section"