mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +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: https://github.com/LadybirdBrowser/ladybird/commit/69367194a6d 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) \
|
||||
|
|
|
@ -6,9 +6,9 @@ Rerun
|
|||
|
||||
Found 3 tests
|
||||
|
||||
1 Pass
|
||||
2 Fail
|
||||
2 Pass
|
||||
1 Fail
|
||||
Details
|
||||
Result Test Name MessageFail Check number of divs
|
||||
Result Test Name MessagePass Check number of divs
|
||||
Pass Check div structure: network
|
||||
Fail Check div structure: document.write Cannot access property "childNodes" on undefined object "div"
|
||||
Fail Check div structure: document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write Cannot access property "firstChild" on null object "document.body"
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write Cannot access property "childNodes" on null object "document.body"
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write
|
||||
Result Test Name MessagePass document.write
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write plaintext
|
||||
Result Test Name MessagePass document.write plaintext
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write into iframe
|
||||
Result Test Name MessagePass document.write into iframe
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write plaintext into iframe
|
||||
Result Test Name MessagePass document.write plaintext into iframe
|
|
@ -6,6 +6,6 @@ Rerun
|
|||
|
||||
Found 1 tests
|
||||
|
||||
1 Fail
|
||||
1 Pass
|
||||
Details
|
||||
Result Test Name MessageFail document.write plaintext into iframe
|
||||
Result Test Name MessagePass document.write plaintext into iframe
|
Loading…
Add table
Reference in a new issue