]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/font-weight.goml
Rollup merge of #89825 - martinvonz:split-inclusive-empty, r=m-ou-se
[rust.git] / src / test / rustdoc-gui / font-weight.goml
1 goto: file://|DOC_PATH|/lib2/struct.Foo.html
2 // This test checks that the font weight is correctly applied.
3 assert-css: ("//*[@class='docblock item-decl']//a[text()='Alias']", {"font-weight": "400"})
4 assert-css: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"})
5 assert-css: ("#method\.a_method > .code-header", {"font-weight": "600"})
6 assert-css: ("#associatedtype\.X > .code-header", {"font-weight": "600"})
7 assert-css: ("#associatedconstant\.Y > .code-header", {"font-weight": "600"})
8
9 goto: file://|DOC_PATH|/test_docs/type.SomeType.html
10 assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL)
11
12 goto: file://|DOC_PATH|/test_docs/struct.Foo.html
13 assert-css: (".impl-items .method", {"font-weight": "600"}, ALL)
14
15 goto: file://|DOC_PATH|/lib2/trait.Trait.html
16
17 // This is a complex selector, so here's how it works:
18 //
19 // * //*[@class='docblock item-decl'] — selects element of any tag with classes docblock and item-decl
20 // * /pre[@class='rust trait'] — selects immediate child with tag pre and classes rust and trait
21 // * /code — selects immediate child with tag code
22 // * /a[@class='constant'] — selects immediate child with tag a and class constant
23 // * //text() — selects child that is text node
24 // * /parent::* — selects immediate parent of the text node (the * means it can be any tag)
25 //
26 // This uses '/parent::*' as a proxy for the style of the text node.
27 // We can't just select the '<a>' because intermediate tags could be added.
28 assert-count: ("//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*", 1)
29 assert-css: ("//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*", {"font-weight": "400"})
30
31 assert-count: (".methods .type", 1)
32 assert-css: (".methods .type", {"font-weight": "600"})
33 assert-count: (".methods .constant", 1)
34 assert-css: (".methods .constant", {"font-weight": "600"})
35 assert-css: (".methods .method", {"font-weight": "600"})