mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibWeb: Clip cell spans past the end of the table
This occurs on Wikipedia for tournament brackets, for example: https://en.wikipedia.org/wiki/2022%E2%80%9323_UEFA_Champions_League_knockout_phase
This commit is contained in:
parent
205f9c75d9
commit
701b170dc0
3 changed files with 96 additions and 0 deletions
|
@ -153,6 +153,12 @@ void TableFormattingContext::calculate_row_column_grid(Box const& box)
|
|||
});
|
||||
|
||||
m_columns.resize(x_width);
|
||||
|
||||
for (auto& cell : m_cells) {
|
||||
// Clip spans to the end of the table.
|
||||
cell.row_span = min(cell.row_span, m_rows.size() - cell.row_index);
|
||||
cell.column_span = min(cell.column_span, m_columns.size() - cell.column_index);
|
||||
}
|
||||
}
|
||||
|
||||
void TableFormattingContext::compute_cell_measures(AvailableSpace const& available_space)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue