summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnver Balalic <balalic.enver@gmail.com>2022-03-31 20:32:00 +0200
committerAndreas Kling <kling@serenityos.org>2022-03-31 21:09:41 +0200
commit7be57c322ea436b2d8c0399749bdde340486b5e1 (patch)
treebfa50045dcc393cb0d67a53864f455784c9ed785
parente18aba69b5b1a6dd91ce567f5ff1868ee5f5a1f8 (diff)
downloadserenity-7be57c322ea436b2d8c0399749bdde340486b5e1.zip
LibWeb: Flex fix minimum main size in min/max violations calculation
While calculating the minimum size for main min/max size violations we were flooring the min size to 0 if the item doesn't have a min main size. Instead of that determine the intrinsic min main size of that element. This fixes the flex: 80% 0 4/1/0 test case in the flex.html test page. This case was missed in a previous commit that added the determine_min_main_size_of_child function
-rw-r--r--Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
index 0070686d2c..fa7c21f1b6 100644
--- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
@@ -773,7 +773,7 @@ void FlexFormattingContext::resolve_flexible_lengths()
for_each_unfrozen_item([&](FlexItem* item) {
auto min_main = has_main_min_size(item->box)
? specified_main_min_size(item->box)
- : 0;
+ : determine_min_main_size_of_child(item->box);
auto max_main = has_main_max_size(item->box)
? specified_main_max_size(item->box)
: NumericLimits<float>::max();