1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // Section 12.2.3.2 of the HTML5 specification says "The following elements
8 // have varying levels of special parsing rules".
9 // https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements
10 var isSpecialElementMap = map[string]bool{
94 func isSpecialElement(element *Node) bool {
95 switch element.Namespace {
97 return isSpecialElementMap[element.Data]
99 return element.Data == "foreignObject"