mirror of
https://github.com/golang/go
synced 2024-11-24 21:10:04 -07:00
html: close <button> element before opening a new one
Pass tests6.dat, test 13: <button><button> | <html> | <head> | <body> | <button> | <button> Also pass tests through test 25: <table><colgroup>foo R=nigeltao CC=golang-dev https://golang.org/cl/5487072
This commit is contained in:
parent
3c638f2892
commit
e25a83d03e
@ -734,6 +734,11 @@ func inBodyIM(p *parser) bool {
|
||||
case "plaintext":
|
||||
p.popUntil(buttonScopeStopTags, "p")
|
||||
p.addElement(p.tok.Data, p.tok.Attr)
|
||||
case "button":
|
||||
p.popUntil(defaultScopeStopTags, "button")
|
||||
p.reconstructActiveFormattingElements()
|
||||
p.addElement(p.tok.Data, p.tok.Attr)
|
||||
p.framesetOK = false
|
||||
case "optgroup", "option":
|
||||
if p.top().Data == "option" {
|
||||
p.oe.pop()
|
||||
|
@ -172,7 +172,7 @@ func TestParser(t *testing.T) {
|
||||
{"tests3.dat", -1},
|
||||
{"tests4.dat", -1},
|
||||
{"tests5.dat", -1},
|
||||
{"tests6.dat", 13},
|
||||
{"tests6.dat", 26},
|
||||
}
|
||||
for _, tf := range testFiles {
|
||||
f, err := os.Open("testdata/webkit/" + tf.filename)
|
||||
|
Loading…
Reference in New Issue
Block a user