mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 21:44:59 +00:00
LibWeb: Parse "textarea" tags during the "in body" insertion mode
Had to handle some more cases in the tokenizer to support this.
This commit is contained in:
parent
f4778d1ba0
commit
756829555a
2 changed files with 45 additions and 11 deletions
|
@ -1029,11 +1029,13 @@ _StartOfFunction:
|
|||
}
|
||||
ON_EOF
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
EMIT_EOF;
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
RECONSUME_IN(BeforeAttributeName);
|
||||
}
|
||||
}
|
||||
END_STATE
|
||||
|
@ -1521,7 +1523,9 @@ _StartOfFunction:
|
|||
ANYTHING_ELSE
|
||||
{
|
||||
// FIXME: Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume in the RCDATA state.
|
||||
TODO();
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('<'));
|
||||
m_queued_tokens.enqueue(HTMLToken::make_character('/'));
|
||||
RECONSUME_IN(RCDATA);
|
||||
}
|
||||
}
|
||||
END_STATE
|
||||
|
@ -1531,24 +1535,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(RCDATA);
|
||||
}
|
||||
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(RCDATA);
|
||||
}
|
||||
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(RCDATA);
|
||||
}
|
||||
SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data);
|
||||
}
|
||||
|
@ -1566,7 +1579,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(RCDATA);
|
||||
}
|
||||
}
|
||||
END_STATE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue