Skip to content

Commit e150aeb

Browse files
Remove "loading content" which is now unnecessary
1 parent 9f6717c commit e150aeb

File tree

4 files changed

+8
-65
lines changed

4 files changed

+8
-65
lines changed

src/librustdoc/html/render/print_item.rs

+8-15
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,6 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
573573
)
574574
}
575575

576-
fn write_loading_content(w: &mut Buffer, extra_content: &str) {
577-
write!(w, "{}<span class=\"loading-content\">Loading content...</span>", extra_content)
578-
}
579-
580576
fn trait_item(w: &mut Buffer, cx: &Context<'_>, m: &clean::Item, t: &clean::Item) {
581577
let name = m.name.as_ref().unwrap();
582578
info!("Documenting {} on {:?}", name, t.name);
@@ -601,7 +597,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
601597
for t in types {
602598
trait_item(w, cx, t, it);
603599
}
604-
write_loading_content(w, "</div>");
600+
w.write_str("</div>");
605601
}
606602

607603
if !consts.is_empty() {
@@ -614,7 +610,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
614610
for t in consts {
615611
trait_item(w, cx, t, it);
616612
}
617-
write_loading_content(w, "</div>");
613+
w.write_str("</div>");
618614
}
619615

620616
// Output the documentation for each function individually
@@ -628,7 +624,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
628624
for m in required {
629625
trait_item(w, cx, m, it);
630626
}
631-
write_loading_content(w, "</div>");
627+
w.write_str("</div>");
632628
}
633629
if !provided.is_empty() {
634630
write_small_section_header(
@@ -640,7 +636,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
640636
for m in provided {
641637
trait_item(w, cx, m, it);
642638
}
643-
write_loading_content(w, "</div>");
639+
w.write_str("</div>");
644640
}
645641

646642
// If there are methods directly on this trait object, render them here.
@@ -703,7 +699,6 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
703699
&[],
704700
);
705701
}
706-
write_loading_content(w, "");
707702
}
708703

709704
write_small_section_header(
@@ -715,7 +710,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
715710
for implementor in concrete {
716711
render_implementor(cx, implementor, it, w, &implementor_dups, &[]);
717712
}
718-
write_loading_content(w, "</div>");
713+
w.write_str("</div>");
719714

720715
if t.is_auto {
721716
write_small_section_header(
@@ -734,7 +729,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
734729
&collect_paths_for_type(implementor.inner_impl().for_.clone(), &cx.cache),
735730
);
736731
}
737-
write_loading_content(w, "</div>");
732+
w.write_str("</div>");
738733
}
739734
} else {
740735
// even without any implementations to write in, we still want the heading and list, so the
@@ -743,18 +738,16 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
743738
w,
744739
"implementors",
745740
"Implementors",
746-
"<div class=\"item-list\" id=\"implementors-list\">",
741+
"<div class=\"item-list\" id=\"implementors-list\"></div>",
747742
);
748-
write_loading_content(w, "</div>");
749743

750744
if t.is_auto {
751745
write_small_section_header(
752746
w,
753747
"synthetic-implementors",
754748
"Auto implementors",
755-
"<div class=\"item-list\" id=\"synthetic-implementors-list\">",
749+
"<div class=\"item-list\" id=\"synthetic-implementors-list\"></div>",
756750
);
757-
write_loading_content(w, "</div>");
758751
}
759752
}
760753

src/librustdoc/html/static/main.js

-20
Original file line numberDiff line numberDiff line change
@@ -1140,26 +1140,6 @@ function hideThemeButtonState() {
11401140
};
11411141
}
11421142

1143-
if (main) {
1144-
onEachLazy(main.getElementsByClassName("loading-content"), function(e) {
1145-
e.remove();
1146-
});
1147-
onEachLazy(main.childNodes, function(e) {
1148-
// Unhide the actual content once loading is complete. Headers get
1149-
// flex treatment for their horizontal layout, divs get block treatment
1150-
// for vertical layout (column-oriented flex layout for divs caused
1151-
// errors in mobile browsers).
1152-
if (e.tagName === "H2" || e.tagName === "H3") {
1153-
var nextTagName = e.nextElementSibling.tagName;
1154-
if (nextTagName === "H2" || nextTagName === "H3") {
1155-
e.nextElementSibling.style.display = "flex";
1156-
} else if (nextTagName !== "DETAILS") {
1157-
e.nextElementSibling.style.display = "block";
1158-
}
1159-
}
1160-
});
1161-
}
1162-
11631143
function buildHelperPopup() {
11641144
var popup = document.createElement("aside");
11651145
addClass(popup, "hidden");

src/librustdoc/html/static/noscript.css

-25
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,6 @@ of content is hidden by default (depending on the settings too), we have to over
44
rules.
55
*/
66

7-
#main > h2 + div, #main > h2 + h3, #main > h3 + div {
8-
display: block;
9-
}
10-
11-
.loading-content {
12-
display: none;
13-
}
14-
15-
#main > h2 + div, #main > h3 + div {
16-
display: block;
17-
}
18-
19-
#main > h2 + h3 {
20-
display: flex;
21-
}
22-
23-
#main .impl-items .hidden {
24-
display: block !important;
25-
}
26-
27-
#main .impl-items h4.hidden {
28-
/* Without this rule, the version and the "[src]" span aren't on the same line as the header. */
29-
display: flex !important;
30-
}
31-
327
#main .attributes {
338
/* Since there is no toggle (the "[-]") when JS is disabled, no need for this margin either. */
349
margin-left: 0 !important;

src/librustdoc/html/static/rustdoc.css

-5
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,6 @@ nav.sub {
431431
#main > .docblock h2 { font-size: 1.15em; }
432432
#main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
433433

434-
#main > h2 + div, #main > h2 + h3, #main > h3 + div {
435-
display: none; /* Changed to flex or block via js once the page is loaded */
436-
flex-wrap: wrap;
437-
}
438-
439434
.docblock h1 { font-size: 1em; }
440435
.docblock h2 { font-size: 0.95em; }
441436
.docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }

0 commit comments

Comments
 (0)