LibWeb: Remove redundant call to fit-content sizing in flex layout

We were calculating the fit-content cross size and then throwing it
away and doing it again. You might think this wasn't so bad since
fit-content relies on cacheable intrinsic sizes *buuuuut* since we're
actually modifying the constraints for the second call, we were indeed
doing completely wasted work here.
This commit is contained in:
Andreas Kling 2025-04-21 15:30:42 +02:00 committed by Andreas Kling
commit 0c6ad0a740
Notes: github-actions[bot] 2025-04-22 10:10:42 +00:00

View file

@ -1130,7 +1130,7 @@ void FlexFormattingContext::determine_hypothetical_cross_size_of_item(FlexItem&
}
// "... treating auto as fit-content"
auto fit_content_cross_size = calculate_fit_content_cross_size(item);
CSSPixels fit_content_cross_size;
if (is_row_layout()) {
auto available_width = item.main_size.has_value() ? AvailableSize::make_definite(item.main_size.value()) : AvailableSize::make_indefinite();
auto available_height = AvailableSize::make_indefinite();