mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00:00
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.
This commit is contained in:
parent
32bd57bdc9
commit
e61bf997db
1 changed files with 1 additions and 7 deletions
|
@ -277,12 +277,6 @@ Optional<TextNode::Chunk> TextNode::ChunkIterator::next()
|
||||||
return result.release_value();
|
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
|
// NOTE: The checks after this need to look at the current iterator
|
||||||
// position, which depends on not being at the end.
|
// position, which depends on not being at the end.
|
||||||
if (m_iterator == m_utf8_view.end())
|
if (m_iterator == m_utf8_view.end())
|
||||||
|
@ -300,7 +294,7 @@ Optional<TextNode::Chunk> TextNode::ChunkIterator::next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_wrap_lines) {
|
if (m_wrap_lines || m_layout_mode == LayoutMode::AllPossibleLineBreaks) {
|
||||||
bool is_space = is_ascii_space(*m_iterator);
|
bool is_space = is_ascii_space(*m_iterator);
|
||||||
if (is_space != m_last_was_space) {
|
if (is_space != m_last_was_space) {
|
||||||
m_last_was_space = is_space;
|
m_last_was_space = is_space;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue