From 8d5768b103da00d07a48f540f83b7e34b91edf7f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 18 Mar 2022 22:39:48 +0100 Subject: [PATCH] LibWeb: Don't treat inline-level children of flex items as whitespace This was causing us to collapse some children of flex items as if they were useless whitespace text nodes. --- Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index 1e42e107d9..2e44535ff5 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -154,8 +154,8 @@ void FlexFormattingContext::generate_anonymous_flex_items() // Skip anonymous text runs that are only whitespace. 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.dom_node().data().is_whitespace()) { + child_box.for_each_in_subtree([&](auto const& node) { + if (!is(node) || !static_cast(node).dom_node().data().is_whitespace()) { contains_only_white_space = false; return IterationDecision::Break; }