Skip to content

Commit 0bf16af

Browse files
committed
Workaround blink/chromium grid layout limitation of 1000 rows
See #88545 for more details
1 parent 497ee32 commit 0bf16af

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/librustdoc/html/render/print_item.rs

+12
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
256256

257257
debug!("{:?}", indices);
258258
let mut curty = None;
259+
// See: https://github.com/rust-lang/rust/issues/88545
260+
let item_table_block_size = 900usize;
261+
let mut item_table_nth_element = 0usize;
262+
259263
for &idx in &indices {
260264
let myitem = &items[idx];
261265
if myitem.is_stripped() {
@@ -280,6 +284,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
280284
id = cx.derive_id(short.to_owned()),
281285
name = name
282286
);
287+
item_table_nth_element = 0;
283288
}
284289

285290
match *myitem.kind {
@@ -386,6 +391,13 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
386391
);
387392
}
388393
}
394+
395+
item_table_nth_element += 1;
396+
if item_table_nth_element > item_table_block_size {
397+
w.write_str(ITEM_TABLE_CLOSE);
398+
w.write_str(ITEM_TABLE_OPEN);
399+
item_table_nth_element = 0;
400+
}
389401
}
390402

391403
if curty.is_some() {

0 commit comments

Comments
 (0)