From bd07e4f25906f4443811e3b6bdb4ff2918beed0c Mon Sep 17 00:00:00 2001 From: Andrew Balholm Date: Thu, 27 Oct 2011 09:45:53 +1100 Subject: [PATCH] html: close Pass tests1.dat, test 34: AC | "DE" Also passes tests 35-48. Test 48 is: R=nigeltao CC=golang-dev https://golang.org/cl/5311063 --- src/pkg/html/parse.go | 6 ++++++ src/pkg/html/parse_test.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pkg/html/parse.go b/src/pkg/html/parse.go index 530942aa8f0..823f7aad29f 100644 --- a/src/pkg/html/parse.go +++ b/src/pkg/html/parse.go @@ -594,6 +594,12 @@ func inBodyIM(p *parser) (insertionMode, bool) { } p.popUntil(buttonScopeStopTags, "p") p.addElement("li", p.tok.Attr) + case "optgroup", "option": + if p.top().Data == "option" { + p.oe.pop() + } + p.reconstructActiveFormattingElements() + p.addElement(p.tok.Data, p.tok.Attr) default: // TODO. 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 b0ddd924762..5022a4f7798 100644 --- a/src/pkg/html/parse_test.go +++ b/src/pkg/html/parse_test.go @@ -132,7 +132,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 < 34; i++ { + for i := 0; i < 49; i++ { // Parse the #data section. b, err := ioutil.ReadAll(<-rc) if err != nil {