mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibWeb: Make HTML tokenizer stop at insertion point after state switch
If we reach the insertion point at the same time as we switch to another tokenizer state, we have to bail immediately without proceeding with the next code point. Otherwise we'd fetch the next token, get an EOF marker, and then proceed as if we're at the end of the input stream, even though more data may be coming (with more calls to document.write()..)
This commit is contained in:
parent
1d554f97de
commit
69367194a6
Notes:
github-actions[bot]
2024-11-23 18:20:21 +00:00
Author: https://github.com/awesomekling
Commit: 69367194a6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2531
18 changed files with 44 additions and 42 deletions
|
@ -30,12 +30,14 @@ namespace Web::HTML {
|
|||
SWITCH_TO_WITH_UNCLEAN_BUILDER(new_state); \
|
||||
} while (0)
|
||||
|
||||
#define SWITCH_TO_WITH_UNCLEAN_BUILDER(new_state) \
|
||||
do { \
|
||||
will_switch_to(State::new_state); \
|
||||
m_state = State::new_state; \
|
||||
CONSUME_NEXT_INPUT_CHARACTER; \
|
||||
goto new_state; \
|
||||
#define SWITCH_TO_WITH_UNCLEAN_BUILDER(new_state) \
|
||||
do { \
|
||||
will_switch_to(State::new_state); \
|
||||
m_state = State::new_state; \
|
||||
if (stop_at_insertion_point == StopAtInsertionPoint::Yes && is_insertion_point_reached()) \
|
||||
return {}; \
|
||||
CONSUME_NEXT_INPUT_CHARACTER; \
|
||||
goto new_state; \
|
||||
} while (0)
|
||||
|
||||
#define RECONSUME_IN(new_state) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue