From d24b3e2035030aa7c472eca92b60c4a0022d42c8 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Wed, 8 Jan 2025 05:00:30 -0800 Subject: [PATCH] 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 --- components/layout_2020/table/layout.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/layout_2020/table/layout.rs b/components/layout_2020/table/layout.rs index 32739905f5a..71705392cff 100644 --- a/components/layout_2020/table/layout.rs +++ b/components/layout_2020/table/layout.rs @@ -753,11 +753,11 @@ impl<'a> TableLayout<'a> { .fold(ContentSizes::zero(), |result, measure| { result + measure.content_sizes }); - - // TODO: GRIDMAX should never be smaller than GRIDMIN! - grid_min_max - .max_content - .max_assign(grid_min_max.min_content); + assert!( + grid_min_max.min_content <= grid_min_max.max_content, + "GRIDMAX should never be smaller than GRIDMIN {:?}", + grid_min_max + ); let inline_border_spacing = self.table.total_border_spacing().inline; grid_min_max.min_content += inline_border_spacing;