Skip to content

Commit 8b5e9c2

Browse files
tcl3awesomekling
authored andcommitted
LibWeb: Emit comment token for unterminated bogus comments on EOF
1 parent 627b7dd commit 8b5e9c2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ Optional<HTMLToken> HTMLTokenizer::next_token(StopAtInsertionPoint stop_at_inser
488488
}
489489
ON_EOF
490490
{
491-
m_queued_tokens.enqueue(move(m_current_token));
492-
EMIT_EOF;
491+
m_current_token.set_comment(consume_current_builder());
492+
EMIT_CURRENT_TOKEN_FOLLOWED_BY_EOF;
493493
}
494494
ON(0)
495495
{

Tests/LibWeb/Text/expected/wpt-import/html/syntax/parsing/html5lib_comments01.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ Harness status: OK
22

33
Found 16 tests
44

5-
15 Pass
6-
1 Fail
5+
16 Pass
76
Pass html5lib_comments01.html 3dbda8330033c3fbf3185a55e963075328099578
87
Pass html5lib_comments01.html 7476098e9823b3deee1857739daf719ff18e37b4
98
Pass html5lib_comments01.html eca7f97a4659eab6da4127c225420f1664b6c0c4
@@ -17,6 +16,6 @@ Pass html5lib_comments01.html 8b36d140a4a223b083a8d41af7c98a1c20377856
1716
Pass html5lib_comments01.html 1894e23c5ee89d6f4b5f1dbe9b681b42863b4d1f
1817
Pass html5lib_comments01.html 2cefeae994b6b0be0accbfff4757fef40ed914eb
1918
Pass html5lib_comments01.html ac9fd94008255e73cba953dbd374cb41703f5446
20-
Fail html5lib_comments01.html 617815b6a683613fcb6b9cd5841b2ea7428d838d
19+
Pass html5lib_comments01.html 617815b6a683613fcb6b9cd5841b2ea7428d838d
2120
Pass html5lib_comments01.html bb8faf75d2e28aee13ec4a0d8eab00b4d7475763
2221
Pass html5lib_comments01.html 89c4ae1ae34df9dff0e516afdef87cd169c3e6a5

0 commit comments

Comments
 (0)