about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-07-16 10:08:11 +0200
committerGitHub <noreply@github.com>2021-07-16 10:08:11 +0200
commitb19f37ca54709761948e3eaea3f86f5cd823e9d2 (patch)
treea8f726384f3935f18e8d68a6db1af1b19fd37a5b /src/test
parenta547abe929b750971f5b909149a0be2a3ec7c366 (diff)
parent868ffd03ed2b52d23eeaa9bf48857dde5083c18d (diff)
Rollup merge of #87167 - GuillaumeGomez:sidebar-display-mobile, r=notriddle
Fix sidebar display on small devices

Part of #87059.

Instead of hiding the sidebar on small devices, we instead move it out of the viewport so that it remains "visible" to our text only users.

Could you confirm it works for you `@ahicks92` and `@DataTriny` please? You can give it a try at [this URL](https://guillaume-gomez.fr/rustdoc-test/test_docs/index.html).

r? `@notriddle`
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/sidebar-mobile.goml10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/sidebar-mobile.goml b/src/test/rustdoc-gui/sidebar-mobile.goml
new file mode 100644
index 00000000000..9a1442e48a9
--- /dev/null
+++ b/src/test/rustdoc-gui/sidebar-mobile.goml
@@ -0,0 +1,10 @@
+// This test ensure that the sidebar isn't "hidden" on mobile but instead moved out of the viewport.
+// This is especially important for devices for "text-first" content (like for users with
+// sight issues).
+goto: file://|DOC_PATH|/test_docs/struct.Foo.html
+// Switching to "mobile view" by reducing the width to 600px.
+size: (600, 600)
+assert-css: (".sidebar-elems", {"display": "block", "left": "-246px"})
+// Opening the sidebar menu.
+click: ".sidebar-menu"
+assert-css: (".sidebar-elems", {"display": "block", "left": "0px"})