From 9af85881f588141334d39c4102e43b930418506f Mon Sep 17 00:00:00 2001 From: Tobias Christiansen Date: Mon, 4 Oct 2021 13:11:37 +0200 Subject: [PATCH] LibWeb: Flexbox: Take parents' specified main size into account Previously, if the parent of the container had a definite main size, it would've been disregarded when calculating the main size of the container if it had no definite size and neither min- nor max-main-size constraints. This patch fixes that behavior by additionally checking whether the main size is not only not constrained but also infinite. --- Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index cd45fbec60..6d4b8ff826 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -410,7 +410,7 @@ void FlexFormattingContext::run(Box& box, LayoutMode) } // 4. Determine the main size of the flex container - if (!main_is_constrained || main_available_size == 0) { + if ((!main_is_constrained && main_size_is_infinite) || main_available_size == 0) { // Uses https://www.w3.org/TR/css-flexbox-1/#intrinsic-main-sizes // 9.9.1 // 1.