errors: 1
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| \"<!--<noscript>\"\n| <body>\n| \"-->\"\n"
}, {
name: "tests16.dat #85"
html: "<!doctype html><noscript><!--<noscript></noscript>--></noscript>"
errors: 1
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| \"<!--<noscript>\"\n| <body>\n| \"-->\"\n"
}, {
name: "tests16.dat #85"
html: "<!doctype html><noscript><!--<noscript></noscript>--></noscript>"
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| <!-- <noscript></noscript> -->\n| <body>\n"
}, {
name: "tests16.dat #86"
html: "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>"
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| <!-- <noscript></noscript> -->\n| <body>\n"
}, {
name: "tests16.dat #86"
html: "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>"
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| \"<!--\"\n| <body>\n| \"X\"\n| <noscript>\n| \"-->\"\n"
}, {
name: "tests16.dat #87"
html: "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>"
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| \"<!--\"\n| <body>\n| \"X\"\n| <noscript>\n| \"-->\"\n"
}, {
name: "tests16.dat #87"
html: "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>"
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| <!-- </noscript>X<noscript> -->\n| <body>\n"
}, {
name: "tests16.dat #88"
html: "<!doctype html><noscript><iframe></noscript>X"
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| <!-- </noscript>X<noscript> -->\n| <body>\n"
}, {
name: "tests16.dat #88"
html: "<!doctype html><noscript><iframe></noscript>X"
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| \"<iframe>\"\n| <body>\n| \"X\"\n"
}, {
name: "tests16.dat #89"
html: "<!doctype html><noscript><iframe></noscript>X"
expected: "| <!DOCTYPE html>\n| <html>\n| <head>\n| <noscript>\n| \"<iframe>\"\n| <body>\n| \"X\"\n"
}, {
name: "tests16.dat #89"
html: "<!doctype html><noscript><iframe></noscript>X"
errors: 2
expected: "| <html>\n| <head>\n| <noscript>\n| \"<!--<noscript>\"\n| <body>\n| \"-->\"\n"
}, {
name: "tests16.dat #182"
html: "<noscript><!--<noscript></noscript>--></noscript>"
errors: 2
expected: "| <html>\n| <head>\n| <noscript>\n| \"<!--<noscript>\"\n| <body>\n| \"-->\"\n"
}, {
name: "tests16.dat #182"
html: "<noscript><!--<noscript></noscript>--></noscript>"
errors: 1
expected: "| <html>\n| <head>\n| <noscript>\n| <!-- <noscript></noscript> -->\n| <body>\n"
}, {
name: "tests16.dat #183"
html: "<noscript><!--</noscript>X<noscript>--></noscript>"
errors: 1
expected: "| <html>\n| <head>\n| <noscript>\n| <!-- <noscript></noscript> -->\n| <body>\n"
}, {
name: "tests16.dat #183"
html: "<noscript><!--</noscript>X<noscript>--></noscript>"
errors: 1
expected: "| <html>\n| <head>\n| <noscript>\n| \"<!--\"\n| <body>\n| \"X\"\n| <noscript>\n| \"-->\"\n"
}, {
name: "tests16.dat #184"
html: "<noscript><!--</noscript>X<noscript>--></noscript>"
errors: 1
expected: "| <html>\n| <head>\n| <noscript>\n| \"<!--\"\n| <body>\n| \"X\"\n| <noscript>\n| \"-->\"\n"
}, {
name: "tests16.dat #184"
html: "<noscript><!--</noscript>X<noscript>--></noscript>"
errors: 1
expected: "| <html>\n| <head>\n| <noscript>\n| <!-- </noscript>X<noscript> -->\n| <body>\n"
}, {
name: "tests16.dat #185"
html: "<noscript><iframe></noscript>X"
errors: 1
expected: "| <html>\n| <head>\n| <noscript>\n| <!-- </noscript>X<noscript> -->\n| <body>\n"
}, {
name: "tests16.dat #185"
html: "<noscript><iframe></noscript>X"
errors: 1
expected: "| <html>\n| <head>\n| <noscript>\n| \"<iframe>\"\n| <body>\n| \"X\"\n"
}, {
name: "tests16.dat #186"
html: "<noscript><iframe></noscript>X"
errors: 1
expected: "| <html>\n| <head>\n| <noscript>\n| \"<iframe>\"\n| <body>\n| \"X\"\n"
}, {
name: "tests16.dat #186"
html: "<noscript><iframe></noscript>X"
errors: 2
expected: "| <html>\n| <head>\n| <noscript>\n| \"<!--\"\n| <body>\n| \"-->\"\n"
}, {
name: "tests5.dat #17"
html: "<noscript><!--</noscript>--></noscript>"
errors: 2
expected: "| <html>\n| <head>\n| <noscript>\n| \"<!--\"\n| <body>\n| \"-->\"\n"
}, {
name: "tests5.dat #17"
html: "<noscript><!--</noscript>--></noscript>"
errors: 1
expected: "| <html>\n| <head>\n| <body>\n| <p>\n| id=\"status\"\n| <noscript>\n| \"<strong>A</strong>\"\n| <span>\n| \"B\"\n"
}, {
name: "webkit02.dat #3"
html: "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
errors: 1
expected: "| <html>\n| <head>\n| <body>\n| <p>\n| id=\"status\"\n| <noscript>\n| \"<strong>A</strong>\"\n| <span>\n| \"B\"\n"
}, {
name: "webkit02.dat #3"
html: "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
attr_keys = []
for k of el.attrs
attr_keys.push k
attr_keys.sort() # TODO this should be "lexicographically by UTF-16 code unit"
for k in attr_keys
ret += "#{prefix} #{k}=\"#{el.attrs[k]}\"\n"
attr_keys = []
for k of el.attrs
attr_keys.push k
attr_keys.sort() # TODO this should be "lexicographically by UTF-16 code unit"
for k in attr_keys
ret += "#{prefix} #{k}=\"#{el.attrs[k]}\"\n"
- # FIXME template shows as "content" with children below it
- ret += serialize_els el.children, "#{prefix} "
+ if el.name is 'template' # ?check ns
+ ret += "#{prefix} content\n"
+ ret += serialize_els el.children, "#{prefix} "
+ else
+ ret += serialize_els el.children, "#{prefix} "
- ret += "#{prefix}<!DOCTYPE#{el.name}>\n" # FIXME add ids
+ ret += "#{prefix}<!DOCTYPE #{el.name}"
+ if (el.public_identifier? and el.public_identifier.length > 0) or (el.system_identifier? and el.system_identifier.length > 0)
+ ret += " \"#{el.public_identifier ? ''}\""
+ ret += " \"#{el.system_identifier ? ''}\""
+ ret += ">\n"
serialized = serialize_els parsed
if serialized isnt args.expected
#wheic.debug_log_each (str) ->
# console.log str
console.log "FAILED: \"#{args.name}\""
console.log " Input: #{args.html}"
serialized = serialize_els parsed
if serialized isnt args.expected
#wheic.debug_log_each (str) ->
# console.log str
console.log "FAILED: \"#{args.name}\""
console.log " Input: #{args.html}"
console.log " Correct: #{args.expected}"
console.log " Output: #{serialized}"
if parse_errors.length > 0
console.log " Correct: #{args.expected}"
console.log " Output: #{serialized}"
if parse_errors.length > 0
- console.log "Tests passed: #{test_results.passed}"
- console.log "Tests Failed: #{test_results.failed}"
+ console.log "Tests passed: #{test_results.passed}, Failed: #{test_results.failed}, ignored: #{test_results.fragment}"