Skip to content

Commit

Permalink
LibWeb: Don't emit current token on EOF in HTML Tokenizer
Browse files Browse the repository at this point in the history
Emitting tokens on EOF caused an infinite loop, freezing the app, which
could be a bit annoying when writing an HTML comment at the end of
the file in Text Editor. :^)
  • Loading branch information
krkk authored and alimpfard committed Feb 14, 2022
1 parent fb5e267 commit c157c21
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,6 @@ Optional<HTMLToken> HTMLTokenizer::next_token()
ON_EOF
{
log_parse_error();
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE
Expand Down Expand Up @@ -1388,7 +1387,6 @@ Optional<HTMLToken> HTMLTokenizer::next_token()
{
log_parse_error();
m_current_token.set_comment(consume_current_builder());
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE
Expand Down Expand Up @@ -1419,7 +1417,6 @@ Optional<HTMLToken> HTMLTokenizer::next_token()
{
log_parse_error();
m_current_token.set_comment(consume_current_builder());
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE
Expand Down Expand Up @@ -1447,7 +1444,6 @@ Optional<HTMLToken> HTMLTokenizer::next_token()
{
log_parse_error();
m_current_token.set_comment(consume_current_builder());
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE
Expand All @@ -1468,7 +1464,6 @@ Optional<HTMLToken> HTMLTokenizer::next_token()
{
log_parse_error();
m_current_token.set_comment(consume_current_builder());
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE
Expand Down

0 comments on commit c157c21

Please sign in to comment.