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 <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2024-09-26 06:21:20 -07:00 committed by GitHub
parent 7fdaccde55
commit 1346643727
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {