Commit 22e918f5 authored by Andrew Balholm's avatar Andrew Balholm Committed by Nigel Tao

exp/html: ignore </html> in afterBodyIM when parsing a fragment

Pass 1 additional test.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6454124
parent e4a50195
......@@ -42,6 +42,8 @@ type parser struct {
fosterParenting bool
// quirks is whether the parser is operating in "quirks mode."
quirks bool
// fragment is whether the parser is parsing an HTML fragment.
fragment bool
// context is the context element when parsing an HTML fragment
// (section 12.4).
context *Node
......@@ -1692,7 +1694,9 @@ func afterBodyIM(p *parser) bool {
}
case EndTagToken:
if p.tok.DataAtom == a.Html {
p.im = afterAfterBodyIM
if !p.fragment {
p.im = afterAfterBodyIM
}
return true
}
case CommentToken:
......@@ -2054,6 +2058,7 @@ func ParseFragment(r io.Reader, context *Node) ([]*Node, error) {
Type: DocumentNode,
},
scripting: true,
fragment: true,
context: context,
}
......
......@@ -80,6 +80,6 @@ PASS "</select><option>"
PASS "<input><option>"
PASS "<keygen><option>"
PASS "<textarea><option>"
FAIL "</html><!--abc-->"
PASS "</html><!--abc-->"
PASS "</frameset><frame>"
PASS ""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment