about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/graph.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-03-04 20:01:04 +0900
committerGitHub <noreply@github.com>2021-03-04 20:01:04 +0900
commit569f0330d8e88aca3fabdfcb9b2dded9177002ce (patch)
treed2d94b182227ff2b5e1b5f8b1250068906bcbafa /compiler/rustc_mir/src/transform/coverage/graph.rs
parent36b7bef1cb0fb9d989f6c6e5ae9f001dea1b6a14 (diff)
parentf9cfe1583b18052bc5f42d92e8973e18ba404b19 (diff)
downloadrust-569f0330d8e88aca3fabdfcb9b2dded9177002ce.tar.gz
rust-569f0330d8e88aca3fabdfcb9b2dded9177002ce.zip
Rollup merge of #82315 - jsha:font-display-swap, r=GuillaumeGomez
Improve page load performance in rustdoc

Add an explicit height to icons (which already had an explicit width) to allow browsers to lay out the page more accurately before the icons have been loaded. https://web.dev/optimize-cls/.

Add min-width: 115px to the crate search dropdown. When the HTML first loads, this dropdown includes only the text "All crates." Later, JS loads the items underneath it, some of which are wider. That causes the dropdown to get wider, causing a distracting reflow. This sets a min-width based on the size that the dropdown eventually becomes based on the crates on doc.rust-lang.org, reducing page movement during load.

Add font-display: swap. Per https://web.dev/font-display/, this prevents "flash of invisible text" during load by using a system font until the custom font is available. I've noticed this flash of invisible text occasionally when reading Rust docs. Note that users without cached fonts will see text, and then see it reflow. For `docs.rust-lang.org`, [setting caching headers will help a lot](https://github.com/rust-lang/simpleinfra/issues/62).

Generated output at https://jacob.hoffman-andrews.com/rust/flow-improvements/std/string/struct.String.html.
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions