diff options
| author | Andrew Balholm <andybalholm@gmail.com> | 2011-11-03 10:11:06 +1100 |
|---|---|---|
| committer | Nigel Tao <nigeltao@golang.org> | 2011-11-03 10:11:06 +1100 |
| commit | cf6a71216211d8d3f487ab158cbf681742e790d4 (patch) | |
| tree | 33bb9db28b7c1091dd88d46c6bf1cc8e7b806355 /src/pkg/html | |
| parent | 33f1d47b38f9c48b326642e2005e24ec06176172 (diff) | |
| download | go-cf6a71216211d8d3f487ab158cbf681742e790d4.tar.xz | |
html: properly close <marquee> elements.
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
Diffstat (limited to 'src/pkg/html')
| -rw-r--r-- | src/pkg/html/parse.go | 4 | ||||
| -rw-r--r-- | src/pkg/html/parse_test.go | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/pkg/html/parse.go b/src/pkg/html/parse.go index c9f016588d..4a21be925a 100644 --- a/src/pkg/html/parse.go +++ b/src/pkg/html/parse.go @@ -635,6 +635,10 @@ func inBodyIM(p *parser) (insertionMode, bool) { p.inBodyEndTagFormatting(p.tok.Data) case "address", "article", "aside", "blockquote", "button", "center", "details", "dir", "div", "dl", "fieldset", "figcaption", "figure", "footer", "header", "hgroup", "listing", "menu", "nav", "ol", "pre", "section", "summary", "ul": p.popUntil(defaultScopeStopTags, p.tok.Data) + case "applet", "marquee", "object": + if p.popUntil(defaultScopeStopTags, p.tok.Data) { + p.clearActiveFormattingElements() + } default: p.inBodyEndTagOther(p.tok.Data) } diff --git a/src/pkg/html/parse_test.go b/src/pkg/html/parse_test.go index 3fa40374ea..65fc8edaed 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 < 80; i++ { + for i := 0; i < 83; i++ { // Parse the #data section. b, err := ioutil.ReadAll(<-rc) if err != nil { |
