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

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
parent 28546ed5
......@@ -1226,7 +1226,13 @@ func inSelectIM(p *parser) bool {
}
p.addElement(p.tok.Data, p.tok.Attr)
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":
endSelect = true
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.
{"tests1.dat", -1},
{"tests2.dat", 34},
{"tests2.dat", 35},
{"tests3.dat", 0},
}
for _, tf := range testFiles {
......
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