From e14d2efba3a43ca5f02ce69f978f64323c471abb Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 15 Oct 2022 15:59:00 +0200 Subject: [PATCH 1/2] Fix display of settings page --- src/librustdoc/html/static/js/settings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/static/js/settings.js b/src/librustdoc/html/static/js/settings.js index 1c5d33e2127..5e1c7e6f03e 100644 --- a/src/librustdoc/html/static/js/settings.js +++ b/src/librustdoc/html/static/js/settings.js @@ -216,7 +216,9 @@ const innerHTML = `
${buildSettingsPageSections(settings)}
`; const el = document.createElement(elementKind); el.id = "settings"; - el.className = "popover"; + if (!isSettingsPage) { + el.className = "popover"; + } el.innerHTML = innerHTML; if (isSettingsPage) { From 11a40ec5ffc68dc44e8ac1b122d46c919b35aff5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 15 Oct 2022 15:59:11 +0200 Subject: [PATCH 2/2] Add more GUI tests for settings page --- src/test/rustdoc-gui/settings.goml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/test/rustdoc-gui/settings.goml b/src/test/rustdoc-gui/settings.goml index dfbf1d38e0e..ed4e9c2516b 100644 --- a/src/test/rustdoc-gui/settings.goml +++ b/src/test/rustdoc-gui/settings.goml @@ -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" show-text: true // needed when we check for colors below. // 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. goto: "file://" + |DOC_PATH| + "/settings.html" 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. assert-false: "noscript section"