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
This commit is contained in:
Andrew Balholm 2011-11-03 10:11:06 +11:00 committed by Nigel Tao
parent 33f1d47b38
commit cf6a712162
2 changed files with 5 additions and 1 deletions

View file

@ -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)
}

View file

@ -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 {