diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-30 22:59:41 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-30 23:00:35 +0200 |
commit | f3b09ddd8e1d48a85435c10bf3f509ef6e3e82a2 (patch) | |
tree | dabf9353ff7a9f16795c0d5717939942625dded1 /Libraries/LibWeb | |
parent | d058addd742c9eae3b7f0616ad9bb37e3e4ce6e6 (diff) | |
download | serenity-f3b09ddd8e1d48a85435c10bf3f509ef6e3e82a2.zip |
LibWeb: Implement more of the ScriptDataEndTagName tokenizer state
Some of this is extremely repetitive. We'll need to rethink how we
do queue/emit to improve this.
Diffstat (limited to 'Libraries/LibWeb')
-rw-r--r-- | Libraries/LibWeb/Parser/HTMLTokenizer.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/Libraries/LibWeb/Parser/HTMLTokenizer.cpp b/Libraries/LibWeb/Parser/HTMLTokenizer.cpp index 7c20d5d535..7941bc6918 100644 --- a/Libraries/LibWeb/Parser/HTMLTokenizer.cpp +++ b/Libraries/LibWeb/Parser/HTMLTokenizer.cpp @@ -1978,22 +1978,31 @@ _StartOfFunction: { if (current_end_tag_token_is_appropriate()) SWITCH_TO(BeforeAttributeName); - // 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(ScriptData); } ON('/') { if (current_end_tag_token_is_appropriate()) SWITCH_TO(SelfClosingStartTag); - // 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(ScriptData); } ON('>') { if (current_end_tag_token_is_appropriate()) SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data); - // 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(ScriptData); } ON_ASCII_UPPER_ALPHA { @@ -2009,7 +2018,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(ScriptData); } } END_STATE |