layout: Assert that GRIDMIN <= GRIDMAX (#34892)

In the past this didn't hold, so we had to floor GRIDMAX by GRIDMIN.
We must have fixed some bugs because now it's fine to just assert it.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-01-08 05:00:30 -08:00 committed by GitHub
parent 4bdd246a6b
commit d24b3e2035
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -753,11 +753,11 @@ impl<'a> TableLayout<'a> {
.fold(ContentSizes::zero(), |result, measure| { .fold(ContentSizes::zero(), |result, measure| {
result + measure.content_sizes result + measure.content_sizes
}); });
assert!(
// TODO: GRIDMAX should never be smaller than GRIDMIN! grid_min_max.min_content <= grid_min_max.max_content,
grid_min_max "GRIDMAX should never be smaller than GRIDMIN {:?}",
.max_content grid_min_max
.max_assign(grid_min_max.min_content); );
let inline_border_spacing = self.table.total_border_spacing().inline; let inline_border_spacing = self.table.total_border_spacing().inline;
grid_min_max.min_content += inline_border_spacing; grid_min_max.min_content += inline_border_spacing;