diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2022-09-09 15:36:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-09 15:36:38 +0200 |
| commit | 2e258cec0505f58ffc2d1997acb5f4ea2e279500 (patch) | |
| tree | d05693f2376caa5a9725b030558f246f5edf995a /src/test/rustdoc-gui | |
| parent | ff21ccfba18760659aa81c9b7e347d54a0ba2833 (diff) | |
| parent | cbcb74e939527750740b0c715068723f5a6e595c (diff) | |
| download | rust-2e258cec0505f58ffc2d1997acb5f4ea2e279500.tar.gz rust-2e258cec0505f58ffc2d1997acb5f4ea2e279500.zip | |
Rollup merge of #101600 - notriddle:notriddle/li, r=GuillaumeGomez
rustdoc: simplify the codeblock tooltip **https://github.com/rust-lang/rust/pull/101593 needs merged first** This PR moves the tooltip into example-wrap, simplifying several overly-complex aspects of how these tooltips work: * The mousover javascript can be removed, because hovering example-wrap can style the tooltip inside. * The sibling selecor can be removed, because hovering the tooltip also hovers the wrapper, which can hover the codeblock itself. * The relative positioning of the `<li>` tag, which was added in https://github.com/rust-lang/rust/commit/e861efd9f9ca45c1048a256812dfe8faffbb1367 to fix the positioning of the code tooltip, can now be removed, because example-wrap itself already has relative positioning.
Diffstat (limited to 'src/test/rustdoc-gui')
| -rw-r--r-- | src/test/rustdoc-gui/check_info_sign_position.goml | 8 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/codeblock-tooltip.goml | 36 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/overflow-tooltip-information.goml | 2 |
3 files changed, 23 insertions, 23 deletions
diff --git a/src/test/rustdoc-gui/check_info_sign_position.goml b/src/test/rustdoc-gui/check_info_sign_position.goml index 3bed7a0a03e..c249895503a 100644 --- a/src/test/rustdoc-gui/check_info_sign_position.goml +++ b/src/test/rustdoc-gui/check_info_sign_position.goml @@ -4,8 +4,8 @@ goto: file://|DOC_PATH|/test_docs/index.html goto: ./fn.check_list_code_block.html // If the codeblock is the first element of the docblock, the information tooltip must have // have some top margin to avoid going over the toggle (the "[+]"). -assert-css: (".docblock > .information > .compile_fail", { "margin-top": "16px" }) +assert-css: (".docblock > .example-wrap > .information > .compile_fail", { "margin-top": "16px" }) // Checks that the other codeblocks don't have this top margin. -assert-css: ("ol > li > .information > .compile_fail", { "margin-top": "0px" }) -assert-css: ("ol > li > .information > .ignore", { "margin-top": "0px" }) -assert-css: (".docblock > .information > .ignore", { "margin-top": "0px" }) +assert-css: ("ol > li > .example-wrap > .information > .compile_fail", { "margin-top": "0px" }) +assert-css: ("ol > li > .example-wrap > .information > .ignore", { "margin-top": "0px" }) +assert-css: (".docblock > .example-wrap > .information > .ignore", { "margin-top": "0px" }) diff --git a/src/test/rustdoc-gui/codeblock-tooltip.goml b/src/test/rustdoc-gui/codeblock-tooltip.goml index a0bb40fce8e..4e85c33c894 100644 --- a/src/test/rustdoc-gui/codeblock-tooltip.goml +++ b/src/test/rustdoc-gui/codeblock-tooltip.goml @@ -8,30 +8,30 @@ reload: // compile_fail block assert-css: (".docblock .information .compile_fail", {"color": "rgba(255, 0, 0, 0.5)"}) -assert-css: (".docblock .example-wrap .compile_fail", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) +assert-css: (".docblock .example-wrap pre.compile_fail", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) move-cursor-to: ".docblock .information .compile_fail" assert-css: (".docblock .information .compile_fail", {"color": "rgb(255, 0, 0)"}) -assert-css: (".docblock .example-wrap .compile_fail", {"border-left": "2px solid rgb(255, 0, 0)"}) +assert-css: (".docblock .example-wrap pre.compile_fail", {"border-left": "2px solid rgb(255, 0, 0)"}) // should_panic block assert-css: (".docblock .information .should_panic", {"color": "rgba(255, 0, 0, 0.5)"}) -assert-css: (".docblock .example-wrap .should_panic", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) +assert-css: (".docblock .example-wrap pre.should_panic", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) move-cursor-to: ".docblock .information .should_panic" assert-css: (".docblock .information .should_panic", {"color": "rgb(255, 0, 0)"}) -assert-css: (".docblock .example-wrap .should_panic", {"border-left": "2px solid rgb(255, 0, 0)"}) +assert-css: (".docblock .example-wrap pre.should_panic", {"border-left": "2px solid rgb(255, 0, 0)"}) // ignore block assert-css: (".docblock .information .ignore", {"color": "rgba(255, 142, 0, 0.6)"}) -assert-css: (".docblock .example-wrap .ignore", {"border-left": "2px solid rgba(255, 142, 0, 0.6)"}) +assert-css: (".docblock .example-wrap pre.ignore", {"border-left": "2px solid rgba(255, 142, 0, 0.6)"}) move-cursor-to: ".docblock .information .ignore" assert-css: (".docblock .information .ignore", {"color": "rgb(255, 142, 0)"}) -assert-css: (".docblock .example-wrap .ignore", {"border-left": "2px solid rgb(255, 142, 0)"}) +assert-css: (".docblock .example-wrap pre.ignore", {"border-left": "2px solid rgb(255, 142, 0)"}) // Light theme. @@ -39,30 +39,30 @@ local-storage: {"rustdoc-theme": "light"} reload: assert-css: (".docblock .information .compile_fail", {"color": "rgba(255, 0, 0, 0.5)"}) -assert-css: (".docblock .example-wrap .compile_fail", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) +assert-css: (".docblock .example-wrap pre.compile_fail", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) move-cursor-to: ".docblock .information .compile_fail" assert-css: (".docblock .information .compile_fail", {"color": "rgb(255, 0, 0)"}) -assert-css: (".docblock .example-wrap .compile_fail", {"border-left": "2px solid rgb(255, 0, 0)"}) +assert-css: (".docblock .example-wrap pre.compile_fail", {"border-left": "2px solid rgb(255, 0, 0)"}) // should_panic block assert-css: (".docblock .information .should_panic", {"color": "rgba(255, 0, 0, 0.5)"}) -assert-css: (".docblock .example-wrap .should_panic", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) +assert-css: (".docblock .example-wrap pre.should_panic", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) move-cursor-to: ".docblock .information .should_panic" assert-css: (".docblock .information .should_panic", {"color": "rgb(255, 0, 0)"}) -assert-css: (".docblock .example-wrap .should_panic", {"border-left": "2px solid rgb(255, 0, 0)"}) +assert-css: (".docblock .example-wrap pre.should_panic", {"border-left": "2px solid rgb(255, 0, 0)"}) // ignore block assert-css: (".docblock .information .ignore", {"color": "rgba(255, 142, 0, 0.6)"}) -assert-css: (".docblock .example-wrap .ignore", {"border-left": "2px solid rgba(255, 142, 0, 0.6)"}) +assert-css: (".docblock .example-wrap pre.ignore", {"border-left": "2px solid rgba(255, 142, 0, 0.6)"}) move-cursor-to: ".docblock .information .ignore" assert-css: (".docblock .information .ignore", {"color": "rgb(255, 142, 0)"}) -assert-css: (".docblock .example-wrap .ignore", {"border-left": "2px solid rgb(255, 142, 0)"}) +assert-css: (".docblock .example-wrap pre.ignore", {"border-left": "2px solid rgb(255, 142, 0)"}) // Ayu theme. @@ -70,27 +70,27 @@ local-storage: {"rustdoc-theme": "ayu"} reload: assert-css: (".docblock .information .compile_fail", {"color": "rgba(255, 0, 0, 0.5)"}) -assert-css: (".docblock .example-wrap .compile_fail", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) +assert-css: (".docblock .example-wrap pre.compile_fail", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) move-cursor-to: ".docblock .information .compile_fail" assert-css: (".docblock .information .compile_fail", {"color": "rgb(255, 0, 0)"}) -assert-css: (".docblock .example-wrap .compile_fail", {"border-left": "2px solid rgb(255, 0, 0)"}) +assert-css: (".docblock .example-wrap pre.compile_fail", {"border-left": "2px solid rgb(255, 0, 0)"}) // should_panic block assert-css: (".docblock .information .should_panic", {"color": "rgba(255, 0, 0, 0.5)"}) -assert-css: (".docblock .example-wrap .should_panic", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) +assert-css: (".docblock .example-wrap pre.should_panic", {"border-left": "2px solid rgba(255, 0, 0, 0.5)"}) move-cursor-to: ".docblock .information .should_panic" assert-css: (".docblock .information .should_panic", {"color": "rgb(255, 0, 0)"}) -assert-css: (".docblock .example-wrap .should_panic", {"border-left": "2px solid rgb(255, 0, 0)"}) +assert-css: (".docblock .example-wrap pre.should_panic", {"border-left": "2px solid rgb(255, 0, 0)"}) // ignore block assert-css: (".docblock .information .ignore", {"color": "rgba(255, 142, 0, 0.6)"}) -assert-css: (".docblock .example-wrap .ignore", {"border-left": "2px solid rgba(255, 142, 0, 0.6)"}) +assert-css: (".docblock .example-wrap pre.ignore", {"border-left": "2px solid rgba(255, 142, 0, 0.6)"}) move-cursor-to: ".docblock .information .ignore" assert-css: (".docblock .information .ignore", {"color": "rgb(255, 142, 0)"}) -assert-css: (".docblock .example-wrap .ignore", {"border-left": "2px solid rgb(255, 142, 0)"}) +assert-css: (".docblock .example-wrap pre.ignore", {"border-left": "2px solid rgb(255, 142, 0)"}) diff --git a/src/test/rustdoc-gui/overflow-tooltip-information.goml b/src/test/rustdoc-gui/overflow-tooltip-information.goml index 7ef85a4c445..5be1aff8d3b 100644 --- a/src/test/rustdoc-gui/overflow-tooltip-information.goml +++ b/src/test/rustdoc-gui/overflow-tooltip-information.goml @@ -2,7 +2,7 @@ // have overflow and max-width CSS rules set because they create a bug in firefox on // mac. For more information: https://github.com/rust-lang/rust/issues/89185 goto: file://|DOC_PATH|/test_docs/fn.foo.html -assert-css: (".docblock > .information", { +assert-css: (".docblock > .example-wrap > .information", { "overflow-x": "visible", "max-width": "none" }, ALL) |
