aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/html/parse_test.go
AgeCommit message (Collapse)Author
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
2011-11-02html: stop at scope marker node when generating implied </a> tagsAndrew Balholm
A <a> tag generates implied end tags for any open <a> elements. But it shouldn't do that when it is inside a table cell the the open <a> is outside the table. So stop the search for an open <a> when we reach a scope marker node. Pass tests1.dat, test 78: <a href="blah">aba<table><tr><td><a href="foo">br</td></tr>x</table>aoe | <html> | <head> | <body> | <a> | href="blah" | "abax" | <table> | <tbody> | <tr> | <td> | <a> | href="foo" | "br" | "aoe" Also pass test 79: <table><a href="blah">aba<tr><td><a href="foo">br</td></tr>x</table>aoe R=nigeltao CC=golang-dev https://golang.org/cl/5320063
2011-11-02html: refactor the blacklist for the "render and re-parse" test.Nigel Tao
R=andybalholm CC=golang-dev, mikesamuel https://golang.org/cl/5331056
2011-11-01html: process </td> tags; foster parent at most one node per tokenAndrew Balholm
Correctly close table cell when </td> is read. Because of reconstructing the active formatting elements, more than one node may be created when reading a single token. If both nodes are foster parented, they will be siblings, but the first node should be the parent of the second. Pass tests1.dat, test 77: <a href="blah">aba<table><a href="foo">br<tr><td></td></tr>x</table>aoe | <html> | <head> | <body> | <a> | href="blah" | "aba" | <a> | href="foo" | "br" | <a> | href="foo" | "x" | <table> | <tbody> | <tr> | <td> | <a> | href="foo" | "aoe" R=nigeltao CC=golang-dev https://golang.org/cl/5305074
2011-10-29html: adjust bookmark in "adoption agency" algorithmAndrew Balholm
In the adoption agency algorithm, the formatting element is sometimes removed from the list of active formatting elements and reinserted at a later index. In that case, the bookmark showing where it is to be reinserted needs to be moved, so that its position relative to its neighbors remains the same (and also so that it doesn't become out of bounds). Pass tests1.dat, test 70: <DIV> abc <B> def <I> ghi <P> jkl </B> | <html> | <head> | <body> | <div> | " abc " | <b> | " def " | <i> | " ghi " | <i> | <p> | <b> | " jkl " Also pass tests through test 76: <test attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> R=nigeltao CC=golang-dev https://golang.org/cl/5322052
2011-10-28html: don't run "adoption agency" on elements that aren't in scope.Andrew Balholm
Pass tests1.dat, test 55: <!DOCTYPE html><font><table></font></table></font> | <!DOCTYPE html> | <html> | <head> | <body> | <font> | <table> Also pass tests through test 69: <DIV> abc <B> def <I> ghi <P> jkl R=nigeltao CC=golang-dev https://golang.org/cl/5309074
2011-10-28html: allow whitespace text nodes in <head>Andrew Balholm
Pass tests1.dat, test 50: <!DOCTYPE html><script> <!-- </script> --> </script> EOF | <!DOCTYPE html> | <html> | <head> | <script> | " <!-- " | " " | <body> | "--> EOF" Also pass tests through test 54: <!DOCTYPE html><title>U-test</title><body><div><p>Test<u></p></div></body> R=nigeltao CC=golang-dev https://golang.org/cl/5311066
2011-10-27html: parse <style> elements inside <head> element.Andrew Balholm
Also correctly handle EOF inside a <style> element. Pass tests1.dat, test 49: <!DOCTYPE html><style> EOF | <!DOCTYPE html> | <html> | <head> | <style> | " EOF" | <body> R=nigeltao CC=golang-dev https://golang.org/cl/5321057
2011-10-27html: close <option> element when opening <optgroup>Andrew Balholm
Pass tests1.dat, test 34: <!DOCTYPE html>A<option>B<optgroup>C<select>D</option>E | <!DOCTYPE html> | <html> | <head> | <body> | "A" | <option> | "B" | <optgroup> | "C" | <select> | "DE" Also passes tests 35-48. Test 48 is: </ COM--MENT > R=nigeltao CC=golang-dev https://golang.org/cl/5311063
2011-10-26html: improve parsing of listsAndrew Balholm
Make a <li> tag close the previous <li> element. Make a </ul> tag close <li> elements. Pass tests1.dat, test 33: <!DOCTYPE html><li>hello<li>world<ul>how<li>do</ul>you</body><!--do--> | <!DOCTYPE html> | <html> | <head> | <body> | <li> | "hello" | <li> | "world" | <ul> | "how" | <li> | "do" | "you" | <!-- do --> R=nigeltao CC=golang-dev https://golang.org/cl/5321051
2011-10-26html: improve parsing of tablesAndrew Balholm
When foster parenting, merge adjacent text nodes. Properly close table row at </tr> tag. Pass tests1.dat, test 32: <!-----><font><div>hello<table>excite!<b>me!<th><i>please!</tr><!--X--> | <!-- - --> | <html> | <head> | <body> | <font> | <div> | "helloexcite!" | <b> | "me!" | <table> | <tbody> | <tr> | <th> | <i> | "please!" | <!-- X --> R=nigeltao CC=golang-dev https://golang.org/cl/5323048
2011-10-25html: dump attributes when running parser tests.Andrew Balholm
The WebKit test data shows attributes as though they were child nodes: <a X>0<b>1<a Y>2 dumps as: | <html> | <head> | <body> | <a> | x="" | "0" | <b> | "1" | <b> | <a> | y="" | "2" So we need to do the same when dumping a tree to compare with it. R=nigeltao CC=golang-dev https://golang.org/cl/5322044
2011-10-23html: implement foster parentingAndrew Balholm
Implement the foster-parenting algorithm for content that is inside a table but not in a cell. Also fix a bug in reconstructing the active formatting elements. Pass test 30 in tests1.dat: <a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y R=nigeltao CC=golang-dev https://golang.org/cl/5309052
2011-10-22html: parse <select> tags.Nigel Tao
The additional test case in parse_test.go is: <select><b><option><select><option></b></select>X R=andybalholm CC=golang-dev https://golang.org/cl/5293051
2011-10-20html: parse and render comment nodes.Nigel Tao
The first additional test case in parse_test.go is: <!--><div>--<!--> The second one is unrelated to the comment change, but also passes: <p><hr></p> R=andybalholm CC=golang-dev https://golang.org/cl/5299047
2011-10-19html: parse raw text and RCDATA elements, such as <script> and <title>.Nigel Tao
Pass tests1.dat, test 26: #data <script><div></script></div><title><p></title><p><p> #document | <html> | <head> | <script> | "<div>" | <title> | "<p>" | <body> | <p> | <p> Thanks to Andy Balholm for driving this change. R=andybalholm CC=golang-dev https://golang.org/cl/5301042
2011-10-13html: insert implied <p> and </p> tagsAndrew Balholm
(test # 25 in tests1.dat) #data <p><b><div></p></b></div>X #document | <html> | <head> | <body> | <p> | <b> | <div> | <b> | | <p> | "X" R=nigeltao CC=golang-dev https://golang.org/cl/5254060
2011-10-13html: when a parse test fails, don't bother testing rendering.Nigel Tao
R=andybalholm CC=golang-dev https://golang.org/cl/5248061
2011-10-10html: add a Render function.Nigel Tao
R=mikesamuel, andybalholm CC=golang-dev https://golang.org/cl/5218041
2011-08-01html: parse doctype tokens; merge adjacent text nodes.Nigel Tao
The test case input is "<!DOCTYPE html><span><button>foo</span>bar". The correct parse is: | <!DOCTYPE html> | <html> | <head> | <body> | <span> | <button> | "foobar" R=gri CC=golang-dev https://golang.org/cl/4794063
2011-07-21html: parse misnested formatting tags according to the HTML5 spec.Nigel Tao
This is the "adoption agency" algorithm. The test case input is "<a><p>X<a>Y</a>Z</p></a>". The correct parse is: | <html> | <head> | <body> | <a> | <p> | <a> | "X" | <a> | "Y" | "Z" R=gri CC=golang-dev https://golang.org/cl/4771042
2011-04-27ioutil: add Discard, update tree.Brad Fitzpatrick
This also removes an unnecessary allocation in http/transfer.go R=r, rsc1, r2, adg CC=golang-dev https://golang.org/cl/4426066
2011-04-04os: New Open API.Rob Pike
We replace the current Open with: OpenFile(name, flag, perm) // same as old Open Open(name) // same as old Open(name, O_RDONLY, 0) Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666) This CL includes a gofix module and full code updates: all.bash passes. (There may be a few comments I missed.) The interesting packages are: gofix os Everything else is automatically generated except for hand tweaks to: src/pkg/io/ioutil/ioutil.go src/pkg/io/ioutil/tempfile.go src/pkg/crypto/tls/generate_cert.go src/cmd/goyacc/goyacc.go src/cmd/goyacc/units.y R=golang-dev, bradfitzwork, rsc, r2 CC=golang-dev https://golang.org/cl/4357052
2010-12-15html: parse "<h1>foo<h2>bar".Nigel Tao
R=gri CC=golang-dev https://golang.org/cl/3571043
2010-12-10html: parse <table><tr><td> tags.Nigel Tao
Also, shorten fooInsertionMode to fooIM. R=gri CC=golang-dev https://golang.org/cl/3504042
2010-12-08html: handle unexpected EOF during parsing.Nigel Tao
This lets us parse HTML like "<html>foo". R=gri CC=golang-dev https://golang.org/cl/3460043
2010-12-07html: first cut at a parser.Nigel Tao
R=gri CC=golang-dev https://golang.org/cl/3355041