| OLD | NEW |
| (Empty) |
| 1 {"tests": [ | |
| 2 | |
| 3 {"description":"< in attribute name", | |
| 4 "input":"<z/0 <>", | |
| 5 "output":["ParseError", "ParseError", ["StartTag", "z", {"0": "", "<": ""}]]}, | |
| 6 | |
| 7 {"description":"< in attribute value", | |
| 8 "input":"<z x=<>", | |
| 9 "output":["ParseError", ["StartTag", "z", {"x": "<"}]]}, | |
| 10 | |
| 11 {"description":"= in unquoted attribute value", | |
| 12 "input":"<z z=z=z>", | |
| 13 "output":["ParseError", ["StartTag", "z", {"z": "z=z"}]]}, | |
| 14 | |
| 15 {"description":"= attribute", | |
| 16 "input":"<z =>", | |
| 17 "output":["ParseError", ["StartTag", "z", {"=": ""}]]}, | |
| 18 | |
| 19 {"description":"== attribute", | |
| 20 "input":"<z ==>", | |
| 21 "output":["ParseError", "ParseError", ["StartTag", "z", {"=": ""}]]}, | |
| 22 | |
| 23 {"description":"=== attribute", | |
| 24 "input":"<z ===>", | |
| 25 "output":["ParseError", "ParseError", ["StartTag", "z", {"=": "="}]]}, | |
| 26 | |
| 27 {"description":"==== attribute", | |
| 28 "input":"<z ====>", | |
| 29 "output":["ParseError", "ParseError", "ParseError", ["StartTag", "z", {"=": "=="
}]]}, | |
| 30 | |
| 31 {"description":"Allowed \" after ampersand in attribute value", | |
| 32 "input":"<z z=\"&\">", | |
| 33 "output":[["StartTag", "z", {"z": "&"}]]}, | |
| 34 | |
| 35 {"description":"Non-allowed ' after ampersand in attribute value", | |
| 36 "input":"<z z=\"&'\">", | |
| 37 "output":["ParseError", ["StartTag", "z", {"z": "&'"}]]}, | |
| 38 | |
| 39 {"description":"Allowed ' after ampersand in attribute value", | |
| 40 "input":"<z z='&'>", | |
| 41 "output":[["StartTag", "z", {"z": "&"}]]}, | |
| 42 | |
| 43 {"description":"Non-allowed \" after ampersand in attribute value", | |
| 44 "input":"<z z='&\"'>", | |
| 45 "output":["ParseError", ["StartTag", "z", {"z": "&\""}]]}, | |
| 46 | |
| 47 {"description":"Text after bogus character reference", | |
| 48 "input":"<z z='&xlink_xmlns;'>bar<z>", | |
| 49 "output":["ParseError",["StartTag","z",{"z":"&xlink_xmlns;"}],["Character","bar"
],["StartTag","z",{}]]}, | |
| 50 | |
| 51 {"description":"Text after hex character reference", | |
| 52 "input":"<z z='  foo'>bar<z>", | |
| 53 "output":[["StartTag","z",{"z":" foo"}],["Character","bar"],["StartTag","z",{}]
]}, | |
| 54 | |
| 55 {"description":"Attribute name starting with \"", | |
| 56 "input":"<foo \"='bar'>", | |
| 57 "output":["ParseError", ["StartTag", "foo", {"\"": "bar"}]]}, | |
| 58 | |
| 59 {"description":"Attribute name starting with '", | |
| 60 "input":"<foo '='bar'>", | |
| 61 "output":["ParseError", ["StartTag", "foo", {"'": "bar"}]]}, | |
| 62 | |
| 63 {"description":"Attribute name containing \"", | |
| 64 "input":"<foo a\"b='bar'>", | |
| 65 "output":["ParseError", ["StartTag", "foo", {"a\"b": "bar"}]]}, | |
| 66 | |
| 67 {"description":"Attribute name containing '", | |
| 68 "input":"<foo a'b='bar'>", | |
| 69 "output":["ParseError", ["StartTag", "foo", {"a'b": "bar"}]]}, | |
| 70 | |
| 71 {"description":"Unquoted attribute value containing '", | |
| 72 "input":"<foo a=b'c>", | |
| 73 "output":["ParseError", ["StartTag", "foo", {"a": "b'c"}]]}, | |
| 74 | |
| 75 {"description":"Unquoted attribute value containing \"", | |
| 76 "input":"<foo a=b\"c>", | |
| 77 "output":["ParseError", ["StartTag", "foo", {"a": "b\"c"}]]}, | |
| 78 | |
| 79 {"description":"Double-quoted attribute value not followed by whitespace", | |
| 80 "input":"<foo a=\"b\"c>", | |
| 81 "output":["ParseError", ["StartTag", "foo", {"a": "b", "c": ""}]]}, | |
| 82 | |
| 83 {"description":"Single-quoted attribute value not followed by whitespace", | |
| 84 "input":"<foo a='b'c>", | |
| 85 "output":["ParseError", ["StartTag", "foo", {"a": "b", "c": ""}]]}, | |
| 86 | |
| 87 {"description":"Quoted attribute followed by permitted /", | |
| 88 "input":"<br a='b'/>", | |
| 89 "output":[["StartTag","br",{"a":"b"},true]]}, | |
| 90 | |
| 91 {"description":"Quoted attribute followed by non-permitted /", | |
| 92 "input":"<bar a='b'/>", | |
| 93 "output":[["StartTag","bar",{"a":"b"},true]]}, | |
| 94 | |
| 95 {"description":"CR EOF after doctype name", | |
| 96 "input":"<!doctype html \r", | |
| 97 "output":["ParseError", ["DOCTYPE", "html", null, null, false]]}, | |
| 98 | |
| 99 {"description":"CR EOF in tag name", | |
| 100 "input":"<z\r", | |
| 101 "output":["ParseError"]}, | |
| 102 | |
| 103 {"description":"Slash EOF in tag name", | |
| 104 "input":"<z/", | |
| 105 "output":["ParseError"]}, | |
| 106 | |
| 107 {"description":"Zero hex numeric entity", | |
| 108 "input":"�", | |
| 109 "output":["ParseError", "ParseError", ["Character", "\uFFFD"]]}, | |
| 110 | |
| 111 {"description":"Zero decimal numeric entity", | |
| 112 "input":"�", | |
| 113 "output":["ParseError", "ParseError", ["Character", "\uFFFD"]]}, | |
| 114 | |
| 115 {"description":"Zero-prefixed hex numeric entity", | |
| 116 "input":"�
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000041;", | |
| 117 "output":[["Character", "A"]]}, | |
| 118 | |
| 119 {"description":"Zero-prefixed decimal numeric entity", | |
| 120 "input":"�
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000065;", | |
| 121 "output":[["Character", "A"]]}, | |
| 122 | |
| 123 {"description":"Empty hex numeric entities", | |
| 124 "input":"&#x &#X ", | |
| 125 "output":["ParseError", ["Character", "&#x "], "ParseError", ["Character", "&#X
"]]}, | |
| 126 | |
| 127 {"description":"Empty decimal numeric entities", | |
| 128 "input":"&# &#; ", | |
| 129 "output":["ParseError", ["Character", "&# "], "ParseError", ["Character", "&#; "
]]}, | |
| 130 | |
| 131 {"description":"Non-BMP numeric entity", | |
| 132 "input":"𐀀", | |
| 133 "output":[["Character", "\uD800\uDC00"]]}, | |
| 134 | |
| 135 {"description":"Maximum non-BMP numeric entity", | |
| 136 "input":"", | |
| 137 "output":["ParseError", ["Character", "\uDBFF\uDFFF"]]}, | |
| 138 | |
| 139 {"description":"Above maximum numeric entity", | |
| 140 "input":"�", | |
| 141 "output":["ParseError", ["Character", "\uFFFD"]]}, | |
| 142 | |
| 143 {"description":"32-bit hex numeric entity", | |
| 144 "input":"�", | |
| 145 "output":["ParseError", ["Character", "\uFFFD"]]}, | |
| 146 | |
| 147 {"description":"33-bit hex numeric entity", | |
| 148 "input":"�", | |
| 149 "output":["ParseError", ["Character", "\uFFFD"]]}, | |
| 150 | |
| 151 {"description":"33-bit decimal numeric entity", | |
| 152 "input":"�", | |
| 153 "output":["ParseError", ["Character", "\uFFFD"]]}, | |
| 154 | |
| 155 {"description":"65-bit hex numeric entity", | |
| 156 "input":"�", | |
| 157 "output":["ParseError", ["Character", "\uFFFD"]]}, | |
| 158 | |
| 159 {"description":"65-bit decimal numeric entity", | |
| 160 "input":"�", | |
| 161 "output":["ParseError", ["Character", "\uFFFD"]]}, | |
| 162 | |
| 163 {"description":"Surrogate code point edge cases", | |
| 164 "input":"퟿����", | |
| 165 "output":[["Character", "\uD7FF"], "ParseError", ["Character", "\uFFFD"], "Parse
Error", ["Character", "\uFFFD"], "ParseError", ["Character", "\uFFFD"], "ParseEr
ror", ["Character", "\uFFFD\uE000"]]}, | |
| 166 | |
| 167 {"description":"Uppercase start tag name", | |
| 168 "input":"<X>", | |
| 169 "output":[["StartTag", "x", {}]]}, | |
| 170 | |
| 171 {"description":"Uppercase end tag name", | |
| 172 "input":"</X>", | |
| 173 "output":[["EndTag", "x"]]}, | |
| 174 | |
| 175 {"description":"Uppercase attribute name", | |
| 176 "input":"<x X>", | |
| 177 "output":[["StartTag", "x", { "x":"" }]]}, | |
| 178 | |
| 179 {"description":"Tag/attribute name case edge values", | |
| 180 "input":"<x@AZ[`az{ @AZ[`az{>", | |
| 181 "output":[["StartTag", "x@az[`az{", { "@az[`az{":"" }]]}, | |
| 182 | |
| 183 {"description":"Duplicate different-case attributes", | |
| 184 "input":"<x x=1 x=2 X=3>", | |
| 185 "output":["ParseError", "ParseError", ["StartTag", "x", { "x":"1" }]]}, | |
| 186 | |
| 187 {"description":"Uppercase close tag attributes", | |
| 188 "input":"</x X>", | |
| 189 "output":["ParseError", ["EndTag", "x"]]}, | |
| 190 | |
| 191 {"description":"Duplicate close tag attributes", | |
| 192 "input":"</x x x>", | |
| 193 "output":["ParseError", "ParseError", ["EndTag", "x"]]}, | |
| 194 | |
| 195 {"description":"Permitted slash", | |
| 196 "input":"<br/>", | |
| 197 "output":[["StartTag","br",{},true]]}, | |
| 198 | |
| 199 {"description":"Non-permitted slash", | |
| 200 "input":"<xr/>", | |
| 201 "output":[["StartTag","xr",{},true]]}, | |
| 202 | |
| 203 {"description":"Permitted slash but in close tag", | |
| 204 "input":"</br/>", | |
| 205 "output":["ParseError", ["EndTag", "br"]]}, | |
| 206 | |
| 207 {"description":"Doctype public case-sensitivity (1)", | |
| 208 "input":"<!DoCtYpE HtMl PuBlIc \"AbC\" \"XyZ\">", | |
| 209 "output":[["DOCTYPE", "html", "AbC", "XyZ", true]]}, | |
| 210 | |
| 211 {"description":"Doctype public case-sensitivity (2)", | |
| 212 "input":"<!dOcTyPe hTmL pUbLiC \"aBc\" \"xYz\">", | |
| 213 "output":[["DOCTYPE", "html", "aBc", "xYz", true]]}, | |
| 214 | |
| 215 {"description":"Doctype system case-sensitivity (1)", | |
| 216 "input":"<!DoCtYpE HtMl SyStEm \"XyZ\">", | |
| 217 "output":[["DOCTYPE", "html", null, "XyZ", true]]}, | |
| 218 | |
| 219 {"description":"Doctype system case-sensitivity (2)", | |
| 220 "input":"<!dOcTyPe hTmL sYsTeM \"xYz\">", | |
| 221 "output":[["DOCTYPE", "html", null, "xYz", true]]}, | |
| 222 | |
| 223 {"description":"U+0000 in lookahead region after non-matching character", | |
| 224 "input":"<!doc>\u0000", | |
| 225 "output":["ParseError", ["Comment", "doc"], "ParseError", ["Character", "\u0000"
]], | |
| 226 "ignoreErrorOrder":true}, | |
| 227 | |
| 228 {"description":"U+0000 in lookahead region", | |
| 229 "input":"<!doc\u0000", | |
| 230 "output":["ParseError", ["Comment", "doc\uFFFD"]], | |
| 231 "ignoreErrorOrder":true}, | |
| 232 | |
| 233 {"description":"U+0080 in lookahead region", | |
| 234 "input":"<!doc\u0080", | |
| 235 "output":["ParseError", "ParseError", ["Comment", "doc\u0080"]], | |
| 236 "ignoreErrorOrder":true}, | |
| 237 | |
| 238 {"description":"U+FDD1 in lookahead region", | |
| 239 "input":"<!doc\uFDD1", | |
| 240 "output":["ParseError", "ParseError", ["Comment", "doc\uFDD1"]], | |
| 241 "ignoreErrorOrder":true}, | |
| 242 | |
| 243 {"description":"U+1FFFF in lookahead region", | |
| 244 "input":"<!doc\uD83F\uDFFF", | |
| 245 "output":["ParseError", "ParseError", ["Comment", "doc\uD83F\uDFFF"]], | |
| 246 "ignoreErrorOrder":true}, | |
| 247 | |
| 248 {"description":"CR followed by non-LF", | |
| 249 "input":"\r?", | |
| 250 "output":[["Character", "\n?"]]}, | |
| 251 | |
| 252 {"description":"CR at EOF", | |
| 253 "input":"\r", | |
| 254 "output":[["Character", "\n"]]}, | |
| 255 | |
| 256 {"description":"LF at EOF", | |
| 257 "input":"\n", | |
| 258 "output":[["Character", "\n"]]}, | |
| 259 | |
| 260 {"description":"CR LF", | |
| 261 "input":"\r\n", | |
| 262 "output":[["Character", "\n"]]}, | |
| 263 | |
| 264 {"description":"CR CR", | |
| 265 "input":"\r\r", | |
| 266 "output":[["Character", "\n\n"]]}, | |
| 267 | |
| 268 {"description":"LF LF", | |
| 269 "input":"\n\n", | |
| 270 "output":[["Character", "\n\n"]]}, | |
| 271 | |
| 272 {"description":"LF CR", | |
| 273 "input":"\n\r", | |
| 274 "output":[["Character", "\n\n"]]}, | |
| 275 | |
| 276 {"description":"text CR CR CR text", | |
| 277 "input":"text\r\r\rtext", | |
| 278 "output":[["Character", "text\n\n\ntext"]]}, | |
| 279 | |
| 280 {"description":"Doctype publik", | |
| 281 "input":"<!DOCTYPE html PUBLIK \"AbC\" \"XyZ\">", | |
| 282 "output":["ParseError", ["DOCTYPE", "html", null, null, false]]}, | |
| 283 | |
| 284 {"description":"Doctype publi", | |
| 285 "input":"<!DOCTYPE html PUBLI", | |
| 286 "output":["ParseError", ["DOCTYPE", "html", null, null, false]]}, | |
| 287 | |
| 288 {"description":"Doctype sistem", | |
| 289 "input":"<!DOCTYPE html SISTEM \"AbC\">", | |
| 290 "output":["ParseError", ["DOCTYPE", "html", null, null, false]]}, | |
| 291 | |
| 292 {"description":"Doctype sys", | |
| 293 "input":"<!DOCTYPE html SYS", | |
| 294 "output":["ParseError", ["DOCTYPE", "html", null, null, false]]}, | |
| 295 | |
| 296 {"description":"Doctype html x>text", | |
| 297 "input":"<!DOCTYPE html x>text", | |
| 298 "output":["ParseError", ["DOCTYPE", "html", null, null, false], ["Character", "t
ext"]]}, | |
| 299 | |
| 300 {"description":"Grave accent in unquoted attribute", | |
| 301 "input":"<a a=aa`>", | |
| 302 "output":["ParseError", ["StartTag", "a", {"a":"aa`"}]]}, | |
| 303 | |
| 304 {"description":"EOF in tag name state ", | |
| 305 "input":"<a", | |
| 306 "output":["ParseError"]}, | |
| 307 | |
| 308 {"description":"EOF in tag name state", | |
| 309 "input":"<a", | |
| 310 "output":["ParseError"]}, | |
| 311 | |
| 312 {"description":"EOF in before attribute name state", | |
| 313 "input":"<a ", | |
| 314 "output":["ParseError"]}, | |
| 315 | |
| 316 {"description":"EOF in attribute name state", | |
| 317 "input":"<a a", | |
| 318 "output":["ParseError"]}, | |
| 319 | |
| 320 {"description":"EOF in after attribute name state", | |
| 321 "input":"<a a ", | |
| 322 "output":["ParseError"]}, | |
| 323 | |
| 324 {"description":"EOF in before attribute value state", | |
| 325 "input":"<a a =", | |
| 326 "output":["ParseError"]}, | |
| 327 | |
| 328 {"description":"EOF in attribute value (double quoted) state", | |
| 329 "input":"<a a =\"a", | |
| 330 "output":["ParseError"]}, | |
| 331 | |
| 332 {"description":"EOF in attribute value (single quoted) state", | |
| 333 "input":"<a a ='a", | |
| 334 "output":["ParseError"]}, | |
| 335 | |
| 336 {"description":"EOF in attribute value (unquoted) state", | |
| 337 "input":"<a a =a", | |
| 338 "output":["ParseError"]}, | |
| 339 | |
| 340 {"description":"EOF in after attribute value state", | |
| 341 "input":"<a a ='a'", | |
| 342 "output":["ParseError"]} | |
| 343 | |
| 344 ]} | |
| OLD | NEW |