diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-05-11 11:34:47 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-05-12 11:27:59 +0200 |
| commit | e150aebbdc8cca565525b0057b9e0aae5c129537 (patch) | |
| tree | 03edebb2d364362c8cf2dddb1a1a3e4afff9b168 | |
| parent | 9f6717c15e516935641ff93f4521d3d76030763c (diff) | |
| download | rust-e150aebbdc8cca565525b0057b9e0aae5c129537.tar.gz rust-e150aebbdc8cca565525b0057b9e0aae5c129537.zip | |
Remove "loading content" which is now unnecessary
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 23 | ||||
| -rw-r--r-- | src/librustdoc/html/static/main.js | 20 | ||||
| -rw-r--r-- | src/librustdoc/html/static/noscript.css | 25 | ||||
| -rw-r--r-- | src/librustdoc/html/static/rustdoc.css | 5 |
4 files changed, 8 insertions, 65 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index f0ca24b8f02..20e82cf2caf 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -573,10 +573,6 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra ) } - fn write_loading_content(w: &mut Buffer, extra_content: &str) { - write!(w, "{}<span class=\"loading-content\">Loading content...</span>", extra_content) - } - fn trait_item(w: &mut Buffer, cx: &Context<'_>, m: &clean::Item, t: &clean::Item) { let name = m.name.as_ref().unwrap(); info!("Documenting {} on {:?}", name, t.name); @@ -601,7 +597,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra for t in types { trait_item(w, cx, t, it); } - write_loading_content(w, "</div>"); + w.write_str("</div>"); } if !consts.is_empty() { @@ -614,7 +610,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra for t in consts { trait_item(w, cx, t, it); } - write_loading_content(w, "</div>"); + w.write_str("</div>"); } // 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 for m in required { trait_item(w, cx, m, it); } - write_loading_content(w, "</div>"); + w.write_str("</div>"); } if !provided.is_empty() { write_small_section_header( @@ -640,7 +636,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra for m in provided { trait_item(w, cx, m, it); } - write_loading_content(w, "</div>"); + w.write_str("</div>"); } // 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 &[], ); } - write_loading_content(w, ""); } write_small_section_header( @@ -715,7 +710,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra for implementor in concrete { render_implementor(cx, implementor, it, w, &implementor_dups, &[]); } - write_loading_content(w, "</div>"); + w.write_str("</div>"); if t.is_auto { write_small_section_header( @@ -734,7 +729,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra &collect_paths_for_type(implementor.inner_impl().for_.clone(), &cx.cache), ); } - write_loading_content(w, "</div>"); + w.write_str("</div>"); } } else { // 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 w, "implementors", "Implementors", - "<div class=\"item-list\" id=\"implementors-list\">", + "<div class=\"item-list\" id=\"implementors-list\"></div>", ); - write_loading_content(w, "</div>"); if t.is_auto { write_small_section_header( w, "synthetic-implementors", "Auto implementors", - "<div class=\"item-list\" id=\"synthetic-implementors-list\">", + "<div class=\"item-list\" id=\"synthetic-implementors-list\"></div>", ); - write_loading_content(w, "</div>"); } } diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 04dc25341f4..597d07e85b3 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1140,26 +1140,6 @@ function hideThemeButtonState() { }; } - if (main) { - onEachLazy(main.getElementsByClassName("loading-content"), function(e) { - e.remove(); - }); - onEachLazy(main.childNodes, function(e) { - // Unhide the actual content once loading is complete. Headers get - // flex treatment for their horizontal layout, divs get block treatment - // for vertical layout (column-oriented flex layout for divs caused - // errors in mobile browsers). - if (e.tagName === "H2" || e.tagName === "H3") { - var nextTagName = e.nextElementSibling.tagName; - if (nextTagName === "H2" || nextTagName === "H3") { - e.nextElementSibling.style.display = "flex"; - } else if (nextTagName !== "DETAILS") { - e.nextElementSibling.style.display = "block"; - } - } - }); - } - function buildHelperPopup() { var popup = document.createElement("aside"); addClass(popup, "hidden"); diff --git a/src/librustdoc/html/static/noscript.css b/src/librustdoc/html/static/noscript.css index 4d3332877c0..0a196edd53b 100644 --- a/src/librustdoc/html/static/noscript.css +++ b/src/librustdoc/html/static/noscript.css @@ -4,31 +4,6 @@ of content is hidden by default (depending on the settings too), we have to over rules. */ -#main > h2 + div, #main > h2 + h3, #main > h3 + div { - display: block; -} - -.loading-content { - display: none; -} - -#main > h2 + div, #main > h3 + div { - display: block; -} - -#main > h2 + h3 { - display: flex; -} - -#main .impl-items .hidden { - display: block !important; -} - -#main .impl-items h4.hidden { - /* Without this rule, the version and the "[src]" span aren't on the same line as the header. */ - display: flex !important; -} - #main .attributes { /* Since there is no toggle (the "[-]") when JS is disabled, no need for this margin either. */ margin-left: 0 !important; diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index aaa2525644f..fc2a88b65c7 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -431,11 +431,6 @@ nav.sub { #main > .docblock h2 { font-size: 1.15em; } #main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; } -#main > h2 + div, #main > h2 + h3, #main > h3 + div { - display: none; /* Changed to flex or block via js once the page is loaded */ - flex-wrap: wrap; -} - .docblock h1 { font-size: 1em; } .docblock h2 { font-size: 0.95em; } .docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; } |
