layout: Add *very* basic support for table layout (#31121)

* layout: Add *very* basic support for table layout

This is the first step to proper table layout. It implements a naive
layout algorithm, notably only taking into account the preferred widths
of the first table row. Still, it causes some float tests to start
passing, so turn on the `layout.tables.enabled` preference for those
directories.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* Address review comments

* Fix a crash with rowspan=0

* Turn on pref and update results for `/css/css-tables` and `/css/CSS2/tables`

---------

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2024-01-19 14:20:20 +01:00 committed by GitHub
parent 3d520f2668
commit fc31e69f79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
115 changed files with 842 additions and 315 deletions

View file

@ -394,6 +394,23 @@ impl<T> LogicalRect<T> {
}
}
pub fn deflate(&self, sides: &LogicalSides<T>) -> Self
where
T: Add<Output = T> + Copy,
T: Sub<Output = T> + Copy,
{
LogicalRect {
start_corner: LogicalVec2 {
inline: self.start_corner.inline + sides.inline_start,
block: self.start_corner.block + sides.block_start,
},
size: LogicalVec2 {
inline: self.size.inline - sides.inline_sum(),
block: self.size.block - sides.block_sum(),
},
}
}
pub fn to_physical(
&self,
mode: WritingMode,