1
0
mirror of https://github.com/golang/go synced 2024-11-20 01:14:40 -07:00

html: move <link> element from after <head> into <head>

Pass tests1.dat, test 85:
<head><meta></head><link>

| <html>
|   <head>
|     <meta>
|     <link>
|   <body>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5297079
This commit is contained in:
Andrew Balholm 2011-11-04 09:29:06 +11:00 committed by Nigel Tao
parent a7f1141dee
commit 46308d7d11
2 changed files with 5 additions and 2 deletions

View File

@ -427,6 +427,7 @@ func beforeHeadIM(p *parser) (insertionMode, bool) {
}
if add || implied {
p.addElement("head", attr)
p.head = p.top()
}
return inHeadIM, !implied
}
@ -511,7 +512,9 @@ func afterHeadIM(p *parser) (insertionMode, bool) {
case "frameset":
// TODO.
case "base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "title":
// TODO.
p.oe = append(p.oe, p.head)
defer p.oe.pop()
return useTheRulesFor(p, afterHeadIM, inHeadIM)
case "head":
// TODO.
default:

View File

@ -133,7 +133,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 < 85; i++ {
for i := 0; i < 86; i++ {
// Parse the #data section.
b, err := ioutil.ReadAll(<-rc)
if err != nil {