From 1346643727336485b8ee19b3db6d4a28366e89f1 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Thu, 26 Sep 2024 06:21:20 -0700 Subject: [PATCH] Assert that we don't get malformed ContentSizes in tables (#33549) We have improved the logic for computing intrinsic sizes, and apparently we are no longer getting a `ContentSizes` whose `min_content` is greater than the `max_content`. Signed-off-by: Oriol Brufau --- components/layout_2020/table/layout.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/layout_2020/table/layout.rs b/components/layout_2020/table/layout.rs index 2d6f500756b..2a45e01bd28 100644 --- a/components/layout_2020/table/layout.rs +++ b/components/layout_2020/table/layout.rs @@ -297,11 +297,10 @@ impl<'a> TableLayout<'a> { }; inline_content_sizes.min_content += padding_border_sums.inline; inline_content_sizes.max_content += padding_border_sums.inline; - - // TODO: the max-content size should never be smaller than the min-content size! - inline_content_sizes.max_content = inline_content_sizes - .max_content - .max(inline_content_sizes.min_content); + assert!( + inline_content_sizes.max_content >= inline_content_sizes.min_content, + "the max-content size should never be smaller than the min-content size" + ); // These formulas differ from the spec, but seem to match Gecko and Blink. let outer_min_content_width = if is_in_fixed_mode {