summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-30 22:59:41 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-30 23:00:35 +0200
commitf3b09ddd8e1d48a85435c10bf3f509ef6e3e82a2 (patch)
treedabf9353ff7a9f16795c0d5717939942625dded1 /Libraries/LibWeb
parentd058addd742c9eae3b7f0616ad9bb37e3e4ce6e6 (diff)
downloadserenity-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.cpp27
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