Files
ladybird/Libraries/LibWeb/Layout/InlineLevelIterator.cpp
Andreas Kling 3877026082 LibWeb: Pre-generate items in InlineLevelIterator
Instead of generating items lazily during iteration (and using a
lookahead queue for peeking), we now pre-generate all items upfront
in the constructor.

This allows next() and next_non_whitespace_sequence_width() to be
simple O(1) array accesses instead of doing generation work.

To handle tabs correctly (which need to know the accumulated width of
content before them on the line), we track m_accumulated_width_for_tabs
during pre-generation and reset it on forced breaks.
2026-01-11 11:10:19 +01:00

19 KiB