mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibWeb: Fix assertion failures in HTMLTokenizer
The *TagName states are all very similar, so it seems to be correct to apply the fix from #8761 to all of those states. This fixes #8788.
This commit is contained in:
parent
ca9c53c1a8
commit
e22a34badb
Notes:
sideshowbarker
2024-07-18 08:56:36 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/e22a34badbf Pull-request: https://github.com/SerenityOS/serenity/pull/8793 Issue: https://github.com/SerenityOS/serenity/issues/8788
1 changed files with 18 additions and 0 deletions
|
@ -1910,6 +1910,8 @@ _StartOfFunction:
|
|||
{
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
// NOTE: The spec doesn't mention this, but it seems that m_current_token (an end tag) is just dropped in this case.
|
||||
m_current_builder.clear();
|
||||
for (auto code_point : m_temporary_buffer)
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(code_point));
|
||||
RECONSUME_IN(RCDATA);
|
||||
|
@ -2023,6 +2025,8 @@ _StartOfFunction:
|
|||
{
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
// NOTE: The spec doesn't mention this, but it seems that m_current_token (an end tag) is just dropped in this case.
|
||||
m_current_builder.clear();
|
||||
for (auto code_point : m_temporary_buffer)
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(code_point));
|
||||
RECONSUME_IN(RAWTEXT);
|
||||
|
@ -2192,6 +2196,8 @@ _StartOfFunction:
|
|||
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
// NOTE: The spec doesn't mention this, but it seems that m_current_token (an end tag) is just dropped in this case.
|
||||
m_current_builder.clear();
|
||||
for (auto code_point : m_temporary_buffer) {
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(code_point));
|
||||
}
|
||||
|
@ -2205,6 +2211,8 @@ _StartOfFunction:
|
|||
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
// NOTE: The spec doesn't mention this, but it seems that m_current_token (an end tag) is just dropped in this case.
|
||||
m_current_builder.clear();
|
||||
for (auto code_point : m_temporary_buffer) {
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(code_point));
|
||||
}
|
||||
|
@ -2218,6 +2226,8 @@ _StartOfFunction:
|
|||
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
// NOTE: The spec doesn't mention this, but it seems that m_current_token (an end tag) is just dropped in this case.
|
||||
m_current_builder.clear();
|
||||
for (auto code_point : m_temporary_buffer) {
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(code_point));
|
||||
}
|
||||
|
@ -2239,6 +2249,8 @@ _StartOfFunction:
|
|||
{
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
// NOTE: The spec doesn't mention this, but it seems that m_current_token (an end tag) is just dropped in this case.
|
||||
m_current_builder.clear();
|
||||
for (auto code_point : m_temporary_buffer) {
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(code_point));
|
||||
}
|
||||
|
@ -2519,6 +2531,8 @@ _StartOfFunction:
|
|||
SWITCH_TO(BeforeAttributeName);
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
// NOTE: The spec doesn't mention this, but it seems that m_current_token (an end tag) is just dropped in this case.
|
||||
m_current_builder.clear();
|
||||
for (auto code_point : m_temporary_buffer)
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(code_point));
|
||||
RECONSUME_IN(ScriptData);
|
||||
|
@ -2530,6 +2544,8 @@ _StartOfFunction:
|
|||
SWITCH_TO(SelfClosingStartTag);
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
// NOTE: The spec doesn't mention this, but it seems that m_current_token (an end tag) is just dropped in this case.
|
||||
m_current_builder.clear();
|
||||
for (auto code_point : m_temporary_buffer)
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(code_point));
|
||||
RECONSUME_IN(ScriptData);
|
||||
|
@ -2541,6 +2557,8 @@ _StartOfFunction:
|
|||
SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data);
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
// NOTE: The spec doesn't mention this, but it seems that m_current_token (an end tag) is just dropped in this case.
|
||||
m_current_builder.clear();
|
||||
for (auto code_point : m_temporary_buffer)
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(code_point));
|
||||
RECONSUME_IN(ScriptData);
|
||||
|
|
Loading…
Reference in a new issue