]>
Commit | Line | Data |
---|---|---|
136023e0 | 1 | // This test checks that the font weight is correctly applied. |
5099ac24 | 2 | goto: file://|DOC_PATH|/lib2/struct.Foo.html |
3c0e092e | 3 | assert-css: ("//*[@class='docblock item-decl']//a[text()='Alias']", {"font-weight": "400"}) |
a2a8927a XL |
4 | assert-css: ( |
5 | "//*[@class='structfield small-section-header']//a[text()='Alias']", | |
6 | {"font-weight": "400"}, | |
7 | ) | |
136023e0 XL |
8 | assert-css: ("#method\.a_method > .code-header", {"font-weight": "600"}) |
9 | assert-css: ("#associatedtype\.X > .code-header", {"font-weight": "600"}) | |
10 | assert-css: ("#associatedconstant\.Y > .code-header", {"font-weight": "600"}) | |
11 | ||
12 | goto: file://|DOC_PATH|/test_docs/type.SomeType.html | |
13 | assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL) | |
14 | ||
15 | goto: file://|DOC_PATH|/test_docs/struct.Foo.html | |
16 | assert-css: (".impl-items .method", {"font-weight": "600"}, ALL) | |
17 | ||
18 | goto: file://|DOC_PATH|/lib2/trait.Trait.html | |
94222f64 XL |
19 | |
20 | // This is a complex selector, so here's how it works: | |
21 | // | |
3c0e092e | 22 | // * //*[@class='docblock item-decl'] — selects element of any tag with classes docblock and item-decl |
94222f64 XL |
23 | // * /pre[@class='rust trait'] — selects immediate child with tag pre and classes rust and trait |
24 | // * /code — selects immediate child with tag code | |
25 | // * /a[@class='constant'] — selects immediate child with tag a and class constant | |
26 | // * //text() — selects child that is text node | |
27 | // * /parent::* — selects immediate parent of the text node (the * means it can be any tag) | |
28 | // | |
29 | // This uses '/parent::*' as a proxy for the style of the text node. | |
30 | // We can't just select the '<a>' because intermediate tags could be added. | |
a2a8927a XL |
31 | assert-count: ( |
32 | "//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*", | |
33 | 1, | |
34 | ) | |
35 | assert-css: ( | |
36 | "//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*", | |
37 | {"font-weight": "400"}, | |
38 | ) | |
94222f64 | 39 | |
a2a8927a XL |
40 | assert-count: (".methods .associatedtype", 1) |
41 | assert-css: (".methods .associatedtype", {"font-weight": "600"}) | |
136023e0 XL |
42 | assert-count: (".methods .constant", 1) |
43 | assert-css: (".methods .constant", {"font-weight": "600"}) | |
44 | assert-css: (".methods .method", {"font-weight": "600"}) |