Skip to content

Commit

Permalink
Backport rust-lang#88776: Workaround blink/chromium grid layout limit…
Browse files Browse the repository at this point in the history
…ation of 1000 rows

See rust-lang#88545 for more details
  • Loading branch information
dns2utf8 committed Sep 11, 2021
1 parent f9a839e commit 5fb9625
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl

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() {
Expand All @@ -278,6 +282,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
id = cx.derive_id(short.to_owned()),
name = name
);
item_table_nth_element = 0;
}

match *myitem.kind {
Expand Down Expand Up @@ -384,6 +389,13 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
);
}
}

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() {
Expand Down

0 comments on commit 5fb9625

Please sign in to comment.