From: Andrew Balholm Date: Thu, 3 Nov 2011 22:29:06 +0000 (+1100) Subject: html: move element from after into X-Git-Tag: weekly.2011-11-08~50 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=46308d7d1191b75dc86f848dbc362616f5b0b0cb;p=gostls13.git html: move element from after into Pass tests1.dat, test 85: | | | | | R=nigeltao CC=golang-dev https://golang.org/cl/5297079 --- diff --git a/src/pkg/html/parse.go b/src/pkg/html/parse.go index 38f8ba481a..0204b7c281 100644 --- a/src/pkg/html/parse.go +++ b/src/pkg/html/parse.go @@ -427,6 +427,7 @@ func beforeHeadIM(p *parser) (insertionMode, bool) { } if add || implied { p.addElement("head", attr) + p.head = p.top() } return inHeadIM, !implied } @@ -511,7 +512,9 @@ func afterHeadIM(p *parser) (insertionMode, bool) { case "frameset": // TODO. case "base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "title": - // TODO. + p.oe = append(p.oe, p.head) + defer p.oe.pop() + return useTheRulesFor(p, afterHeadIM, inHeadIM) case "head": // TODO. default: diff --git a/src/pkg/html/parse_test.go b/src/pkg/html/parse_test.go index 3194a3fa47..8dc00ba484 100644 --- a/src/pkg/html/parse_test.go +++ b/src/pkg/html/parse_test.go @@ -133,7 +133,7 @@ func TestParser(t *testing.T) { rc := make(chan io.Reader) go readDat(filename, rc) // TODO(nigeltao): Process all test cases, not just a subset. - for i := 0; i < 85; i++ { + for i := 0; i < 86; i++ { // Parse the #data section. b, err := ioutil.ReadAll(<-rc) if err != nil {