OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [exp/] [html/] [const.go] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// 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.
4
 
5
package html
6
 
7
// Section 12.2.3.2 of the HTML5 specification says "The following elements
8
// have varying levels of special parsing rules".
9
// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#the-stack-of-open-elements
10
var isSpecialElementMap = map[string]bool{
11
        "address":    true,
12
        "applet":     true,
13
        "area":       true,
14
        "article":    true,
15
        "aside":      true,
16
        "base":       true,
17
        "basefont":   true,
18
        "bgsound":    true,
19
        "blockquote": true,
20
        "body":       true,
21
        "br":         true,
22
        "button":     true,
23
        "caption":    true,
24
        "center":     true,
25
        "col":        true,
26
        "colgroup":   true,
27
        "command":    true,
28
        "dd":         true,
29
        "details":    true,
30
        "dir":        true,
31
        "div":        true,
32
        "dl":         true,
33
        "dt":         true,
34
        "embed":      true,
35
        "fieldset":   true,
36
        "figcaption": true,
37
        "figure":     true,
38
        "footer":     true,
39
        "form":       true,
40
        "frame":      true,
41
        "frameset":   true,
42
        "h1":         true,
43
        "h2":         true,
44
        "h3":         true,
45
        "h4":         true,
46
        "h5":         true,
47
        "h6":         true,
48
        "head":       true,
49
        "header":     true,
50
        "hgroup":     true,
51
        "hr":         true,
52
        "html":       true,
53
        "iframe":     true,
54
        "img":        true,
55
        "input":      true,
56
        "isindex":    true,
57
        "li":         true,
58
        "link":       true,
59
        "listing":    true,
60
        "marquee":    true,
61
        "menu":       true,
62
        "meta":       true,
63
        "nav":        true,
64
        "noembed":    true,
65
        "noframes":   true,
66
        "noscript":   true,
67
        "object":     true,
68
        "ol":         true,
69
        "p":          true,
70
        "param":      true,
71
        "plaintext":  true,
72
        "pre":        true,
73
        "script":     true,
74
        "section":    true,
75
        "select":     true,
76
        "style":      true,
77
        "summary":    true,
78
        "table":      true,
79
        "tbody":      true,
80
        "td":         true,
81
        "textarea":   true,
82
        "tfoot":      true,
83
        "th":         true,
84
        "thead":      true,
85
        "title":      true,
86
        "tr":         true,
87
        "ul":         true,
88
        "wbr":        true,
89
        "xmp":        true,
90
}
91
 
92
func isSpecialElement(element *Node) bool {
93
        switch element.Namespace {
94
        case "", "html":
95
                return isSpecialElementMap[element.Data]
96
        case "svg":
97
                return element.Data == "foreignObject"
98
        }
99
        return false
100
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.