Fix table track constrainedness (#33550)

* Fix table track constraindness

Only as size that isn't `auto` and doesn't contain percentages can constrain
a table track (https://drafts.csswg.org/css-tables/#constrainedness).

However, in a bunch of cases we were only checking for `auto`.

Also, we were allowing the inline-size of a cell to constrain both its
column and row. Using the block-size of the row makes more sense.
The spec doesn't define constrainedness for rows, though.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

* Apply suggestions from code review

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Oriol Brufau 2024-09-26 07:06:33 -07:00 committed by GitHub
parent 1346643727
commit 0cefee48e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 27 additions and 47 deletions

View file

@ -55,6 +55,15 @@ impl<T: fmt::Debug> fmt::Debug for LogicalVec2<T> {
}
}
impl<T: Default> Default for LogicalVec2<T> {
fn default() -> Self {
Self {
inline: T::default(),
block: T::default(),
}
}
}
impl<T: Clone> LogicalVec2<T> {
pub fn from_physical_size(physical_size: &PhysicalSize<T>, mode: WritingMode) -> Self {
// https://drafts.csswg.org/css-writing-modes/#logical-to-physical