diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-01-10 11:03:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-10 11:03:06 +0100 |
| commit | a4ac4fae416b18f71a2f7ef2772ca4a4cc871828 (patch) | |
| tree | 862a34e614d55abea159be0a8bbb844268f0de39 /src/test/rustdoc-gui | |
| parent | d20affbf8d80f03e2390fd75690a5de5e883f85a (diff) | |
| parent | 962c0a4ee59e3c1a2413e785694c9433ffd0a9e1 (diff) | |
| download | rust-a4ac4fae416b18f71a2f7ef2772ca4a4cc871828.tar.gz rust-a4ac4fae416b18f71a2f7ef2772ca4a4cc871828.zip | |
Rollup merge of #92602 - jsha:source-link-2, r=GuillaumeGomez
Make source links look cleaner Change from syntaxy-looking [src] to the plain word "source". Change the syntaxy-looking `[-]` at the top of the page to say "collapse". Reduce opacity of rightside content. Part of #59851 r? `@GuillaumeGomez` Demo: https://rustdoc.crud.net/jsha/source-link-2/std/string/struct.String.html [Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/display.20of.20source.20link).
Diffstat (limited to 'src/test/rustdoc-gui')
| -rw-r--r-- | src/test/rustdoc-gui/anchors.goml | 6 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/headings.goml | 8 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/toggle-docs.goml | 3 |
3 files changed, 11 insertions, 6 deletions
diff --git a/src/test/rustdoc-gui/anchors.goml b/src/test/rustdoc-gui/anchors.goml index ca60be72cea..e6758287d8c 100644 --- a/src/test/rustdoc-gui/anchors.goml +++ b/src/test/rustdoc-gui/anchors.goml @@ -13,8 +13,10 @@ reload: assert-css: ("#toggle-all-docs", {"color": "rgb(0, 0, 0)"}) assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgb(0, 0, 0)"}) assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgb(173, 55, 138)"}) -assert-css: (".srclink", {"color": "rgb(0, 0, 0)"}) -assert-css: (".srclink", {"color": "rgb(0, 0, 0)"}) +assert-css: (".srclink", {"color": "rgb(56, 115, 173)"}) + +move-cursor-to: ".main-heading .srclink" +assert-css: (".srclink", {"text-decoration": "underline solid rgb(56, 115, 173)"}) assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"}) diff --git a/src/test/rustdoc-gui/headings.goml b/src/test/rustdoc-gui/headings.goml index 87c512468e0..9db75c59d94 100644 --- a/src/test/rustdoc-gui/headings.goml +++ b/src/test/rustdoc-gui/headings.goml @@ -15,7 +15,7 @@ goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html assert-css: ("h1.fqn", {"font-size": "24px"}) -assert-css: ("h1.fqn", {"border-bottom-width": "1px"}) +assert-css: (".main-heading", {"border-bottom-width": "1px"}) assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"}) @@ -55,7 +55,7 @@ assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "15.2p goto: file://|DOC_PATH|/test_docs/enum.HeavilyDocumentedEnum.html assert-css: ("h1.fqn", {"font-size": "24px"}) -assert-css: ("h1.fqn", {"border-bottom-width": "1px"}) +assert-css: (".main-heading", {"border-bottom-width": "1px"}) assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"}) @@ -115,7 +115,7 @@ assert-css: (".sidebar .others h3", {"border-bottom-width": "1px"}, ALL) goto: file://|DOC_PATH|/test_docs/union.HeavilyDocumentedUnion.html assert-css: ("h1.fqn", {"font-size": "24px"}) -assert-css: ("h1.fqn", {"border-bottom-width": "1px"}) +assert-css: (".main-heading", {"border-bottom-width": "1px"}) assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"}) @@ -148,7 +148,7 @@ assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"border-bottom-width": " goto: file://|DOC_PATH|/test_docs/macro.heavily_documented_macro.html assert-css: ("h1.fqn", {"font-size": "24px"}) -assert-css: ("h1.fqn", {"border-bottom-width": "1px"}) +assert-css: (".main-heading", {"border-bottom-width": "1px"}) assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"}) diff --git a/src/test/rustdoc-gui/toggle-docs.goml b/src/test/rustdoc-gui/toggle-docs.goml index eaa4c554d5a..e11aae21e3f 100644 --- a/src/test/rustdoc-gui/toggle-docs.goml +++ b/src/test/rustdoc-gui/toggle-docs.goml @@ -1,10 +1,13 @@ goto: file://|DOC_PATH|/test_docs/index.html assert-attribute: ("#main-content > details.top-doc", {"open": ""}) +assert-text: ("#toggle-all-docs", "[−]") click: "#toggle-all-docs" wait-for: 1000 // This is now collapsed so there shouldn't be the "open" attribute on details. assert-attribute-false: ("#main-content > details.top-doc", {"open": ""}) +assert-text: ("#toggle-all-docs", "[+]") click: "#toggle-all-docs" wait-for: 1000 // Not collapsed anymore so the "open" attribute should be back. assert-attribute: ("#main-content > details.top-doc", {"open": ""}) +assert-text: ("#toggle-all-docs", "[−]") |
