From dd5ff428edbc7cd4fa600b81f27bbec28589704f Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Sat, 5 Feb 2022 05:05:05 -0800 Subject: [PATCH] =?UTF-8?q?rustdoc:=20tweak=20line=20and=20=C2=B6=20spacin?= =?UTF-8?q?g=20for=20a11y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The W3C Web Content Accessibility Guidelines specify a minimum line spacing of 1.5 and a minimum paragraph spacing of 1.5 times the line spacing. Our current line spacing (implemented by line-height) is 1.4, so it's a small bump to go up to 1.5. Similarly, we have a paragraph spacing of 0.6em. Bump that to 0.75em (which is 1.5 times the 0.5em distance between lines). Also, fix all the font sizes so instead of being round-ish numbers in rem (like 1.1rem, 1.2rem), they are round numbers in pixels. Ensure each font size is at least 2 pixels different than the nearest other font size, so distinctions can be clearly seen. Overall the font-sizes are mostly staying the same, being rounded up or down as appropriate. Remove a few unused styles. Simplify the display of the mobile-topbar location, by setting its margins to auto rather than trying to size it exactly to the topbar. --- src/librustdoc/html/static/css/rustdoc.css | 112 ++++++++---------- .../rustdoc-gui/docblock-big-code-mobile.goml | 2 +- src/test/rustdoc-gui/headings.goml | 71 ++++++----- src/test/rustdoc-gui/item-info-width.goml | 2 +- src/test/rustdoc-gui/mobile.goml | 2 +- src/test/rustdoc-gui/sidebar-source-code.goml | 2 +- src/test/rustdoc-gui/sidebar.goml | 2 +- src/test/rustdoc-gui/src-font-size.goml | 5 +- .../rustdoc-gui/type-declation-overflow.goml | 4 +- 9 files changed, 96 insertions(+), 106 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 6d94c70eadee6..04112c9779b36 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -108,7 +108,9 @@ html { /* General structure and fonts */ body { - font: 1rem/1.4 "Source Serif 4", NanumBarunGothic, serif; + /* Line spacing at least 1.5 per Web Content Accessibility Guidelines + https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */ + font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif; margin: 0; position: relative; /* We use overflow-wrap: break-word for Safari, which doesn't recognize @@ -124,13 +126,13 @@ body { } h1 { - font-size: 1.5rem; + font-size: 1.5rem; /* 24px */ } h2 { - font-size: 1.4rem; + font-size: 1.375rem; /* 22px */ } h3 { - font-size: 1.3rem; + font-size: 1.25rem; /* 20px */ } h1, h2, h3, h4, h5, h6 { font-weight: 500; @@ -170,7 +172,7 @@ h2, border-bottom: 1px solid; } h3.code-header { - font-size: 1.1rem; + font-size: 1.125rem; /* 18px */ } h4.code-header { font-size: 1rem; @@ -221,19 +223,18 @@ a.srclink, font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif; } -.content ul.crate a.crate { - font-size: 1rem/1.6; -} - ol, ul { - padding-left: 25px; + padding-left: 24px; } ul ul, ol ul, ul ol, ol ol { - margin-bottom: .6em; + margin-bottom: .625em; } p { - margin: 0 0 .6em 0; + /* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines. + Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that. + https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */ + margin: 0 0 .75em 0; } summary { @@ -303,7 +304,7 @@ code, pre, a.test-arrow, .code-header { } .docblock code, .docblock-short code { border-radius: 3px; - padding: 0 0.1em; + padding: 0 0.125em; } .docblock pre code, .docblock-short pre code { padding: 0; @@ -364,7 +365,7 @@ nav.sub { } .sidebar { - font-size: 0.9rem; + font-size: 0.875rem; width: 250px; min-width: 200px; overflow-y: scroll; @@ -476,8 +477,8 @@ nav.sub { .block a, h2.location a { display: block; - padding: 0.3rem; - margin-left: -0.3rem; + padding: 0.25rem; + margin-left: -0.25rem; text-overflow: ellipsis; overflow: hidden; @@ -497,7 +498,7 @@ h2.location a { } .sidebar h3 { - font-size: 1.1rem; + font-size: 1.125rem; /* 18px */ font-weight: 500; padding: 0; margin: 0; @@ -598,18 +599,18 @@ h2.location a { white-space: pre-wrap; } -.top-doc .docblock h2 { font-size: 1.3rem; } -.top-doc .docblock h3 { font-size: 1.15rem; } +.top-doc .docblock h2 { font-size: 1.375rem; } +.top-doc .docblock h3 { font-size: 1.25; } .top-doc .docblock h4, .top-doc .docblock h5 { - font-size: 1.1rem; + font-size: 1.125rem; } .top-doc .docblock h6 { font-size: 1rem; } .docblock h5 { font-size: 1rem; } -.docblock h6 { font-size: 0.95rem; } +.docblock h6 { font-size: 0.875rem; } .docblock { margin-left: 24px; @@ -623,12 +624,12 @@ h2.location a { .content .out-of-band { flex-grow: 0; - font-size: 1.15rem; + font-size: 1.125rem; font-weight: normal; float: right; } -.method > .code-header, .trait-impl > .code-header, .invisible > .code-header { +.method > .code-header, .trait-impl > .code-header { max-width: calc(100% - 41px); display: block; } @@ -664,7 +665,7 @@ h2.location a { .content td { vertical-align: top; } .content td:first-child { padding-right: 20px; } .content td p:first-child { margin-top: 0; } -.content td h1, .content td h2 { margin-left: 0; font-size: 1.1rem; } +.content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; } .content tr:first-child td { border-top: 0; } .docblock table { @@ -713,7 +714,7 @@ h2.location a { .content .fn .where, .content .where.fmt-newline { display: block; - font-size: 0.8rem; + font-size: 0.875rem; } .content .methods > div:not(.notable-traits):not(.method) { @@ -736,7 +737,7 @@ h2.location a { } .content .item-info code { - font-size: 0.81rem; + font-size: 0.875rem; } .content .item-info { @@ -839,15 +840,6 @@ h2.small-section-header > .anchor { text-decoration: underline; } -.invisible > .srclink, -.method > .code-header + .srclink { - position: absolute; - top: 0; - right: 0; - font-size: 1.0625rem; - font-weight: normal; -} - .block a.current.crate { font-weight: 500; } /* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap @@ -885,7 +877,7 @@ table, display: table-cell; } .item-left { - padding-right: 1.2rem; + padding-right: 1.25rem; } .search-container { @@ -907,8 +899,8 @@ table, #crate-search { min-width: 115px; margin-top: 5px; - margin-left: 0.2em; - padding-left: 0.3em; + margin-left: 0.25em; + padding-left: 0.3125em; padding-right: 23px; border: 0; border-radius: 4px; @@ -942,7 +934,7 @@ table, border: 1px solid; border-radius: 2px; padding: 5px 8px; - font-size: 1.0625rem; + font-size: 1rem; transition: border-color 300ms ease; width: 100%; } @@ -1054,7 +1046,7 @@ body.blur > :not(#help) { .stab { padding: 3px; margin-bottom: 5px; - font-size: 0.9rem; + font-size: 0.875rem; font-weight: normal; } .stab p { @@ -1062,7 +1054,7 @@ body.blur > :not(#help) { } .stab .emoji { - font-size: 1.2rem; + font-size: 1.25rem; } /* Black one-pixel outline around emoji shapes */ @@ -1078,10 +1070,10 @@ body.blur > :not(#help) { .import-item .stab { border-radius: 3px; display: inline-block; - font-size: 0.8rem; + font-size: 0.875rem; line-height: 1.2; margin-bottom: 0; - margin-left: .3em; + margin-left: 0.3125em; padding: 2px; vertical-align: text-bottom; } @@ -1107,9 +1099,6 @@ body.blur > :not(#help) { font-weight: normal; font-size: 1rem; } -.impl .srclink { - font-size: 1.0625rem; -} .rightside { float: right; @@ -1141,7 +1130,7 @@ a.test-arrow { position: absolute; padding: 5px 10px 5px 10px; border-radius: 5px; - font-size: 1.3rem; + font-size: 1.375rem; top: 5px; right: 5px; z-index: 1; @@ -1179,7 +1168,7 @@ a.test-arrow:hover{ h3.variant { font-weight: 600; - font-size: 1.1rem; + font-size: 1.125rem; margin-bottom: 10px; border-bottom: none; } @@ -1391,7 +1380,7 @@ pre.rust { left: 0; cursor: pointer; font-weight: bold; - font-size: 1.2rem; + font-size: 1.25rem; border-bottom: 1px solid; display: flex; height: 40px; @@ -1516,12 +1505,9 @@ kbd { } .table-display .out-of-band { position: relative; - font-size: 1.1875rem; + font-size: 1.125rem; display: block; } -#implementors-list > .impl-items .table-display .out-of-band { - font-size: 1.0625rem; -} .table-display td:hover .anchor { display: block; @@ -1562,7 +1548,7 @@ div.name.expand + .children { div.name::before { content: "\25B6"; padding-left: 4px; - font-size: 0.7rem; + font-size: 0.625rem; position: absolute; left: -16px; top: 4px; @@ -1595,8 +1581,8 @@ details.rustdoc-toggle > summary.hideme > span { details.rustdoc-toggle > summary::before { content: ""; cursor: pointer; - width: 17px; - height: max(17px, 1.1em); + width: 16px; + height: 16px; background-repeat: no-repeat; background-position: top left; display: inline-block; @@ -1643,7 +1629,7 @@ details.rustdoc-toggle > summary.hideme::before { details.rustdoc-toggle > summary:not(.hideme)::before { position: absolute; left: -24px; - top: 3px; + top: 4px; } .impl-items > details.rustdoc-toggle > summary:not(.hideme)::before { @@ -1680,8 +1666,8 @@ details.undocumented > summary::before, details.rustdoc-toggle > summary::before details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle[open] > summary.hideme::before { - width: 17px; - height: max(17px, 1.1em); + width: 16px; + height: 16px; background-repeat: no-repeat; background-position: top left; display: inline-block; @@ -1808,8 +1794,14 @@ details.rustdoc-toggle[open] > summary.hideme::after { width: 0; } + .mobile-topbar .location a { + padding: 0; + margin: 0; + } + .mobile-topbar .location { border: none; + padding: 0; margin: auto 0.5em auto auto; text-overflow: ellipsis; overflow: hidden; @@ -1818,7 +1810,7 @@ details.rustdoc-toggle[open] > summary.hideme::after { height is specified in pixels, this also has to be specified in pixels to avoid overflowing the topbar when the user sets a bigger font size. */ - font-size: 22.4px; + font-size: 24px; } .mobile-topbar .logo-container { diff --git a/src/test/rustdoc-gui/docblock-big-code-mobile.goml b/src/test/rustdoc-gui/docblock-big-code-mobile.goml index 12677a5648a2d..02f79f1fcd774 100644 --- a/src/test/rustdoc-gui/docblock-big-code-mobile.goml +++ b/src/test/rustdoc-gui/docblock-big-code-mobile.goml @@ -6,4 +6,4 @@ goto: file://|DOC_PATH|/test_docs/long_code_block/index.html show-text: true // We need to enable text draw to be able to have the "real" size // Little explanations for this test: if the text wasn't displayed on two lines, it would take // around 20px (which is the font size). -assert-property: (".docblock p > code", {"offsetHeight": "42"}) +assert-property: (".docblock p > code", {"offsetHeight": "44"}) diff --git a/src/test/rustdoc-gui/headings.goml b/src/test/rustdoc-gui/headings.goml index 48e0156f1b81b..8f126d98fe44d 100644 --- a/src/test/rustdoc-gui/headings.goml +++ b/src/test/rustdoc-gui/headings.goml @@ -6,34 +6,33 @@ // Most of these sizes are set in CSS in `em` units, so here's a conversion chart based on our // default 16px font size: // 24px 1.5em -// 22.4px 1.4em -// 20.8px 1.3em -// 18.4px 1.15em -// 17.6px 1.1em -// 16px 1em -// 15.2px 0.95em +// 22px 1.375rem +// 20px 1.25rem +// 18px 1.125em +// 16px 1rem +// 14px 0.875rem goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html assert-css: ("h1.fqn", {"font-size": "24px"}) -assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) +assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"}) assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"}) -assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"}) +assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "20px"}) assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"}) -assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "17.6px"}) +assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "18px"}) assert-css: ("h4#top-doc-prose-sub-sub-heading", {"border-bottom-width": "1px"}) -assert-css: ("h2#fields", {"font-size": "22.4px"}) +assert-css: ("h2#fields", {"font-size": "22px"}) assert-css: ("h2#fields", {"border-bottom-width": "1px"}) -assert-css: ("h3#title-for-field", {"font-size": "20.8px"}) +assert-css: ("h3#title-for-field", {"font-size": "20px"}) assert-css: ("h3#title-for-field", {"border-bottom-width": "0px"}) assert-css: ("h4#sub-heading-for-field", {"font-size": "16px"}) assert-css: ("h4#sub-heading-for-field", {"border-bottom-width": "0px"}) -assert-css: ("h2#implementations", {"font-size": "22.4px"}) +assert-css: ("h2#implementations", {"font-size": "22px"}) assert-css: ("h2#implementations", {"border-bottom-width": "1px"}) -assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"}) +assert-css: ("#impl > h3.code-header", {"font-size": "18px"}) assert-css: ("#impl > h3.code-header", {"border-bottom-width": "0px"}) assert-css: ("#method\.do_nothing > h4.code-header", {"font-size": "16px"}) assert-css: ("#method\.do_nothing > h4.code-header", {"border-bottom-width": "0px"}) @@ -42,27 +41,27 @@ assert-css: ("h4#title-for-struct-impl-doc", {"font-size": "16px"}) assert-css: ("h4#title-for-struct-impl-doc", {"border-bottom-width": "0px"}) assert-css: ("h5#sub-heading-for-struct-impl-doc", {"font-size": "16px"}) assert-css: ("h5#sub-heading-for-struct-impl-doc", {"border-bottom-width": "0px"}) -assert-css: ("h6#sub-sub-heading-for-struct-impl-doc", {"font-size": "15.2px"}) +assert-css: ("h6#sub-sub-heading-for-struct-impl-doc", {"font-size": "14px"}) assert-css: ("h6#sub-sub-heading-for-struct-impl-doc", {"border-bottom-width": "0px"}) assert-css: ("h5#title-for-struct-impl-item-doc", {"font-size": "16px"}) assert-css: ("h5#title-for-struct-impl-item-doc", {"border-bottom-width": "0px"}) -assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"font-size": "15.2px"}) +assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"font-size": "14px"}) assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"border-bottom-width": "0px"}) -assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "15.2px"}) +assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "14px"}) goto: file://|DOC_PATH|/test_docs/enum.HeavilyDocumentedEnum.html assert-css: ("h1.fqn", {"font-size": "24px"}) -assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) +assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"}) assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"}) -assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"}) +assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "20px"}) assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"}) -assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "17.6px"}) +assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "18px"}) assert-css: ("h4#top-doc-prose-sub-sub-heading", {"border-bottom-width": "1px"}) -assert-css: ("h2#variants", {"font-size": "22.4px"}) +assert-css: ("h2#variants", {"font-size": "22px"}) assert-css: ("h2#variants", {"border-bottom-width": "1px"}) assert-css: ("h4#none-prose-title", {"font-size": "16px"}) @@ -77,18 +76,18 @@ assert-css: ("h5#wrapped-prose-sub-heading", {"border-bottom-width": "0px"}) assert-css: ("h5#wrapped0-prose-title", {"font-size": "16px"}) assert-css: ("h5#wrapped0-prose-title", {"border-bottom-width": "0px"}) -assert-css: ("h6#wrapped0-prose-sub-heading", {"font-size": "15.2px"}) +assert-css: ("h6#wrapped0-prose-sub-heading", {"font-size": "14px"}) assert-css: ("h6#wrapped0-prose-sub-heading", {"border-bottom-width": "0px"}) assert-css: ("h5#structy-prose-title", {"font-size": "16px"}) assert-css: ("h5#structy-prose-title", {"border-bottom-width": "0px"}) -assert-css: ("h6#structy-prose-sub-heading", {"font-size": "15.2px"}) +assert-css: ("h6#structy-prose-sub-heading", {"font-size": "14px"}) assert-css: ("h6#structy-prose-sub-heading", {"border-bottom-width": "0px"}) -assert-css: ("h2#implementations", {"font-size": "22.4px"}) +assert-css: ("h2#implementations", {"font-size": "22px"}) assert-css: ("h2#implementations", {"border-bottom-width": "1px"}) -assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"}) +assert-css: ("#impl > h3.code-header", {"font-size": "18px"}) assert-css: ("#impl > h3.code-header", {"border-bottom-width": "0px"}) assert-css: ("#method\.do_nothing > h4.code-header", {"font-size": "16px"}) assert-css: ("#method\.do_nothing > h4.code-header", {"border-bottom-width": "0px"}) @@ -97,14 +96,14 @@ assert-css: ("h4#title-for-enum-impl-doc", {"font-size": "16px"}) assert-css: ("h4#title-for-enum-impl-doc", {"border-bottom-width": "0px"}) assert-css: ("h5#sub-heading-for-enum-impl-doc", {"font-size": "16px"}) assert-css: ("h5#sub-heading-for-enum-impl-doc", {"border-bottom-width": "0px"}) -assert-css: ("h6#sub-sub-heading-for-enum-impl-doc", {"font-size": "15.2px"}) +assert-css: ("h6#sub-sub-heading-for-enum-impl-doc", {"font-size": "14px"}) assert-css: ("h6#sub-sub-heading-for-enum-impl-doc", {"border-bottom-width": "0px"}) assert-css: ("h5#title-for-enum-impl-item-doc", {"font-size": "16px"}) assert-css: ("h5#title-for-enum-impl-item-doc", {"border-bottom-width": "0px"}) -assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"font-size": "15.2px"}) +assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"font-size": "14px"}) assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"border-bottom-width": "0px"}) -assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"font-size": "15.2px"}) +assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"font-size": "14px"}) assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"border-bottom-width": "0px"}) assert-text: (".sidebar .others h3", "Modules") @@ -114,23 +113,23 @@ goto: file://|DOC_PATH|/test_docs/union.HeavilyDocumentedUnion.html assert-css: ("h1.fqn", {"font-size": "24px"}) -assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) +assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"}) assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"}) -assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"}) +assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "20px"}) assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"}) -assert-css: ("h2#fields", {"font-size": "22.4px"}) +assert-css: ("h2#fields", {"font-size": "22px"}) assert-css: ("h2#fields", {"border-bottom-width": "1px"}) -assert-css: ("h3#title-for-union-variant", {"font-size": "20.8px"}) +assert-css: ("h3#title-for-union-variant", {"font-size": "20px"}) assert-css: ("h3#title-for-union-variant", {"border-bottom-width": "0px"}) assert-css: ("h4#sub-heading-for-union-variant", {"font-size": "16px"}) assert-css: ("h4#sub-heading-for-union-variant", {"border-bottom-width": "0px"}) -assert-css: ("h2#implementations", {"font-size": "22.4px"}) +assert-css: ("h2#implementations", {"font-size": "22px"}) assert-css: ("h2#implementations", {"border-bottom-width": "1px"}) -assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"}) +assert-css: ("#impl > h3.code-header", {"font-size": "18px"}) assert-css: ("#impl > h3.code-header", {"border-bottom-width": "0px"}) assert-css: ("h4#title-for-union-impl-doc", {"font-size": "16px"}) assert-css: ("h4#title-for-union-impl-doc", {"border-bottom-width": "0px"}) @@ -139,16 +138,16 @@ assert-css: ("h5#sub-heading-for-union-impl-doc", {"border-bottom-width": "0px"} assert-css: ("h5#title-for-union-impl-item-doc", {"font-size": "16px"}) assert-css: ("h5#title-for-union-impl-item-doc", {"border-bottom-width": "0px"}) -assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"font-size": "15.2px"}) +assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"font-size": "14px"}) assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"border-bottom-width": "0px"}) goto: file://|DOC_PATH|/test_docs/macro.heavily_documented_macro.html assert-css: ("h1.fqn", {"font-size": "24px"}) -assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"}) +assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"}) assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"}) -assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"}) +assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "20px"}) assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"}) goto: file://|DOC_PATH|/staged_api/struct.Foo.html diff --git a/src/test/rustdoc-gui/item-info-width.goml b/src/test/rustdoc-gui/item-info-width.goml index 1c4cf4ddf87f3..7a32d9029103a 100644 --- a/src/test/rustdoc-gui/item-info-width.goml +++ b/src/test/rustdoc-gui/item-info-width.goml @@ -4,5 +4,5 @@ goto: file://|DOC_PATH|/lib2/struct.Foo.html size: (1100, 800) // We check that ".item-info" is bigger than its content. assert-css: (".item-info", {"width": "790px"}) -assert-css: (".item-info .stab", {"width": "341px"}) +assert-css: (".item-info .stab", {"width": "340px"}) assert-position: (".item-info .stab", {"x": 295}) diff --git a/src/test/rustdoc-gui/mobile.goml b/src/test/rustdoc-gui/mobile.goml index 2e44dd32d45b4..e70abcb83cf2b 100644 --- a/src/test/rustdoc-gui/mobile.goml +++ b/src/test/rustdoc-gui/mobile.goml @@ -11,7 +11,7 @@ assert-css: (".main-heading", { "flex-direction": "column" }) -assert-property: (".mobile-topbar h2.location", {"offsetHeight": 48}) +assert-property: (".mobile-topbar h2.location", {"offsetHeight": 36}) // Note: We can't use assert-text here because the 'Since' is set by CSS and // is therefore not part of the DOM. diff --git a/src/test/rustdoc-gui/sidebar-source-code.goml b/src/test/rustdoc-gui/sidebar-source-code.goml index 1c5eb9239ba8b..0cb8e7763851c 100644 --- a/src/test/rustdoc-gui/sidebar-source-code.goml +++ b/src/test/rustdoc-gui/sidebar-source-code.goml @@ -10,7 +10,7 @@ click: (10, 10) // We wait for the sidebar to be expanded (there is a 0.5s animation). wait-for: 600 assert-css: ("nav.sidebar.expanded", {"width": "300px"}) -assert-css: ("nav.sidebar.expanded a", {"font-size": "14.4px"}) +assert-css: ("nav.sidebar.expanded a", {"font-size": "14px"}) // We collapse the sidebar. click: (10, 10) // We wait for the sidebar to be collapsed (there is a 0.5s animation). diff --git a/src/test/rustdoc-gui/sidebar.goml b/src/test/rustdoc-gui/sidebar.goml index 877cc61b66f24..9505e00512f4c 100644 --- a/src/test/rustdoc-gui/sidebar.goml +++ b/src/test/rustdoc-gui/sidebar.goml @@ -77,7 +77,7 @@ assert-text: ("#functions + .item-table .item-left > a", "foo") // Links to trait implementations in the sidebar should not wrap even if they are long. goto: file://|DOC_PATH|/lib2/struct.HasALongTraitWithParams.html -assert-property: (".sidebar-links a", {"offsetHeight": 30}) +assert-property: (".sidebar-links a", {"offsetHeight": 29}) // Test that clicking on of the "In " headings in the sidebar links to the // appropriate anchor in index.html. diff --git a/src/test/rustdoc-gui/src-font-size.goml b/src/test/rustdoc-gui/src-font-size.goml index b0b2f122afdb9..0c01e25455486 100644 --- a/src/test/rustdoc-gui/src-font-size.goml +++ b/src/test/rustdoc-gui/src-font-size.goml @@ -4,9 +4,8 @@ goto: file://|DOC_PATH|/test_docs/struct.Foo.html show-text: true // Check the impl headers. -assert-css: (".impl.has-srclink .srclink", {"font-size": "17px"}, ALL) -// The ".6" part is because the font-size is actually "1.1em". -assert-css: (".impl.has-srclink .code-header.in-band", {"font-size": "17.6px"}, ALL) +assert-css: (".impl.has-srclink .srclink", {"font-size": "16px"}, ALL) +assert-css: (".impl.has-srclink .code-header.in-band", {"font-size": "18px"}, ALL) // Check the impl items. assert-css: (".impl-items .has-srclink .srclink", {"font-size": "16px"}, ALL) assert-css: (".impl-items .has-srclink .code-header", {"font-size": "16px"}, ALL) diff --git a/src/test/rustdoc-gui/type-declation-overflow.goml b/src/test/rustdoc-gui/type-declation-overflow.goml index d4142511e4373..22212a31728dc 100644 --- a/src/test/rustdoc-gui/type-declation-overflow.goml +++ b/src/test/rustdoc-gui/type-declation-overflow.goml @@ -32,6 +32,6 @@ assert-property: (".item-decl pre", {"scrollWidth": "950"}) size: (600, 600) goto: file://|DOC_PATH|/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html // It shouldn't have an overflow in the topbar either. -assert-property: (".mobile-topbar .location", {"scrollWidth": "493"}) -assert-property: (".mobile-topbar .location", {"clientWidth": "493"}) +assert-property: (".mobile-topbar .location", {"scrollWidth": "492"}) +assert-property: (".mobile-topbar .location", {"clientWidth": "492"}) assert-css: (".mobile-topbar .location", {"overflow-x": "hidden"})