]> Cypherpunks repositories - gostls13.git/commitdiff
html: properly close <marquee> elements.
authorAndrew Balholm <andybalholm@gmail.com>
Wed, 2 Nov 2011 23:11:06 +0000 (10:11 +1100)
committerNigel Tao <nigeltao@golang.org>
Wed, 2 Nov 2011 23:11:06 +0000 (10:11 +1100)
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

src/pkg/html/parse.go
src/pkg/html/parse_test.go

index c9f016588d0081748f765a64a4ccc0cbeccb82f3..4a21be925a6425c242212911ecc259772f3f0135 100644 (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)
                }
index 3fa40374eae34ee8c8b76d09f1e63163e0438985..65fc8edaed59086a27d7fd57c9d8369612b3bd67 100644 (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 {