mirror of
https://github.com/golang/go
synced 2024-11-20 00:04:43 -07:00
html: auto-close <p> elements when starting <form> element.
Pass tests2.dat, test 26: <!doctypehtml><p><form> | <!DOCTYPE html> | <html> | <head> | <body> | <p> | <form> Also pass tests through test 32: <!DOCTYPE html><!-- X R=nigeltao CC=golang-dev https://golang.org/cl/5369114
This commit is contained in:
parent
a619da9f4a
commit
b91d82258f
@ -619,6 +619,12 @@ func inBodyIM(p *parser) bool {
|
||||
// TODO: detect <select> inside a table.
|
||||
p.im = inSelectIM
|
||||
return true
|
||||
case "form":
|
||||
if p.form == nil {
|
||||
p.popUntil(buttonScopeStopTags, "p")
|
||||
p.addElement(p.tok.Data, p.tok.Attr)
|
||||
p.form = p.top()
|
||||
}
|
||||
case "li":
|
||||
p.framesetOK = false
|
||||
for i := len(p.oe) - 1; i >= 0; i-- {
|
||||
|
@ -134,7 +134,7 @@ func TestParser(t *testing.T) {
|
||||
}{
|
||||
// TODO(nigeltao): Process all the test cases from all the .dat files.
|
||||
{"tests1.dat", -1},
|
||||
{"tests2.dat", 26},
|
||||
{"tests2.dat", 33},
|
||||
{"tests3.dat", 0},
|
||||
}
|
||||
for _, tf := range testFiles {
|
||||
|
Loading…
Reference in New Issue
Block a user