Skip to content

Commit 9ec9f26

Browse files
authored
Merge pull request #25 from HTMLParseErrorWG/review-fixes2
Review fixes2
2 parents b13e570 + 7b6415d commit 9ec9f26

10 files changed

+12
-21
lines changed

tokenizer/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ Basic Structure
1414
    "output": [expected_output_tokens],
1515
    "initialStates": [initial_states],
1616
    "lastStartTag": last_start_tag,
17-
    "ignoreErrorOrder": ignore_error_order
17+
"errors": [parse_errors]
1818
    }
1919
]}
2020

2121
Multiple tests per file are allowed simply by adding more objects to the
2222
"tests" list.
2323

24+
Each parse error is an object that contains error `code` and one-based
25+
error location indices: `line` and `col`.
26+
2427
`description`, `input` and `output` are always present. The other values
2528
are optional.
2629

tokenizer/test4.test

-5
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@
355355
{"description":"U+0000 in lookahead region after non-matching character",
356356
"input":"<!doc>\u0000",
357357
"output":[["Comment", "doc"], ["Character", "\u0000"]],
358-
"ignoreErrorOrder":true,
359358
"errors":[
360359
{ "code": "incorrectly-opened-comment", "line": 1, "col": 3 },
361360
{ "code": "unexpected-null-character", "line": 1, "col": 7 }
@@ -364,15 +363,13 @@
364363
{"description":"U+0000 in lookahead region",
365364
"input":"<!doc\u0000",
366365
"output":[["Comment", "doc\uFFFD"]],
367-
"ignoreErrorOrder":true,
368366
"errors":[
369367
{ "code": "incorrectly-opened-comment", "line": 1, "col": 3 }
370368
]},
371369

372370
{"description":"U+0080 in lookahead region",
373371
"input":"<!doc\u0080",
374372
"output":[["Comment", "doc\u0080"]],
375-
"ignoreErrorOrder":true,
376373
"errors":[
377374
{ "code": "incorrectly-opened-comment", "line": 1, "col": 3 },
378375
{ "code": "control-character-in-input-stream", "line": 1, "col": 6 }
@@ -381,7 +378,6 @@
381378
{"description":"U+FDD1 in lookahead region",
382379
"input":"<!doc\uFDD1",
383380
"output":[["Comment", "doc\uFDD1"]],
384-
"ignoreErrorOrder":true,
385381
"errors":[
386382
{ "code": "incorrectly-opened-comment", "line": 1, "col": 3 },
387383
{ "code": "noncharacter-in-input-stream", "line": 1, "col": 6 }
@@ -390,7 +386,6 @@
390386
{"description":"U+1FFFF in lookahead region",
391387
"input":"<!doc\uD83F\uDFFF",
392388
"output":[["Comment", "doc\uD83F\uDFFF"]],
393-
"ignoreErrorOrder":true,
394389
"errors":[
395390
{ "code": "incorrectly-opened-comment", "line": 1, "col": 3 },
396391
{ "code": "noncharacter-in-input-stream", "line": 1, "col": 6 }

tokenizer/unicodeCharsProblematic.test

-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"doubleEscaped":true,
44
"input": "\\uDFFF",
55
"output":[["Character", "\\uDFFF"]],
6-
"ignoreErrorOrder":true,
76
"errors":[
87
{ "code": "surrogate-in-input-stream", "line": 1, "col": 1 }
98
]},
@@ -12,7 +11,6 @@
1211
"doubleEscaped":true,
1312
"input": "\\uD800",
1413
"output":[["Character", "\\uD800"]],
15-
"ignoreErrorOrder":true,
1614
"errors":[
1715
{ "code": "surrogate-in-input-stream", "line": 1, "col": 1 }
1816
]},
@@ -21,7 +19,6 @@
2119
"doubleEscaped":true,
2220
"input": "a\\uDFFF",
2321
"output":[["Character", "a"], ["Character", "\\uDFFF"]],
24-
"ignoreErrorOrder":true,
2522
"errors":[
2623
{ "code": "surrogate-in-input-stream", "line": 1, "col": 2 }
2724
]},
@@ -30,15 +27,13 @@
3027
"doubleEscaped":true,
3128
"input": "\\uD800a",
3229
"output":[["Character", "\\uD800a"]],
33-
"ignoreErrorOrder":true,
3430
"errors":[
3531
{ "code": "surrogate-in-input-stream", "line": 1, "col": 1 }
3632
]},
3733

3834
{"description":"CR followed by U+0000",
3935
"input":"\r\u0000",
4036
"output":[["Character", "\n"], ["Character", "\u0000"]],
41-
"ignoreErrorOrder":true,
4237
"errors":[
4338
{ "code": "unexpected-null-character", "line": 2, "col": 1 }
4439
]}

tokenizer/xmlViolation.test

-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
{"description":"Non-XML character",
44
"input":"a\uFFFFb",
5-
"ignoreErrorOrder":true,
65
"output":[["Character","a\uFFFDb"]]},
76

87
{"description":"Non-XML space",
98
"input":"a\u000Cb",
10-
"ignoreErrorOrder":true,
119
"output":[["Character","a b"]]},
1210

1311
{"description":"Double hyphen in comment",

tree-construction/doctype01.dat

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@
378378
| <body>
379379

380380
#data
381-
<!DOCTYPE root-element [SYSTEM OR PUBLIC FPI] "uri" [
381+
<!DOCTYPE root-element [SYSTEM OR PUBLIC FPI] "uri" [
382382
<!-- internal declarations -->
383383
]>
384384
#errors

tree-construction/html5test-com.dat

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#data
1313
<div foo<bar=''>
1414
#errors
15-
(1,9): unexpected-character-in-attribute-name
15+
(1,9): invalid-character-in-attribute-name
1616
(1,16): expected-doctype-but-got-start-tag
1717
(1,16): expected-closing-tag-but-got-eof
1818
#new-errors
@@ -28,7 +28,7 @@
2828
<div foo=`bar`>
2929
#errors
3030
(1,10): equals-in-unquoted-attribute-value
31-
(1,14): missing-whitespace-between-attributes
31+
(1,14): unexpected-character-in-unquoted-attribute-value
3232
(1,15): expected-doctype-but-got-start-tag
3333
(1,15): expected-closing-tag-but-got-eof
3434
#new-errors
@@ -44,7 +44,7 @@
4444
#data
4545
<div \"foo=''>
4646
#errors
47-
(1,7): unexpected-character-in-attribute-name
47+
(1,7): invalid-character-in-attribute-name
4848
(1,14): expected-doctype-but-got-start-tag
4949
(1,14): expected-closing-tag-but-got-eof
5050
#new-errors

tree-construction/tests2.dat

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
#data
235235
<!DOCTYPE html></b test<b &=&amp>X
236236
#errors
237-
(1,24): unexpected-character-in-attribute-name
237+
(1,24): invalid-character-in-attribute-name
238238
(1,32): named-entity-without-semicolon
239239
(1,33): attributes-in-end-tag
240240
(1,33): unexpected-end-tag-before-html

tree-construction/tests26.dat

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265

266266
#errors
267267
(1,3): expected-doctype-but-got-start-tag
268-
(1,11): unexpected-character-in-attribute-name
268+
(1,11): invalid-character-in-attribute-name
269269
(1,12): unexpected-character-after-solidus-in-tag
270270
(1,21): unexpected-end-tag
271271
(2,0): expected-closing-tag-but-got-eof

tree-construction/webkit01.dat

+1-1
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ console.log("FOO<span>BAR</span>BAZ");
622622
#data
623623
<img <="" FAIL>
624624
#errors
625-
(1,6): unexpected-character-in-attribute-name
625+
(1,6): invalid-character-in-attribute-name
626626
(1,15): expected-doctype-but-got-start-tag
627627
#new-errors
628628
(1:6) unexpected-character-in-attribute-name

tree-construction/webkit02.dat

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<html><body><img src="" border="0" alt="><div>A</div></body></html>
6060
#errors
6161
(1,6): expected-doctype-but-got-start-tag
62-
(1,67): eof-in-tag-double-quote
62+
(1,67): eof-in-attribute-value-double-quote
6363
#new-errors
6464
(1:68) eof-in-tag
6565
#document

0 commit comments

Comments
 (0)