From 9ee4df0e9cbe474a0f357ed00dd479a2dae65e23 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Wed, 18 Jan 2023 12:39:13 -0700 Subject: [PATCH 1/2] rustdoc: remove redundant rule `#settings .setting-line` Since the current version of settings.js always nests things below a div with ID `settings`, this rule always overrode the one above. --- src/librustdoc/html/static/css/settings.css | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/librustdoc/html/static/css/settings.css b/src/librustdoc/html/static/css/settings.css index 3fa478751737f..7211ffb779568 100644 --- a/src/librustdoc/html/static/css/settings.css +++ b/src/librustdoc/html/static/css/settings.css @@ -1,5 +1,5 @@ .setting-line { - margin: 0.6em 0 0.6em 0.3em; + margin: 1.2em 0.6em; position: relative; } @@ -55,10 +55,6 @@ cursor: pointer; } -#settings .setting-line { - margin: 1.2em 0.6em; -} - .setting-line .radio-line input:checked { box-shadow: inset 0 0 0 3px var(--main-background-color); background-color: var(--settings-input-color); From 34d595dda16cbcc7a14aea17db8c5328867ed94d Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Wed, 18 Jan 2023 12:48:24 -0700 Subject: [PATCH 2/2] rustdoc: add test case for setting-line margin on settings.html --- tests/rustdoc-gui/settings.goml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/rustdoc-gui/settings.goml b/tests/rustdoc-gui/settings.goml index 72de41e41bae1..951ff4e30d2e3 100644 --- a/tests/rustdoc-gui/settings.goml +++ b/tests/rustdoc-gui/settings.goml @@ -8,6 +8,10 @@ assert-false: "#settings" click: "#settings-menu" wait-for: "#settings" assert-css: ("#settings", {"display": "block"}) + +// Store the line margin to compare with the settings.html later. +store-css: (setting_line_margin, ".setting-line", "margin") + // Let's close it by clicking on the same button. click: "#settings-menu" wait-for-css: ("#settings", {"display": "none"}) @@ -211,6 +215,9 @@ assert-css: (".setting-line", {"position": "relative"}) assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS) compare-elements-position: (".sub form", "#settings", ("x")) +// Check that setting-line has the same margin in this mode as in the popover. +assert-css: (".setting-line", {"margin": |setting_line_margin|}) + // We now check the display with JS disabled. assert-false: "noscript section" javascript: false