From b7003194d2cce2b75eb0860af9445a0b176b8abf Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 19 Jul 2022 23:30:52 +0200 Subject: [PATCH] LibWeb: Use right offset for `justify-content: flex-end` Offsets in this algorithm are relative to the starting position, so it should be 0 whether its `flex-start` or `flex-end`. --- .../Libraries/LibWeb/Layout/FlexFormattingContext.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index cd37937fda..9b8d7a13f8 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -1106,16 +1106,8 @@ void FlexFormattingContext::distribute_any_remaining_free_space() switch (flex_container().computed_values().justify_content()) { case CSS::JustifyContent::FlexStart: - if (is_direction_reverse()) - space_before_first_item = m_available_space->main.value_or(NumericLimits::max()); - else - space_before_first_item = 0; - break; case CSS::JustifyContent::FlexEnd: - if (is_direction_reverse()) - space_before_first_item = 0; - else - space_before_first_item = m_available_space->main.value_or(NumericLimits::max()); + space_before_first_item = 0; break; case CSS::JustifyContent::Center: space_before_first_item = (m_available_space->main.value_or(NumericLimits::max()) - used_main_space) / 2.0f;