diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index 2b5f033102..a0a620c21f 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -312,7 +312,7 @@ void FlexFormattingContext::run(Box& box, LayoutMode) box.for_each_child_of_type([&](Box& child_box) { layout_inside(child_box, LayoutMode::Default); // Skip anonymous text runs that are only whitespace. - if (child_box.is_anonymous()) { + if (child_box.is_anonymous() && !child_box.first_child_of_type()) { bool contains_only_white_space = true; child_box.for_each_in_inclusive_subtree_of_type([&contains_only_white_space](auto& text_node) { if (!text_node.text_for_rendering().is_whitespace()) {