1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 04:34:59 +00:00

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

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