Skip to content

Commit 64beb04

Browse files
Rollup merge of rust-lang#106543 - notriddle:notriddle/source-sidebar-width-zero, r=GuillaumeGomez
rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }` This CSS was added in dc2c972, before 6a5f8b1 when the sidebars were merged. Now that they are merged, the source sidebar is being pushed off-screen anyway, so giving it zero width doesn't do much.
2 parents eeb76eb + 16a3c80 commit 64beb04

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,14 +1598,10 @@ in storage.js
15981598

15991599
.sidebar.shown,
16001600
.source-sidebar-expanded .source .sidebar,
1601-
.sidebar:focus-within {
1601+
.rustdoc:not(.source) .sidebar:focus-within {
16021602
left: 0;
16031603
}
16041604

1605-
.rustdoc.source > .sidebar {
1606-
width: 0;
1607-
}
1608-
16091605
.mobile-topbar h2 {
16101606
padding-bottom: 0;
16111607
margin: auto 0.5em auto auto;

src/test/rustdoc-gui/sidebar-source-code-display.goml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ assert-css: (
171171

172172
// We now check that the scroll position is kept when opening the sidebar.
173173
click: "#src-sidebar-toggle"
174-
wait-for-css: (".sidebar", {"width": "0px"})
174+
wait-for-css: (".sidebar", {"left": "-1000px"})
175175
// We scroll to line 117 to change the scroll position.
176176
scroll-to: '//*[@id="117"]'
177177
assert-window-property: {"pageYOffset": "2542"}
178178
// Expanding the sidebar...
179179
click: "#src-sidebar-toggle"
180-
wait-for-css: (".sidebar", {"width": "500px"})
180+
wait-for-css: (".sidebar", {"left": "0px"})
181181
click: "#src-sidebar-toggle"
182-
wait-for-css: (".sidebar", {"width": "0px"})
182+
wait-for-css: (".sidebar", {"left": "-1000px"})
183183
// The "scrollTop" property should be the same.
184184
assert-window-property: {"pageYOffset": "2542"}
185185

src/test/rustdoc-gui/sidebar-source-code.goml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@op
7777

7878
// We now switch to mobile mode.
7979
size: (600, 600)
80-
wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "600px"})
80+
wait-for-css: (".source-sidebar-expanded nav.sidebar", {"left": "0px"})
8181
// We collapse the sidebar.
8282
click: (10, 10)
83-
// We check that the sidebar has the expected width (0).
84-
assert-css: ("nav.sidebar", {"width": "0px"})
83+
// We check that the sidebar has been moved off-screen.
84+
assert-css: ("nav.sidebar", {"left": "-1000px"})
8585
// We ensure that the class has been removed.
8686
assert-false: ".source-sidebar-expanded"
8787
assert: "nav.sidebar"

0 commit comments

Comments
 (0)