aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/html/parse_test.go
AgeCommit message (Collapse)Author
2012-01-25html: move the HTML parser to an exp/html package. The parser is aNigel Tao
work in progress, and we are not ready to freeze its API for Go 1. Package html still exists, containing just two functions: EscapeString and UnescapeString. Both the packages at exp/html and html are "package html". The former is a superset of the latter. At some point in the future, the exp/html code will move back into html, once we have finalized the parser API. R=rsc, dsymonds CC=golang-dev https://golang.org/cl/5571059
2012-01-19html: in foreign content, check for HTML integration points in breakoutNigel Tao
elements. Pass tests10.dat, test 33: <!DOCTYPE html><svg><desc><svg><ul>a | <!DOCTYPE html> | <html> | <head> | <body> | <svg svg> | <svg desc> | <svg svg> | <ul> | "a" Also pass test 34: <!DOCTYPE html><p><svg><desc><p> R=andybalholm, dsymonds CC=golang-dev https://golang.org/cl/5536048
2012-01-11html: propagate foreign namespaces only when adding foreign content.Nigel Tao
Pass tests10.dat, test 31: <div><svg><path><foreignObject><p></div>a | <html> | <head> | <body> | <div> | <svg svg> | <svg path> | <svg foreignObject> | <p> | "a" Also pass test 32: <!DOCTYPE html><svg><desc><div><svg><ul>a R=andybalholm CC=golang-dev https://golang.org/cl/5527064
2012-01-10html: foreign element HTML integration points, tag name adjustment,Nigel Tao
shorten the MathML namespace abbreviation from "mathml" to "math". Python's html5lib uses "mathml", but I think that that is an internal implementation detail; the test cases use "math". Pass tests10.dat, test 30: <div><svg><path><foreignObject><math></div>a | <html> | <head> | <body> | <div> | <svg svg> | <svg path> | <svg foreignObject> | <math math> | "a" R=andybalholm CC=golang-dev https://golang.org/cl/5529044
2012-01-04html: parse <frameset> inside bodyAndrew Balholm
Pass tests6.dat, test 47: <param><frameset></frameset> | <html> | <head> | <frameset> Also pass remaining tests in tests6.dat. R=nigeltao CC=golang-dev https://golang.org/cl/5489136
2011-12-25html: adjust foreign attributes.Nigel Tao
Pass tests10.dat, test 22: <!DOCTYPE html><body xlink:href=foo><svg xlink:href=foo></svg> | <!DOCTYPE html> | <html> | <head> | <body> | xlink:href="foo" | <svg svg> | xlink href="foo" Also pass tests through test 29: <div><svg><path></svg><path> R=andybalholm CC=golang-dev https://golang.org/cl/5489117
2011-12-24html: "in select in table" insertion mode.Andrew Balholm
Pass tests10.dat, test 16: <!DOCTYPE html><body><table><tr><td><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux | <!DOCTYPE html> | <html> | <head> | <body> | <table> | <tbody> | <tr> | <td> | <select> | "foobarbaz" | <p> | "quux" Also pass tests through test 21: <!DOCTYPE html><frameset></frameset><svg><g></g><g></g><p><span> R=nigeltao CC=golang-dev https://golang.org/cl/5505069
2011-12-23html: Don't ignore whitespace in "after after frameset" mode.Andrew Balholm
Pass tests6.dat, test 46: <html><frameset></frameset></html> | <html> | <head> | <frameset> | " " R=nigeltao CC=golang-dev https://golang.org/cl/5505065
2011-12-21html: handle breakout tags in foreign content.Nigel Tao
Also recognize that, in the latest version of the HTML5 spec, foreign content is not an insertion mode, but a separate concern. Pass tests10.dat, test 13: <!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g><p>baz</table><p>quux | <!DOCTYPE html> | <html> | <head> | <body> | <table> | <caption> | <svg svg> | <svg g> | "foo" | <svg g> | "bar" | <p> | "baz" | <p> | "quux" Also pass tests through test 15: <!DOCTYPE html><body><table><colgroup><svg><g>foo</g><g>bar</g><p>baz</table><p>quux R=andybalholm CC=golang-dev https://golang.org/cl/5494078
2011-12-20html: ignore <caption>, <col>, <tbody> etc. when parsing table fragmentsAndrew Balholm
Pass tests6.dat, test 36: <caption><col><colgroup><tbody><tfoot><thead><tr> | <tr> Pass tests through test 44: <body></body></html> R=nigeltao CC=golang-dev https://golang.org/cl/5494055
2011-12-19html: handle text nodes in foreign content.Nigel Tao
Passes tests10.dat, test 6: <!DOCTYPE html><body><table><svg><g>foo</g></svg></table> | <!DOCTYPE html> | <html> | <head> | <body> | <svg svg> | <svg g> | "foo" | <table> Also pass tests through test 12: <!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</caption></table> R=andybalholm CC=golang-dev https://golang.org/cl/5495061
2011-12-16html: handle end tags in foreign objects.Nigel Tao
I'm not 100% sure I get all the corner cases right, for end tags, but I'll let the test suite smoke it out. Pass tests10.dat, test 1: <!DOCTYPE html><svg></svg><![CDATA[a]]> | <!DOCTYPE html> | <html> | <head> | <body> | <svg svg> | <!-- [CDATA[a]] --> Also pass tests through test 5: <!DOCTYPE html><body><table><svg></svg></table> R=andybalholm CC=golang-dev https://golang.org/cl/5495044
2011-12-15html: don't leave "in column group" mode when ignoring a tokenAndrew Balholm
Pass tests6.dat, test 26: foo<col> | <col> Also pass tests through test 35: <table><tr><div><td> R=nigeltao CC=golang-dev https://golang.org/cl/5482074
2011-12-14html: close <button> element before opening a new oneAndrew Balholm
Pass tests6.dat, test 13: <button><button> | <html> | <head> | <body> | <button> | <button> Also pass tests through test 25: <table><colgroup>foo R=nigeltao CC=golang-dev https://golang.org/cl/5487072
2011-12-13html: a first step at parsing foreign content (MathML, SVG).Nigel Tao
Nodes now have a Namespace field. Pass adoption01.dat, test 12: <a><svg><tr><input></a> | <html> | <head> | <body> | <a> | <svg svg> | <svg tr> | <svg input> The other adoption01.dat tests already passed. R=andybalholm CC=golang-dev https://golang.org/cl/5467075
2011-12-12html: don't ignore whitespace in or after framesetsAndrew Balholm
Pass tests6.dat, test 7: <frameset></frameset> foo | <html> | <head> | <frameset> | " " Also pass tests through test 12: <form><form> R=nigeltao CC=golang-dev https://golang.org/cl/5480061
2011-12-02html: allow whitespace between head and bodyAndrew Balholm
Also ignore <head> tag after </head>. Pass tests6.dat, test 0: <!doctype html></head> <head> | <!DOCTYPE html> | <html> | <head> | " " | <body> Also pass tests through test 6: <body> <div> R=nigeltao CC=golang-dev https://golang.org/cl/5447064
2011-12-01html: implement fragment parsing algorithmAndrew Balholm
Pass the tests in tests4.dat. R=nigeltao CC=golang-dev https://golang.org/cl/5447055
2011-11-30html: parse <xmp> tagsAndrew Balholm
Pass tests5.dat, test 10: <p><xmp></xmp> | <html> | <head> | <body> | <p> | <xmp> Also pass the remaining tests in tests5.dat. R=nigeltao CC=golang-dev https://golang.org/cl/5440062
2011-11-30html: parse the contents of <iframe> elements as raw textAndrew Balholm
Pass tests5.dat, test 4: <iframe> <!---> </iframe>x | <html> | <head> | <body> | <iframe> | " <!---> " | "x" Also pass tests through test 9: <style> <!</-- </style>x R=nigeltao CC=golang-dev https://golang.org/cl/5450044
2011-11-29html: detect quirks modeAndrew Balholm
Pass tests3.dat, test 23: <p><table></table> | <html> | <head> | <body> | <p> | <table> R=nigeltao CC=golang-dev https://golang.org/cl/5446043
2011-11-28html: parse <nobr> elementsAndrew Balholm
Pass tests3.dat, test 20: <!doctype html><nobr><nobr><nobr> | <!DOCTYPE html> | <html> | <head> | <body> | <nobr> | <nobr> | <nobr> Also pass tests through test 22: <!doctype html><html><body><p><table></table></body></html> R=nigeltao CC=golang-dev https://golang.org/cl/5438056
2011-11-27html: ignore <head> tags in <head> elementAndrew Balholm
Pass tests3.dat, test 12: <!DOCTYPE html><HTML><META><HEAD></HEAD></HTML> | <!DOCTYPE html> | <html> | <head> | <meta> | <body> Also pass tests through test 19: <!DOCTYPE html><html><head></head><body><ul><li><div><p><li></ul></body></html> R=nigeltao CC=golang-dev https://golang.org/cl/5436069
2011-11-24html: ingore newline at the start of a <pre> blockAndrew Balholm
Pass tests3.dat, test 4: <!DOCTYPE html><html><head></head><body><pre>\n</pre></body></html> | <!DOCTYPE html> | <html> | <head> | <body> | <pre> Also pass tests through test 11: <!DOCTYPE html><pre>&#x0a;&#x0a;A</pre> R=nigeltao CC=golang-dev https://golang.org/cl/5437051
2011-11-24html: parse DOCTYPE into name and public and system identifiersAndrew Balholm
Pass tests2.dat, test 59: <!DOCTYPE <!DOCTYPE HTML>><!--<!--x-->--> | <!DOCTYPE <!doctype> | <html> | <head> | <body> | ">" | <!-- <!--x --> | "-->" Pass all the tests in doctype01.dat. Also pass tests2.dat, test 60: <!doctype html><div><form></form><div></div></div> R=nigeltao CC=golang-dev https://golang.org/cl/5437045
2011-11-23html: on EOF in a comment, ignore final dashes (up to 2)Andrew Balholm
Pass tests2.dat, test 57: <!DOCTYPE html><!--x-- | <!DOCTYPE html> | <!-- x --> | <html> | <head> | <body> Also pass test 58: <!DOCTYPE html><table><tr><td></p></table> R=nigeltao CC=golang-dev https://golang.org/cl/5436048
2011-11-22html: copy attributes from extra <html> tags to root elementAndrew Balholm
Pass tests2.dat, test 50: <!DOCTYPE html><html><body><html id=x> | <!DOCTYPE html> | <html> | id="x" | <head> | <body> Also pass tests through test 56: <!DOCTYPE html>X<p/x/y/z> R=nigeltao CC=golang-dev https://golang.org/cl/5432045
2011-11-22html: ignore whitespace before <head> elementAndrew Balholm
Pass tests2.dat, test 47: " \n " (That is, two spaces separated by a newline) | <html> | <head> | <body> Also pass tests through test 49: <!DOCTYPE html><script> </script> <title>x</title> </head> R=nigeltao CC=golang-dev https://golang.org/cl/5422043
2011-11-20html: refactor parse test infrastructureAndrew Balholm
My excuse for doing this is that test cases with newlines in them didn't work. But instead of just fixing that, I rearranged everything in parse_test.go to use fewer channels and pipes, and just call a straightforward function to read test cases from a file. R=nigeltao CC=golang-dev https://golang.org/cl/5410049
2011-11-17html: parse <isindex>Andrew Balholm
Pass tests2.dat, test 42: <isindex test=x name=x> | <html> | <head> | <body> | <form> | <hr> | <label> | "This is a searchable index. Enter search keywords: " | <input> | name="isindex" | test="x" | <hr> R=nigeltao CC=golang-dev https://golang.org/cl/5399049
2011-11-17html: parse </optgroup> and </option>Andrew Balholm
Pass tests2.dat, test 35: <!DOCTYPE html><select><optgroup><option></optgroup><option><select><option> | <!DOCTYPE html> | <html> | <head> | <body> | <select> | <optgroup> | <option> | <option> | <option> Also pass tests through test 41: <!DOCTYPE html><!-- XXX - XXX - XXX --> R=nigeltao, rsc CC=golang-dev https://golang.org/cl/5395045
2011-11-16html: parse <optgroup> tagsAndrew Balholm
Pass tests2.dat, test 34: <!DOCTYPE html><select><option><optgroup> | <!DOCTYPE html> | <html> | <head> | <body> | <select> | <option> | <optgroup> R=nigeltao CC=golang-dev https://golang.org/cl/5393045
2011-11-16html: parse <caption> elementsAndrew Balholm
Pass tests2.dat, test 33: <!DOCTYPE html><table><caption>test TEST</caption><td>test | <!DOCTYPE html> | <html> | <head> | <body> | <table> | <caption> | "test TEST" | <tbody> | <tr> | <td> | "test" R=nigeltao CC=golang-dev https://golang.org/cl/5371099
2011-11-15html: auto-close <p> elements when starting <form> element.Andrew Balholm
Pass tests2.dat, test 26: <!doctypehtml><p><form> | <!DOCTYPE html> | <html> | <head> | <body> | <p> | <form> Also pass tests through test 32: <!DOCTYPE html><!-- X R=nigeltao CC=golang-dev https://golang.org/cl/5369114
2011-11-15html: parse and render <plaintext> elementsAndrew Balholm
Pass tests2.dat, test 10: <table><plaintext><td> | <html> | <head> | <body> | <plaintext> | "<td>" | <table> Also pass tests through test 25: <!doctypehtml><p><dd> R=nigeltao CC=golang-dev https://golang.org/cl/5369109
2011-11-13html: auto-close <dd> and <dt> elementsAndrew Balholm
Pass tests2.dat, test 8: <!DOCTYPE html><dt><div><dd> | <!DOCTYPE html> | <html> | <head> | <body> | <dt> | <div> | <dd> Also pass tests through test 9: <script></x R=nigeltao CC=golang-dev https://golang.org/cl/5373083
2011-11-12html: handle end tags in strange placesAndrew Balholm
Pass tests1.dat, test 111: </strong></b></em></i></u></strike></s></blink></tt></pre></big></small></font></select></h1></h2></h3></h4></h5></h6></body></br></a></img></title></span></style></script></table></th></td></tr></frame></area></link></param></hr></input></col></base></meta></basefont></bgsound></embed></spacer></p></dd></dt></caption></colgroup></tbody></tfoot></thead></address></blockquote></center></dir></div></dl></fieldset></listing></menu></ol></ul></li></nobr></wbr></form></button></marquee></object></html></frameset></head></iframe></image></isindex></noembed></noframes></noscript></optgroup></option></plaintext></textarea> | <html> | <head> | <body> | <br> | <p> Also pass all the remaining tests in tests1.dat. R=nigeltao CC=golang-dev https://golang.org/cl/5372066
2011-11-11html: ignore <col> tag outside tablesAndrew Balholm
Pass tests1.dat, test 109: <table><col><tbody><col><tr><col><td><col></table><col> | <html> | <head> | <body> | <table> | <colgroup> | <col> | <tbody> | <colgroup> | <col> | <tbody> | <tr> | <colgroup> | <col> | <tbody> | <tr> | <td> | <colgroup> | <col> Also pass test 110: <table><colgroup><tbody><colgroup><tr><colgroup><td><colgroup></table><colgroup> R=nigeltao CC=golang-dev https://golang.org/cl/5369069
2011-11-11html: parse column groupsAndrew Balholm
Pass tests1.dat, test 108: <table><colgroup><col><colgroup><col><col><col><colgroup><col><col><thead><tr><td></table> | <html> | <head> | <body> | <table> | <colgroup> | <col> | <colgroup> | <col> | <col> | <col> | <colgroup> | <col> | <col> | <thead> | <tr> | <td> R=nigeltao CC=golang-dev https://golang.org/cl/5369061
2011-11-10html: parse framesetsAndrew Balholm
Pass tests1.dat, test 106: <frameset><frame><frameset><frame></frameset><noframes></noframes></frameset> | <html> | <head> | <frameset> | <frame> | <frameset> | <frame> | <noframes> Also pass test 107: <h1><table><td><h3></table><h3></h1> R=nigeltao CC=golang-dev https://golang.org/cl/5373050
2011-11-10html: don't emit text token for empty raw text elements.Andrew Balholm
Pass tests1.dat, test 99: <script></script></div><title></title><p><p> | <html> | <head> | <script> | <title> | <body> | <p> | <p> Also pass tests through test 105: <ul><li><ul></li><li>a</li></ul></li></ul> R=nigeltao CC=golang-dev https://golang.org/cl/5373043
2011-11-09html: correctly parse </html> in <head> element.Andrew Balholm
Pass tests1.dat, test 92: <head></html><meta><p> | <html> | <head> | <body> | <meta> | <p> Also pass tests through test 98: <p><b><div><marquee></p></b></div> R=nigeltao CC=golang-dev https://golang.org/cl/5359054
2011-11-09html: treat <image> as <img>Andrew Balholm
Pass tests1.dat, test 90: <p><image></p> | <html> | <head> | <body> | <p> | <img> Also pass test 91: <a><table><a></table><p><a><div><a> R=nigeltao CC=golang-dev https://golang.org/cl/5339052
2011-11-08html: parse <body>, <base>, <link>, <meta>, and <title> tags inside page bodyAndrew Balholm
Pass tests1.dat, test 87: <body><body><base><link><meta><title><p></title><body><p></body> | <html> | <head> | <body> | <base> | <link> | <meta> | <title> | "<p>" | <p> Handling the last <body> tag requires correcting the original insertion mode in useTheRulesFor. Also pass test 88: <textarea><p></textarea> R=nigeltao CC=golang-dev https://golang.org/cl/5364047
2011-11-07html: be able to test more than one testdata file.Nigel Tao
R=andybalholm CC=golang-dev https://golang.org/cl/5351041
2011-11-04html: properly close <tr> element when an new <tr> starts.Andrew Balholm
Pass tests1.dat, test 87: <table><tr><tr><td><td><span><th><span>X</table> | <html> | <head> | <body> | <table> | <tbody> | <tr> | <tr> | <td> | <td> | <span> | <th> | <span> | "X" R=nigeltao CC=golang-dev https://golang.org/cl/5343041
2011-11-04html: move <link> element from after <head> into <head>Andrew Balholm
Pass tests1.dat, test 85: <head><meta></head><link> | <html> | <head> | <meta> | <link> | <body> R=nigeltao CC=golang-dev https://golang.org/cl/5297079
2011-11-03html: parse <link> elements in <head>Andrew Balholm
Pass tests1.dat, test 83: <title><meta></title><link><title><meta></title> | <html> | <head> | <title> | "<meta>" | <link> | <title> | "<meta>" | <body> Also pass test 84: <style><!--</style><meta><script>--><link></script> R=nigeltao CC=golang-dev https://golang.org/cl/5331061
2011-11-03html: properly close <marquee> elements.Andrew Balholm
Pass tests1.dat, test 80: <a href=a>aa<marquee>aa<a href=b>bb</marquee>aa | <html> | <head> | <body> | <a> | href="a" | "aa" | <marquee> | "aa" | <a> | href="b" | "bb" | "aa" Also pass tests through test 82: <!DOCTYPE html><spacer>foo R=nigeltao CC=golang-dev https://golang.org/cl/5319071
2011-11-01src/pkg/[a-m]*: gofix -r error -force=errorRuss Cox
R=golang-dev, iant CC=golang-dev https://golang.org/cl/5322051