|
| 1 | +// This test check that headers (a) have the correct heading level, and (b) are the right size. |
| 2 | +// The sizes may change as design changes, but try to make sure a lower header is never bigger than |
| 3 | +// its parent headers. |
| 4 | +// Most of these sizes are set in CSS in `em` units, so here's a conversion chart based on our |
| 5 | +// default 16px font size: |
| 6 | +// 24px 1.5em |
| 7 | +// 22.4px 1.4em |
| 8 | +// 20.8px 1.3em |
| 9 | +// 18.4px 1.15em |
| 10 | +// 17.6px 1.1em |
| 11 | +// 16px 1em |
| 12 | +// 15.2px 0.95em |
| 13 | +goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html |
| 14 | + |
| 15 | +assert-css: ("h1.fqn", {"font-size": "24px"}) |
| 16 | + |
| 17 | +assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) |
| 18 | +assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"}) |
| 19 | +assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "17.6px"}) |
| 20 | + |
| 21 | +assert-css: ("h2#fields", {"font-size": "22.4px"}) |
| 22 | +assert-css: ("h3#title-for-field", {"font-size": "20.8px"}) |
| 23 | +assert-css: ("h4#sub-heading-for-field", {"font-size": "16px"}) |
| 24 | + |
| 25 | +assert-css: ("h2#implementations", {"font-size": "22.4px"}) |
| 26 | + |
| 27 | +assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"}) |
| 28 | +assert-css: ("#method\.do_nothing > h4.code-header", {"font-size": "16px"}) |
| 29 | + |
| 30 | +assert-css: ("h4#title-for-struct-impl-doc", {"font-size": "16px"}) |
| 31 | +assert-css: ("h5#sub-heading-for-struct-impl-doc", {"font-size": "16px"}) |
| 32 | +assert-css: ("h6#sub-sub-heading-for-struct-impl-doc", {"font-size": "15.2px"}) |
| 33 | + |
| 34 | +assert-css: ("h5#title-for-struct-impl-item-doc", {"font-size": "16px"}) |
| 35 | +assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"font-size": "15.2px"}) |
| 36 | +assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "15.2px"}) |
| 37 | + |
| 38 | +goto: file://|DOC_PATH|/test_docs/enum.HeavilyDocumentedEnum.html |
| 39 | + |
| 40 | +assert-css: ("h1.fqn", {"font-size": "24px"}) |
| 41 | + |
| 42 | +assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) |
| 43 | +assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"}) |
| 44 | +assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "17.6px"}) |
| 45 | + |
| 46 | +assert-css: ("h2#variants", {"font-size": "22.4px"}) |
| 47 | + |
| 48 | +assert-css: ("h3#none-prose-title", {"font-size": "20.8px"}) |
| 49 | +assert-css: ("h4#none-prose-sub-heading", {"font-size": "16px"}) |
| 50 | + |
| 51 | +assert-css: ("h3#wrapped-prose-title", {"font-size": "20.8px"}) |
| 52 | +assert-css: ("h4#wrapped-prose-sub-heading", {"font-size": "16px"}) |
| 53 | + |
| 54 | +assert-css: ("h4#wrapped0-prose-title", {"font-size": "16px"}) |
| 55 | +assert-css: ("h5#wrapped0-prose-sub-heading", {"font-size": "16px"}) |
| 56 | + |
| 57 | +assert-css: ("h4#structy-prose-title", {"font-size": "16px"}) |
| 58 | +assert-css: ("h5#structy-prose-sub-heading", {"font-size": "16px"}) |
| 59 | + |
| 60 | +assert-css: ("h2#implementations", {"font-size": "22.4px"}) |
| 61 | + |
| 62 | +assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"}) |
| 63 | +assert-css: ("#method\.do_nothing > h4.code-header", {"font-size": "16px"}) |
| 64 | + |
| 65 | +assert-css: ("h4#title-for-enum-impl-doc", {"font-size": "16px"}) |
| 66 | +assert-css: ("h5#sub-heading-for-enum-impl-doc", {"font-size": "16px"}) |
| 67 | +assert-css: ("h6#sub-sub-heading-for-enum-impl-doc", {"font-size": "15.2px"}) |
| 68 | + |
| 69 | +assert-css: ("h5#title-for-enum-impl-item-doc", {"font-size": "16px"}) |
| 70 | +assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"font-size": "15.2px"}) |
| 71 | +assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"font-size": "15.2px"}) |
| 72 | + |
| 73 | +goto: file://|DOC_PATH|/test_docs/union.HeavilyDocumentedUnion.html |
| 74 | + |
| 75 | +assert-css: ("h1.fqn", {"font-size": "24px"}) |
| 76 | + |
| 77 | +assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) |
| 78 | +assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"}) |
| 79 | + |
| 80 | +assert-css: ("h2#fields", {"font-size": "22.4px"}) |
| 81 | + |
| 82 | +assert-css: ("h3#title-for-union-variant", {"font-size": "20.8px"}) |
| 83 | +assert-css: ("h4#sub-heading-for-union-variant", {"font-size": "16px"}) |
| 84 | + |
| 85 | +assert-css: ("h2#implementations", {"font-size": "22.4px"}) |
| 86 | + |
| 87 | +assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"}) |
| 88 | +assert-css: ("h4#title-for-union-impl-doc", {"font-size": "16px"}) |
| 89 | +assert-css: ("h5#sub-heading-for-union-impl-doc", {"font-size": "16px"}) |
| 90 | + |
| 91 | +assert-css: ("h5#title-for-union-impl-item-doc", {"font-size": "16px"}) |
| 92 | +assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"font-size": "15.2px"}) |
| 93 | + |
| 94 | +goto: file://|DOC_PATH|/test_docs/macro.heavily_documented_macro.html |
| 95 | + |
| 96 | +assert-css: ("h1.fqn", {"font-size": "24px"}) |
| 97 | + |
| 98 | +assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) |
| 99 | +assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"}) |
0 commit comments