summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-30 16:15:16 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-30 17:47:50 +0200
commitc9dd4598229223a13278307ca6065fa5bc59de1e (patch)
tree022c94210ce403c809a571fa8c611addc181c72d /Libraries/LibWeb
parentd0eb35e5c30caae2fb54940f1b81b47079829e32 (diff)
downloadserenity-c9dd4598229223a13278307ca6065fa5bc59de1e.zip
LibWeb: Implement some more RAWTEXT stuff in the tokenizer
Diffstat (limited to 'Libraries/LibWeb')
-rw-r--r--Libraries/LibWeb/Parser/HTMLTokenizer.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/Libraries/LibWeb/Parser/HTMLTokenizer.cpp b/Libraries/LibWeb/Parser/HTMLTokenizer.cpp
index bbf61d4c26..82555d04bd 100644
--- a/Libraries/LibWeb/Parser/HTMLTokenizer.cpp
+++ b/Libraries/LibWeb/Parser/HTMLTokenizer.cpp
@@ -1617,8 +1617,9 @@ _StartOfFunction:
}
ANYTHING_ELSE
{
- // FIXME: Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume in the RAWTEXT state.
- TODO();
+ m_queued_tokens.enqueue(HTMLToken::make_character('<'));
+ m_queued_tokens.enqueue(HTMLToken::make_character('/'));
+ RECONSUME_IN(RAWTEXT);
}
}
END_STATE
@@ -1628,24 +1629,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(RAWTEXT);
}
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(RAWTEXT);
}
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(RAWTEXT);
}
SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data);
}
@@ -1663,7 +1673,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(RAWTEXT);
}
}
END_STATE