mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 12:42:54 +00:00
LibWeb: Implement some more RAWTEXT stuff in the tokenizer
This commit is contained in:
parent
d0eb35e5c3
commit
c9dd459822
Notes:
sideshowbarker
2024-07-19 05:56:41 +09:00
Author: https://github.com/awesomekling
Commit: c9dd459822
1 changed files with 23 additions and 9 deletions
|
@ -1617,8 +1617,9 @@ _StartOfFunction:
|
|||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
// FIXME: Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume in the RAWTEXT state.
|
||||
TODO();
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
RECONSUME_IN(RAWTEXT);
|
||||
}
|
||||
}
|
||||
END_STATE
|
||||
|
@ -1628,24 +1629,33 @@ _StartOfFunction:
|
|||
ON_WHITESPACE
|
||||
{
|
||||
if (!current_end_tag_token_is_appropriate()) {
|
||||
// FIXME: Otherwise, treat it as per the "anything else" entry below.
|
||||
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);
|
||||
}
|
||||
SWITCH_TO(BeforeAttributeName);
|
||||
}
|
||||
ON('/')
|
||||
{
|
||||
if (!current_end_tag_token_is_appropriate()) {
|
||||
// FIXME: Otherwise, treat it as per the "anything else" entry below.
|
||||
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);
|
||||
}
|
||||
SWITCH_TO(SelfClosingStartTag);
|
||||
}
|
||||
ON('>')
|
||||
{
|
||||
if (!current_end_tag_token_is_appropriate()) {
|
||||
// FIXME: Otherwise, treat it as per the "anything else" entry below.
|
||||
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);
|
||||
}
|
||||
SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data);
|
||||
}
|
||||
|
@ -1663,7 +1673,11 @@ _StartOfFunction:
|
|||
}
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue