1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

LibWeb: Implement some more RAWTEXT stuff in the tokenizer

This commit is contained in:
Andreas Kling 2020-05-30 16:15:16 +02:00
parent d0eb35e5c3
commit c9dd459822

View file

@ -1617,8 +1617,9 @@ _StartOfFunction:
} }
ANYTHING_ELSE ANYTHING_ELSE
{ {
// FIXME: Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume in the RAWTEXT state. m_queued_tokens.enqueue(HTMLToken::make_character('<'));
TODO(); m_queued_tokens.enqueue(HTMLToken::make_character('/'));
RECONSUME_IN(RAWTEXT);
} }
} }
END_STATE END_STATE
@ -1628,24 +1629,33 @@ _StartOfFunction:
ON_WHITESPACE ON_WHITESPACE
{ {
if (!current_end_tag_token_is_appropriate()) { if (!current_end_tag_token_is_appropriate()) {
// FIXME: Otherwise, treat it as per the "anything else" entry below. m_queued_tokens.enqueue(HTMLToken::make_character('<'));
TODO(); m_queued_tokens.enqueue(HTMLToken::make_character('/'));
for (auto codepoint : m_temporary_buffer)
m_queued_tokens.enqueue(HTMLToken::make_character(codepoint));
RECONSUME_IN(RAWTEXT);
} }
SWITCH_TO(BeforeAttributeName); SWITCH_TO(BeforeAttributeName);
} }
ON('/') ON('/')
{ {
if (!current_end_tag_token_is_appropriate()) { if (!current_end_tag_token_is_appropriate()) {
// FIXME: Otherwise, treat it as per the "anything else" entry below. m_queued_tokens.enqueue(HTMLToken::make_character('<'));
TODO(); m_queued_tokens.enqueue(HTMLToken::make_character('/'));
for (auto codepoint : m_temporary_buffer)
m_queued_tokens.enqueue(HTMLToken::make_character(codepoint));
RECONSUME_IN(RAWTEXT);
} }
SWITCH_TO(SelfClosingStartTag); SWITCH_TO(SelfClosingStartTag);
} }
ON('>') ON('>')
{ {
if (!current_end_tag_token_is_appropriate()) { if (!current_end_tag_token_is_appropriate()) {
// FIXME: Otherwise, treat it as per the "anything else" entry below. m_queued_tokens.enqueue(HTMLToken::make_character('<'));
TODO(); m_queued_tokens.enqueue(HTMLToken::make_character('/'));
for (auto codepoint : m_temporary_buffer)
m_queued_tokens.enqueue(HTMLToken::make_character(codepoint));
RECONSUME_IN(RAWTEXT);
} }
SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data); SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data);
} }
@ -1663,7 +1673,11 @@ _StartOfFunction:
} }
ANYTHING_ELSE ANYTHING_ELSE
{ {
TODO(); m_queued_tokens.enqueue(HTMLToken::make_character('<'));
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
for (auto codepoint : m_temporary_buffer)
m_queued_tokens.enqueue(HTMLToken::make_character(codepoint));
RECONSUME_IN(RAWTEXT);
} }
} }
END_STATE END_STATE