about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKang Seonghoon <public+git@mearie.org>2015-03-05 23:10:15 +0900
committerKang Seonghoon <public+git@mearie.org>2015-03-05 23:10:15 +0900
commit4a6fb45ee1c51a67d75d99244446868b36f22cc6 (patch)
treed8374e72468add695f63e104988962ba9f138df5
parent9e28156551c1a2af3c47a0937290176ccc457703 (diff)
downloadrust-4a6fb45ee1c51a67d75d99244446868b36f22cc6.tar.gz
rust-4a6fb45ee1c51a67d75d99244446868b36f22cc6.zip
rustdoc: Reworded comments to give the rationale for JS.
-rw-r--r--src/librustdoc/html/render.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index a9a9d0f7694..0edeff71364 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2209,7 +2209,14 @@ impl<'a> fmt::Display for Sidebar<'a> {
         let it = self.item;
         let parentlen = cx.current.len() - if it.is_mod() {1} else {0};
 
-        // this is not rendered via JS, as that would hamper the accessibility
+        // the sidebar is designed to display sibling functions, modules and
+        // other miscellaneous informations. since there are lots of sibling
+        // items (and that causes quadratic growth in large modules),
+        // we refactor common parts into a shared JavaScript file per module.
+        // still, we don't move everything into JS because we want to preserve
+        // as much HTML as possible in order to allow non-JS-enabled browsers
+        // to navigate the documentation (though slightly inefficiently).
+
         try!(write!(fmt, "<p class='location'>"));
         for (i, name) in cx.current.iter().take(parentlen).enumerate() {
             if i > 0 {