This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 0356034
authored
Rollup merge of rust-lang#100409 - jsha:highlight-lighter, r=GuillaumeGomez
rustdoc: don't generate DOM element for operator
In our source page highlighting, we were generating `<span class="op">` tags for all "operators", including e.g. `<` `>` around generic parameters, `*`, `&`. This contributed significantly to DOM size, but we don't actually style `.op` except in the ayu theme.
Remove the styles for `.op` in ayu, and stop generating the `<span>`s.
This reduces DOM size of an example page[1] from 265,938 HTML elements to 242,165 elements, a 9% reduction.
r? ``@GuillaumeGomez``
Demo: (warning - slow!) https://rustdoc.crud.net/jsha/highlight-lighter/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html
[1]:
https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.htmlFile tree
7 files changed
+25
-31
lines changed- src
- librustdoc/html
- highlight/fixtures
- static/css/themes
- test/rustdoc
7 files changed
+25
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | 166 | | |
168 | 167 | | |
169 | 168 | | |
| |||
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
190 | | - | |
191 | 189 | | |
192 | 190 | | |
193 | 191 | | |
| |||
212 | 210 | | |
213 | 211 | | |
214 | 212 | | |
215 | | - | |
216 | 213 | | |
217 | 214 | | |
218 | 215 | | |
| |||
516 | 513 | | |
517 | 514 | | |
518 | 515 | | |
519 | | - | |
| 516 | + | |
520 | 517 | | |
521 | 518 | | |
522 | 519 | | |
| |||
532 | 529 | | |
533 | 530 | | |
534 | 531 | | |
535 | | - | |
| 532 | + | |
536 | 533 | | |
537 | 534 | | |
538 | 535 | | |
539 | 536 | | |
540 | | - | |
| 537 | + | |
541 | 538 | | |
542 | 539 | | |
543 | | - | |
| 540 | + | |
544 | 541 | | |
545 | 542 | | |
546 | 543 | | |
| |||
553 | 550 | | |
554 | 551 | | |
555 | 552 | | |
556 | | - | |
| 553 | + | |
557 | 554 | | |
558 | 555 | | |
559 | 556 | | |
560 | 557 | | |
561 | 558 | | |
562 | 559 | | |
563 | 560 | | |
564 | | - | |
| 561 | + | |
565 | 562 | | |
566 | 563 | | |
567 | 564 | | |
| |||
578 | 575 | | |
579 | 576 | | |
580 | 577 | | |
581 | | - | |
| 578 | + | |
582 | 579 | | |
583 | 580 | | |
584 | 581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
18 | | - | |
| 15 | + | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
| |||
0 commit comments