mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Peek after extracting next chunk in InlineLevelIterator
Peek is used to determine if the current chunk is the last and if so, add trailing box metrics. For this to work correctly, it must be done only after calling next(), otherwise peek gives us the current chunk.
This commit is contained in:
parent
eeef370902
commit
884b7fcbf5
Notes:
github-actions[bot]
2025-10-20 11:38:42 +00:00
Author: https://github.com/amhndu 🔰
Commit: 884b7fcbf5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6506
Reviewed-by: https://github.com/AtkinsSJ ✅
6 changed files with 41 additions and 13 deletions
|
|
@ -497,10 +497,11 @@ Optional<InlineLevelIterator::Item> InlineLevelIterator::next_without_lookahead(
|
|||
else
|
||||
m_text_node_context->is_first_chunk = false;
|
||||
|
||||
auto chunk_opt = m_text_node_context->chunk_iterator.next();
|
||||
|
||||
if (!m_text_node_context->chunk_iterator.peek(0).has_value())
|
||||
m_text_node_context->is_last_chunk = true;
|
||||
|
||||
auto chunk_opt = m_text_node_context->chunk_iterator.next();
|
||||
auto is_empty_editable = false;
|
||||
if (!chunk_opt.has_value()) {
|
||||
auto const is_only_chunk = m_text_node_context->is_first_chunk && m_text_node_context->is_last_chunk;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue