Commit 8846c08
committed
rustdoc: use CSS containment to speed up render
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Containment
This affected layout a little and required adjustments to the CSS to
keep spacing the same. In particular, the margins of adjacent items
usually overlap with each other. However, when an item has contain:
layout, any margins of child nodes push out the size of the item itself.
This was making spacing between items a little too big. To solve that, I
removed margins in some places: in particular for certain classes that
often occur at the end of a `details.rustdoc-toggle` block, I removed
their bottom margin. Generally, the margins provided by the next item
down are sufficient.
Also remove an unnecessary margin-top on .code-header.1 parent 57ee5cf commit 8846c08
File tree
2 files changed
+32
-16
lines changed- src
- librustdoc/html/static/css
- test/rustdoc-gui
2 files changed
+32
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | 179 | | |
182 | 180 | | |
183 | 181 | | |
| |||
292 | 290 | | |
293 | 291 | | |
294 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
295 | 298 | | |
296 | 299 | | |
297 | 300 | | |
| |||
565 | 568 | | |
566 | 569 | | |
567 | 570 | | |
568 | | - | |
569 | 571 | | |
570 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
571 | 581 | | |
572 | 582 | | |
573 | 583 | | |
| |||
726 | 736 | | |
727 | 737 | | |
728 | 738 | | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | 739 | | |
734 | 740 | | |
735 | 741 | | |
| |||
1532 | 1538 | | |
1533 | 1539 | | |
1534 | 1540 | | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
1535 | 1551 | | |
1536 | 1552 | | |
1537 | 1553 | | |
| |||
2012 | 2028 | | |
2013 | 2029 | | |
2014 | 2030 | | |
2015 | | - | |
| 2031 | + | |
2016 | 2032 | | |
2017 | 2033 | | |
2018 | 2034 | | |
2019 | | - | |
| 2035 | + | |
2020 | 2036 | | |
2021 | 2037 | | |
2022 | 2038 | | |
2023 | | - | |
2024 | | - | |
2025 | | - | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
2026 | 2042 | | |
2027 | 2043 | | |
2028 | 2044 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
0 commit comments