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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [exp/] [html/] [foreign.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
import (
8
        "strings"
9
)
10
 
11
func adjustForeignAttributes(aa []Attribute) {
12
        for i, a := range aa {
13
                if a.Key == "" || a.Key[0] != 'x' {
14
                        continue
15
                }
16
                switch a.Key {
17
                case "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show",
18
                        "xlink:title", "xlink:type", "xml:base", "xml:lang", "xml:space", "xmlns:xlink":
19
                        j := strings.Index(a.Key, ":")
20
                        aa[i].Namespace = a.Key[:j]
21
                        aa[i].Key = a.Key[j+1:]
22
                }
23
        }
24
}
25
 
26
func htmlIntegrationPoint(n *Node) bool {
27
        if n.Type != ElementNode {
28
                return false
29
        }
30
        switch n.Namespace {
31
        case "math":
32
                // TODO: annotation-xml elements whose start tags have "text/html" or
33
                // "application/xhtml+xml" encodings.
34
        case "svg":
35
                switch n.Data {
36
                case "desc", "foreignObject", "title":
37
                        return true
38
                }
39
        }
40
        return false
41
}
42
 
43
// Section 12.2.5.5.
44
var breakout = map[string]bool{
45
        "b":          true,
46
        "big":        true,
47
        "blockquote": true,
48
        "body":       true,
49
        "br":         true,
50
        "center":     true,
51
        "code":       true,
52
        "dd":         true,
53
        "div":        true,
54
        "dl":         true,
55
        "dt":         true,
56
        "em":         true,
57
        "embed":      true,
58
        "font":       true,
59
        "h1":         true,
60
        "h2":         true,
61
        "h3":         true,
62
        "h4":         true,
63
        "h5":         true,
64
        "h6":         true,
65
        "head":       true,
66
        "hr":         true,
67
        "i":          true,
68
        "img":        true,
69
        "li":         true,
70
        "listing":    true,
71
        "menu":       true,
72
        "meta":       true,
73
        "nobr":       true,
74
        "ol":         true,
75
        "p":          true,
76
        "pre":        true,
77
        "ruby":       true,
78
        "s":          true,
79
        "small":      true,
80
        "span":       true,
81
        "strong":     true,
82
        "strike":     true,
83
        "sub":        true,
84
        "sup":        true,
85
        "table":      true,
86
        "tt":         true,
87
        "u":          true,
88
        "ul":         true,
89
        "var":        true,
90
}
91
 
92
// Section 12.2.5.5.
93
var svgTagNameAdjustments = map[string]string{
94
        "altglyph":            "altGlyph",
95
        "altglyphdef":         "altGlyphDef",
96
        "altglyphitem":        "altGlyphItem",
97
        "animatecolor":        "animateColor",
98
        "animatemotion":       "animateMotion",
99
        "animatetransform":    "animateTransform",
100
        "clippath":            "clipPath",
101
        "feblend":             "feBlend",
102
        "fecolormatrix":       "feColorMatrix",
103
        "fecomponenttransfer": "feComponentTransfer",
104
        "fecomposite":         "feComposite",
105
        "feconvolvematrix":    "feConvolveMatrix",
106
        "fediffuselighting":   "feDiffuseLighting",
107
        "fedisplacementmap":   "feDisplacementMap",
108
        "fedistantlight":      "feDistantLight",
109
        "feflood":             "feFlood",
110
        "fefunca":             "feFuncA",
111
        "fefuncb":             "feFuncB",
112
        "fefuncg":             "feFuncG",
113
        "fefuncr":             "feFuncR",
114
        "fegaussianblur":      "feGaussianBlur",
115
        "feimage":             "feImage",
116
        "femerge":             "feMerge",
117
        "femergenode":         "feMergeNode",
118
        "femorphology":        "feMorphology",
119
        "feoffset":            "feOffset",
120
        "fepointlight":        "fePointLight",
121
        "fespecularlighting":  "feSpecularLighting",
122
        "fespotlight":         "feSpotLight",
123
        "fetile":              "feTile",
124
        "feturbulence":        "feTurbulence",
125
        "foreignobject":       "foreignObject",
126
        "glyphref":            "glyphRef",
127
        "lineargradient":      "linearGradient",
128
        "radialgradient":      "radialGradient",
129
        "textpath":            "textPath",
130
}
131
 
132
// TODO: add look-up tables for MathML and SVG attribute adjustments.

powered by: WebSVN 2.1.0

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