LibWeb: Implement the "after attribute name" tokenizer state

One little step at a time towards parsing the monster blob of HTML we
get from twitter.com :^)
This commit is contained in:
Andreas Kling 2020-05-27 18:27:32 +02:00
parent 1b0c39ca60
commit 39b5494aeb
Notes: sideshowbarker 2024-07-19 06:04:16 +09:00

View file

@ -807,6 +807,31 @@ _StartOfFunction:
BEGIN_STATE(AfterAttributeName)
{
ON_WHITESPACE
{
continue;
}
ON('/')
{
SWITCH_TO(SelfClosingStartTag);
}
ON('=')
{
SWITCH_TO(BeforeAttributeValue);
}
ON('>')
{
SWITCH_TO(Data);
}
ON_EOF
{
TODO();
}
ANYTHING_ELSE
{
m_current_token.m_tag.attributes.append(HTMLToken::AttributeBuilder());
RECONSUME_IN(AttributeName);
}
}
END_STATE