Commit e25a83d0 authored by Andrew Balholm's avatar Andrew Balholm Committed by Nigel Tao

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
parent 3c638f28
...@@ -734,6 +734,11 @@ func inBodyIM(p *parser) bool { ...@@ -734,6 +734,11 @@ func inBodyIM(p *parser) bool {
case "plaintext": case "plaintext":
p.popUntil(buttonScopeStopTags, "p") p.popUntil(buttonScopeStopTags, "p")
p.addElement(p.tok.Data, p.tok.Attr) 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": case "optgroup", "option":
if p.top().Data == "option" { if p.top().Data == "option" {
p.oe.pop() p.oe.pop()
......
...@@ -172,7 +172,7 @@ func TestParser(t *testing.T) { ...@@ -172,7 +172,7 @@ func TestParser(t *testing.T) {
{"tests3.dat", -1}, {"tests3.dat", -1},
{"tests4.dat", -1}, {"tests4.dat", -1},
{"tests5.dat", -1}, {"tests5.dat", -1},
{"tests6.dat", 13}, {"tests6.dat", 26},
} }
for _, tf := range testFiles { for _, tf := range testFiles {
f, err := os.Open("testdata/webkit/" + tf.filename) f, err := os.Open("testdata/webkit/" + tf.filename)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment