summaryrefslogtreecommitdiff
path: root/libgo/go/html/const.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/html/const.go')
-rw-r--r--libgo/go/html/const.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/libgo/go/html/const.go b/libgo/go/html/const.go
index 832e9dbc096..d7cc8bb9a99 100644
--- a/libgo/go/html/const.go
+++ b/libgo/go/html/const.go
@@ -7,7 +7,7 @@ package html
// Section 12.2.3.2 of the HTML5 specification says "The following elements
// have varying levels of special parsing rules".
// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#the-stack-of-open-elements
-var isSpecialElement = map[string]bool{
+var isSpecialElementMap = map[string]bool{
"address": true,
"applet": true,
"area": true,
@@ -88,3 +88,13 @@ var isSpecialElement = map[string]bool{
"wbr": true,
"xmp": true,
}
+
+func isSpecialElement(element *Node) bool {
+ switch element.Namespace {
+ case "", "html":
+ return isSpecialElementMap[element.Data]
+ case "svg":
+ return element.Data == "foreignObject"
+ }
+ return false
+}