From d796ad4209b2c45d66a8e8b2fa8beac462c80671 Mon Sep 17 00:00:00 2001 From: Lukas Markeffsky <@> Date: Sun, 31 Dec 2023 20:31:06 +0100 Subject: [PATCH] rustdoc ui: adjust tooltip z-index to be above sidebar --- src/librustdoc/html/static/css/rustdoc.css | 2 +- tests/rustdoc-gui/tooltip-over-sidebar.goml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/rustdoc-gui/tooltip-over-sidebar.goml diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 995fd5d054d..3686bbbda7a 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1046,7 +1046,7 @@ so that we can apply CSS-filters to change the arrow color in themes */ position: absolute; top: 100%; right: 0; - z-index: 2; + z-index: 101; margin-top: 7px; border-radius: 3px; border: 1px solid var(--border-color); diff --git a/tests/rustdoc-gui/tooltip-over-sidebar.goml b/tests/rustdoc-gui/tooltip-over-sidebar.goml new file mode 100644 index 00000000000..71bf6978731 --- /dev/null +++ b/tests/rustdoc-gui/tooltip-over-sidebar.goml @@ -0,0 +1,12 @@ +// Check that the doctest info tooltips are above the sidebar. +go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" +move-cursor-to: ".example-wrap.ignore .tooltip" +wait-for: ".tooltip.popover" + +// Move cursor to top left corner of the tooltip and check that it doesn't fade. +move-cursor-to: ".tooltip.popover" +wait-for: 100 +assert: ".tooltip.popover:not(.fade-out)" + +move-cursor-to: (0, 0) +wait-for: ".tooltip.popover.fade-out"