about summary refs log tree commit diff
path: root/tests/coverage/overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-07 15:14:59 +0000
committerbors <bors@rust-lang.org>2023-11-07 15:14:59 +0000
commit9bd71afb90c2a6e0348cdd4a2b10a3bf39908f19 (patch)
tree0c8f05e7f9cc5f2006ce56dc3a820158645c91a6 /tests/coverage/overflow.rs
parent187d1afa9dc17d06e65f5e817e2bd1d9ae33830a (diff)
parent2a929813016946dd671a9b01a5cefdda168dcc0b (diff)
downloadrust-9bd71afb90c2a6e0348cdd4a2b10a3bf39908f19.tar.gz
rust-9bd71afb90c2a6e0348cdd4a2b10a3bf39908f19.zip
Auto merge of #115904 - notriddle:notriddle/preload-bold, r=GuillaumeGomez
rustdoc: stop preloading Source Serif 4 Bold

According to #91170, italic fonts are not preloaded because they're rarely used, but bold fonts are. This seems to be true of bold Source Code Pro and bold Fira Sans, but bold and italic Source Serif Pro seem to be equally heavily used.

This is, I assume, the result of using Fira Sans Bold and Source Code Bold headings, so you only get bold Serif text when the doc author uses strong `**` emphasis (or within certain kinds of tooltip, which shouldn't be preloaded because they only show up long after the page is loaded).

To check this, run these two commands in the browser console to measure how much they're used. The measurement is extremely rough, but it gets the idea across: the two styles are about equally popular.

    // count bold elements
    Array.prototype.slice.call(document.querySelectorAll("*")).filter(x => { const y = document.defaultView.getComputedStyle(x); return y.fontFamily.indexOf("Source Serif 4") !== -1 && y.fontWeight > 400 }).length
    // count italic elements
    Array.prototype.slice.call(document.querySelectorAll("*")).filter(x => { const y = document.defaultView.getComputedStyle(x); return y.fontFamily.indexOf("Source Serif 4") !== -1 && y.fontStyle == "italic" }).length

| URL          | Bold | Italic |
|--------------|-----:|-------:|
| [std]        |    2 |      9 |
| [Vec]        |    8 |     89 |
| [regex]      |   33 |     17 |
| [test_suite] |    0 |      0 |

[std]: https://doc.rust-lang.org/nightly/std/index.html
[Vec]: https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html
[regex]: https://docs.rs/regex/1.9.5/regex/index.html
[test_suite]: https://docs.rs/test-suite/3.2.9/test_suite/
Diffstat (limited to 'tests/coverage/overflow.rs')
0 files changed, 0 insertions, 0 deletions