Skip to content

Commit

Permalink
html: don't leave "in column group" mode when ignoring a token
Browse files Browse the repository at this point in the history
Pass tests6.dat, test 26:
foo<col>

| <col>

Also pass tests through test 35:
<table><tr><div><td>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5482074
  • Loading branch information
Andrew Balholm authored and nigeltao committed Dec 14, 2011
1 parent 076ebed commit 85fdd68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/pkg/html/parse.go
Expand Up @@ -1166,8 +1166,8 @@ func inColumnGroupIM(p *parser) bool {
case "colgroup":
if p.oe.top().Data != "html" {
p.oe.pop()
p.im = inTableIM
}
p.im = inTableIM
return true
case "col":
// Ignore the token.
Expand All @@ -1176,9 +1176,10 @@ func inColumnGroupIM(p *parser) bool {
}
if p.oe.top().Data != "html" {
p.oe.pop()
p.im = inTableIM
return false
}
p.im = inTableIM
return false
return true
}

// Section 12.2.5.4.13.
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/html/parse_test.go
Expand Up @@ -172,7 +172,7 @@ func TestParser(t *testing.T) {
{"tests3.dat", -1},
{"tests4.dat", -1},
{"tests5.dat", -1},
{"tests6.dat", 26},
{"tests6.dat", 36},
}
for _, tf := range testFiles {
f, err := os.Open("testdata/webkit/" + tf.filename)
Expand Down

0 comments on commit 85fdd68

Please sign in to comment.