LibWeb: Emit character/comment tokens lazily to accumulate more data

Instead of emitting data-bearing tokens immediately, do it lazily at
the next state change. This allows us to accumulate full bursts of
text in between tags instead of having one token per character. :^)
This commit is contained in:
Andreas Kling 2020-05-23 18:43:09 +02:00
commit 7be36366be
Notes: sideshowbarker 2024-07-19 06:12:20 +09:00
2 changed files with 31 additions and 3 deletions

View file

@ -148,6 +148,7 @@ private:
void will_switch_to(State);
void will_reconsume_in(State);
void flush_current_character_or_comment_if_needed();
State m_state { State::Data };
State m_return_state { State::Data };