Skip to content

Commit 6387590

Browse files
dns2utf8cuviper
authored andcommitted
Workaround blink/chromium grid layout limitation of 1000 rows
See #88545 for more details (cherry picked from commit 0bf16af)
1 parent 5c76db1 commit 6387590

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
@@ -254,6 +254,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
254254

255255
debug!("{:?}", indices);
256256
let mut curty = None;
257+
// See: https://github.com/rust-lang/rust/issues/88545
258+
let item_table_block_size = 900usize;
259+
let mut item_table_nth_element = 0usize;
260+
257261
for &idx in &indices {
258262
let myitem = &items[idx];
259263
if myitem.is_stripped() {
@@ -278,6 +282,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
278282
id = cx.derive_id(short.to_owned()),
279283
name = name
280284
);
285+
item_table_nth_element = 0;
281286
}
282287

283288
match *myitem.kind {
@@ -384,6 +389,13 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
384389
);
385390
}
386391
}
392+
393+
item_table_nth_element += 1;
394+
if item_table_nth_element > item_table_block_size {
395+
w.write_str(ITEM_TABLE_CLOSE);
396+
w.write_str(ITEM_TABLE_OPEN);
397+
item_table_nth_element = 0;
398+
}
387399
}
388400

389401
if curty.is_some() {

0 commit comments

Comments
 (0)