Skip to content

Commit 586f2dd

Browse files
committed
Add Script data double escaped state errors.
1 parent 8c72094 commit 586f2dd

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

tokenizer/domjs.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@
4646
{ "code": "unexpected-null-character", "line": 1, "col": 36 }
4747
]
4848
},
49+
{
50+
"description":"NUL in script HTML comment - double escaped",
51+
"doubleEscaped":true,
52+
"initialStates":["Script data state"],
53+
"input":"<!--<script>\\u0000--><!--<script>-\\u0000--><!--<script>--\\u0000-->",
54+
"output":[["Character", "<!--<script>\\uFFFD--><!--<script>-\\uFFFD--><!--<script>--\\uFFFD-->"]],
55+
"errors":[
56+
{ "code": "unexpected-null-character", "line": 1, "col": 13 }
57+
]
58+
},
4959
{
5060
"description":"EOF in script HTML comment",
5161
"initialStates":["Script data state"],
@@ -73,6 +83,15 @@
7383
{ "code": "eof-in-script-html-comment", "line": 1, "col": 11 }
7484
]
7585
},
86+
{
87+
"description":"EOF in script HTML comment - double escaped",
88+
"initialStates":["Script data state"],
89+
"input":"<!--<script>",
90+
"output":[["Character", "<!--<script>"]],
91+
"errors":[
92+
{ "code": "eof-in-script-html-comment", "line": 1, "col": 13 }
93+
]
94+
},
7695
{
7796
"description":"leading U+FEFF must pass through",
7897
"doubleEscaped":true,

tree-construction/domjs-unsafe.dat

45 Bytes
Binary file not shown.

tree-construction/tests16.dat

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@
400400
#errors
401401
(1,35): eof-in-script-in-script
402402
(1,35): expected-named-closing-tag-but-got-eof
403+
#new-errors
404+
(1:36) eof-in-script-html-comment
403405
#document
404406
| <!DOCTYPE html>
405407
| <html>
@@ -413,6 +415,8 @@
413415
#errors
414416
(1,36): eof-in-script-in-script
415417
(1,36): expected-named-closing-tag-but-got-eof
418+
#new-errors
419+
(1:37) eof-in-script-html-comment
416420
#document
417421
| <!DOCTYPE html>
418422
| <html>
@@ -426,6 +430,8 @@
426430
#errors
427431
(1,37): eof-in-script-in-script
428432
(1,37): expected-named-closing-tag-but-got-eof
433+
#new-errors
434+
(1:38) eof-in-script-html-comment
429435
#document
430436
| <!DOCTYPE html>
431437
| <html>
@@ -439,6 +445,8 @@
439445
#errors
440446
(1,37): eof-in-script-in-script
441447
(1,37): expected-named-closing-tag-but-got-eof
448+
#new-errors
449+
(1:38) eof-in-script-html-comment
442450
#document
443451
| <!DOCTYPE html>
444452
| <html>
@@ -452,6 +460,8 @@
452460
#errors
453461
(1,38): eof-in-script-in-script
454462
(1,38): expected-named-closing-tag-but-got-eof
463+
#new-errors
464+
(1:39) eof-in-script-html-comment
455465
#document
456466
| <!DOCTYPE html>
457467
| <html>
@@ -465,6 +475,8 @@
465475
#errors
466476
(1,43): eof-in-script-in-script
467477
(1,43): expected-named-closing-tag-but-got-eof
478+
#new-errors
479+
(1:44) eof-in-script-html-comment
468480
#document
469481
| <!DOCTYPE html>
470482
| <html>
@@ -478,6 +490,8 @@
478490
#errors
479491
(1,44): eof-in-script-in-script
480492
(1,44): expected-named-closing-tag-but-got-eof
493+
#new-errors
494+
(1:45) eof-in-script-html-comment
481495
#document
482496
| <!DOCTYPE html>
483497
| <html>
@@ -646,6 +660,8 @@
646660
#errors
647661
(1,37): eof-in-script-in-script
648662
(1,37): expected-named-closing-tag-but-got-eof
663+
#new-errors
664+
(1:38) eof-in-script-html-comment
649665
#document
650666
| <!DOCTYPE html>
651667
| <html>
@@ -659,6 +675,8 @@
659675
#errors
660676
(1,37): eof-in-script-in-script
661677
(1,37): expected-named-closing-tag-but-got-eof
678+
#new-errors
679+
(1:38) eof-in-script-html-comment
662680
#document
663681
| <!DOCTYPE html>
664682
| <html>
@@ -685,6 +703,8 @@
685703
#errors
686704
(1,38): eof-in-script-in-script
687705
(1,38): expected-named-closing-tag-but-got-eof
706+
#new-errors
707+
(1:39) eof-in-script-html-comment
688708
#document
689709
| <!DOCTYPE html>
690710
| <html>
@@ -698,6 +718,8 @@
698718
#errors
699719
(1,38): eof-in-script-in-script
700720
(1,38): expected-named-closing-tag-but-got-eof
721+
#new-errors
722+
(1:39) eof-in-script-html-comment
701723
#document
702724
| <!DOCTYPE html>
703725
| <html>
@@ -1664,6 +1686,8 @@
16641686
(1,8): expected-doctype-but-got-start-tag
16651687
(1,20): eof-in-script-in-script
16661688
(1,20): expected-named-closing-tag-but-got-eof
1689+
#new-errors
1690+
(1:21) eof-in-script-html-comment
16671691
#document
16681692
| <html>
16691693
| <head>
@@ -1677,6 +1701,8 @@
16771701
(1,8): expected-doctype-but-got-start-tag
16781702
(1,21): eof-in-script-in-script
16791703
(1,21): expected-named-closing-tag-but-got-eof
1704+
#new-errors
1705+
(1:22) eof-in-script-html-comment
16801706
#document
16811707
| <html>
16821708
| <head>
@@ -1690,6 +1716,8 @@
16901716
(1,8): expected-doctype-but-got-start-tag
16911717
(1,22): eof-in-script-in-script
16921718
(1,22): expected-named-closing-tag-but-got-eof
1719+
#new-errors
1720+
(1:23) eof-in-script-html-comment
16931721
#document
16941722
| <html>
16951723
| <head>
@@ -1703,6 +1731,8 @@
17031731
(1,8): expected-doctype-but-got-start-tag
17041732
(1,22): eof-in-script-in-script
17051733
(1,22): expected-named-closing-tag-but-got-eof
1734+
#new-errors
1735+
(1:23) eof-in-script-html-comment
17061736
#document
17071737
| <html>
17081738
| <head>
@@ -1716,6 +1746,8 @@
17161746
(1,8): expected-doctype-but-got-start-tag
17171747
(1,23): eof-in-script-in-script
17181748
(1,23): expected-named-closing-tag-but-got-eof
1749+
#new-errors
1750+
(1:24) eof-in-script-html-comment
17191751
#document
17201752
| <html>
17211753
| <head>
@@ -1729,6 +1761,8 @@
17291761
(1,8): expected-doctype-but-got-start-tag
17301762
(1,28): eof-in-script-in-script
17311763
(1,28): expected-named-closing-tag-but-got-eof
1764+
#new-errors
1765+
(1:29) eof-in-script-html-comment
17321766
#document
17331767
| <html>
17341768
| <head>
@@ -1742,6 +1776,8 @@
17421776
(1,8): expected-doctype-but-got-start-tag
17431777
(1,29): eof-in-script-in-script
17441778
(1,29): expected-named-closing-tag-but-got-eof
1779+
#new-errors
1780+
(1:30) eof-in-script-html-comment
17451781
#document
17461782
| <html>
17471783
| <head>
@@ -1910,6 +1946,8 @@
19101946
(1,8): expected-doctype-but-got-start-tag
19111947
(1,22): eof-in-script-in-script
19121948
(1,22): expected-named-closing-tag-but-got-eof
1949+
#new-errors
1950+
(1:23) eof-in-script-html-comment
19131951
#document
19141952
| <html>
19151953
| <head>
@@ -1936,6 +1974,8 @@
19361974
(1,8): expected-doctype-but-got-start-tag
19371975
(1,23): eof-in-script-in-script
19381976
(1,23): expected-named-closing-tag-but-got-eof
1977+
#new-errors
1978+
(1:24) eof-in-script-html-comment
19391979
#document
19401980
| <html>
19411981
| <head>

0 commit comments

Comments
 (0)