aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/html/parse.go
diff options
context:
space:
mode:
authorAndrew Balholm <andybalholm@gmail.com>2011-11-04 09:29:06 +1100
committerNigel Tao <nigeltao@golang.org>2011-11-04 09:29:06 +1100
commit46308d7d1191b75dc86f848dbc362616f5b0b0cb (patch)
tree389c0b6c2478ab0602c768b7c61fafa55c965cd0 /src/pkg/html/parse.go
parenta7f1141dee05bf889b64401c787f08e1c8643e88 (diff)
downloadgo-46308d7d1191b75dc86f848dbc362616f5b0b0cb.tar.xz
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
Diffstat (limited to 'src/pkg/html/parse.go')
-rw-r--r--src/pkg/html/parse.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pkg/html/parse.go b/src/pkg/html/parse.go
index 38f8ba481a..0204b7c281 100644
--- a/src/pkg/html/parse.go
+++ b/src/pkg/html/parse.go
@@ -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: