aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/html
diff options
context:
space:
mode:
authorAndrew Balholm <andybalholm@gmail.com>2012-01-04 09:51:15 +1100
committerNigel Tao <nigeltao@golang.org>2012-01-04 09:51:15 +1100
commit99fed2be279934f0e4d806833f810a3ac78f0e60 (patch)
treed0cc1a28d4249b039f533e75e991889d0e5cc3ba /src/pkg/html
parent7ccd505dc47842c94898f5aed72509c54af22576 (diff)
downloadgo-99fed2be279934f0e4d806833f810a3ac78f0e60.tar.xz
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
Diffstat (limited to 'src/pkg/html')
-rw-r--r--src/pkg/html/parse.go13
-rw-r--r--src/pkg/html/parse_test.go2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/pkg/html/parse.go b/src/pkg/html/parse.go
index b2903b302d..380df83427 100644
--- a/src/pkg/html/parse.go
+++ b/src/pkg/html/parse.go
@@ -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":
diff --git a/src/pkg/html/parse_test.go b/src/pkg/html/parse_test.go
index 2f6059b288..2b6a8b5083 100644
--- a/src/pkg/html/parse_test.go
+++ b/src/pkg/html/parse_test.go
@@ -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 {