]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/headings.goml
Rollup merge of #91939 - GKFX:feature-91866, r=cjgillot
[rust.git] / src / test / rustdoc-gui / headings.goml
1 // This test checks that headers (a) have the correct heading level, (b) are the right size,
2 // and (c) have the correct underlining (or absence of underlining).
3 // The sizes may change as design changes, but try to make sure a lower header is never bigger than
4 // its parent headers. Also make sure lower headers don't have underlines when their parents lack
5 // an underline.
6 // Most of these sizes are set in CSS in `em` units, so here's a conversion chart based on our
7 // default 16px font size:
8 // 24px    1.5em
9 // 22.4px  1.4em
10 // 20.8px  1.3em
11 // 18.4px  1.15em
12 // 17.6px  1.1em
13 // 16px    1em
14 // 15.2px  0.95em  
15 goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
16
17 assert-css: ("h1.fqn", {"font-size": "24px"})
18
19 assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"})
20 assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
21 assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"})
22 assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
23 assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "17.6px"})
24 assert-css: ("h4#top-doc-prose-sub-sub-heading", {"border-bottom-width": "1px"})
25
26 assert-css: ("h2#fields", {"font-size": "22.4px"})
27 assert-css: ("h2#fields", {"border-bottom-width": "1px"})
28 assert-css: ("h3#title-for-field", {"font-size": "20.8px"})
29 assert-css: ("h3#title-for-field", {"border-bottom-width": "0px"})
30 assert-css: ("h4#sub-heading-for-field", {"font-size": "16px"})
31 assert-css: ("h4#sub-heading-for-field", {"border-bottom-width": "0px"})
32
33 assert-css: ("h2#implementations", {"font-size": "22.4px"})
34 assert-css: ("h2#implementations", {"border-bottom-width": "1px"})
35
36 assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"})
37 assert-css: ("#impl > h3.code-header", {"border-bottom-width": "0px"})
38 assert-css: ("#method\.do_nothing > h4.code-header", {"font-size": "16px"})
39 assert-css: ("#method\.do_nothing > h4.code-header", {"border-bottom-width": "0px"})
40
41 assert-css: ("h4#title-for-struct-impl-doc", {"font-size": "16px"})
42 assert-css: ("h4#title-for-struct-impl-doc", {"border-bottom-width": "0px"})
43 assert-css: ("h5#sub-heading-for-struct-impl-doc", {"font-size": "16px"})
44 assert-css: ("h5#sub-heading-for-struct-impl-doc", {"border-bottom-width": "0px"})
45 assert-css: ("h6#sub-sub-heading-for-struct-impl-doc", {"font-size": "15.2px"})
46 assert-css: ("h6#sub-sub-heading-for-struct-impl-doc", {"border-bottom-width": "0px"})
47
48 assert-css: ("h5#title-for-struct-impl-item-doc", {"font-size": "16px"})
49 assert-css: ("h5#title-for-struct-impl-item-doc", {"border-bottom-width": "0px"})
50 assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"font-size": "15.2px"})
51 assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"border-bottom-width": "0px"})
52 assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "15.2px"})
53
54 goto: file://|DOC_PATH|/test_docs/enum.HeavilyDocumentedEnum.html
55
56 assert-css: ("h1.fqn", {"font-size": "24px"})
57
58 assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"})
59 assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
60 assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"})
61 assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
62 assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "17.6px"})
63 assert-css: ("h4#top-doc-prose-sub-sub-heading", {"border-bottom-width": "1px"})
64
65 assert-css: ("h2#variants", {"font-size": "22.4px"})
66 assert-css: ("h2#variants", {"border-bottom-width": "1px"})
67
68 assert-css: ("h4#none-prose-title", {"font-size": "16px"})
69 assert-css: ("h4#none-prose-title", {"border-bottom-width": "0px"})
70 assert-css: ("h5#none-prose-sub-heading", {"font-size": "16px"})
71 assert-css: ("h5#none-prose-sub-heading", {"border-bottom-width": "0px"})
72
73 assert-css: ("h4#wrapped-prose-title", {"font-size": "16px"})
74 assert-css: ("h4#wrapped-prose-title", {"border-bottom-width": "0px"})
75 assert-css: ("h5#wrapped-prose-sub-heading", {"font-size": "16px"})
76 assert-css: ("h5#wrapped-prose-sub-heading", {"border-bottom-width": "0px"})
77
78 assert-css: ("h5#wrapped0-prose-title", {"font-size": "16px"})
79 assert-css: ("h5#wrapped0-prose-title", {"border-bottom-width": "0px"})
80 assert-css: ("h6#wrapped0-prose-sub-heading", {"font-size": "15.2px"})
81 assert-css: ("h6#wrapped0-prose-sub-heading", {"border-bottom-width": "0px"})
82
83 assert-css: ("h5#structy-prose-title", {"font-size": "16px"})
84 assert-css: ("h5#structy-prose-title", {"border-bottom-width": "0px"})
85 assert-css: ("h6#structy-prose-sub-heading", {"font-size": "15.2px"})
86 assert-css: ("h6#structy-prose-sub-heading", {"border-bottom-width": "0px"})
87
88 assert-css: ("h2#implementations", {"font-size": "22.4px"})
89 assert-css: ("h2#implementations", {"border-bottom-width": "1px"})
90
91 assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"})
92 assert-css: ("#impl > h3.code-header", {"border-bottom-width": "0px"})
93 assert-css: ("#method\.do_nothing > h4.code-header", {"font-size": "16px"})
94 assert-css: ("#method\.do_nothing > h4.code-header", {"border-bottom-width": "0px"})
95
96 assert-css: ("h4#title-for-enum-impl-doc", {"font-size": "16px"})
97 assert-css: ("h4#title-for-enum-impl-doc", {"border-bottom-width": "0px"})
98 assert-css: ("h5#sub-heading-for-enum-impl-doc", {"font-size": "16px"})
99 assert-css: ("h5#sub-heading-for-enum-impl-doc", {"border-bottom-width": "0px"})
100 assert-css: ("h6#sub-sub-heading-for-enum-impl-doc", {"font-size": "15.2px"})
101 assert-css: ("h6#sub-sub-heading-for-enum-impl-doc", {"border-bottom-width": "0px"})
102
103 assert-css: ("h5#title-for-enum-impl-item-doc", {"font-size": "16px"})
104 assert-css: ("h5#title-for-enum-impl-item-doc", {"border-bottom-width": "0px"})
105 assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"font-size": "15.2px"})
106 assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"border-bottom-width": "0px"})
107 assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"font-size": "15.2px"})
108 assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"border-bottom-width": "0px"})
109
110 assert-text: (".sidebar .others h3", "Modules")
111 assert-css: (".sidebar .others h3", {"border-bottom-width": "0px"}, ALL)
112
113 goto: file://|DOC_PATH|/test_docs/union.HeavilyDocumentedUnion.html
114
115 assert-css: ("h1.fqn", {"font-size": "24px"})
116
117 assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"})
118 assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
119 assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"})
120 assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
121
122 assert-css: ("h2#fields", {"font-size": "22.4px"})
123 assert-css: ("h2#fields", {"border-bottom-width": "1px"})
124
125 assert-css: ("h3#title-for-union-variant", {"font-size": "20.8px"})
126 assert-css: ("h3#title-for-union-variant", {"border-bottom-width": "0px"})
127 assert-css: ("h4#sub-heading-for-union-variant", {"font-size": "16px"})
128 assert-css: ("h4#sub-heading-for-union-variant", {"border-bottom-width": "0px"})
129
130 assert-css: ("h2#implementations", {"font-size": "22.4px"})
131 assert-css: ("h2#implementations", {"border-bottom-width": "1px"})
132
133 assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"})
134 assert-css: ("#impl > h3.code-header", {"border-bottom-width": "0px"})
135 assert-css: ("h4#title-for-union-impl-doc", {"font-size": "16px"})
136 assert-css: ("h4#title-for-union-impl-doc", {"border-bottom-width": "0px"})
137 assert-css: ("h5#sub-heading-for-union-impl-doc", {"font-size": "16px"})
138 assert-css: ("h5#sub-heading-for-union-impl-doc", {"border-bottom-width": "0px"})
139
140 assert-css: ("h5#title-for-union-impl-item-doc", {"font-size": "16px"})
141 assert-css: ("h5#title-for-union-impl-item-doc", {"border-bottom-width": "0px"})
142 assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"font-size": "15.2px"})
143 assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"border-bottom-width": "0px"})
144
145 goto: file://|DOC_PATH|/test_docs/macro.heavily_documented_macro.html
146
147 assert-css: ("h1.fqn", {"font-size": "24px"})
148
149 assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"})
150 assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
151 assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"})
152 assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
153
154 goto: file://|DOC_PATH|/staged_api/struct.Foo.html
155 show-text: true
156 local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
157 assert-css: (".since", {"color": "rgb(128, 128, 128)"})
158
159 local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
160 reload:
161 assert-css: (".since", {"color": "rgb(128, 128, 128)"})
162
163 local-storage: {"rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false"}
164 reload:
165 assert-css: (".since", {"color": "rgb(128, 128, 128)"})