Auto merge of #20163 - Manishearth:rowspan-crash, r=mbrubeck

Don't panic on cells with both a rowspan and colspan in include_sizes_from_previous_rows

fixes #20162

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20163)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-03-01 20:36:50 -05:00 committed by GitHub
commit e446897cf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 1 deletions

View file

@ -123,7 +123,16 @@ impl TableRowFlow {
if *span == 1 {
break;
}
let incoming = incoming_rowspan_data[*col];
let incoming = if let Some(incoming) = incoming_rowspan_data.get(*col) {
*incoming
} else {
// This happens when we have a cell with both rowspan and colspan
// incoming_rowspan_data only records the data for the first column,
// but that's ok because we only need to account for each spanning cell
// once. So we skip ahead.
*col += 1;
continue;
};
*max_block_size = max(*max_block_size, incoming);
*col += 1;
}