@@ -582,13 +582,11 @@ public function parse() {
582
582
583
583
} elseif ($ char === false ) {
584
584
/* EOF
585
- Parse error. Emit the current tag token. Reconsume the EOF
586
- character in the data state. */
585
+ Parse error. Reconsume the EOF character in the data state. */
587
586
$ this ->emitToken (array (
588
587
'type ' => self ::PARSEERROR ,
589
588
'data ' => 'eof-in-tag-name '
590
589
));
591
- $ this ->emitToken ($ this ->token );
592
590
593
591
$ this ->stream ->unget ();
594
592
$ state = 'data ' ;
@@ -644,13 +642,11 @@ public function parse() {
644
642
645
643
} elseif ($ char === false ) {
646
644
/* EOF
647
- Parse error. Emit the current tag token. Reconsume the EOF
648
- character in the data state. */
645
+ Parse error. Reconsume the EOF character in the data state. */
649
646
$ this ->emitToken (array (
650
647
'type ' => self ::PARSEERROR ,
651
648
'data ' => 'expected-attribute-name-but-got-eof '
652
649
));
653
- $ this ->emitToken ($ this ->token );
654
650
655
651
$ this ->stream ->unget ();
656
652
$ state = 'data ' ;
@@ -725,13 +721,11 @@ public function parse() {
725
721
726
722
} elseif ($ char === false ) {
727
723
/* EOF
728
- Parse error. Emit the current tag token. Reconsume the EOF
729
- character in the data state. */
724
+ Parse error. Reconsume the EOF character in the data state. */
730
725
$ this ->emitToken (array (
731
726
'type ' => self ::PARSEERROR ,
732
727
'data ' => 'eof-in-attribute-name '
733
728
));
734
- $ this ->emitToken ($ this ->token );
735
729
736
730
$ this ->stream ->unget ();
737
731
$ state = 'data ' ;
@@ -814,13 +808,11 @@ public function parse() {
814
808
815
809
} elseif ($ char === false ) {
816
810
/* EOF
817
- Parse error. Emit the current tag token. Reconsume the EOF
818
- character in the data state. */
811
+ Parse error. Reconsume the EOF character in the data state. */
819
812
$ this ->emitToken (array (
820
813
'type ' => self ::PARSEERROR ,
821
814
'data ' => 'expected-end-of-tag-but-got-eof '
822
815
));
823
- $ this ->emitToken ($ this ->token );
824
816
825
817
$ this ->stream ->unget ();
826
818
$ state = 'data ' ;
@@ -892,13 +884,11 @@ public function parse() {
892
884
893
885
} elseif ($ char === false ) {
894
886
/* EOF
895
- Parse error. Emit the current tag token. Reconsume
896
- the character in the data state. */
887
+ Parse error. Reconsume the EOF character in the data state. */
897
888
$ this ->emitToken (array (
898
889
'type ' => self ::PARSEERROR ,
899
890
'data ' => 'expected-attribute-value-but-got-eof '
900
891
));
901
- $ this ->emitToken ($ this ->token );
902
892
$ this ->stream ->unget ();
903
893
$ state = 'data ' ;
904
894
@@ -940,13 +930,11 @@ public function parse() {
940
930
941
931
} elseif ($ char === false ) {
942
932
/* EOF
943
- Parse error. Emit the current tag token. Reconsume the character
944
- in the data state. */
933
+ Parse error. Reconsume the EOF character in the data state. */
945
934
$ this ->emitToken (array (
946
935
'type ' => self ::PARSEERROR ,
947
936
'data ' => 'eof-in-attribute-value-double-quote '
948
937
));
949
- $ this ->emitToken ($ this ->token );
950
938
951
939
$ this ->stream ->unget ();
952
940
$ state = 'data ' ;
@@ -980,13 +968,11 @@ public function parse() {
980
968
981
969
} elseif ($ char === false ) {
982
970
/* EOF
983
- Parse error. Emit the current tag token. Reconsume the character
984
- in the data state. */
971
+ Parse error. Reconsume the EOF character in the data state. */
985
972
$ this ->emitToken (array (
986
973
'type ' => self ::PARSEERROR ,
987
974
'data ' => 'eof-in-attribute-value-single-quote '
988
975
));
989
- $ this ->emitToken ($ this ->token );
990
976
991
977
$ this ->stream ->unget ();
992
978
$ state = 'data ' ;
@@ -1029,13 +1015,11 @@ public function parse() {
1029
1015
1030
1016
} elseif ($ char === false ) {
1031
1017
/* EOF
1032
- Parse error. Emit the current tag token. Reconsume
1033
- the character in the data state. */
1018
+ Parse error. Reconsume the EOF character in the data state. */
1034
1019
$ this ->emitToken (array (
1035
1020
'type ' => self ::PARSEERROR ,
1036
1021
'data ' => 'eof-in-attribute-value-no-quotes '
1037
1022
));
1038
- $ this ->emitToken ($ this ->token );
1039
1023
$ this ->stream ->unget ();
1040
1024
$ state = 'data ' ;
1041
1025
@@ -1089,13 +1073,11 @@ public function parse() {
1089
1073
1090
1074
} elseif ($ char === false ) {
1091
1075
/* EOF
1092
- Parse error. Emit the current tag token. Reconsume the EOF
1093
- character in the data state. */
1076
+ Parse error. Reconsume the EOF character in the data state. */
1094
1077
$ this ->emitToken (array (
1095
1078
'type ' => self ::PARSEERROR ,
1096
1079
'data ' => 'unexpected-EOF-after-attribute-value '
1097
1080
));
1098
- $ this ->emitToken ($ this ->token );
1099
1081
$ this ->stream ->unget ();
1100
1082
$ state = 'data ' ;
1101
1083
@@ -1135,13 +1117,11 @@ public function parse() {
1135
1117
1136
1118
} elseif ($ char === false ) {
1137
1119
/* EOF
1138
- Parse error. Emit the current tag token. Reconsume the
1139
- EOF character in the data state. */
1120
+ Parse error. Reconsume the EOF character in the data state. */
1140
1121
$ this ->emitToken (array (
1141
1122
'type ' => self ::PARSEERROR ,
1142
1123
'data ' => 'unexpected-eof-after-self-closing '
1143
1124
));
1144
- $ this ->emitToken ($ this ->token );
1145
1125
$ this ->stream ->unget ();
1146
1126
$ state = 'data ' ;
1147
1127
@@ -1418,6 +1398,24 @@ public function parse() {
1418
1398
U+0020 SPACE
1419
1399
Switch to the before DOCTYPE name state. */
1420
1400
$ state = 'before DOCTYPE name ' ;
1401
+
1402
+ } elseif ($ char === false ) {
1403
+ /* EOF
1404
+ Parse error. Create a new DOCTYPE token. Set its
1405
+ force-quirks flag to on. Emit the token. Reconsume the
1406
+ EOF character in the data state. */
1407
+ $ this ->emitToken (array (
1408
+ 'type ' => self ::PARSEERROR ,
1409
+ 'data ' => 'need-space-after-doctype-but-got-eof '
1410
+ ));
1411
+ $ this ->emitToken (array (
1412
+ 'name ' => '' ,
1413
+ 'type ' => self ::DOCTYPE ,
1414
+ 'force-quirks ' => true ,
1415
+ 'error ' => true
1416
+ ));
1417
+ $ this ->stream ->unget ();
1418
+ $ state = 'data ' ;
1421
1419
1422
1420
} else {
1423
1421
/* Anything else
0 commit comments