Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -2527,9 +2527,12 @@ in src-script.js and main.js
z-index: 11;
/* Reduce height slightly to account for mobile topbar. */
height: calc(100vh - 45px);
width: 200px;
/* resize indicator: hide this when on touch or mobile */
border-right: none;
width: 100%;
}
.sidebar-elems .block li a {
white-space: wrap;
}

/* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
Expand Down
4 changes: 0 additions & 4 deletions tests/rustdoc-gui/notable-trait.goml
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ click: ".sidebar-menu-toggle"
assert: "//*[@class='sidebar shown']"
assert-count: ("//*[@class='tooltip popover']", 0)
assert-false: "#method\.create_an_iterator_from_read .tooltip:focus"
// Clicking a notable trait tooltip popover should close the sidebar.
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']"
assert-count: ("//*[@class='tooltip popover']", 1)
assert-false: "//*[@class='sidebar shown']"

// Also check the focus handling for the settings button.
set-window-size: (1100, 600)
Expand Down
13 changes: 0 additions & 13 deletions tests/rustdoc-gui/pocket-menu.goml
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,3 @@ assert-css: ("#settings-menu .popover", {"display": "block"})
click: ".sidebar-menu-toggle"
assert: "//*[@class='sidebar shown']"
assert-css: ("#settings-menu .popover", {"display": "none"})
// Opening the settings popover should close the sidebar.
click: "#settings-menu a"
assert-css: ("#settings-menu .popover", {"display": "block"})
assert-false: "//*[@class='sidebar shown']"

// Opening the settings popover at start (which async loads stuff) should also close.
reload:
click: ".sidebar-menu-toggle"
assert: "//*[@class='sidebar shown']"
assert-false: "#settings-menu .popover"
click: "#settings-menu a"
assert-false: "//*[@class='sidebar shown']"
wait-for: "#settings-menu .popover"
7 changes: 5 additions & 2 deletions tests/rustdoc-gui/sidebar-mobile.goml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ assert-css: (
{"display": "block"}
)

// Click elsewhere.
click: "body"
// Click the toggle to close it
click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})

// Open the sidebar menu, and make sure pressing Escape closes it.
Expand All @@ -57,6 +57,7 @@ scroll-to: ".block.keyword li:nth-child(1)"
compare-elements-position-near: (".block.keyword li:nth-child(1)", ".mobile-topbar", {"y": 544})

// Now checking the background color of the sidebar.
reload:
show-text: true

define-function: (
Expand All @@ -72,6 +73,8 @@ define-function: (
"background-color": |background|,
"color": |color|,
})
// Close the sidebar menu.
press-key: "Escape"
},
)

Expand Down
Loading