1
0
mirror of https://github.com/golang/go synced 2024-11-24 21:10:04 -07:00

html: parse <nobr> elements

Pass tests3.dat, test 20:
<!doctype html><nobr><nobr><nobr>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <nobr>
|     <nobr>
|     <nobr>

Also pass tests through test 22:
<!doctype html><html><body><p><table></table></body></html>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5438056
This commit is contained in:
Andrew Balholm 2011-11-28 10:55:31 +11:00 committed by Nigel Tao
parent 4c113ffe16
commit 68e7363b56
2 changed files with 8 additions and 1 deletions

View File

@ -679,6 +679,13 @@ func inBodyIM(p *parser) bool {
case "b", "big", "code", "em", "font", "i", "s", "small", "strike", "strong", "tt", "u":
p.reconstructActiveFormattingElements()
p.addFormattingElement(p.tok.Data, p.tok.Attr)
case "nobr":
p.reconstructActiveFormattingElements()
if p.elementInScope(defaultScopeStopTags, "nobr") {
p.inBodyEndTagFormatting("nobr")
p.reconstructActiveFormattingElements()
}
p.addFormattingElement(p.tok.Data, p.tok.Attr)
case "applet", "marquee", "object":
p.reconstructActiveFormattingElements()
p.addElement(p.tok.Data, p.tok.Attr)

View File

@ -152,7 +152,7 @@ func TestParser(t *testing.T) {
{"doctype01.dat", -1},
{"tests1.dat", -1},
{"tests2.dat", -1},
{"tests3.dat", 20},
{"tests3.dat", 23},
}
for _, tf := range testFiles {
f, err := os.Open("testdata/webkit/" + tf.filename)