aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/html
AgeCommit message (Collapse)Author
2012-02-06html: add package doc.Nigel Tao
Fixes #2857. R=r, adg CC=golang-dev https://golang.org/cl/5635046
2012-02-03std: add struct field tags to untagged literals.Nigel Tao
R=rsc, dsymonds, bsiegert, rogpeppe CC=golang-dev https://golang.org/cl/5619052
2012-02-01all packages: fix various typosRobert Griesemer
Detected semi-automatically. There are probably more. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5620046
2012-01-30build: remove Make.pkg, Make.toolRuss Cox
Consequently, remove many package Makefiles, and shorten the few that remain. gomake becomes 'go tool make'. Turn off test phases of run.bash that do not work, flagged with $BROKEN. Future CLs will restore these, but this seemed like a big enough CL already. R=golang-dev, r CC=golang-dev https://golang.org/cl/5601057
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/template: fix docs after API changesGustavo Niemeyer
R=golang-dev, r CC=golang-dev https://golang.org/cl/5528109
2012-01-19text/template/parse: use human error printsRob Pike
The previous version of all the node.String methods printed the parse tree and was useful for developing the parse tree code. Now that that's done, we might as well print the nodes using the standard template syntax. It's much easier to read and makes error reporting look more natural. Helps issue 2644. R=rsc, n13m3y3r CC=golang-dev https://golang.org/cl/5553066
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/template: reenable testcases and fix mis-escaped sequences.Mike Samuel
Tighter octal parsing broke some tests and were disabled in https://golang.org/cl/5530051 Those tests were broken. The CSS decoder was supposed to see CSS hex escape sequences of the form '\' <hex>+, but those escape sequences were instead being consumed by the template parser. This change properly escapes those escape sequences, and uses proper escaping for NULs. R=golang-dev, rsc, nigeltao CC=golang-dev https://golang.org/cl/5529073
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-09strconv: return ErrSyntax when unquoting illegal octal sequences. ThisSameer Ajmani
is consistent with what the Go compiler returns when such sequences appear in string literals. Fixes #2658. R=golang-dev, rsc, r, r, nigeltao CC=golang-dev https://golang.org/cl/5530051
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-20template: better error message for empty templatesRob Pike
New("x").ParseFiles("y") can result in an empty "x" template. Make the message clearer that this is the problem. The error returns from both template packages in this case were confusing. I considered making the method use "x" instead of "y" in this case, but that just made other situations confusing and harder to explain. Fixes #2594. R=golang-dev, rsc, r CC=golang-dev https://golang.org/cl/5498048
2011-12-20panics: use the new facilities of testing.B insteadRob Pike
Lots of panics go away. Also fix a name error in html/template. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5498045
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/template: define the FuncMap type locallyRob Pike
This redefinition means that the public signature of html/template does not refer to text/template. Fixes #2546. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5487083
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: update comments to match latest spec.Nigel Tao
R=dsymonds CC=golang-dev https://golang.org/cl/5482054
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-09html/template: make Must workRob Pike
Fixes #2545. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5475054
2011-12-08update tree for new default type ruleRuss Cox
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5448091
2011-12-08html/template: clean up locking for ExecuteTemplateRob Pike
R=mikesamuel, rogpeppe CC=golang-dev https://golang.org/cl/5448137
2011-12-06html/template: simplify ExecuteTemplate a littleRob Pike
Allow the text template to handle the error case of no template with the given name. Simplification suggested by Mike Samuel. R=mikesamuel CC=golang-dev https://golang.org/cl/5437147
2011-12-05use new strconv APIRuss Cox
All but 3 cases (in gcimporter.go and hixie.go) are automatic conversions using gofix. No attempt is made to use the new Append functions even though there are definitely opportunities. R=golang-dev, gri CC=golang-dev https://golang.org/cl/5447069
2011-12-02gofmt -s misc srcRuss Cox
R=golang-dev, bradfitz, gri CC=golang-dev https://golang.org/cl/5451079
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-01gofmt: applied gofmt -w -s src miscRobert Griesemer
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5451070
2011-12-01text/template: replace Add with AddParseTreeRob Pike
Makes it clear we're adding exactly one tree and creating a new template for it. R=rsc CC=golang-dev https://golang.org/cl/5448077
2011-11-30html/template: make execution thread-safeRob Pike
The problem is that execution can modify the template, so it needs interlocking to have the same thread-safe guarantee as text/template. Fixes #2439. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5450056
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/template: update to new template APIRob Pike
Not quite done yet but enough is here to review. Embedding is eliminated so clients can't accidentally reach methods of text/template.Template that would break the invariants. TODO later: Add and Clone are unimplemented. TODO later: address issue 2349 R=golang-dev, r, rsc CC=golang-dev https://golang.org/cl/5434077
2011-11-30html: clean up the z.rawTag calculation in the tokenizer.Nigel Tao
R=andybalholm CC=golang-dev https://golang.org/cl/5440064
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: spin doctype.go out of parse.go.Nigel Tao
R=andybalholm CC=golang-dev https://golang.org/cl/5445049
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-25html/template: fix documentation indentAndrew Gerrand
R=nigeltao CC=golang-dev https://golang.org/cl/5437061
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