From b77830d6d930f073fae595bf25f932759076f5ea Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 30 Dec 2021 16:21:25 +0100 Subject: [PATCH 1/2] Update browser-ui-test version to have assert-position command --- src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile index 6e77bb0a09b..d4701a25614 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile @@ -72,7 +72,7 @@ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}" # https://github.com/puppeteer/puppeteer/issues/375 # # We also specify the version in case we need to update it to go around cache limitations. -RUN npm install -g browser-ui-test@0.5.1 --unsafe-perm=true +RUN npm install -g browser-ui-test@0.5.3 --unsafe-perm=true ENV RUST_CONFIGURE_ARGS \ --build=x86_64-unknown-linux-gnu \ From 7c78ea5b53a8a37d3d56a79c1aeca75beab80140 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 29 Dec 2021 18:54:33 +0100 Subject: [PATCH 2/2] Fix display of toggles on mobile --- src/librustdoc/html/static/css/rustdoc.css | 10 ++++++++++ src/test/rustdoc-gui/toggle-docs-mobile.goml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index cbb078f2ab3..e5c667a37c6 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -2007,6 +2007,16 @@ details.rustdoc-toggle[open] > summary.hideme::after { max-width: 100vw; width: 100vw; } + + /* Position of the "[-]" element. */ + details.rustdoc-toggle:not(.top-doc) > summary { + margin-left: 10px; + } + .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before, + #main-content > details.rustdoc-toggle:not(.top-doc) > summary::before, + #main-content > div > details.rustdoc-toggle > summary::before { + left: -11px; + } } @media print { diff --git a/src/test/rustdoc-gui/toggle-docs-mobile.goml b/src/test/rustdoc-gui/toggle-docs-mobile.goml index 471d88701d4..b370dd012fa 100644 --- a/src/test/rustdoc-gui/toggle-docs-mobile.goml +++ b/src/test/rustdoc-gui/toggle-docs-mobile.goml @@ -9,6 +9,16 @@ assert-attribute: (".top-doc", {"open": ""}) click: (3, 280) assert-attribute: (".top-doc", {"open": ""}) +// Assert the position of the toggle on the top doc block. +assert-position: (".top-doc summary::before", {"x": 4}) +// Assert the position of the toggle on the impl block. +assert-position: ("#implementations + details > summary::before", {"x": 4}) +// Assert the position of the toggle on a method. +assert-position: ( + "#trait-implementations-list .impl-items .method-toggle > summary::before", + {"x": 4}, +) + // Now we do the same but with a little bigger width size: (600, 600) assert-attribute: (".top-doc", {"open": ""})