Pass tests2.dat, test 35:
<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <select>
| <optgroup>
| <option>
| <option>
| <option>
Also pass tests through test 41:
<!DOCTYPE html><!-- XXX - XXX - XXX -->
R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/
5395045
case EndTagToken:
switch p.tok.Data {
case "option":
- // TODO.
+ if p.top().Data == "option" {
+ p.oe.pop()
+ }
case "optgroup":
- // TODO.
+ i := len(p.oe) - 1
+ if p.oe[i].Data == "option" {
+ i--
+ }
+ if p.oe[i].Data == "optgroup" {
+ p.oe = p.oe[:i]
+ }
case "select":
endSelect = true
default:
}{
// TODO(nigeltao): Process all the test cases from all the .dat files.
{"tests1.dat", -1},
- {"tests2.dat", 35},
+ {"tests2.dat", 42},
{"tests3.dat", 0},
}
for _, tf := range testFiles {