mirror of
https://github.com/golang/go
synced 2024-11-25 09:07:58 -07:00
html: parse <optgroup> tags
Pass tests2.dat, test 34: <!DOCTYPE html><select><option><optgroup> | <!DOCTYPE html> | <html> | <head> | <body> | <select> | <option> | <optgroup> R=nigeltao CC=golang-dev https://golang.org/cl/5393045
This commit is contained in:
parent
28546ed56a
commit
3307597069
@ -1226,7 +1226,13 @@ func inSelectIM(p *parser) bool {
|
|||||||
}
|
}
|
||||||
p.addElement(p.tok.Data, p.tok.Attr)
|
p.addElement(p.tok.Data, p.tok.Attr)
|
||||||
case "optgroup":
|
case "optgroup":
|
||||||
// TODO.
|
if p.top().Data == "option" {
|
||||||
|
p.oe.pop()
|
||||||
|
}
|
||||||
|
if p.top().Data == "optgroup" {
|
||||||
|
p.oe.pop()
|
||||||
|
}
|
||||||
|
p.addElement(p.tok.Data, p.tok.Attr)
|
||||||
case "select":
|
case "select":
|
||||||
endSelect = true
|
endSelect = true
|
||||||
case "input", "keygen", "textarea":
|
case "input", "keygen", "textarea":
|
||||||
|
@ -134,7 +134,7 @@ func TestParser(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
// TODO(nigeltao): Process all the test cases from all the .dat files.
|
// TODO(nigeltao): Process all the test cases from all the .dat files.
|
||||||
{"tests1.dat", -1},
|
{"tests1.dat", -1},
|
||||||
{"tests2.dat", 34},
|
{"tests2.dat", 35},
|
||||||
{"tests3.dat", 0},
|
{"tests3.dat", 0},
|
||||||
}
|
}
|
||||||
for _, tf := range testFiles {
|
for _, tf := range testFiles {
|
||||||
|
Loading…
Reference in New Issue
Block a user