From: Andrew Balholm Date: Tue, 7 Aug 2012 03:36:08 +0000 (+1000) Subject: exp/html: correctly handle after </head> X-Git-Tag: go1.1rc2~2684 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5530a426efed5baa88e47ac73be19d7b7e99d743;p=gostls13.git exp/html: correctly handle <title> after </head> The <title> element was getting removed from the stack of open elements, when its parent, the <head> element should have been removed instead. Pass 2 additional tests. R=nigeltao CC=golang-dev https://golang.org/cl/6449101 --- diff --git a/src/pkg/exp/html/parse.go b/src/pkg/exp/html/parse.go index 6b1f40cb8e..0bde2fe0e7 100644 --- a/src/pkg/exp/html/parse.go +++ b/src/pkg/exp/html/parse.go @@ -669,7 +669,7 @@ func afterHeadIM(p *parser) bool { return true case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: p.oe = append(p.oe, p.head) - defer p.oe.pop() + defer p.oe.remove(p.head) return inHeadIM(p) case a.Head: // Ignore the token. diff --git a/src/pkg/exp/html/testlogs/tests7.dat.log b/src/pkg/exp/html/testlogs/tests7.dat.log index 85d6c77088..dfb956b01f 100644 --- a/src/pkg/exp/html/testlogs/tests7.dat.log +++ b/src/pkg/exp/html/testlogs/tests7.dat.log @@ -1,7 +1,7 @@ PASS "<!doctype html><body><title>X" PASS "X
" -FAIL "X" -FAIL "X" +PASS "X" +PASS "X" PASS "
" PASS "X
" PASS " "