mirror of
https://github.com/golang/go
synced 2024-11-25 11:48:04 -07:00
exp/html: correctly handle <title> after </head>
The <title> element was getting removed from the stack of open elements, when its parent, the <head> element should have been removed instead. Pass 2 additional tests. R=nigeltao CC=golang-dev https://golang.org/cl/6449101
This commit is contained in:
parent
0bfa31e961
commit
5530a426ef
@ -669,7 +669,7 @@ func afterHeadIM(p *parser) bool {
|
||||
return true
|
||||
case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title:
|
||||
p.oe = append(p.oe, p.head)
|
||||
defer p.oe.pop()
|
||||
defer p.oe.remove(p.head)
|
||||
return inHeadIM(p)
|
||||
case a.Head:
|
||||
// Ignore the token.
|
||||
|
@ -1,7 +1,7 @@
|
||||
PASS "<!doctype html><body><title>X</title>"
|
||||
PASS "<!doctype html><table><title>X</title></table>"
|
||||
FAIL "<!doctype html><head></head><title>X</title>"
|
||||
FAIL "<!doctype html></head><title>X</title>"
|
||||
PASS "<!doctype html><head></head><title>X</title>"
|
||||
PASS "<!doctype html></head><title>X</title>"
|
||||
PASS "<!doctype html><table><meta></table>"
|
||||
PASS "<!doctype html><table>X<tr><td><table> <meta></table></table>"
|
||||
PASS "<!doctype html><html> <head>"
|
||||
|
Loading…
Reference in New Issue
Block a user