mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Reinitialize TextNode chunk state after collapsing whitespace
When collapsible whitespace is skipped without committing a prior chunk, the loop would fall through and continue with font information derived from the last whitespace code point rather than the next non-whitespace character. Restart the function via recursion so that these values are reinitialized from the correct code point.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
815e9db05d
commit
483ea12914
Notes:
github-actions[bot]
2026-03-09 14:36:13 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/483ea129146 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8298 Reviewed-by: https://github.com/gmta ✅
@@ -727,10 +727,11 @@ Optional<TextNode::Chunk> TextNode::ChunkIterator::next_without_peek()
|
||||
|
||||
while (m_current_index < m_view.length_in_code_units() && is_collapsible(current_code_point()))
|
||||
m_current_index = next_grapheme_boundary();
|
||||
can_break_at_current_position = is_at_line_break_opportunity();
|
||||
|
||||
if (result.has_value())
|
||||
return result.release_value();
|
||||
|
||||
return next_without_peek();
|
||||
}
|
||||
|
||||
if (m_should_wrap_lines) {
|
||||
|
||||
Reference in New Issue
Block a user