1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +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:
Andi Gallo 2023-06-18 12:27:44 +00:00 committed by Andreas Kling
parent 205f9c75d9
commit 701b170dc0
3 changed files with 96 additions and 0 deletions

View file

@ -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)