From aa5941952936e171c1f2bc11210ae567de9221a6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 26 Mar 2024 12:59:08 +0100 Subject: [PATCH] LibWeb: Remove unnecessary check that BFC isn't clearing a flex item A block-level box in BFC will never be a flex item. It may be a flex container, but not an item. Hence this check was unnecessary. --- Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 816a31498ba..27982a23293 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -826,10 +826,9 @@ BlockFormattingContext::DidIntroduceClearance BlockFormattingContext::clear_floa } }; - // Flex-items don't float and also don't clear. - if ((computed_values.clear() == CSS::Clear::Left || computed_values.clear() == CSS::Clear::Both) && !child_box.is_flex_item()) + if (computed_values.clear() == CSS::Clear::Left || computed_values.clear() == CSS::Clear::Both) clear_floating_boxes(m_left_floats); - if ((computed_values.clear() == CSS::Clear::Right || computed_values.clear() == CSS::Clear::Both) && !child_box.is_flex_item()) + if (computed_values.clear() == CSS::Clear::Right || computed_values.clear() == CSS::Clear::Both) clear_floating_boxes(m_right_floats); return result;