1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:50:22 -07:00

html: parse <frameset> inside body

Pass tests6.dat, test 47:
<param><frameset></frameset>

| <html>
|   <head>
|   <frameset>

Also pass remaining tests in tests6.dat.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5489136
This commit is contained in:
Andrew Balholm 2012-01-04 09:51:15 +11:00 committed by Nigel Tao
parent 7ccd505dc4
commit 99fed2be27
2 changed files with 14 additions and 1 deletions

View File

@ -749,6 +749,19 @@ func inBodyIM(p *parser) bool {
copyAttributes(body, p.tok)
}
}
case "frameset":
if !p.framesetOK || len(p.oe) < 2 || p.oe[1].Data != "body" {
// Ignore the token.
return true
}
body := p.oe[1]
if body.Parent != nil {
body.Parent.Remove(body)
}
p.oe = p.oe[:1]
p.addElement(p.tok.Data, p.tok.Attr)
p.im = inFramesetIM
return true
case "base", "basefont", "bgsound", "command", "link", "meta", "noframes", "script", "style", "title":
return inHeadIM(p)
case "image":

View File

@ -183,7 +183,7 @@ func TestParser(t *testing.T) {
{"tests3.dat", -1},
{"tests4.dat", -1},
{"tests5.dat", -1},
{"tests6.dat", 47},
{"tests6.dat", -1},
{"tests10.dat", 30},
}
for _, tf := range testFiles {