]> git.lizzy.rs Git - rust.git/commitdiff
Workaround blink/chromium grid layout limitation of 1000 rows
authorStefan Schindler <dns2utf8@estada.ch>
Thu, 9 Sep 2021 13:11:02 +0000 (15:11 +0200)
committerStefan Schindler <dns2utf8@estada.ch>
Thu, 9 Sep 2021 13:11:02 +0000 (15:11 +0200)
See https://github.com/rust-lang/rust/issues/88545 for more details

src/librustdoc/html/render/print_item.rs

index 470749ef7b3387759cc295e21533a43bab114636..431bc2b51256a1b99b017a22449bf08fae9e6273 100644 (file)
@@ -256,6 +256,10 @@ fn cmp(
 
     debug!("{:?}", indices);
     let mut curty = None;
+    // See: https://github.com/rust-lang/rust/issues/88545
+    let item_table_block_size = 900usize;
+    let mut item_table_nth_element = 0usize;
+
     for &idx in &indices {
         let myitem = &items[idx];
         if myitem.is_stripped() {
@@ -280,6 +284,7 @@ fn cmp(
                 id = cx.derive_id(short.to_owned()),
                 name = name
             );
+            item_table_nth_element = 0;
         }
 
         match *myitem.kind {
@@ -386,6 +391,13 @@ fn cmp(
                 );
             }
         }
+
+        item_table_nth_element += 1;
+        if item_table_nth_element > item_table_block_size {
+            w.write_str(ITEM_TABLE_CLOSE);
+            w.write_str(ITEM_TABLE_OPEN);
+            item_table_nth_element = 0;
+        }
     }
 
     if curty.is_some() {