From e61bf997db6695573a4e2fbc431c51ee3171c54c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 5 Mar 2022 13:06:04 +0100 Subject: [PATCH] LibWeb: Don't break on *every character* in AllPossibleLineBreaks mode This mode is used to find the min-content inline size, so we should break between words, not characters. --- Userland/Libraries/LibWeb/Layout/TextNode.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/TextNode.cpp b/Userland/Libraries/LibWeb/Layout/TextNode.cpp index b58ae0a7d1..149e1e9318 100644 --- a/Userland/Libraries/LibWeb/Layout/TextNode.cpp +++ b/Userland/Libraries/LibWeb/Layout/TextNode.cpp @@ -277,12 +277,6 @@ Optional TextNode::ChunkIterator::next() return result.release_value(); } - if (m_layout_mode == LayoutMode::AllPossibleLineBreaks) { - if (auto result = try_commit_chunk(start_of_chunk, m_iterator, false); result.has_value()) { - return result.release_value(); - } - } - // NOTE: The checks after this need to look at the current iterator // position, which depends on not being at the end. if (m_iterator == m_utf8_view.end()) @@ -300,7 +294,7 @@ Optional TextNode::ChunkIterator::next() } } - if (m_wrap_lines) { + if (m_wrap_lines || m_layout_mode == LayoutMode::AllPossibleLineBreaks) { bool is_space = is_ascii_space(*m_iterator); if (is_space != m_last_was_space) { m_last_was_space = is_space;