diff options
author | Andreas Kling <kling@serenityos.org> | 2022-07-21 16:16:12 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-25 15:03:18 +0200 |
commit | 3145f92bc0ef778acc5188b0e77218e34e384369 (patch) | |
tree | 5b1c21586bfdcfbb921575116248f2de1b37d72a /Userland/Libraries | |
parent | b71f747453c211df06ebfcb64be34abc9b73a4d3 (diff) | |
download | serenity-3145f92bc0ef778acc5188b0e77218e34e384369.zip |
LibWeb: Count flex item's *outer* size towards container intrinsic size
This isn't in the spec, but it's visually obvious that we need to count
item margin boxes towards the main intrinsic size of the flex container.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index 432152e99c..5f313a23e0 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -1425,6 +1425,10 @@ float FlexFormattingContext::calculate_intrinsic_main_size_of_flex_container(Lay auto result = flex_item->flex_base_size + product; // FIXME: Clamp result to min/max main size + // NOTE: The spec doesn't mention anything about the *outer* size here, but if we don't add the margin box, + // flex items with non-zero padding/border/margin in the main axis end up overflowing the container. + result = flex_item->add_main_margin_box_sizes(result); + sum += result; } |