]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/type-declation-overflow.goml
Merge commit 'f4850f7292efa33759b4f7f9b7621268979e9914' into clippyup
[rust.git] / src / test / rustdoc-gui / type-declation-overflow.goml
1 // This test ensures that the items declaration content overflow is handled inside the <pre> directly.
2
3 // We need to disable this check because
4 // `implementors/test_docs/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.js`
5 // doesn't exist.
6 fail-on-request-error: false
7
8 goto: "file://" + |DOC_PATH| + "/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html"
9 // We set a fixed size so there is no chance of "random" resize.
10 size: (1100, 800)
11 // Logically, the <body> scroll width should be the width of the window.
12 assert-property: ("body", {"scrollWidth": "1100"})
13 // However, since there is overflow in the type declaration, its scroll width is bigger.
14 assert-property: (".item-decl pre", {"scrollWidth": "1324"})
15
16 // In the table-ish view on the module index, the name should not be wrapped more than necessary.
17 goto: "file://" + |DOC_PATH| + "/lib2/too_long/index.html"
18 assert-property: (".item-table .struct", {"offsetWidth": "684"})
19
20 // We now make the same check on type declaration...
21 goto: "file://" + |DOC_PATH| + "/lib2/too_long/type.ReallyLongTypeNameLongLongLong.html"
22 assert-property: ("body", {"scrollWidth": "1100"})
23 // We now check that the section width hasn't grown because of it.
24 assert-property: ("#main-content", {"scrollWidth": "840"})
25 // And now checking that it has scrollable content.
26 assert-property: (".item-decl pre", {"scrollWidth": "1103"})
27
28 // ... and constant.
29 // On a sidenote, it also checks that the (very) long title isn't changing the docblock width.
30 goto: "file://" + |DOC_PATH| + "/lib2/too_long/constant.ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong.html"
31 assert-property: ("body", {"scrollWidth": "1100"})
32 // We now check that the section width hasn't grown because of it.
33 assert-property: ("#main-content", {"scrollWidth": "840"})
34 // And now checking that it has scrollable content.
35 assert-property: (".item-decl pre", {"scrollWidth": "950"})
36
37 // On mobile:
38 size: (600, 600)
39 goto: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
40 // It shouldn't have an overflow in the topbar either.
41 store-property: (scrollWidth, ".mobile-topbar h2", "scrollWidth")
42 assert-property: (".mobile-topbar h2", {"clientWidth": |scrollWidth|})
43 assert-css: (".mobile-topbar h2", {"overflow-x": "hidden"})
44
45 // Check wrapping for top main-heading h1 and out-of-band.
46 // On desktop, they wrap when too big.
47 size: (1100, 800)
48 goto: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
49 compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y"))
50 goto: "file://" + |DOC_PATH| + "/lib2/index.html"
51 compare-elements-position: (".main-heading h1", ".main-heading .out-of-band", ("y"))
52 // make sure there is a gap between them
53 compare-elements-position-near-false: (".main-heading h1", ".main-heading .out-of-band", {"x": 550})
54
55 // On mobile, they always wrap.
56 size: (600, 600)
57 goto: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
58 compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y"))
59 goto: "file://" + |DOC_PATH| + "/lib2/index.html"
60 compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y"))