mirror of
https://github.com/golang/go
synced 2024-11-22 00:44:39 -07:00
exp/html: ignore </html> in afterBodyIM when parsing a fragment
Pass 1 additional test. R=nigeltao CC=golang-dev https://golang.org/cl/6454124
This commit is contained in:
parent
e4a50195c3
commit
22e918f5d6
@ -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 ""
|
||||
|
Loading…
Reference in New Issue
Block a user