Skip to content

Commit 3aaec55

Browse files
authored
Rollup merge of #88776 - dns2utf8:rustdoc_workaround_1000_elements_grid_bug, r=GuillaumeGomez
Workaround blink/chromium grid layout limitation of 1000 rows I made this in case we don't come up with a better solution in time. See #88545 for more details. A rendered version of the standard library is hosted here: https://data.estada.ch/rustdoc-nightly_497ee321af_2021-09-09/core/arch/arm/index.html r? `@GuillaumeGomez` `@jsha`
2 parents 130e2e1 + 0bf16af commit 3aaec55

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() {
@@ -281,6 +285,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
281285
id = cx.derive_id(short.to_owned()),
282286
name = name
283287
);
288+
item_table_nth_element = 0;
284289
}
285290

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

392404
if curty.is_some() {

0 commit comments

Comments
 (0)