From 801ac0e24ff6269fe71d22d29b8482e2117b2f82 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Tue, 18 Jan 2022 22:05:17 -0800 Subject: Fix scroll offset when jumping to internal id --- src/test/rustdoc-gui/sidebar-mobile.goml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/test/rustdoc-gui') diff --git a/src/test/rustdoc-gui/sidebar-mobile.goml b/src/test/rustdoc-gui/sidebar-mobile.goml index 547eb3fd1b3..680822b6ecb 100644 --- a/src/test/rustdoc-gui/sidebar-mobile.goml +++ b/src/test/rustdoc-gui/sidebar-mobile.goml @@ -29,3 +29,9 @@ assert-css: (".sidebar", {"display": "block", "left": "-1000px"}) // Check that the topbar is visible assert-property: (".mobile-topbar", {"clientHeight": "45"}) + +// Check that clicking an element from the sidebar scrolls to the right place +// so the target is not obscured by the topbar. +click: ".sidebar-menu-toggle" +click: ".sidebar-links a" +assert-position: ("#method\.must_use", {"y": 45}) -- cgit 1.4.1-3-g733a5