mirror of
https://github.com/golang/net.git
synced 2026-03-31 10:27:08 +09:00
html: make (*nodeStack)contains distinguish namespace
By proceeding without distinguishing namespace, inconsistency will occur. This commit makes the method distinguish the HTML namespace. Fixes golang/go#27846 Change-Id: I8269f670240c0fe31162a16fbe1ac23acacec00f Reviewed-on: https://go-review.googlesource.com/c/159397 Run-TryBot: Kunpei Sakai <namusyaka@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Nigel Tao <nigeltao@golang.org>
This commit is contained in:
@@ -177,7 +177,7 @@ func (s *nodeStack) index(n *Node) int {
|
||||
// contains returns whether a is within s.
|
||||
func (s *nodeStack) contains(a atom.Atom) bool {
|
||||
for _, n := range *s {
|
||||
if n.DataAtom == a {
|
||||
if n.DataAtom == a && n.Namespace == "" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
25
html/testdata/go/template.dat
vendored
25
html/testdata/go/template.dat
vendored
@@ -35,3 +35,28 @@
|
||||
| <math mo>
|
||||
| <template>
|
||||
| content
|
||||
|
||||
#data
|
||||
<svg><template><desc><t><svg></template>
|
||||
#errors
|
||||
#document
|
||||
| <html>
|
||||
| <head>
|
||||
| <body>
|
||||
| <svg svg>
|
||||
| <svg template>
|
||||
| <svg desc>
|
||||
| <t>
|
||||
| <svg svg>
|
||||
|
||||
#data
|
||||
<math><template><mn><b></template>
|
||||
#errors
|
||||
#document
|
||||
| <html>
|
||||
| <head>
|
||||
| <body>
|
||||
| <math math>
|
||||
| <math template>
|
||||
| <math mn>
|
||||
| <b>
|
||||
|
||||
Reference in New Issue
Block a user