From 5570fdae88cc93579cf2a03e9e2211051b0ef263 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 22 May 2023 16:40:01 -0700 Subject: [PATCH 1/2] rustdoc: merge identical CSS rules --- src/librustdoc/html/static/css/settings.css | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/librustdoc/html/static/css/settings.css b/src/librustdoc/html/static/css/settings.css index 99cf8e443f0..ff46ccee6c6 100644 --- a/src/librustdoc/html/static/css/settings.css +++ b/src/librustdoc/html/static/css/settings.css @@ -15,11 +15,6 @@ .setting-radio input { border-radius: 50%; } -.setting-check input:checked { - content: url('data:image/svg+xml,\ - \ - '); -} .setting-radio span, .setting-check span { padding-bottom: 1px; @@ -52,6 +47,9 @@ .setting-check input:checked { background-color: var(--settings-input-color); border-width: 1px; + content: url('data:image/svg+xml,\ + \ + '); } .setting-radio input:focus, .setting-check input:focus { box-shadow: 0 0 1px 1px var(--settings-input-color); From 24913bd768e3aa1bab4f0ba8a9310e965c17fae0 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 22 May 2023 16:41:52 -0700 Subject: [PATCH 2/2] rustdoc: remove unneeded `position: relative` setting CSS This was added to control percentage sizes, in 79956b96e875e6ba2bfa551fabda6b7896f988ac Now, the only percentage size is [`border-radius`], which is based on the size of the box itself, not its containing block. This leaves the property unused. [`border-radius`]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius --- src/librustdoc/html/static/css/settings.css | 1 - tests/rustdoc-gui/settings.goml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/static/css/settings.css b/src/librustdoc/html/static/css/settings.css index ff46ccee6c6..c1324c0760e 100644 --- a/src/librustdoc/html/static/css/settings.css +++ b/src/librustdoc/html/static/css/settings.css @@ -1,6 +1,5 @@ .setting-line { margin: 1.2em 0.6em; - position: relative; } .setting-radio input, .setting-check input { diff --git a/tests/rustdoc-gui/settings.goml b/tests/rustdoc-gui/settings.goml index bf1fe7be910..c37d969324c 100644 --- a/tests/rustdoc-gui/settings.goml +++ b/tests/rustdoc-gui/settings.goml @@ -301,7 +301,7 @@ wait-for-css: ("#help-button .popover", {"display": "block"}) // Now we go to the settings page to check that the CSS is loaded as expected. go-to: "file://" + |DOC_PATH| + "/settings.html" wait-for: "#settings" -assert-css: (".setting-line", {"position": "relative"}) +assert-css: (".setting-radio", {"cursor": "pointer"}) assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS) compare-elements-position: (".sub form", "#settings", ("x")) @@ -322,4 +322,4 @@ reload: set-window-size: (300, 1000) click: "#settings-menu" wait-for: "#settings" -assert-css: (".setting-line", {"position": "relative"}) +assert-css: (".setting-radio", {"cursor": "pointer"})