layout: simplify CollapsedBorderLine (#35125)

This used to be a struct that had a list of `CollapsedBorder`s, and the
maximum border width among that list.

However, this cached maximum border width was only used when resolving
the borders of the table. Therefore, for all grid lines except the first
and last ones per axis, this data was useless.

Also, in order to address #35123 I plan to retroactively zero out some
collapsed borders, which could invalidate this cache.

So this patch just removes the field and turns `CollapsedBorderLine`
into an alias of `Vec<CollapsedBorder>`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-01-23 04:38:24 -08:00 committed by GitHub
parent 2db828f0c7
commit aa54a0b1a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 45 deletions

View file

@ -915,10 +915,10 @@ impl<'a> BuilderForBoxFragment<'a> {
for (x, column_size) in table_info.track_sizes.x.iter().enumerate() {
let mut row_sum = Au::zero();
for (y, row_size) in table_info.track_sizes.y.iter().enumerate() {
let left_border = &table_info.collapsed_borders.x[x].list[y];
let right_border = &table_info.collapsed_borders.x[x + 1].list[y];
let top_border = &table_info.collapsed_borders.y[y].list[x];
let bottom_border = &table_info.collapsed_borders.y[y + 1].list[x];
let left_border = &table_info.collapsed_borders.x[x][y];
let right_border = &table_info.collapsed_borders.x[x + 1][y];
let top_border = &table_info.collapsed_borders.y[y][x];
let bottom_border = &table_info.collapsed_borders.y[y + 1][x];
let details = wr::BorderDetails::Normal(wr::NormalBorder {
left: self.build_border_side(left_border.style_color.clone()),
right: self.build_border_side(right_border.style_color.clone()),