From 4d84e349ae84e1dfae4baab399dbb2e3fe6aa720 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 4 Oct 2022 11:55:58 +0200 Subject: [PATCH] LibWeb: Recreate flex lines before calculating intrinsic cross size This will allow us to do intrinsic cross sizing without depending on intrinsic main sizing happening first. --- Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index ada354370e..bc64cf6bf1 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -1565,7 +1565,10 @@ float FlexFormattingContext::calculate_intrinsic_cross_size_of_flex_container() // min-content/max-content cross-size contribution among the flex items (respectively), then using that size // as the available space in the cross axis for each of the flex items during layout. - // HACK: We run steps 7, 9 and 11 from the main algorithm. This gives us *some* cross size information to work with. + // HACK: We run steps 5, 7, 9 and 11 from the main algorithm. This gives us *some* cross size information to work with. + m_flex_lines.clear(); + collect_flex_items_into_flex_lines(); + for (auto& flex_item : m_flex_items) { determine_hypothetical_cross_size_of_item(flex_item, false); }