diff options
| author | Michael Howell <michael@notriddle.com> | 2023-04-10 16:15:51 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2023-04-12 10:31:06 -0700 |
| commit | bb7ed64f457be500a74d53c9d12f1d0a8f7badf6 (patch) | |
| tree | 0ffb08571f4631765cef1defa0e14d7454a77ed4 /tests/rustdoc-gui/sidebar-source-code-display.goml | |
| parent | 661b33f5247debc4e0cd948caa388997e18e9cb8 (diff) | |
| download | rust-bb7ed64f457be500a74d53c9d12f1d0a8f7badf6.tar.gz rust-bb7ed64f457be500a74d53c9d12f1d0a8f7badf6.zip | |
rustdoc: use CSS `overscroll-behavior` instead of JavaScript
Fixes the desktop scrolling weirdness mentioned in https://github.com/rust-lang/rust/pull/98775#issuecomment-1182575603 As described in the MDN page for this property: * The current Firefox ESR is 102, and the first Firefox version to support this feature is 59. * The current Chrome version 112, and the first version to support this is 63. * Edge is described as having a minor bug in `none` mode, but we use `contain` mode anyway, so it doesn't matter. * Safari 16, released September 2022, is the last browser to add this feature, and is also the oldest version we officially support.
Diffstat (limited to 'tests/rustdoc-gui/sidebar-source-code-display.goml')
| -rw-r--r-- | tests/rustdoc-gui/sidebar-source-code-display.goml | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/tests/rustdoc-gui/sidebar-source-code-display.goml b/tests/rustdoc-gui/sidebar-source-code-display.goml index f34e30b724d..20bf0596f95 100644 --- a/tests/rustdoc-gui/sidebar-source-code-display.goml +++ b/tests/rustdoc-gui/sidebar-source-code-display.goml @@ -183,22 +183,12 @@ wait-for-css: (".sidebar", {"left": "-1000px"}) // The "scrollTop" property should be the same. assert-window-property: {"pageYOffset": "2542"} -// We now check that the scroll position is restored if the window is resized. -set-window-size: (500, 700) -click: "#src-sidebar-toggle" -wait-for-css: ("#source-sidebar", {"visibility": "visible"}) -assert-window-property: {"pageYOffset": "0"} -set-window-size: (900, 900) -assert-window-property: {"pageYOffset": "2542"} -set-window-size: (500, 700) -click: "#src-sidebar-toggle" -wait-for-css: ("#source-sidebar", {"visibility": "hidden"}) - // We now check that opening the sidebar and clicking a link will close it. // The behavior here on mobile is different than the behavior on desktop, // but common sense dictates that if you have a list of files that fills the entire screen, and // you click one of them, you probably want to actually see the file's contents, and not just // make it the current selection. +set-window-size: (500, 700) click: "#src-sidebar-toggle" wait-for-css: ("#source-sidebar", {"visibility": "visible"}) assert-local-storage: {"rustdoc-source-sidebar-show": "true"} |
