mirror of
https://github.com/golang/go
synced 2024-11-21 22:54:40 -07:00
html: close <option> element when opening <optgroup>
Pass tests1.dat, test 34: <!DOCTYPE html>A<option>B<optgroup>C<select>D</option>E | <!DOCTYPE html> | <html> | <head> | <body> | "A" | <option> | "B" | <optgroup> | "C" | <select> | "DE" Also passes tests 35-48. Test 48 is: </ COM--MENT > R=nigeltao CC=golang-dev https://golang.org/cl/5311063
This commit is contained in:
parent
2cf5359830
commit
bd07e4f259
@ -594,6 +594,12 @@ func inBodyIM(p *parser) (insertionMode, bool) {
|
||||
}
|
||||
p.popUntil(buttonScopeStopTags, "p")
|
||||
p.addElement("li", p.tok.Attr)
|
||||
case "optgroup", "option":
|
||||
if p.top().Data == "option" {
|
||||
p.oe.pop()
|
||||
}
|
||||
p.reconstructActiveFormattingElements()
|
||||
p.addElement(p.tok.Data, p.tok.Attr)
|
||||
default:
|
||||
// TODO.
|
||||
p.addElement(p.tok.Data, p.tok.Attr)
|
||||
|
@ -132,7 +132,7 @@ func TestParser(t *testing.T) {
|
||||
rc := make(chan io.Reader)
|
||||
go readDat(filename, rc)
|
||||
// TODO(nigeltao): Process all test cases, not just a subset.
|
||||
for i := 0; i < 34; i++ {
|
||||
for i := 0; i < 49; i++ {
|
||||
// Parse the #data section.
|
||||
b, err := ioutil.ReadAll(<-rc)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user