1 // This test is to ensure that the anchors (`ยง`) have the expected color and position.
2 goto: file://|DOC_PATH|/staged_api/struct.Foo.html
4 // This is needed to ensure that the text color is computed.
7 // Set the theme to light.
8 local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
9 // We reload the page so the local storage settings are being used.
12 assert-css: ("#toggle-all-docs", {"color": "rgb(0, 0, 0)"})
13 assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgb(0, 0, 0)"})
14 assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgb(173, 55, 138)"})
16 ".rightside .srclink",
17 {"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"},
20 compare-elements-css: (".rightside .srclink", ".rightside.srclink", ["color", "text-decoration"])
21 compare-elements-css: (".main-heading .srclink", ".rightside.srclink", ["color", "text-decoration"])
23 move-cursor-to: ".main-heading .srclink"
25 ".main-heading .srclink",
26 {"color": "rgb(56, 115, 173)", "text-decoration": "underline solid rgb(56, 115, 173)"},
28 move-cursor-to: ".impl-items .rightside .srclink"
30 ".impl-items .rightside .srclink",
31 {"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"},
33 move-cursor-to: ".impl-items .rightside.srclink"
35 ".impl-items .rightside.srclink",
36 {"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"},
39 goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
41 assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"})
43 assert-css: (".sidebar a", {"color": "rgb(53, 109, 164)"})
44 assert-css: (".in-band a", {"color": "rgb(0, 0, 0)"})
46 // We move the cursor over the "Implementations" title so the anchor is displayed.
47 move-cursor-to: "h2#implementations"
48 assert-css: ("h2#implementations a.anchor", {"color": "rgb(0, 0, 0)"})
50 // Same thing with the impl block title.
51 move-cursor-to: "#impl-HeavilyDocumentedStruct"
52 assert-css: ("#impl-HeavilyDocumentedStruct a.anchor", {"color": "rgb(0, 0, 0)"})
54 assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"})
57 // We do the same checks with the dark theme now.
59 local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
60 goto: file://|DOC_PATH|/staged_api/struct.Foo.html
62 assert-css: ("#toggle-all-docs", {"color": "rgb(221, 221, 221)"})
63 assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgb(221, 221, 221)"})
64 assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgb(45, 191, 184)"})
66 ".rightside .srclink",
67 {"color": "rgb(210, 153, 29)", "text-decoration": "none solid rgb(210, 153, 29)"},
70 compare-elements-css: (".rightside .srclink", ".rightside.srclink", ["color", "text-decoration"])
71 compare-elements-css: (".main-heading .srclink", ".rightside.srclink", ["color", "text-decoration"])
73 move-cursor-to: ".main-heading .srclink"
75 ".main-heading .srclink",
76 {"color": "rgb(210, 153, 29)", "text-decoration": "underline solid rgb(210, 153, 29)"},
78 move-cursor-to: ".impl-items .rightside .srclink"
80 ".impl-items .rightside .srclink",
81 {"color": "rgb(210, 153, 29)", "text-decoration": "none solid rgb(210, 153, 29)"},
83 move-cursor-to: ".impl-items .rightside.srclink"
85 ".impl-items .rightside.srclink",
86 {"color": "rgb(210, 153, 29)", "text-decoration": "none solid rgb(210, 153, 29)"},
89 goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
91 assert-css: ("#top-doc-prose-title", {"color": "rgb(221, 221, 221)"})
93 assert-css: (".sidebar a", {"color": "rgb(253, 191, 53)"})
94 assert-css: (".in-band a", {"color": "rgb(221, 221, 221)"})
96 // We move the cursor over the "Implementations" title so the anchor is displayed.
97 move-cursor-to: "h2#implementations"
98 assert-css: ("h2#implementations a.anchor", {"color": "rgb(221, 221, 221)"})
100 // Same thing with the impl block title.
101 move-cursor-to: "#impl-HeavilyDocumentedStruct"
102 assert-css: ("#impl-HeavilyDocumentedStruct a.anchor", {"color": "rgb(221, 221, 221)"})
104 assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"})
107 // We do the same checks with the ayu theme now.
109 local-storage: {"rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false"}
110 goto: file://|DOC_PATH|/staged_api/struct.Foo.html
112 assert-css: ("#toggle-all-docs", {"color": "rgb(197, 197, 197)"})
113 assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgb(255, 255, 255)"})
114 assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgb(255, 160, 165)"})
116 ".rightside .srclink",
117 {"color": "rgb(57, 175, 215)", "text-decoration": "none solid rgb(57, 175, 215)"},
120 compare-elements-css: (".rightside .srclink", ".rightside.srclink", ["color", "text-decoration"])
121 compare-elements-css: (".main-heading .srclink", ".rightside.srclink", ["color", "text-decoration"])
123 move-cursor-to: ".main-heading .srclink"
125 ".main-heading .srclink",
126 {"color": "rgb(57, 175, 215)", "text-decoration": "underline solid rgb(57, 175, 215)"},
128 move-cursor-to: ".impl-items .rightside .srclink"
130 ".impl-items .rightside .srclink",
131 {"color": "rgb(57, 175, 215)", "text-decoration": "none solid rgb(57, 175, 215)"},
133 move-cursor-to: ".impl-items .rightside.srclink"
135 ".impl-items .rightside.srclink",
136 {"color": "rgb(57, 175, 215)", "text-decoration": "none solid rgb(57, 175, 215)"},
139 goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
141 assert-css: ("#top-doc-prose-title", {"color": "rgb(255, 255, 255)"})
143 assert-css: (".sidebar a", {"color": "rgb(83, 177, 219)"})
144 assert-css: (".in-band a", {"color": "rgb(255, 255, 255)"})
146 // We move the cursor over the "Implementations" title so the anchor is displayed.
147 move-cursor-to: "h2#implementations"
148 assert-css: ("h2#implementations a.anchor", {"color": "rgb(197, 197, 197)"})
150 // Same thing with the impl block title.
151 move-cursor-to: "#impl-HeavilyDocumentedStruct"
152 assert-css: ("#impl-HeavilyDocumentedStruct a.anchor", {"color": "rgb(197, 197, 197)"})
154 assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"})