From: Andrew Balholm Date: Sun, 27 Nov 2011 23:55:31 +0000 (+1100) Subject: html: parse elements X-Git-Tag: weekly.2011-12-01~49 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=68e7363b56a0a42414620a5a5cb756fb0edf82e7;p=gostls13.git html: parse elements Pass tests3.dat, test 20: | | | | | | | Also pass tests through test 22:

R=nigeltao CC=golang-dev https://golang.org/cl/5438056 --- diff --git a/src/pkg/html/parse.go b/src/pkg/html/parse.go index 723f65a4d7..adfac61edc 100644 --- a/src/pkg/html/parse.go +++ b/src/pkg/html/parse.go @@ -679,6 +679,13 @@ func inBodyIM(p *parser) bool { case "b", "big", "code", "em", "font", "i", "s", "small", "strike", "strong", "tt", "u": p.reconstructActiveFormattingElements() p.addFormattingElement(p.tok.Data, p.tok.Attr) + case "nobr": + p.reconstructActiveFormattingElements() + if p.elementInScope(defaultScopeStopTags, "nobr") { + p.inBodyEndTagFormatting("nobr") + p.reconstructActiveFormattingElements() + } + p.addFormattingElement(p.tok.Data, p.tok.Attr) case "applet", "marquee", "object": p.reconstructActiveFormattingElements() p.addElement(p.tok.Data, p.tok.Attr) diff --git a/src/pkg/html/parse_test.go b/src/pkg/html/parse_test.go index 4a088c74b1..9e02173b80 100644 --- a/src/pkg/html/parse_test.go +++ b/src/pkg/html/parse_test.go @@ -152,7 +152,7 @@ func TestParser(t *testing.T) { {"doctype01.dat", -1}, {"tests1.dat", -1}, {"tests2.dat", -1}, - {"tests3.dat", 20}, + {"tests3.dat", 23}, } for _, tf := range testFiles { f, err := os.Open("testdata/webkit/" + tf.filename)