mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 12:42:54 +00:00
LibWeb: Implement all CDATA tokenizer states
Even though we haven't implemented any switches to these states yet, we may as well have them ready for when we do implement the switches.
This commit is contained in:
parent
821312729a
commit
a1838f676e
Notes:
sideshowbarker
2024-07-19 05:39:22 +09:00
Author: https://github.com/Lubrsi
Commit: a1838f676e
Pull-request: https://github.com/SerenityOS/serenity/pull/2556
1 changed files with 50 additions and 0 deletions
|
@ -2436,6 +2436,56 @@ _StartOfFunction:
|
|||
}
|
||||
END_STATE
|
||||
|
||||
BEGIN_STATE(CDATASection)
|
||||
{
|
||||
ON(']')
|
||||
{
|
||||
SWITCH_TO(CDATASectionBracket);
|
||||
}
|
||||
ON_EOF
|
||||
{
|
||||
PARSE_ERROR();
|
||||
EMIT_EOF;
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
EMIT_CURRENT_CHARACTER;
|
||||
}
|
||||
}
|
||||
END_STATE
|
||||
|
||||
BEGIN_STATE(CDATASectionBracket)
|
||||
{
|
||||
ON(']')
|
||||
{
|
||||
SWITCH_TO(CDATASectionEnd);
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
EMIT_CHARACTER_AND_RECONSUME_IN(']', CDATASection);
|
||||
}
|
||||
}
|
||||
END_STATE
|
||||
|
||||
BEGIN_STATE(CDATASectionEnd)
|
||||
{
|
||||
ON(']')
|
||||
{
|
||||
EMIT_CHARACTER(']');
|
||||
}
|
||||
ON('>')
|
||||
{
|
||||
SWITCH_TO(Data);
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(']'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character(']'));
|
||||
RECONSUME_IN(CDATASection);
|
||||
}
|
||||
}
|
||||
END_STATE
|
||||
|
||||
default:
|
||||
TODO();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue