mirror of
https://github.com/golang/go
synced 2024-11-25 13:07:57 -07:00
html: don't run "adoption agency" on elements that aren't in scope.
Pass tests1.dat, test 55: <!DOCTYPE html><font><table></font></table></font> | <!DOCTYPE html> | <html> | <head> | <body> | <font> | <table> Also pass tests through test 69: <DIV> abc <B> def <I> ghi <P> jkl R=nigeltao CC=golang-dev https://golang.org/cl/5309074
This commit is contained in:
parent
0e81e508be
commit
03f163c7f2
@ -675,6 +675,10 @@ func (p *parser) inBodyEndTagFormatting(tag string) {
|
|||||||
p.afe.remove(formattingElement)
|
p.afe.remove(formattingElement)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if !p.elementInScope(defaultScopeStopTags, tag) {
|
||||||
|
// Ignore the tag.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Steps 5-6. Find the furthest block.
|
// Steps 5-6. Find the furthest block.
|
||||||
var furthestBlock *Node
|
var furthestBlock *Node
|
||||||
|
@ -132,7 +132,7 @@ func TestParser(t *testing.T) {
|
|||||||
rc := make(chan io.Reader)
|
rc := make(chan io.Reader)
|
||||||
go readDat(filename, rc)
|
go readDat(filename, rc)
|
||||||
// TODO(nigeltao): Process all test cases, not just a subset.
|
// TODO(nigeltao): Process all test cases, not just a subset.
|
||||||
for i := 0; i < 55; i++ {
|
for i := 0; i < 70; i++ {
|
||||||
// Parse the #data section.
|
// Parse the #data section.
|
||||||
b, err := ioutil.ReadAll(<-rc)
|
b, err := ioutil.ReadAll(<-rc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user