1
0
mirror of https://github.com/golang/go synced 2024-11-25 01:08:02 -07:00

html: don't leave "in column group" mode when ignoring a token

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
This commit is contained in:
Andrew Balholm 2011-12-15 10:45:19 +11:00 committed by Nigel Tao
parent 076ebed0d8
commit 85fdd68bd9
2 changed files with 5 additions and 4 deletions

View File

@ -1166,8 +1166,8 @@ func inColumnGroupIM(p *parser) bool {
case "colgroup":
if p.oe.top().Data != "html" {
p.oe.pop()
}
p.im = inTableIM
}
return true
case "col":
// Ignore the token.
@ -1176,10 +1176,11 @@ func inColumnGroupIM(p *parser) bool {
}
if p.oe.top().Data != "html" {
p.oe.pop()
}
p.im = inTableIM
return false
}
return true
}
// Section 12.2.5.4.13.
func inTableBodyIM(p *parser) bool {

View File

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