1{ 2 "tests": [ 3 { 4 "fragmentContext": null, 5 "description": "<!DOCTYPE html><p><b><i><u></p> <p>X", 6 "input": "<!DOCTYPE html><p><b><i><u></p> <p>X", 7 "output": [ 8 [ 9 "DOCTYPE", 10 "html", 11 null, 12 null, 13 true 14 ], 15 [ 16 "StartTag", 17 "p", 18 {} 19 ], 20 [ 21 "StartTag", 22 "b", 23 {} 24 ], 25 [ 26 "StartTag", 27 "i", 28 {} 29 ], 30 [ 31 "StartTag", 32 "u", 33 {} 34 ], 35 [ 36 "EndTag", 37 "p" 38 ], 39 [ 40 "Character", 41 " " 42 ], 43 [ 44 "StartTag", 45 "p", 46 {} 47 ], 48 [ 49 "Character", 50 "X" 51 ] 52 ] 53 }, 54 { 55 "fragmentContext": null, 56 "description": "<p><b><i><u></p>\\n<p>X", 57 "input": "<p><b><i><u></p>\n<p>X", 58 "output": [ 59 [ 60 "StartTag", 61 "p", 62 {} 63 ], 64 [ 65 "StartTag", 66 "b", 67 {} 68 ], 69 [ 70 "StartTag", 71 "i", 72 {} 73 ], 74 [ 75 "StartTag", 76 "u", 77 {} 78 ], 79 [ 80 "EndTag", 81 "p" 82 ], 83 [ 84 "Character", 85 "\n" 86 ], 87 [ 88 "StartTag", 89 "p", 90 {} 91 ], 92 [ 93 "Character", 94 "X" 95 ] 96 ] 97 }, 98 { 99 "fragmentContext": null, 100 "description": "<!doctype html></html> <head>", 101 "input": "<!doctype html></html> <head>", 102 "output": [ 103 [ 104 "DOCTYPE", 105 "html", 106 null, 107 null, 108 true 109 ], 110 [ 111 "EndTag", 112 "html" 113 ], 114 [ 115 "Character", 116 " " 117 ], 118 [ 119 "StartTag", 120 "head", 121 {} 122 ] 123 ] 124 }, 125 { 126 "fragmentContext": null, 127 "description": "<!doctype html></body><meta>", 128 "input": "<!doctype html></body><meta>", 129 "output": [ 130 [ 131 "DOCTYPE", 132 "html", 133 null, 134 null, 135 true 136 ], 137 [ 138 "EndTag", 139 "body" 140 ], 141 [ 142 "StartTag", 143 "meta", 144 {} 145 ] 146 ] 147 }, 148 { 149 "fragmentContext": null, 150 "description": "<html></html><!-- foo -->", 151 "input": "<html></html><!-- foo -->", 152 "output": [ 153 [ 154 "StartTag", 155 "html", 156 {} 157 ], 158 [ 159 "EndTag", 160 "html" 161 ], 162 [ 163 "Comment", 164 " foo " 165 ] 166 ] 167 }, 168 { 169 "fragmentContext": null, 170 "description": "<!doctype html></body><title>X</title>", 171 "input": "<!doctype html></body><title>X</title>", 172 "output": [ 173 [ 174 "DOCTYPE", 175 "html", 176 null, 177 null, 178 true 179 ], 180 [ 181 "EndTag", 182 "body" 183 ], 184 [ 185 "StartTag", 186 "title", 187 {} 188 ], 189 [ 190 "Character", 191 "X" 192 ], 193 [ 194 "EndTag", 195 "title" 196 ] 197 ] 198 }, 199 { 200 "fragmentContext": null, 201 "description": "<!doctype html><table> X<meta></table>", 202 "input": "<!doctype html><table> X<meta></table>", 203 "output": [ 204 [ 205 "DOCTYPE", 206 "html", 207 null, 208 null, 209 true 210 ], 211 [ 212 "StartTag", 213 "table", 214 {} 215 ], 216 [ 217 "Character", 218 " X" 219 ], 220 [ 221 "StartTag", 222 "meta", 223 {} 224 ], 225 [ 226 "EndTag", 227 "table" 228 ] 229 ] 230 }, 231 { 232 "fragmentContext": null, 233 "description": "<!doctype html><table> x</table>", 234 "input": "<!doctype html><table> x</table>", 235 "output": [ 236 [ 237 "DOCTYPE", 238 "html", 239 null, 240 null, 241 true 242 ], 243 [ 244 "StartTag", 245 "table", 246 {} 247 ], 248 [ 249 "Character", 250 " x" 251 ], 252 [ 253 "EndTag", 254 "table" 255 ] 256 ] 257 }, 258 { 259 "fragmentContext": null, 260 "description": "<!doctype html><table> x </table>", 261 "input": "<!doctype html><table> x </table>", 262 "output": [ 263 [ 264 "DOCTYPE", 265 "html", 266 null, 267 null, 268 true 269 ], 270 [ 271 "StartTag", 272 "table", 273 {} 274 ], 275 [ 276 "Character", 277 " x " 278 ], 279 [ 280 "EndTag", 281 "table" 282 ] 283 ] 284 }, 285 { 286 "fragmentContext": null, 287 "description": "<!doctype html><table><tr> x</table>", 288 "input": "<!doctype html><table><tr> x</table>", 289 "output": [ 290 [ 291 "DOCTYPE", 292 "html", 293 null, 294 null, 295 true 296 ], 297 [ 298 "StartTag", 299 "table", 300 {} 301 ], 302 [ 303 "StartTag", 304 "tr", 305 {} 306 ], 307 [ 308 "Character", 309 " x" 310 ], 311 [ 312 "EndTag", 313 "table" 314 ] 315 ] 316 }, 317 { 318 "fragmentContext": null, 319 "description": "<!doctype html><table>X<style> <tr>x </style> </table>", 320 "input": "<!doctype html><table>X<style> <tr>x </style> </table>", 321 "output": [ 322 [ 323 "DOCTYPE", 324 "html", 325 null, 326 null, 327 true 328 ], 329 [ 330 "StartTag", 331 "table", 332 {} 333 ], 334 [ 335 "Character", 336 "X" 337 ], 338 [ 339 "StartTag", 340 "style", 341 {} 342 ], 343 [ 344 "Character", 345 " <tr>x " 346 ], 347 [ 348 "EndTag", 349 "style" 350 ], 351 [ 352 "Character", 353 " " 354 ], 355 [ 356 "EndTag", 357 "table" 358 ] 359 ] 360 }, 361 { 362 "fragmentContext": null, 363 "description": "<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div>", 364 "input": "<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div>", 365 "output": [ 366 [ 367 "DOCTYPE", 368 "html", 369 null, 370 null, 371 true 372 ], 373 [ 374 "StartTag", 375 "div", 376 {} 377 ], 378 [ 379 "StartTag", 380 "table", 381 {} 382 ], 383 [ 384 "StartTag", 385 "a", 386 {} 387 ], 388 [ 389 "Character", 390 "foo" 391 ], 392 [ 393 "EndTag", 394 "a" 395 ], 396 [ 397 "Character", 398 " " 399 ], 400 [ 401 "StartTag", 402 "tr", 403 {} 404 ], 405 [ 406 "StartTag", 407 "td", 408 {} 409 ], 410 [ 411 "Character", 412 "bar" 413 ], 414 [ 415 "EndTag", 416 "td" 417 ], 418 [ 419 "Character", 420 " " 421 ], 422 [ 423 "EndTag", 424 "tr" 425 ], 426 [ 427 "EndTag", 428 "table" 429 ], 430 [ 431 "EndTag", 432 "div" 433 ] 434 ] 435 }, 436 { 437 "fragmentContext": null, 438 "description": "<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes>", 439 "input": "<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes>", 440 "output": [ 441 [ 442 "StartTag", 443 "frame", 444 {} 445 ], 446 [ 447 "EndTag", 448 "frame" 449 ], 450 [ 451 "EndTag", 452 "frame" 453 ], 454 [ 455 "StartTag", 456 "frameset", 457 {} 458 ], 459 [ 460 "StartTag", 461 "frame", 462 {} 463 ], 464 [ 465 "StartTag", 466 "frameset", 467 {} 468 ], 469 [ 470 "StartTag", 471 "frame", 472 {} 473 ], 474 [ 475 "EndTag", 476 "frameset" 477 ], 478 [ 479 "StartTag", 480 "noframes", 481 {} 482 ], 483 [ 484 "Character", 485 "</frameset><noframes>" 486 ] 487 ] 488 }, 489 { 490 "fragmentContext": null, 491 "description": "<!DOCTYPE html><object></html>", 492 "input": "<!DOCTYPE html><object></html>", 493 "output": [ 494 [ 495 "DOCTYPE", 496 "html", 497 null, 498 null, 499 true 500 ], 501 [ 502 "StartTag", 503 "object", 504 {} 505 ], 506 [ 507 "EndTag", 508 "html" 509 ] 510 ] 511 } 512 ] 513}