@emasoft/svg-matrix 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/svg-matrix.js +7 -6
- package/bin/svgm.js +109 -40
- package/dist/svg-matrix.min.js +7 -7
- package/dist/svg-toolbox.min.js +148 -228
- package/dist/svgm.min.js +152 -232
- package/dist/version.json +5 -5
- package/package.json +1 -1
- package/scripts/postinstall.js +72 -41
- package/scripts/test-postinstall.js +18 -16
- package/scripts/version-sync.js +78 -60
- package/src/animation-optimization.js +190 -98
- package/src/animation-references.js +11 -3
- package/src/arc-length.js +23 -20
- package/src/bezier-analysis.js +9 -13
- package/src/bezier-intersections.js +18 -4
- package/src/browser-verify.js +35 -8
- package/src/clip-path-resolver.js +285 -114
- package/src/convert-path-data.js +20 -8
- package/src/css-specificity.js +33 -9
- package/src/douglas-peucker.js +272 -141
- package/src/geometry-to-path.js +79 -22
- package/src/gjk-collision.js +287 -126
- package/src/index.js +56 -21
- package/src/inkscape-support.js +122 -101
- package/src/logger.js +43 -27
- package/src/marker-resolver.js +201 -121
- package/src/mask-resolver.js +231 -98
- package/src/matrix.js +9 -5
- package/src/mesh-gradient.js +22 -14
- package/src/off-canvas-detection.js +53 -17
- package/src/path-optimization.js +356 -171
- package/src/path-simplification.js +671 -256
- package/src/pattern-resolver.js +1 -3
- package/src/polygon-clip.js +396 -78
- package/src/svg-boolean-ops.js +90 -23
- package/src/svg-collections.js +1546 -667
- package/src/svg-flatten.js +152 -38
- package/src/svg-matrix-lib.js +2 -2
- package/src/svg-parser.js +5 -1
- package/src/svg-rendering-context.js +3 -1
- package/src/svg-toolbox-lib.js +2 -2
- package/src/svg-toolbox.js +99 -457
- package/src/svg-validation-data.js +513 -345
- package/src/svg2-polyfills.js +156 -93
- package/src/svgm-lib.js +8 -4
- package/src/transform-optimization.js +168 -51
- package/src/transforms2d.js +73 -40
- package/src/transforms3d.js +34 -27
- package/src/use-symbol-resolver.js +175 -76
- package/src/vector.js +80 -44
- package/src/vendor/inkscape-hatch-polyfill.js +143 -108
- package/src/vendor/inkscape-hatch-polyfill.min.js +291 -1
- package/src/vendor/inkscape-mesh-polyfill.js +953 -766
- package/src/vendor/inkscape-mesh-polyfill.min.js +896 -1
- package/src/verification.js +3 -4
package/src/svg-collections.js
CHANGED
|
@@ -14,64 +14,64 @@
|
|
|
14
14
|
* Reference: SVG 1.1 spec, CSS inheritance rules
|
|
15
15
|
*/
|
|
16
16
|
export const inheritableAttrs = new Set([
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
17
|
+
"clip-rule",
|
|
18
|
+
"color",
|
|
19
|
+
"color-interpolation",
|
|
20
|
+
"color-interpolation-filters",
|
|
21
|
+
"color-profile",
|
|
22
|
+
"color-rendering",
|
|
23
|
+
"cursor",
|
|
24
|
+
"direction",
|
|
25
|
+
"dominant-baseline",
|
|
26
|
+
"fill",
|
|
27
|
+
"fill-opacity",
|
|
28
|
+
"fill-rule",
|
|
29
|
+
"font",
|
|
30
|
+
"font-family",
|
|
31
|
+
"font-size",
|
|
32
|
+
"font-size-adjust",
|
|
33
|
+
"font-stretch",
|
|
34
|
+
"font-style",
|
|
35
|
+
"font-variant",
|
|
36
|
+
"font-weight",
|
|
37
|
+
"glyph-orientation-horizontal",
|
|
38
|
+
"glyph-orientation-vertical",
|
|
39
|
+
"image-rendering",
|
|
40
|
+
"letter-spacing",
|
|
41
|
+
"marker",
|
|
42
|
+
"marker-end",
|
|
43
|
+
"marker-mid",
|
|
44
|
+
"marker-start",
|
|
45
|
+
"paint-order",
|
|
46
|
+
"pointer-events",
|
|
47
|
+
"shape-rendering",
|
|
48
|
+
"stroke",
|
|
49
|
+
"stroke-dasharray",
|
|
50
|
+
"stroke-dashoffset",
|
|
51
|
+
"stroke-linecap",
|
|
52
|
+
"stroke-linejoin",
|
|
53
|
+
"stroke-miterlimit",
|
|
54
|
+
"stroke-opacity",
|
|
55
|
+
"stroke-width",
|
|
56
|
+
"text-anchor",
|
|
57
|
+
"text-rendering",
|
|
58
|
+
"visibility",
|
|
59
|
+
"word-spacing",
|
|
60
|
+
"writing-mode",
|
|
61
61
|
]);
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Presentation attributes that do NOT inherit
|
|
65
65
|
*/
|
|
66
66
|
export const nonInheritableAttrs = new Set([
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
"clip-path",
|
|
68
|
+
"display",
|
|
69
|
+
"filter",
|
|
70
|
+
"mask",
|
|
71
|
+
"opacity",
|
|
72
|
+
"text-decoration",
|
|
73
|
+
"transform",
|
|
74
|
+
"unicode-bidi",
|
|
75
75
|
]);
|
|
76
76
|
|
|
77
77
|
// ============================================================================
|
|
@@ -82,18 +82,18 @@ export const nonInheritableAttrs = new Set([
|
|
|
82
82
|
* Attributes that can contain url() references to other elements
|
|
83
83
|
*/
|
|
84
84
|
export const referencesProps = new Set([
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
85
|
+
"clip-path",
|
|
86
|
+
"color-profile",
|
|
87
|
+
"fill",
|
|
88
|
+
"filter",
|
|
89
|
+
"href",
|
|
90
|
+
"marker-end",
|
|
91
|
+
"marker-mid",
|
|
92
|
+
"marker-start",
|
|
93
|
+
"mask",
|
|
94
|
+
"stroke",
|
|
95
|
+
"style",
|
|
96
|
+
"xlink:href",
|
|
97
97
|
]);
|
|
98
98
|
|
|
99
99
|
// ============================================================================
|
|
@@ -103,46 +103,102 @@ export const referencesProps = new Set([
|
|
|
103
103
|
export const elemsGroups = {
|
|
104
104
|
animation: new Set([
|
|
105
105
|
// Include both mixed-case and lowercase for case-insensitive matching
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
"animate",
|
|
107
|
+
"animateColor",
|
|
108
|
+
"animatecolor",
|
|
109
|
+
"animateMotion",
|
|
110
|
+
"animatemotion",
|
|
111
|
+
"animateTransform",
|
|
112
|
+
"animatetransform",
|
|
113
|
+
"set",
|
|
111
114
|
]),
|
|
115
|
+
descriptive: new Set(["desc", "metadata", "title"]),
|
|
112
116
|
shape: new Set([
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
"circle",
|
|
118
|
+
"ellipse",
|
|
119
|
+
"line",
|
|
120
|
+
"path",
|
|
121
|
+
"polygon",
|
|
122
|
+
"polyline",
|
|
123
|
+
"rect",
|
|
117
124
|
]),
|
|
125
|
+
structural: new Set(["defs", "g", "svg", "symbol", "use"]),
|
|
118
126
|
paintServer: new Set([
|
|
119
127
|
// Include both mixed-case and lowercase for case-insensitive matching
|
|
120
|
-
|
|
121
|
-
|
|
128
|
+
"hatch",
|
|
129
|
+
"linearGradient",
|
|
130
|
+
"lineargradient",
|
|
131
|
+
"meshGradient",
|
|
132
|
+
"meshgradient",
|
|
133
|
+
"pattern",
|
|
134
|
+
"radialGradient",
|
|
135
|
+
"radialgradient",
|
|
136
|
+
"solidColor",
|
|
137
|
+
"solidcolor",
|
|
122
138
|
]),
|
|
123
139
|
nonRendering: new Set([
|
|
124
140
|
// Include both mixed-case and lowercase for case-insensitive matching
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
141
|
+
"clipPath",
|
|
142
|
+
"clippath",
|
|
143
|
+
"filter",
|
|
144
|
+
"linearGradient",
|
|
145
|
+
"lineargradient",
|
|
146
|
+
"marker",
|
|
147
|
+
"mask",
|
|
148
|
+
"pattern",
|
|
149
|
+
"radialGradient",
|
|
150
|
+
"radialgradient",
|
|
151
|
+
"solidColor",
|
|
152
|
+
"solidcolor",
|
|
153
|
+
"symbol",
|
|
128
154
|
]),
|
|
129
155
|
container: new Set([
|
|
130
|
-
|
|
156
|
+
"a",
|
|
157
|
+
"defs",
|
|
158
|
+
"g",
|
|
159
|
+
"marker",
|
|
160
|
+
"mask",
|
|
161
|
+
"pattern",
|
|
162
|
+
"svg",
|
|
163
|
+
"switch",
|
|
164
|
+
"symbol",
|
|
131
165
|
]),
|
|
132
166
|
textContent: new Set([
|
|
133
|
-
|
|
134
|
-
|
|
167
|
+
"altGlyph",
|
|
168
|
+
"altGlyphDef",
|
|
169
|
+
"altGlyphItem",
|
|
170
|
+
"glyph",
|
|
171
|
+
"glyphRef",
|
|
172
|
+
"text",
|
|
173
|
+
"textPath",
|
|
174
|
+
"tref",
|
|
175
|
+
"tspan",
|
|
135
176
|
]),
|
|
136
177
|
filterPrimitive: new Set([
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
178
|
+
"feBlend",
|
|
179
|
+
"feColorMatrix",
|
|
180
|
+
"feComponentTransfer",
|
|
181
|
+
"feComposite",
|
|
182
|
+
"feConvolveMatrix",
|
|
183
|
+
"feDiffuseLighting",
|
|
184
|
+
"feDisplacementMap",
|
|
185
|
+
"feDropShadow",
|
|
186
|
+
"feFlood",
|
|
187
|
+
"feFuncA",
|
|
188
|
+
"feFuncB",
|
|
189
|
+
"feFuncG",
|
|
190
|
+
"feFuncR",
|
|
191
|
+
"feGaussianBlur",
|
|
192
|
+
"feImage",
|
|
193
|
+
"feMerge",
|
|
194
|
+
"feMergeNode",
|
|
195
|
+
"feMorphology",
|
|
196
|
+
"feOffset",
|
|
197
|
+
"feSpecularLighting",
|
|
198
|
+
"feTile",
|
|
199
|
+
"feTurbulence",
|
|
145
200
|
]),
|
|
201
|
+
lightSource: new Set(["feDistantLight", "fePointLight", "feSpotLight"]),
|
|
146
202
|
};
|
|
147
203
|
|
|
148
204
|
// ============================================================================
|
|
@@ -153,33 +209,33 @@ export const elemsGroups = {
|
|
|
153
209
|
* Namespaces used by various SVG editors that can be safely removed
|
|
154
210
|
*/
|
|
155
211
|
export const editorNamespaces = new Set([
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
212
|
+
"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",
|
|
213
|
+
"http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd",
|
|
214
|
+
"http://www.inkscape.org/namespaces/inkscape",
|
|
215
|
+
"http://www.bohemiancoding.com/sketch/ns",
|
|
216
|
+
"http://ns.adobe.com/AdobeIllustrator/10.0/",
|
|
217
|
+
"http://ns.adobe.com/Graphs/1.0/",
|
|
218
|
+
"http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/",
|
|
219
|
+
"http://ns.adobe.com/Variables/1.0/",
|
|
220
|
+
"http://ns.adobe.com/SaveForWeb/1.0/",
|
|
221
|
+
"http://ns.adobe.com/Extensibility/1.0/",
|
|
222
|
+
"http://ns.adobe.com/Flows/1.0/",
|
|
223
|
+
"http://ns.adobe.com/ImageReplacement/1.0/",
|
|
224
|
+
"http://ns.adobe.com/GenericCustomNamespace/1.0/",
|
|
225
|
+
"http://ns.adobe.com/XPath/1.0/",
|
|
226
|
+
"http://schemas.microsoft.com/visio/2003/SVGExtensions/",
|
|
227
|
+
"http://taptrix.com/vectorillustrator/svg_extensions",
|
|
228
|
+
"http://www.figma.com/figma/ns",
|
|
229
|
+
"http://purl.org/dc/elements/1.1/",
|
|
230
|
+
"http://creativecommons.org/ns#",
|
|
231
|
+
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
232
|
+
"http://www.serif.com/",
|
|
233
|
+
"http://www.vector.evaxdesign.sk",
|
|
178
234
|
// Additional editor namespaces
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
235
|
+
"http://www.corel.com/coreldraw/svg",
|
|
236
|
+
"http://gravit.io/ns",
|
|
237
|
+
"http://serif.com/affinity",
|
|
238
|
+
"http://canva.com/ns",
|
|
183
239
|
]);
|
|
184
240
|
|
|
185
241
|
// ============================================================================
|
|
@@ -192,193 +248,193 @@ export const editorNamespaces = new Set([
|
|
|
192
248
|
* All keys are lowercase. When looking up colors, normalize input with .toLowerCase()
|
|
193
249
|
*/
|
|
194
250
|
export const colorsNames = {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
251
|
+
aliceblue: "#f0f8ff",
|
|
252
|
+
antiquewhite: "#faebd7",
|
|
253
|
+
aqua: "#0ff",
|
|
254
|
+
aquamarine: "#7fffd4",
|
|
255
|
+
azure: "#f0ffff",
|
|
256
|
+
beige: "#f5f5dc",
|
|
257
|
+
bisque: "#ffe4c4",
|
|
258
|
+
black: "#000",
|
|
259
|
+
blanchedalmond: "#ffebcd",
|
|
260
|
+
blue: "#00f",
|
|
261
|
+
blueviolet: "#8a2be2",
|
|
262
|
+
brown: "#a52a2a",
|
|
263
|
+
burlywood: "#deb887",
|
|
264
|
+
cadetblue: "#5f9ea0",
|
|
265
|
+
chartreuse: "#7fff00",
|
|
266
|
+
chocolate: "#d2691e",
|
|
267
|
+
coral: "#ff7f50",
|
|
268
|
+
cornflowerblue: "#6495ed",
|
|
269
|
+
cornsilk: "#fff8dc",
|
|
270
|
+
crimson: "#dc143c",
|
|
271
|
+
cyan: "#0ff",
|
|
272
|
+
darkblue: "#00008b",
|
|
273
|
+
darkcyan: "#008b8b",
|
|
274
|
+
darkgoldenrod: "#b8860b",
|
|
275
|
+
darkgray: "#a9a9a9",
|
|
276
|
+
darkgreen: "#006400",
|
|
277
|
+
darkgrey: "#a9a9a9",
|
|
278
|
+
darkkhaki: "#bdb76b",
|
|
279
|
+
darkmagenta: "#8b008b",
|
|
280
|
+
darkolivegreen: "#556b2f",
|
|
281
|
+
darkorange: "#ff8c00",
|
|
282
|
+
darkorchid: "#9932cc",
|
|
283
|
+
darkred: "#8b0000",
|
|
284
|
+
darksalmon: "#e9967a",
|
|
285
|
+
darkseagreen: "#8fbc8f",
|
|
286
|
+
darkslateblue: "#483d8b",
|
|
287
|
+
darkslategray: "#2f4f4f",
|
|
288
|
+
darkslategrey: "#2f4f4f",
|
|
289
|
+
darkturquoise: "#00ced1",
|
|
290
|
+
darkviolet: "#9400d3",
|
|
291
|
+
deeppink: "#ff1493",
|
|
292
|
+
deepskyblue: "#00bfff",
|
|
293
|
+
dimgray: "#696969",
|
|
294
|
+
dimgrey: "#696969",
|
|
295
|
+
dodgerblue: "#1e90ff",
|
|
296
|
+
firebrick: "#b22222",
|
|
297
|
+
floralwhite: "#fffaf0",
|
|
298
|
+
forestgreen: "#228b22",
|
|
299
|
+
fuchsia: "#f0f",
|
|
300
|
+
gainsboro: "#dcdcdc",
|
|
301
|
+
ghostwhite: "#f8f8ff",
|
|
302
|
+
gold: "#ffd700",
|
|
303
|
+
goldenrod: "#daa520",
|
|
304
|
+
gray: "#808080",
|
|
305
|
+
green: "#008000",
|
|
306
|
+
greenyellow: "#adff2f",
|
|
307
|
+
grey: "#808080",
|
|
308
|
+
honeydew: "#f0fff0",
|
|
309
|
+
hotpink: "#ff69b4",
|
|
310
|
+
indianred: "#cd5c5c",
|
|
311
|
+
indigo: "#4b0082",
|
|
312
|
+
ivory: "#fffff0",
|
|
313
|
+
khaki: "#f0e68c",
|
|
314
|
+
lavender: "#e6e6fa",
|
|
315
|
+
lavenderblush: "#fff0f5",
|
|
316
|
+
lawngreen: "#7cfc00",
|
|
317
|
+
lemonchiffon: "#fffacd",
|
|
318
|
+
lightblue: "#add8e6",
|
|
319
|
+
lightcoral: "#f08080",
|
|
320
|
+
lightcyan: "#e0ffff",
|
|
321
|
+
lightgoldenrodyellow: "#fafad2",
|
|
322
|
+
lightgray: "#d3d3d3",
|
|
323
|
+
lightgreen: "#90ee90",
|
|
324
|
+
lightgrey: "#d3d3d3",
|
|
325
|
+
lightpink: "#ffb6c1",
|
|
326
|
+
lightsalmon: "#ffa07a",
|
|
327
|
+
lightseagreen: "#20b2aa",
|
|
328
|
+
lightskyblue: "#87cefa",
|
|
329
|
+
lightslategray: "#789",
|
|
330
|
+
lightslategrey: "#789",
|
|
331
|
+
lightsteelblue: "#b0c4de",
|
|
332
|
+
lightyellow: "#ffffe0",
|
|
333
|
+
lime: "#0f0",
|
|
334
|
+
limegreen: "#32cd32",
|
|
335
|
+
linen: "#faf0e6",
|
|
336
|
+
magenta: "#f0f",
|
|
337
|
+
maroon: "#800000",
|
|
338
|
+
mediumaquamarine: "#66cdaa",
|
|
339
|
+
mediumblue: "#0000cd",
|
|
340
|
+
mediumorchid: "#ba55d3",
|
|
341
|
+
mediumpurple: "#9370db",
|
|
342
|
+
mediumseagreen: "#3cb371",
|
|
343
|
+
mediumslateblue: "#7b68ee",
|
|
344
|
+
mediumspringgreen: "#00fa9a",
|
|
345
|
+
mediumturquoise: "#48d1cc",
|
|
346
|
+
mediumvioletred: "#c71585",
|
|
347
|
+
midnightblue: "#191970",
|
|
348
|
+
mintcream: "#f5fffa",
|
|
349
|
+
mistyrose: "#ffe4e1",
|
|
350
|
+
moccasin: "#ffe4b5",
|
|
351
|
+
navajowhite: "#ffdead",
|
|
352
|
+
navy: "#000080",
|
|
353
|
+
oldlace: "#fdf5e6",
|
|
354
|
+
olive: "#808000",
|
|
355
|
+
olivedrab: "#6b8e23",
|
|
356
|
+
orange: "#ffa500",
|
|
357
|
+
orangered: "#ff4500",
|
|
358
|
+
orchid: "#da70d6",
|
|
359
|
+
palegoldenrod: "#eee8aa",
|
|
360
|
+
palegreen: "#98fb98",
|
|
361
|
+
paleturquoise: "#afeeee",
|
|
362
|
+
palevioletred: "#db7093",
|
|
363
|
+
papayawhip: "#ffefd5",
|
|
364
|
+
peachpuff: "#ffdab9",
|
|
365
|
+
peru: "#cd853f",
|
|
366
|
+
pink: "#ffc0cb",
|
|
367
|
+
plum: "#dda0dd",
|
|
368
|
+
powderblue: "#b0e0e6",
|
|
369
|
+
purple: "#800080",
|
|
370
|
+
rebeccapurple: "#639",
|
|
371
|
+
red: "#f00",
|
|
372
|
+
rosybrown: "#bc8f8f",
|
|
373
|
+
royalblue: "#4169e1",
|
|
374
|
+
saddlebrown: "#8b4513",
|
|
375
|
+
salmon: "#fa8072",
|
|
376
|
+
sandybrown: "#f4a460",
|
|
377
|
+
seagreen: "#2e8b57",
|
|
378
|
+
seashell: "#fff5ee",
|
|
379
|
+
sienna: "#a0522d",
|
|
380
|
+
silver: "#c0c0c0",
|
|
381
|
+
skyblue: "#87ceeb",
|
|
382
|
+
slateblue: "#6a5acd",
|
|
383
|
+
slategray: "#708090",
|
|
384
|
+
slategrey: "#708090",
|
|
385
|
+
snow: "#fffafa",
|
|
386
|
+
springgreen: "#00ff7f",
|
|
387
|
+
steelblue: "#4682b4",
|
|
388
|
+
tan: "#d2b48c",
|
|
389
|
+
teal: "#008080",
|
|
390
|
+
thistle: "#d8bfd8",
|
|
391
|
+
tomato: "#ff6347",
|
|
392
|
+
turquoise: "#40e0d0",
|
|
393
|
+
violet: "#ee82ee",
|
|
394
|
+
wheat: "#f5deb3",
|
|
395
|
+
white: "#fff",
|
|
396
|
+
whitesmoke: "#f5f5f5",
|
|
397
|
+
yellow: "#ff0",
|
|
398
|
+
yellowgreen: "#9acd32",
|
|
343
399
|
};
|
|
344
400
|
|
|
345
401
|
/**
|
|
346
402
|
* Hex values that have shorter color names
|
|
347
403
|
*/
|
|
348
404
|
export const colorsShortNames = {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
405
|
+
"#f0ffff": "azure",
|
|
406
|
+
"#f5f5dc": "beige",
|
|
407
|
+
"#ffe4c4": "bisque",
|
|
408
|
+
"#a52a2a": "brown",
|
|
409
|
+
"#ff7f50": "coral",
|
|
410
|
+
"#ffd700": "gold",
|
|
411
|
+
"#808080": "gray",
|
|
412
|
+
"#008000": "green",
|
|
413
|
+
"#4b0082": "indigo",
|
|
414
|
+
"#fffff0": "ivory",
|
|
415
|
+
"#f0e68c": "khaki",
|
|
416
|
+
"#faf0e6": "linen",
|
|
417
|
+
"#800000": "maroon",
|
|
418
|
+
"#000080": "navy",
|
|
419
|
+
"#808000": "olive",
|
|
420
|
+
"#ffa500": "orange",
|
|
421
|
+
"#da70d6": "orchid",
|
|
422
|
+
"#cd853f": "peru",
|
|
423
|
+
"#ffc0cb": "pink",
|
|
424
|
+
"#dda0dd": "plum",
|
|
425
|
+
"#800080": "purple",
|
|
426
|
+
"#f00": "red",
|
|
427
|
+
"#fa8072": "salmon",
|
|
428
|
+
"#a0522d": "sienna",
|
|
429
|
+
"#c0c0c0": "silver",
|
|
430
|
+
"#fffafa": "snow",
|
|
431
|
+
"#d2b48c": "tan",
|
|
432
|
+
"#008080": "teal",
|
|
433
|
+
"#ff6347": "tomato",
|
|
434
|
+
"#ee82ee": "violet",
|
|
435
|
+
"#f5deb3": "wheat",
|
|
436
|
+
"#fff": "white",
|
|
437
|
+
"#ff0": "yellow",
|
|
382
438
|
};
|
|
383
439
|
|
|
384
440
|
// ============================================================================
|
|
@@ -389,12 +445,12 @@ export const colorsShortNames = {
|
|
|
389
445
|
* Attributes that accept color values
|
|
390
446
|
*/
|
|
391
447
|
export const colorsProps = new Set([
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
448
|
+
"color",
|
|
449
|
+
"fill",
|
|
450
|
+
"flood-color",
|
|
451
|
+
"lighting-color",
|
|
452
|
+
"stop-color",
|
|
453
|
+
"stroke",
|
|
398
454
|
]);
|
|
399
455
|
|
|
400
456
|
// ============================================================================
|
|
@@ -406,31 +462,88 @@ export const colorsProps = new Set([
|
|
|
406
462
|
*/
|
|
407
463
|
export const knownElements = new Set([
|
|
408
464
|
// Structural elements
|
|
409
|
-
|
|
465
|
+
"svg",
|
|
466
|
+
"g",
|
|
467
|
+
"defs",
|
|
468
|
+
"symbol",
|
|
469
|
+
"use",
|
|
410
470
|
// Shape elements
|
|
411
|
-
|
|
471
|
+
"path",
|
|
472
|
+
"rect",
|
|
473
|
+
"circle",
|
|
474
|
+
"ellipse",
|
|
475
|
+
"line",
|
|
476
|
+
"polyline",
|
|
477
|
+
"polygon",
|
|
412
478
|
// Text elements
|
|
413
|
-
|
|
414
|
-
|
|
479
|
+
"text",
|
|
480
|
+
"tspan",
|
|
481
|
+
"tref",
|
|
482
|
+
"textPath",
|
|
483
|
+
"altGlyph",
|
|
484
|
+
"altGlyphDef",
|
|
485
|
+
"altGlyphItem",
|
|
486
|
+
"glyph",
|
|
487
|
+
"glyphRef",
|
|
415
488
|
// Gradient elements
|
|
416
|
-
|
|
489
|
+
"linearGradient",
|
|
490
|
+
"radialGradient",
|
|
491
|
+
"meshGradient",
|
|
492
|
+
"stop",
|
|
417
493
|
// Container elements
|
|
418
|
-
|
|
494
|
+
"a",
|
|
495
|
+
"marker",
|
|
496
|
+
"mask",
|
|
497
|
+
"pattern",
|
|
498
|
+
"clipPath",
|
|
499
|
+
"switch",
|
|
419
500
|
// Filter elements
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
501
|
+
"filter",
|
|
502
|
+
"feBlend",
|
|
503
|
+
"feColorMatrix",
|
|
504
|
+
"feComponentTransfer",
|
|
505
|
+
"feComposite",
|
|
506
|
+
"feConvolveMatrix",
|
|
507
|
+
"feDiffuseLighting",
|
|
508
|
+
"feDisplacementMap",
|
|
509
|
+
"feDistantLight",
|
|
510
|
+
"feDropShadow",
|
|
511
|
+
"feFlood",
|
|
512
|
+
"feFuncA",
|
|
513
|
+
"feFuncB",
|
|
514
|
+
"feFuncG",
|
|
515
|
+
"feFuncR",
|
|
516
|
+
"feGaussianBlur",
|
|
517
|
+
"feImage",
|
|
518
|
+
"feMerge",
|
|
519
|
+
"feMergeNode",
|
|
520
|
+
"feMorphology",
|
|
521
|
+
"feOffset",
|
|
522
|
+
"fePointLight",
|
|
523
|
+
"feSpecularLighting",
|
|
524
|
+
"feSpotLight",
|
|
525
|
+
"feTile",
|
|
526
|
+
"feTurbulence",
|
|
427
527
|
// Descriptive elements
|
|
428
|
-
|
|
528
|
+
"title",
|
|
529
|
+
"desc",
|
|
530
|
+
"metadata",
|
|
429
531
|
// Animation elements
|
|
430
|
-
|
|
532
|
+
"animate",
|
|
533
|
+
"animateColor",
|
|
534
|
+
"animateMotion",
|
|
535
|
+
"animateTransform",
|
|
536
|
+
"set",
|
|
537
|
+
"mpath",
|
|
431
538
|
// Other elements
|
|
432
|
-
|
|
433
|
-
|
|
539
|
+
"image",
|
|
540
|
+
"foreignObject",
|
|
541
|
+
"view",
|
|
542
|
+
"style",
|
|
543
|
+
"script",
|
|
544
|
+
"solidColor",
|
|
545
|
+
"hatch",
|
|
546
|
+
"hatchpath",
|
|
434
547
|
]);
|
|
435
548
|
|
|
436
549
|
// ============================================================================
|
|
@@ -442,146 +555,204 @@ export const knownElements = new Set([
|
|
|
442
555
|
*/
|
|
443
556
|
export const presentationDefaults = {
|
|
444
557
|
// Fill defaults
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
558
|
+
fill: "#000",
|
|
559
|
+
"fill-opacity": "1",
|
|
560
|
+
"fill-rule": "nonzero",
|
|
448
561
|
|
|
449
562
|
// Stroke defaults
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
563
|
+
stroke: "none",
|
|
564
|
+
"stroke-width": "1",
|
|
565
|
+
"stroke-opacity": "1",
|
|
566
|
+
"stroke-linecap": "butt",
|
|
567
|
+
"stroke-linejoin": "miter",
|
|
568
|
+
"stroke-miterlimit": "4",
|
|
569
|
+
"stroke-dasharray": "none",
|
|
570
|
+
"stroke-dashoffset": "0",
|
|
458
571
|
|
|
459
572
|
// Opacity/visibility defaults
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
573
|
+
opacity: "1",
|
|
574
|
+
visibility: "visible",
|
|
575
|
+
display: "inline",
|
|
463
576
|
|
|
464
577
|
// Clip/mask defaults
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
578
|
+
clip: "auto",
|
|
579
|
+
"clip-path": "none",
|
|
580
|
+
"clip-rule": "nonzero",
|
|
581
|
+
mask: "none",
|
|
469
582
|
|
|
470
583
|
// Marker defaults
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
584
|
+
"marker-start": "none",
|
|
585
|
+
"marker-mid": "none",
|
|
586
|
+
"marker-end": "none",
|
|
474
587
|
|
|
475
588
|
// Color defaults
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
589
|
+
"stop-color": "#000",
|
|
590
|
+
"stop-opacity": "1",
|
|
591
|
+
"flood-color": "#000",
|
|
592
|
+
"flood-opacity": "1",
|
|
593
|
+
"lighting-color": "#fff",
|
|
481
594
|
|
|
482
595
|
// Rendering defaults
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
596
|
+
"color-interpolation": "sRGB",
|
|
597
|
+
"color-interpolation-filters": "linearRGB",
|
|
598
|
+
"color-rendering": "auto",
|
|
599
|
+
"shape-rendering": "auto",
|
|
600
|
+
"text-rendering": "auto",
|
|
601
|
+
"image-rendering": "auto",
|
|
489
602
|
|
|
490
603
|
// Paint defaults
|
|
491
|
-
|
|
492
|
-
|
|
604
|
+
"paint-order": "normal",
|
|
605
|
+
"vector-effect": "none",
|
|
493
606
|
|
|
494
607
|
// Text defaults
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
608
|
+
"text-anchor": "start",
|
|
609
|
+
"text-overflow": "clip",
|
|
610
|
+
"text-decoration": "none",
|
|
611
|
+
"dominant-baseline": "auto",
|
|
612
|
+
"alignment-baseline": "baseline",
|
|
613
|
+
"baseline-shift": "baseline",
|
|
614
|
+
"writing-mode": "lr-tb",
|
|
615
|
+
direction: "ltr",
|
|
616
|
+
"unicode-bidi": "normal",
|
|
617
|
+
"letter-spacing": "normal",
|
|
618
|
+
"word-spacing": "normal",
|
|
506
619
|
|
|
507
620
|
// Font defaults
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
621
|
+
"font-style": "normal",
|
|
622
|
+
"font-variant": "normal",
|
|
623
|
+
"font-weight": "normal",
|
|
624
|
+
"font-stretch": "normal",
|
|
625
|
+
"font-size": "medium",
|
|
626
|
+
"font-size-adjust": "none",
|
|
514
627
|
|
|
515
628
|
// Deprecated but still present
|
|
516
|
-
|
|
517
|
-
|
|
629
|
+
"glyph-orientation-vertical": "auto",
|
|
630
|
+
"glyph-orientation-horizontal": "0deg",
|
|
518
631
|
};
|
|
519
632
|
|
|
520
633
|
/**
|
|
521
634
|
* Element-specific default values
|
|
522
635
|
*/
|
|
523
636
|
export const elementDefaults = {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
637
|
+
circle: { cx: "0", cy: "0" },
|
|
638
|
+
ellipse: { cx: "0", cy: "0" },
|
|
639
|
+
line: { x1: "0", y1: "0", x2: "0", y2: "0" },
|
|
640
|
+
rect: { x: "0", y: "0", rx: "0", ry: "0" },
|
|
641
|
+
image: { x: "0", y: "0", preserveAspectRatio: "xMidYMid meet" },
|
|
642
|
+
svg: { x: "0", y: "0", preserveAspectRatio: "xMidYMid meet" },
|
|
643
|
+
symbol: { preserveAspectRatio: "xMidYMid meet" },
|
|
644
|
+
marker: {
|
|
645
|
+
markerUnits: "strokeWidth",
|
|
646
|
+
refX: "0",
|
|
647
|
+
refY: "0",
|
|
648
|
+
markerWidth: "3",
|
|
649
|
+
markerHeight: "3",
|
|
535
650
|
},
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
651
|
+
linearGradient: {
|
|
652
|
+
x1: "0",
|
|
653
|
+
y1: "0",
|
|
654
|
+
x2: "100%",
|
|
655
|
+
y2: "0",
|
|
656
|
+
spreadMethod: "pad",
|
|
539
657
|
},
|
|
540
|
-
|
|
541
|
-
|
|
658
|
+
radialGradient: {
|
|
659
|
+
cx: "50%",
|
|
660
|
+
cy: "50%",
|
|
661
|
+
r: "50%",
|
|
542
662
|
// Note: fx and fy default to cx and cy values respectively per SVG spec,
|
|
543
663
|
// but this cannot be expressed in static defaults. Omitted to avoid incorrect values.
|
|
544
|
-
|
|
664
|
+
spreadMethod: "pad",
|
|
665
|
+
},
|
|
666
|
+
pattern: {
|
|
667
|
+
x: "0",
|
|
668
|
+
y: "0",
|
|
669
|
+
patternUnits: "objectBoundingBox",
|
|
670
|
+
patternContentUnits: "userSpaceOnUse",
|
|
671
|
+
},
|
|
672
|
+
clipPath: { clipPathUnits: "userSpaceOnUse" },
|
|
673
|
+
mask: {
|
|
674
|
+
maskUnits: "objectBoundingBox",
|
|
675
|
+
maskContentUnits: "userSpaceOnUse",
|
|
676
|
+
x: "-10%",
|
|
677
|
+
y: "-10%",
|
|
678
|
+
width: "120%",
|
|
679
|
+
height: "120%",
|
|
680
|
+
},
|
|
681
|
+
filter: {
|
|
682
|
+
primitiveUnits: "objectBoundingBox",
|
|
683
|
+
x: "-10%",
|
|
684
|
+
y: "-10%",
|
|
685
|
+
width: "120%",
|
|
686
|
+
height: "120%",
|
|
687
|
+
},
|
|
688
|
+
feBlend: { mode: "normal" },
|
|
689
|
+
feColorMatrix: { type: "matrix" },
|
|
690
|
+
feComposite: { operator: "over", k1: "0", k2: "0", k3: "0", k4: "0" },
|
|
691
|
+
feConvolveMatrix: {
|
|
692
|
+
order: "3",
|
|
693
|
+
bias: "0",
|
|
694
|
+
edgeMode: "duplicate",
|
|
695
|
+
preserveAlpha: "false",
|
|
545
696
|
},
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
697
|
+
feDisplacementMap: {
|
|
698
|
+
scale: "0",
|
|
699
|
+
xChannelSelector: "A",
|
|
700
|
+
yChannelSelector: "A",
|
|
550
701
|
},
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
702
|
+
feDistantLight: { azimuth: "0", elevation: "0" },
|
|
703
|
+
fePointLight: { x: "0", y: "0", z: "0" },
|
|
704
|
+
feSpotLight: {
|
|
705
|
+
x: "0",
|
|
706
|
+
y: "0",
|
|
707
|
+
z: "0",
|
|
708
|
+
pointsAtX: "0",
|
|
709
|
+
pointsAtY: "0",
|
|
710
|
+
pointsAtZ: "0",
|
|
711
|
+
specularExponent: "1",
|
|
556
712
|
},
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
713
|
+
feTurbulence: {
|
|
714
|
+
baseFrequency: "0",
|
|
715
|
+
numOctaves: "1",
|
|
716
|
+
seed: "0",
|
|
717
|
+
stitchTiles: "noStitch",
|
|
718
|
+
type: "turbulence",
|
|
560
719
|
},
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
'feSpotLight': {
|
|
569
|
-
'x': '0', 'y': '0', 'z': '0',
|
|
570
|
-
'pointsAtX': '0', 'pointsAtY': '0', 'pointsAtZ': '0',
|
|
571
|
-
'specularExponent': '1'
|
|
720
|
+
feFuncR: {
|
|
721
|
+
type: "identity",
|
|
722
|
+
slope: "1",
|
|
723
|
+
intercept: "0",
|
|
724
|
+
amplitude: "1",
|
|
725
|
+
exponent: "1",
|
|
726
|
+
offset: "0",
|
|
572
727
|
},
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
728
|
+
feFuncG: {
|
|
729
|
+
type: "identity",
|
|
730
|
+
slope: "1",
|
|
731
|
+
intercept: "0",
|
|
732
|
+
amplitude: "1",
|
|
733
|
+
exponent: "1",
|
|
734
|
+
offset: "0",
|
|
576
735
|
},
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
736
|
+
feFuncB: {
|
|
737
|
+
type: "identity",
|
|
738
|
+
slope: "1",
|
|
739
|
+
intercept: "0",
|
|
740
|
+
amplitude: "1",
|
|
741
|
+
exponent: "1",
|
|
742
|
+
offset: "0",
|
|
743
|
+
},
|
|
744
|
+
feFuncA: {
|
|
745
|
+
type: "identity",
|
|
746
|
+
slope: "1",
|
|
747
|
+
intercept: "0",
|
|
748
|
+
amplitude: "1",
|
|
749
|
+
exponent: "1",
|
|
750
|
+
offset: "0",
|
|
751
|
+
},
|
|
752
|
+
a: { target: "_self" },
|
|
753
|
+
textPath: { startOffset: "0" },
|
|
754
|
+
animate: { begin: "0s" },
|
|
755
|
+
animateMotion: { rotate: "0" },
|
|
585
756
|
};
|
|
586
757
|
|
|
587
758
|
// ============================================================================
|
|
@@ -592,15 +763,19 @@ export const elementDefaults = {
|
|
|
592
763
|
* Text-related elements that can contain text content
|
|
593
764
|
*/
|
|
594
765
|
export const textElems = new Set([
|
|
595
|
-
|
|
766
|
+
"altGlyph",
|
|
767
|
+
"textPath",
|
|
768
|
+
"tref",
|
|
769
|
+
"tspan",
|
|
770
|
+
"text",
|
|
771
|
+
"title",
|
|
772
|
+
"desc",
|
|
596
773
|
]);
|
|
597
774
|
|
|
598
775
|
/**
|
|
599
776
|
* Elements that can contain path data
|
|
600
777
|
*/
|
|
601
|
-
export const pathElems = new Set([
|
|
602
|
-
'glyph', 'missing-glyph', 'path'
|
|
603
|
-
]);
|
|
778
|
+
export const pathElems = new Set(["glyph", "missing-glyph", "path"]);
|
|
604
779
|
|
|
605
780
|
// ============================================================================
|
|
606
781
|
// ATTRIBUTE GROUPS (P4-4: 15 SVGO-compatible attribute groups)
|
|
@@ -610,74 +785,206 @@ export const pathElems = new Set([
|
|
|
610
785
|
* Complete attribute groups matching SVGO's _collections.js
|
|
611
786
|
*/
|
|
612
787
|
export const attrsGroups = {
|
|
613
|
-
animationAddition: new Set([
|
|
614
|
-
|
|
615
|
-
]),
|
|
616
|
-
animationAttributeTarget: new Set([
|
|
617
|
-
'attributeType', 'attributeName'
|
|
618
|
-
]),
|
|
619
|
-
animationEvent: new Set([
|
|
620
|
-
'onbegin', 'onend', 'onrepeat', 'onload'
|
|
621
|
-
]),
|
|
788
|
+
animationAddition: new Set(["additive", "accumulate"]),
|
|
789
|
+
animationAttributeTarget: new Set(["attributeType", "attributeName"]),
|
|
790
|
+
animationEvent: new Set(["onbegin", "onend", "onrepeat", "onload"]),
|
|
622
791
|
animationTiming: new Set([
|
|
623
|
-
|
|
792
|
+
"begin",
|
|
793
|
+
"dur",
|
|
794
|
+
"end",
|
|
795
|
+
"min",
|
|
796
|
+
"max",
|
|
797
|
+
"restart",
|
|
798
|
+
"repeatCount",
|
|
799
|
+
"repeatDur",
|
|
800
|
+
"fill",
|
|
624
801
|
]),
|
|
625
802
|
animationValue: new Set([
|
|
626
|
-
|
|
803
|
+
"calcMode",
|
|
804
|
+
"values",
|
|
805
|
+
"keyTimes",
|
|
806
|
+
"keySplines",
|
|
807
|
+
"from",
|
|
808
|
+
"to",
|
|
809
|
+
"by",
|
|
627
810
|
]),
|
|
628
811
|
conditionalProcessing: new Set([
|
|
629
|
-
|
|
812
|
+
"requiredFeatures",
|
|
813
|
+
"requiredExtensions",
|
|
814
|
+
"systemLanguage",
|
|
630
815
|
]),
|
|
631
816
|
core: new Set([
|
|
632
|
-
|
|
817
|
+
"id",
|
|
818
|
+
"tabindex",
|
|
819
|
+
"xml:base",
|
|
820
|
+
"xml:lang",
|
|
821
|
+
"xml:space",
|
|
822
|
+
"lang",
|
|
633
823
|
]),
|
|
634
824
|
graphicalEvent: new Set([
|
|
635
|
-
|
|
636
|
-
|
|
825
|
+
"onfocusin",
|
|
826
|
+
"onfocusout",
|
|
827
|
+
"onactivate",
|
|
828
|
+
"onclick",
|
|
829
|
+
"onmousedown",
|
|
830
|
+
"onmouseup",
|
|
831
|
+
"onmouseover",
|
|
832
|
+
"onmousemove",
|
|
833
|
+
"onmouseout",
|
|
834
|
+
"onload",
|
|
637
835
|
]),
|
|
638
836
|
presentation: new Set([
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
837
|
+
"alignment-baseline",
|
|
838
|
+
"baseline-shift",
|
|
839
|
+
"clip",
|
|
840
|
+
"clip-path",
|
|
841
|
+
"clip-rule",
|
|
842
|
+
"color",
|
|
843
|
+
"color-interpolation",
|
|
844
|
+
"color-interpolation-filters",
|
|
845
|
+
"color-profile",
|
|
846
|
+
"color-rendering",
|
|
847
|
+
"cursor",
|
|
848
|
+
"direction",
|
|
849
|
+
"display",
|
|
850
|
+
"dominant-baseline",
|
|
851
|
+
"enable-background",
|
|
852
|
+
"fill",
|
|
853
|
+
"fill-opacity",
|
|
854
|
+
"fill-rule",
|
|
855
|
+
"filter",
|
|
856
|
+
"flood-color",
|
|
857
|
+
"flood-opacity",
|
|
858
|
+
"font",
|
|
859
|
+
"font-family",
|
|
860
|
+
"font-size",
|
|
861
|
+
"font-size-adjust",
|
|
862
|
+
"font-stretch",
|
|
863
|
+
"font-style",
|
|
864
|
+
"font-variant",
|
|
865
|
+
"font-weight",
|
|
866
|
+
"glyph-orientation-horizontal",
|
|
867
|
+
"glyph-orientation-vertical",
|
|
868
|
+
"image-rendering",
|
|
869
|
+
"kerning",
|
|
870
|
+
"letter-spacing",
|
|
871
|
+
"lighting-color",
|
|
872
|
+
"marker",
|
|
873
|
+
"marker-end",
|
|
874
|
+
"marker-mid",
|
|
875
|
+
"marker-start",
|
|
876
|
+
"mask",
|
|
877
|
+
"opacity",
|
|
878
|
+
"overflow",
|
|
879
|
+
"paint-order",
|
|
880
|
+
"pointer-events",
|
|
881
|
+
"shape-rendering",
|
|
882
|
+
"stop-color",
|
|
883
|
+
"stop-opacity",
|
|
884
|
+
"stroke",
|
|
885
|
+
"stroke-dasharray",
|
|
886
|
+
"stroke-dashoffset",
|
|
887
|
+
"stroke-linecap",
|
|
888
|
+
"stroke-linejoin",
|
|
889
|
+
"stroke-miterlimit",
|
|
890
|
+
"stroke-opacity",
|
|
891
|
+
"stroke-width",
|
|
892
|
+
"text-anchor",
|
|
893
|
+
"text-decoration",
|
|
894
|
+
"text-rendering",
|
|
895
|
+
"transform",
|
|
896
|
+
"transform-origin",
|
|
897
|
+
"unicode-bidi",
|
|
898
|
+
"vector-effect",
|
|
899
|
+
"visibility",
|
|
900
|
+
"word-spacing",
|
|
901
|
+
"writing-mode",
|
|
653
902
|
]),
|
|
654
903
|
xlink: new Set([
|
|
655
|
-
|
|
656
|
-
|
|
904
|
+
"xlink:href",
|
|
905
|
+
"xlink:show",
|
|
906
|
+
"xlink:actuate",
|
|
907
|
+
"xlink:type",
|
|
908
|
+
"xlink:role",
|
|
909
|
+
"xlink:arcrole",
|
|
910
|
+
"xlink:title",
|
|
657
911
|
]),
|
|
658
912
|
documentEvent: new Set([
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
913
|
+
"onunload",
|
|
914
|
+
"onabort",
|
|
915
|
+
"onerror",
|
|
916
|
+
"onresize",
|
|
917
|
+
"onscroll",
|
|
918
|
+
"onzoom",
|
|
663
919
|
]),
|
|
920
|
+
documentElementEvent: new Set(["oncopy", "oncut", "onpaste"]),
|
|
664
921
|
globalEvent: new Set([
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
922
|
+
"oncancel",
|
|
923
|
+
"oncanplay",
|
|
924
|
+
"oncanplaythrough",
|
|
925
|
+
"onchange",
|
|
926
|
+
"onclick",
|
|
927
|
+
"onclose",
|
|
928
|
+
"oncuechange",
|
|
929
|
+
"ondblclick",
|
|
930
|
+
"ondrag",
|
|
931
|
+
"ondragend",
|
|
932
|
+
"ondragenter",
|
|
933
|
+
"ondragleave",
|
|
934
|
+
"ondragover",
|
|
935
|
+
"ondragstart",
|
|
936
|
+
"ondrop",
|
|
937
|
+
"ondurationchange",
|
|
938
|
+
"onemptied",
|
|
939
|
+
"onended",
|
|
940
|
+
"onerror",
|
|
941
|
+
"onfocus",
|
|
942
|
+
"oninput",
|
|
943
|
+
"oninvalid",
|
|
944
|
+
"onkeydown",
|
|
945
|
+
"onkeypress",
|
|
946
|
+
"onkeyup",
|
|
947
|
+
"onload",
|
|
948
|
+
"onloadeddata",
|
|
949
|
+
"onloadedmetadata",
|
|
950
|
+
"onloadstart",
|
|
951
|
+
"onmousedown",
|
|
952
|
+
"onmouseenter",
|
|
953
|
+
"onmouseleave",
|
|
954
|
+
"onmousemove",
|
|
955
|
+
"onmouseout",
|
|
956
|
+
"onmouseover",
|
|
957
|
+
"onmouseup",
|
|
958
|
+
"onmousewheel",
|
|
959
|
+
"onpause",
|
|
960
|
+
"onplay",
|
|
961
|
+
"onplaying",
|
|
962
|
+
"onprogress",
|
|
963
|
+
"onratechange",
|
|
964
|
+
"onreset",
|
|
965
|
+
"onresize",
|
|
966
|
+
"onscroll",
|
|
967
|
+
"onseeked",
|
|
968
|
+
"onseeking",
|
|
969
|
+
"onselect",
|
|
970
|
+
"onshow",
|
|
971
|
+
"onstalled",
|
|
972
|
+
"onsubmit",
|
|
973
|
+
"onsuspend",
|
|
974
|
+
"ontimeupdate",
|
|
975
|
+
"ontoggle",
|
|
976
|
+
"onvolumechange",
|
|
977
|
+
"onwaiting",
|
|
678
978
|
]),
|
|
979
|
+
filterPrimitive: new Set(["x", "y", "width", "height", "result"]),
|
|
679
980
|
transferFunction: new Set([
|
|
680
|
-
|
|
981
|
+
"type",
|
|
982
|
+
"tableValues",
|
|
983
|
+
"slope",
|
|
984
|
+
"intercept",
|
|
985
|
+
"amplitude",
|
|
986
|
+
"exponent",
|
|
987
|
+
"offset",
|
|
681
988
|
]),
|
|
682
989
|
};
|
|
683
990
|
|
|
@@ -690,15 +997,21 @@ export const attrsGroups = {
|
|
|
690
997
|
*/
|
|
691
998
|
export const attrsGroupsDeprecated = {
|
|
692
999
|
presentation: new Set([
|
|
693
|
-
|
|
694
|
-
|
|
1000
|
+
"enable-background",
|
|
1001
|
+
"glyph-orientation-horizontal",
|
|
1002
|
+
"glyph-orientation-vertical",
|
|
1003
|
+
"kerning",
|
|
1004
|
+
"clip",
|
|
695
1005
|
]),
|
|
696
1006
|
xlink: new Set([
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
1007
|
+
"xlink:type",
|
|
1008
|
+
"xlink:role",
|
|
1009
|
+
"xlink:arcrole",
|
|
1010
|
+
"xlink:title",
|
|
1011
|
+
"xlink:show",
|
|
1012
|
+
"xlink:actuate",
|
|
701
1013
|
]),
|
|
1014
|
+
core: new Set(["xml:base", "xml:lang", "xml:space"]),
|
|
702
1015
|
};
|
|
703
1016
|
|
|
704
1017
|
// ============================================================================
|
|
@@ -710,182 +1023,719 @@ export const attrsGroupsDeprecated = {
|
|
|
710
1023
|
* Used for validation and removing invalid children
|
|
711
1024
|
*/
|
|
712
1025
|
export const allowedChildrenPerElement = {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
1026
|
+
svg: new Set([
|
|
1027
|
+
"a",
|
|
1028
|
+
"altGlyphDef",
|
|
1029
|
+
"animate",
|
|
1030
|
+
"animateColor",
|
|
1031
|
+
"animateMotion",
|
|
1032
|
+
"animateTransform",
|
|
1033
|
+
"circle",
|
|
1034
|
+
"clipPath",
|
|
1035
|
+
"cursor",
|
|
1036
|
+
"defs",
|
|
1037
|
+
"desc",
|
|
1038
|
+
"ellipse",
|
|
1039
|
+
"filter",
|
|
1040
|
+
"font",
|
|
1041
|
+
"font-face",
|
|
1042
|
+
"foreignObject",
|
|
1043
|
+
"g",
|
|
1044
|
+
"image",
|
|
1045
|
+
"line",
|
|
1046
|
+
"linearGradient",
|
|
1047
|
+
"marker",
|
|
1048
|
+
"mask",
|
|
1049
|
+
"metadata",
|
|
1050
|
+
"mpath",
|
|
1051
|
+
"path",
|
|
1052
|
+
"pattern",
|
|
1053
|
+
"polygon",
|
|
1054
|
+
"polyline",
|
|
1055
|
+
"radialGradient",
|
|
1056
|
+
"rect",
|
|
1057
|
+
"script",
|
|
1058
|
+
"set",
|
|
1059
|
+
"style",
|
|
1060
|
+
"svg",
|
|
1061
|
+
"switch",
|
|
1062
|
+
"symbol",
|
|
1063
|
+
"text",
|
|
1064
|
+
"title",
|
|
1065
|
+
"use",
|
|
1066
|
+
"view",
|
|
1067
|
+
]),
|
|
1068
|
+
g: new Set([
|
|
1069
|
+
"a",
|
|
1070
|
+
"animate",
|
|
1071
|
+
"animateColor",
|
|
1072
|
+
"animateMotion",
|
|
1073
|
+
"animateTransform",
|
|
1074
|
+
"circle",
|
|
1075
|
+
"clipPath",
|
|
1076
|
+
"cursor",
|
|
1077
|
+
"defs",
|
|
1078
|
+
"desc",
|
|
1079
|
+
"ellipse",
|
|
1080
|
+
"filter",
|
|
1081
|
+
"font",
|
|
1082
|
+
"font-face",
|
|
1083
|
+
"foreignObject",
|
|
1084
|
+
"g",
|
|
1085
|
+
"image",
|
|
1086
|
+
"line",
|
|
1087
|
+
"linearGradient",
|
|
1088
|
+
"marker",
|
|
1089
|
+
"mask",
|
|
1090
|
+
"metadata",
|
|
1091
|
+
"path",
|
|
1092
|
+
"pattern",
|
|
1093
|
+
"polygon",
|
|
1094
|
+
"polyline",
|
|
1095
|
+
"radialGradient",
|
|
1096
|
+
"rect",
|
|
1097
|
+
"script",
|
|
1098
|
+
"set",
|
|
1099
|
+
"style",
|
|
1100
|
+
"svg",
|
|
1101
|
+
"switch",
|
|
1102
|
+
"symbol",
|
|
1103
|
+
"text",
|
|
1104
|
+
"title",
|
|
1105
|
+
"use",
|
|
1106
|
+
"view",
|
|
1107
|
+
]),
|
|
1108
|
+
defs: new Set([
|
|
1109
|
+
"a",
|
|
1110
|
+
"altGlyphDef",
|
|
1111
|
+
"animate",
|
|
1112
|
+
"animateColor",
|
|
1113
|
+
"animateMotion",
|
|
1114
|
+
"animateTransform",
|
|
1115
|
+
"circle",
|
|
1116
|
+
"clipPath",
|
|
1117
|
+
"cursor",
|
|
1118
|
+
"defs",
|
|
1119
|
+
"desc",
|
|
1120
|
+
"ellipse",
|
|
1121
|
+
"filter",
|
|
1122
|
+
"font",
|
|
1123
|
+
"font-face",
|
|
1124
|
+
"foreignObject",
|
|
1125
|
+
"g",
|
|
1126
|
+
"image",
|
|
1127
|
+
"line",
|
|
1128
|
+
"linearGradient",
|
|
1129
|
+
"marker",
|
|
1130
|
+
"mask",
|
|
1131
|
+
"metadata",
|
|
1132
|
+
"mpath",
|
|
1133
|
+
"path",
|
|
1134
|
+
"pattern",
|
|
1135
|
+
"polygon",
|
|
1136
|
+
"polyline",
|
|
1137
|
+
"radialGradient",
|
|
1138
|
+
"rect",
|
|
1139
|
+
"script",
|
|
1140
|
+
"set",
|
|
1141
|
+
"style",
|
|
1142
|
+
"svg",
|
|
1143
|
+
"switch",
|
|
1144
|
+
"symbol",
|
|
1145
|
+
"text",
|
|
1146
|
+
"title",
|
|
1147
|
+
"use",
|
|
1148
|
+
"view",
|
|
733
1149
|
// SVG 2.0 elements
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'path',
|
|
740
|
-
'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'set', 'style',
|
|
741
|
-
'svg', 'switch', 'symbol', 'text', 'title', 'use', 'view'
|
|
742
|
-
]),
|
|
743
|
-
'marker': new Set([
|
|
744
|
-
'a', 'animate', 'animateColor', 'animateMotion', 'animateTransform', 'circle',
|
|
745
|
-
'clipPath', 'cursor', 'defs', 'desc', 'ellipse', 'filter', 'font', 'font-face', 'foreignObject',
|
|
746
|
-
'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'path',
|
|
747
|
-
'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'set', 'style',
|
|
748
|
-
'svg', 'switch', 'symbol', 'text', 'title', 'use', 'view'
|
|
749
|
-
]),
|
|
750
|
-
'clipPath': new Set([
|
|
751
|
-
'animate', 'animateColor', 'animateMotion', 'animateTransform', 'circle', 'desc',
|
|
752
|
-
'ellipse', 'line', 'metadata', 'path', 'polygon', 'polyline', 'rect', 'set', 'text',
|
|
753
|
-
'title', 'use'
|
|
754
|
-
]),
|
|
755
|
-
'mask': new Set([
|
|
756
|
-
'a', 'animate', 'animateColor', 'animateMotion', 'animateTransform', 'circle',
|
|
757
|
-
'clipPath', 'cursor', 'defs', 'desc', 'ellipse', 'filter', 'font', 'font-face', 'foreignObject',
|
|
758
|
-
'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'path',
|
|
759
|
-
'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'set', 'style',
|
|
760
|
-
'svg', 'switch', 'symbol', 'text', 'title', 'use', 'view'
|
|
761
|
-
]),
|
|
762
|
-
'pattern': new Set([
|
|
763
|
-
'a', 'animate', 'animateColor', 'animateMotion', 'animateTransform', 'circle',
|
|
764
|
-
'clipPath', 'cursor', 'defs', 'desc', 'ellipse', 'filter', 'font', 'font-face', 'foreignObject',
|
|
765
|
-
'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'path',
|
|
766
|
-
'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'set', 'style',
|
|
767
|
-
'svg', 'switch', 'symbol', 'text', 'title', 'use', 'view'
|
|
768
|
-
]),
|
|
769
|
-
'a': new Set([
|
|
770
|
-
'a', 'animate', 'animateColor', 'animateMotion', 'animateTransform', 'circle',
|
|
771
|
-
'clipPath', 'cursor', 'defs', 'desc', 'ellipse', 'filter', 'font', 'font-face', 'foreignObject',
|
|
772
|
-
'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'path',
|
|
773
|
-
'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'set', 'style',
|
|
774
|
-
'svg', 'switch', 'symbol', 'text', 'title', 'use', 'view'
|
|
775
|
-
]),
|
|
776
|
-
'switch': new Set([
|
|
777
|
-
'a', 'animate', 'animateColor', 'animateMotion', 'animateTransform', 'circle',
|
|
778
|
-
'cursor', 'desc', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'metadata', 'path',
|
|
779
|
-
'polygon', 'polyline', 'rect', 'set', 'svg', 'switch', 'text', 'title', 'use', 'view'
|
|
780
|
-
]),
|
|
781
|
-
'text': new Set([
|
|
782
|
-
'a', 'altGlyph', 'animate', 'animateColor', 'animateMotion', 'animateTransform',
|
|
783
|
-
'desc', 'metadata', 'set', 'textPath', 'title', 'tref', 'tspan'
|
|
784
|
-
]),
|
|
785
|
-
'textPath': new Set([
|
|
786
|
-
'a', 'altGlyph', 'animate', 'animateColor', 'desc', 'metadata', 'set', 'title', 'tref', 'tspan'
|
|
787
|
-
]),
|
|
788
|
-
'tspan': new Set([
|
|
789
|
-
'a', 'altGlyph', 'animate', 'animateColor', 'desc', 'metadata', 'set', 'title', 'tref', 'tspan'
|
|
790
|
-
]),
|
|
791
|
-
'linearGradient': new Set([
|
|
792
|
-
'animate', 'animateTransform', 'desc', 'metadata', 'set', 'stop', 'title'
|
|
793
|
-
]),
|
|
794
|
-
'radialGradient': new Set([
|
|
795
|
-
'animate', 'animateTransform', 'desc', 'metadata', 'set', 'stop', 'title'
|
|
1150
|
+
"meshgradient",
|
|
1151
|
+
"meshGradient",
|
|
1152
|
+
"hatch",
|
|
1153
|
+
"solidcolor",
|
|
1154
|
+
"solidColor",
|
|
796
1155
|
]),
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
1156
|
+
symbol: new Set([
|
|
1157
|
+
"a",
|
|
1158
|
+
"animate",
|
|
1159
|
+
"animateColor",
|
|
1160
|
+
"animateMotion",
|
|
1161
|
+
"animateTransform",
|
|
1162
|
+
"circle",
|
|
1163
|
+
"clipPath",
|
|
1164
|
+
"cursor",
|
|
1165
|
+
"defs",
|
|
1166
|
+
"desc",
|
|
1167
|
+
"ellipse",
|
|
1168
|
+
"filter",
|
|
1169
|
+
"font",
|
|
1170
|
+
"font-face",
|
|
1171
|
+
"foreignObject",
|
|
1172
|
+
"g",
|
|
1173
|
+
"image",
|
|
1174
|
+
"line",
|
|
1175
|
+
"linearGradient",
|
|
1176
|
+
"marker",
|
|
1177
|
+
"mask",
|
|
1178
|
+
"metadata",
|
|
1179
|
+
"path",
|
|
1180
|
+
"pattern",
|
|
1181
|
+
"polygon",
|
|
1182
|
+
"polyline",
|
|
1183
|
+
"radialGradient",
|
|
1184
|
+
"rect",
|
|
1185
|
+
"script",
|
|
1186
|
+
"set",
|
|
1187
|
+
"style",
|
|
1188
|
+
"svg",
|
|
1189
|
+
"switch",
|
|
1190
|
+
"symbol",
|
|
1191
|
+
"text",
|
|
1192
|
+
"title",
|
|
1193
|
+
"use",
|
|
1194
|
+
"view",
|
|
1195
|
+
]),
|
|
1196
|
+
marker: new Set([
|
|
1197
|
+
"a",
|
|
1198
|
+
"animate",
|
|
1199
|
+
"animateColor",
|
|
1200
|
+
"animateMotion",
|
|
1201
|
+
"animateTransform",
|
|
1202
|
+
"circle",
|
|
1203
|
+
"clipPath",
|
|
1204
|
+
"cursor",
|
|
1205
|
+
"defs",
|
|
1206
|
+
"desc",
|
|
1207
|
+
"ellipse",
|
|
1208
|
+
"filter",
|
|
1209
|
+
"font",
|
|
1210
|
+
"font-face",
|
|
1211
|
+
"foreignObject",
|
|
1212
|
+
"g",
|
|
1213
|
+
"image",
|
|
1214
|
+
"line",
|
|
1215
|
+
"linearGradient",
|
|
1216
|
+
"marker",
|
|
1217
|
+
"mask",
|
|
1218
|
+
"metadata",
|
|
1219
|
+
"path",
|
|
1220
|
+
"pattern",
|
|
1221
|
+
"polygon",
|
|
1222
|
+
"polyline",
|
|
1223
|
+
"radialGradient",
|
|
1224
|
+
"rect",
|
|
1225
|
+
"script",
|
|
1226
|
+
"set",
|
|
1227
|
+
"style",
|
|
1228
|
+
"svg",
|
|
1229
|
+
"switch",
|
|
1230
|
+
"symbol",
|
|
1231
|
+
"text",
|
|
1232
|
+
"title",
|
|
1233
|
+
"use",
|
|
1234
|
+
"view",
|
|
1235
|
+
]),
|
|
1236
|
+
clipPath: new Set([
|
|
1237
|
+
"animate",
|
|
1238
|
+
"animateColor",
|
|
1239
|
+
"animateMotion",
|
|
1240
|
+
"animateTransform",
|
|
1241
|
+
"circle",
|
|
1242
|
+
"desc",
|
|
1243
|
+
"ellipse",
|
|
1244
|
+
"line",
|
|
1245
|
+
"metadata",
|
|
1246
|
+
"path",
|
|
1247
|
+
"polygon",
|
|
1248
|
+
"polyline",
|
|
1249
|
+
"rect",
|
|
1250
|
+
"set",
|
|
1251
|
+
"text",
|
|
1252
|
+
"title",
|
|
1253
|
+
"use",
|
|
1254
|
+
]),
|
|
1255
|
+
mask: new Set([
|
|
1256
|
+
"a",
|
|
1257
|
+
"animate",
|
|
1258
|
+
"animateColor",
|
|
1259
|
+
"animateMotion",
|
|
1260
|
+
"animateTransform",
|
|
1261
|
+
"circle",
|
|
1262
|
+
"clipPath",
|
|
1263
|
+
"cursor",
|
|
1264
|
+
"defs",
|
|
1265
|
+
"desc",
|
|
1266
|
+
"ellipse",
|
|
1267
|
+
"filter",
|
|
1268
|
+
"font",
|
|
1269
|
+
"font-face",
|
|
1270
|
+
"foreignObject",
|
|
1271
|
+
"g",
|
|
1272
|
+
"image",
|
|
1273
|
+
"line",
|
|
1274
|
+
"linearGradient",
|
|
1275
|
+
"marker",
|
|
1276
|
+
"mask",
|
|
1277
|
+
"metadata",
|
|
1278
|
+
"path",
|
|
1279
|
+
"pattern",
|
|
1280
|
+
"polygon",
|
|
1281
|
+
"polyline",
|
|
1282
|
+
"radialGradient",
|
|
1283
|
+
"rect",
|
|
1284
|
+
"script",
|
|
1285
|
+
"set",
|
|
1286
|
+
"style",
|
|
1287
|
+
"svg",
|
|
1288
|
+
"switch",
|
|
1289
|
+
"symbol",
|
|
1290
|
+
"text",
|
|
1291
|
+
"title",
|
|
1292
|
+
"use",
|
|
1293
|
+
"view",
|
|
1294
|
+
]),
|
|
1295
|
+
pattern: new Set([
|
|
1296
|
+
"a",
|
|
1297
|
+
"animate",
|
|
1298
|
+
"animateColor",
|
|
1299
|
+
"animateMotion",
|
|
1300
|
+
"animateTransform",
|
|
1301
|
+
"circle",
|
|
1302
|
+
"clipPath",
|
|
1303
|
+
"cursor",
|
|
1304
|
+
"defs",
|
|
1305
|
+
"desc",
|
|
1306
|
+
"ellipse",
|
|
1307
|
+
"filter",
|
|
1308
|
+
"font",
|
|
1309
|
+
"font-face",
|
|
1310
|
+
"foreignObject",
|
|
1311
|
+
"g",
|
|
1312
|
+
"image",
|
|
1313
|
+
"line",
|
|
1314
|
+
"linearGradient",
|
|
1315
|
+
"marker",
|
|
1316
|
+
"mask",
|
|
1317
|
+
"metadata",
|
|
1318
|
+
"path",
|
|
1319
|
+
"pattern",
|
|
1320
|
+
"polygon",
|
|
1321
|
+
"polyline",
|
|
1322
|
+
"radialGradient",
|
|
1323
|
+
"rect",
|
|
1324
|
+
"script",
|
|
1325
|
+
"set",
|
|
1326
|
+
"style",
|
|
1327
|
+
"svg",
|
|
1328
|
+
"switch",
|
|
1329
|
+
"symbol",
|
|
1330
|
+
"text",
|
|
1331
|
+
"title",
|
|
1332
|
+
"use",
|
|
1333
|
+
"view",
|
|
1334
|
+
]),
|
|
1335
|
+
a: new Set([
|
|
1336
|
+
"a",
|
|
1337
|
+
"animate",
|
|
1338
|
+
"animateColor",
|
|
1339
|
+
"animateMotion",
|
|
1340
|
+
"animateTransform",
|
|
1341
|
+
"circle",
|
|
1342
|
+
"clipPath",
|
|
1343
|
+
"cursor",
|
|
1344
|
+
"defs",
|
|
1345
|
+
"desc",
|
|
1346
|
+
"ellipse",
|
|
1347
|
+
"filter",
|
|
1348
|
+
"font",
|
|
1349
|
+
"font-face",
|
|
1350
|
+
"foreignObject",
|
|
1351
|
+
"g",
|
|
1352
|
+
"image",
|
|
1353
|
+
"line",
|
|
1354
|
+
"linearGradient",
|
|
1355
|
+
"marker",
|
|
1356
|
+
"mask",
|
|
1357
|
+
"metadata",
|
|
1358
|
+
"path",
|
|
1359
|
+
"pattern",
|
|
1360
|
+
"polygon",
|
|
1361
|
+
"polyline",
|
|
1362
|
+
"radialGradient",
|
|
1363
|
+
"rect",
|
|
1364
|
+
"script",
|
|
1365
|
+
"set",
|
|
1366
|
+
"style",
|
|
1367
|
+
"svg",
|
|
1368
|
+
"switch",
|
|
1369
|
+
"symbol",
|
|
1370
|
+
"text",
|
|
1371
|
+
"title",
|
|
1372
|
+
"use",
|
|
1373
|
+
"view",
|
|
1374
|
+
]),
|
|
1375
|
+
switch: new Set([
|
|
1376
|
+
"a",
|
|
1377
|
+
"animate",
|
|
1378
|
+
"animateColor",
|
|
1379
|
+
"animateMotion",
|
|
1380
|
+
"animateTransform",
|
|
1381
|
+
"circle",
|
|
1382
|
+
"cursor",
|
|
1383
|
+
"desc",
|
|
1384
|
+
"ellipse",
|
|
1385
|
+
"foreignObject",
|
|
1386
|
+
"g",
|
|
1387
|
+
"image",
|
|
1388
|
+
"line",
|
|
1389
|
+
"metadata",
|
|
1390
|
+
"path",
|
|
1391
|
+
"polygon",
|
|
1392
|
+
"polyline",
|
|
1393
|
+
"rect",
|
|
1394
|
+
"set",
|
|
1395
|
+
"svg",
|
|
1396
|
+
"switch",
|
|
1397
|
+
"text",
|
|
1398
|
+
"title",
|
|
1399
|
+
"use",
|
|
1400
|
+
"view",
|
|
1401
|
+
]),
|
|
1402
|
+
text: new Set([
|
|
1403
|
+
"a",
|
|
1404
|
+
"altGlyph",
|
|
1405
|
+
"animate",
|
|
1406
|
+
"animateColor",
|
|
1407
|
+
"animateMotion",
|
|
1408
|
+
"animateTransform",
|
|
1409
|
+
"desc",
|
|
1410
|
+
"metadata",
|
|
1411
|
+
"set",
|
|
1412
|
+
"textPath",
|
|
1413
|
+
"title",
|
|
1414
|
+
"tref",
|
|
1415
|
+
"tspan",
|
|
800
1416
|
]),
|
|
801
|
-
|
|
802
|
-
|
|
1417
|
+
textPath: new Set([
|
|
1418
|
+
"a",
|
|
1419
|
+
"altGlyph",
|
|
1420
|
+
"animate",
|
|
1421
|
+
"animateColor",
|
|
1422
|
+
"desc",
|
|
1423
|
+
"metadata",
|
|
1424
|
+
"set",
|
|
1425
|
+
"title",
|
|
1426
|
+
"tref",
|
|
1427
|
+
"tspan",
|
|
803
1428
|
]),
|
|
804
|
-
|
|
805
|
-
|
|
1429
|
+
tspan: new Set([
|
|
1430
|
+
"a",
|
|
1431
|
+
"altGlyph",
|
|
1432
|
+
"animate",
|
|
1433
|
+
"animateColor",
|
|
1434
|
+
"desc",
|
|
1435
|
+
"metadata",
|
|
1436
|
+
"set",
|
|
1437
|
+
"title",
|
|
1438
|
+
"tref",
|
|
1439
|
+
"tspan",
|
|
806
1440
|
]),
|
|
807
|
-
|
|
808
|
-
|
|
1441
|
+
linearGradient: new Set([
|
|
1442
|
+
"animate",
|
|
1443
|
+
"animateTransform",
|
|
1444
|
+
"desc",
|
|
1445
|
+
"metadata",
|
|
1446
|
+
"set",
|
|
1447
|
+
"stop",
|
|
1448
|
+
"title",
|
|
809
1449
|
]),
|
|
1450
|
+
radialGradient: new Set([
|
|
1451
|
+
"animate",
|
|
1452
|
+
"animateTransform",
|
|
1453
|
+
"desc",
|
|
1454
|
+
"metadata",
|
|
1455
|
+
"set",
|
|
1456
|
+
"stop",
|
|
1457
|
+
"title",
|
|
1458
|
+
]),
|
|
1459
|
+
// SVG 2.0 mesh gradient element hierarchy
|
|
1460
|
+
meshgradient: new Set([
|
|
1461
|
+
"animate",
|
|
1462
|
+
"animateTransform",
|
|
1463
|
+
"desc",
|
|
1464
|
+
"metadata",
|
|
1465
|
+
"meshrow",
|
|
1466
|
+
"set",
|
|
1467
|
+
"title",
|
|
1468
|
+
]),
|
|
1469
|
+
meshGradient: new Set([
|
|
1470
|
+
"animate",
|
|
1471
|
+
"animateTransform",
|
|
1472
|
+
"desc",
|
|
1473
|
+
"metadata",
|
|
1474
|
+
"meshrow",
|
|
1475
|
+
"set",
|
|
1476
|
+
"title",
|
|
1477
|
+
]),
|
|
1478
|
+
meshrow: new Set(["meshpatch"]),
|
|
1479
|
+
meshpatch: new Set(["stop"]),
|
|
810
1480
|
// SVG 2.0 hatch element
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
1481
|
+
hatch: new Set([
|
|
1482
|
+
"animate",
|
|
1483
|
+
"animateTransform",
|
|
1484
|
+
"desc",
|
|
1485
|
+
"hatchpath",
|
|
1486
|
+
"hatchPath",
|
|
1487
|
+
"metadata",
|
|
1488
|
+
"script",
|
|
1489
|
+
"set",
|
|
1490
|
+
"style",
|
|
1491
|
+
"title",
|
|
1492
|
+
]),
|
|
1493
|
+
hatchpath: new Set([
|
|
1494
|
+
"animate",
|
|
1495
|
+
"animateTransform",
|
|
1496
|
+
"desc",
|
|
1497
|
+
"metadata",
|
|
1498
|
+
"script",
|
|
1499
|
+
"set",
|
|
1500
|
+
"title",
|
|
1501
|
+
]),
|
|
1502
|
+
hatchPath: new Set([
|
|
1503
|
+
"animate",
|
|
1504
|
+
"animateTransform",
|
|
1505
|
+
"desc",
|
|
1506
|
+
"metadata",
|
|
1507
|
+
"script",
|
|
1508
|
+
"set",
|
|
1509
|
+
"title",
|
|
1510
|
+
]),
|
|
1511
|
+
filter: new Set([
|
|
1512
|
+
"animate",
|
|
1513
|
+
"animateTransform",
|
|
1514
|
+
"desc",
|
|
1515
|
+
"feBlend",
|
|
1516
|
+
"feColorMatrix",
|
|
1517
|
+
"feComponentTransfer",
|
|
1518
|
+
"feComposite",
|
|
1519
|
+
"feConvolveMatrix",
|
|
1520
|
+
"feDiffuseLighting",
|
|
1521
|
+
"feDisplacementMap",
|
|
1522
|
+
"feDropShadow",
|
|
1523
|
+
"feFlood",
|
|
1524
|
+
"feGaussianBlur",
|
|
1525
|
+
"feImage",
|
|
1526
|
+
"feMerge",
|
|
1527
|
+
"feMorphology",
|
|
1528
|
+
"feOffset",
|
|
1529
|
+
"feSpecularLighting",
|
|
1530
|
+
"feTile",
|
|
1531
|
+
"feTurbulence",
|
|
1532
|
+
"metadata",
|
|
1533
|
+
"set",
|
|
1534
|
+
"title",
|
|
1535
|
+
]),
|
|
1536
|
+
feBlend: new Set(["animate", "set"]),
|
|
1537
|
+
feColorMatrix: new Set(["animate", "set"]),
|
|
1538
|
+
feComponentTransfer: new Set(["feFuncA", "feFuncB", "feFuncG", "feFuncR"]),
|
|
1539
|
+
feComposite: new Set(["animate", "set"]),
|
|
1540
|
+
feConvolveMatrix: new Set(["animate", "set"]),
|
|
1541
|
+
feDiffuseLighting: new Set([
|
|
1542
|
+
"animate",
|
|
1543
|
+
"feDistantLight",
|
|
1544
|
+
"fePointLight",
|
|
1545
|
+
"feSpotLight",
|
|
1546
|
+
"set",
|
|
1547
|
+
]),
|
|
1548
|
+
feDisplacementMap: new Set(["animate", "set"]),
|
|
1549
|
+
feDropShadow: new Set(["animate", "set"]),
|
|
1550
|
+
feFlood: new Set(["animate", "set"]),
|
|
1551
|
+
feFuncA: new Set(["animate", "set"]),
|
|
1552
|
+
feFuncB: new Set(["animate", "set"]),
|
|
1553
|
+
feFuncG: new Set(["animate", "set"]),
|
|
1554
|
+
feFuncR: new Set(["animate", "set"]),
|
|
1555
|
+
feGaussianBlur: new Set(["animate", "set"]),
|
|
1556
|
+
feImage: new Set(["animate", "set"]),
|
|
1557
|
+
feMerge: new Set(["feMergeNode"]),
|
|
1558
|
+
feMergeNode: new Set(["animate", "set"]),
|
|
1559
|
+
feMorphology: new Set(["animate", "set"]),
|
|
1560
|
+
feOffset: new Set(["animate", "set"]),
|
|
1561
|
+
feSpecularLighting: new Set([
|
|
1562
|
+
"animate",
|
|
1563
|
+
"feDistantLight",
|
|
1564
|
+
"fePointLight",
|
|
1565
|
+
"feSpotLight",
|
|
1566
|
+
"set",
|
|
1567
|
+
]),
|
|
1568
|
+
feTile: new Set(["animate", "set"]),
|
|
1569
|
+
feTurbulence: new Set(["animate", "set"]),
|
|
1570
|
+
animate: new Set(["desc", "metadata", "title"]),
|
|
1571
|
+
animateColor: new Set(["desc", "metadata", "title"]),
|
|
1572
|
+
animateMotion: new Set(["desc", "metadata", "mpath", "title"]),
|
|
1573
|
+
animateTransform: new Set(["desc", "metadata", "title"]),
|
|
1574
|
+
set: new Set(["desc", "metadata", "title"]),
|
|
853
1575
|
// Shape elements cannot have children (except animation)
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
1576
|
+
circle: new Set([
|
|
1577
|
+
"animate",
|
|
1578
|
+
"animateColor",
|
|
1579
|
+
"animateMotion",
|
|
1580
|
+
"animateTransform",
|
|
1581
|
+
"desc",
|
|
1582
|
+
"metadata",
|
|
1583
|
+
"set",
|
|
1584
|
+
"title",
|
|
1585
|
+
]),
|
|
1586
|
+
ellipse: new Set([
|
|
1587
|
+
"animate",
|
|
1588
|
+
"animateColor",
|
|
1589
|
+
"animateMotion",
|
|
1590
|
+
"animateTransform",
|
|
1591
|
+
"desc",
|
|
1592
|
+
"metadata",
|
|
1593
|
+
"set",
|
|
1594
|
+
"title",
|
|
1595
|
+
]),
|
|
1596
|
+
line: new Set([
|
|
1597
|
+
"animate",
|
|
1598
|
+
"animateColor",
|
|
1599
|
+
"animateMotion",
|
|
1600
|
+
"animateTransform",
|
|
1601
|
+
"desc",
|
|
1602
|
+
"metadata",
|
|
1603
|
+
"set",
|
|
1604
|
+
"title",
|
|
1605
|
+
]),
|
|
1606
|
+
path: new Set([
|
|
1607
|
+
"animate",
|
|
1608
|
+
"animateColor",
|
|
1609
|
+
"animateMotion",
|
|
1610
|
+
"animateTransform",
|
|
1611
|
+
"desc",
|
|
1612
|
+
"metadata",
|
|
1613
|
+
"set",
|
|
1614
|
+
"title",
|
|
1615
|
+
]),
|
|
1616
|
+
polygon: new Set([
|
|
1617
|
+
"animate",
|
|
1618
|
+
"animateColor",
|
|
1619
|
+
"animateMotion",
|
|
1620
|
+
"animateTransform",
|
|
1621
|
+
"desc",
|
|
1622
|
+
"metadata",
|
|
1623
|
+
"set",
|
|
1624
|
+
"title",
|
|
1625
|
+
]),
|
|
1626
|
+
polyline: new Set([
|
|
1627
|
+
"animate",
|
|
1628
|
+
"animateColor",
|
|
1629
|
+
"animateMotion",
|
|
1630
|
+
"animateTransform",
|
|
1631
|
+
"desc",
|
|
1632
|
+
"metadata",
|
|
1633
|
+
"set",
|
|
1634
|
+
"title",
|
|
1635
|
+
]),
|
|
1636
|
+
rect: new Set([
|
|
1637
|
+
"animate",
|
|
1638
|
+
"animateColor",
|
|
1639
|
+
"animateMotion",
|
|
1640
|
+
"animateTransform",
|
|
1641
|
+
"desc",
|
|
1642
|
+
"metadata",
|
|
1643
|
+
"set",
|
|
1644
|
+
"title",
|
|
1645
|
+
]),
|
|
1646
|
+
image: new Set([
|
|
1647
|
+
"animate",
|
|
1648
|
+
"animateColor",
|
|
1649
|
+
"animateMotion",
|
|
1650
|
+
"animateTransform",
|
|
1651
|
+
"desc",
|
|
1652
|
+
"metadata",
|
|
1653
|
+
"set",
|
|
1654
|
+
"title",
|
|
1655
|
+
]),
|
|
1656
|
+
use: new Set([
|
|
1657
|
+
"animate",
|
|
1658
|
+
"animateColor",
|
|
1659
|
+
"animateMotion",
|
|
1660
|
+
"animateTransform",
|
|
1661
|
+
"desc",
|
|
1662
|
+
"metadata",
|
|
1663
|
+
"set",
|
|
1664
|
+
"title",
|
|
1665
|
+
]),
|
|
863
1666
|
// Descriptive elements have no children
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1667
|
+
title: new Set([]),
|
|
1668
|
+
desc: new Set([]),
|
|
1669
|
+
metadata: new Set([]), // Can have any XML content, but SVG-wise empty
|
|
867
1670
|
// Light source elements
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
1671
|
+
feDistantLight: new Set(["animate", "set"]),
|
|
1672
|
+
fePointLight: new Set(["animate", "set"]),
|
|
1673
|
+
feSpotLight: new Set(["animate", "set"]),
|
|
871
1674
|
// Stop element
|
|
872
|
-
|
|
1675
|
+
stop: new Set(["animate", "set"]),
|
|
873
1676
|
// SVG 2.0 solidColor element (paint server)
|
|
874
|
-
|
|
875
|
-
|
|
1677
|
+
solidColor: new Set([
|
|
1678
|
+
"animate",
|
|
1679
|
+
"animateColor",
|
|
1680
|
+
"animateTransform",
|
|
1681
|
+
"desc",
|
|
1682
|
+
"metadata",
|
|
1683
|
+
"set",
|
|
1684
|
+
"title",
|
|
1685
|
+
]),
|
|
1686
|
+
solidcolor: new Set([
|
|
1687
|
+
"animate",
|
|
1688
|
+
"animateColor",
|
|
1689
|
+
"animateTransform",
|
|
1690
|
+
"desc",
|
|
1691
|
+
"metadata",
|
|
1692
|
+
"set",
|
|
1693
|
+
"title",
|
|
1694
|
+
]),
|
|
876
1695
|
// Text content elements
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1696
|
+
tref: new Set([
|
|
1697
|
+
"animate",
|
|
1698
|
+
"animateColor",
|
|
1699
|
+
"desc",
|
|
1700
|
+
"metadata",
|
|
1701
|
+
"set",
|
|
1702
|
+
"title",
|
|
1703
|
+
]),
|
|
1704
|
+
altGlyph: new Set([
|
|
1705
|
+
"animate",
|
|
1706
|
+
"animateColor",
|
|
1707
|
+
"desc",
|
|
1708
|
+
"metadata",
|
|
1709
|
+
"set",
|
|
1710
|
+
"title",
|
|
1711
|
+
]),
|
|
1712
|
+
altGlyphDef: new Set(["altGlyphItem"]),
|
|
1713
|
+
altGlyphItem: new Set(["glyphRef", "altGlyphItem"]),
|
|
1714
|
+
glyph: new Set([
|
|
1715
|
+
"animate",
|
|
1716
|
+
"animateColor",
|
|
1717
|
+
"animateMotion",
|
|
1718
|
+
"animateTransform",
|
|
1719
|
+
"circle",
|
|
1720
|
+
"desc",
|
|
1721
|
+
"ellipse",
|
|
1722
|
+
"line",
|
|
1723
|
+
"metadata",
|
|
1724
|
+
"path",
|
|
1725
|
+
"polygon",
|
|
1726
|
+
"polyline",
|
|
1727
|
+
"rect",
|
|
1728
|
+
"set",
|
|
1729
|
+
"title",
|
|
1730
|
+
"use",
|
|
1731
|
+
]),
|
|
1732
|
+
glyphRef: new Set([]),
|
|
883
1733
|
// Other elements
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
1734
|
+
foreignObject: new Set([]), // Can contain any non-SVG content
|
|
1735
|
+
style: new Set([]),
|
|
1736
|
+
script: new Set([]),
|
|
1737
|
+
view: new Set(["desc", "metadata", "title"]),
|
|
1738
|
+
mpath: new Set(["desc", "metadata", "title"]),
|
|
889
1739
|
};
|
|
890
1740
|
|
|
891
1741
|
// ============================================================================
|
|
@@ -899,37 +1749,66 @@ export const allowedChildrenPerElement = {
|
|
|
899
1749
|
export const pseudoClasses = {
|
|
900
1750
|
// User action pseudo-classes - cannot be evaluated
|
|
901
1751
|
userAction: new Set([
|
|
902
|
-
|
|
1752
|
+
":hover",
|
|
1753
|
+
":active",
|
|
1754
|
+
":focus",
|
|
1755
|
+
":focus-within",
|
|
1756
|
+
":focus-visible",
|
|
903
1757
|
]),
|
|
904
1758
|
// Tree-structural pseudo-classes - can sometimes be evaluated
|
|
905
1759
|
treeStructural: new Set([
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
1760
|
+
":root",
|
|
1761
|
+
":empty",
|
|
1762
|
+
":first-child",
|
|
1763
|
+
":last-child",
|
|
1764
|
+
":only-child",
|
|
1765
|
+
":first-of-type",
|
|
1766
|
+
":last-of-type",
|
|
1767
|
+
":only-of-type",
|
|
1768
|
+
":nth-child",
|
|
1769
|
+
":nth-last-child",
|
|
1770
|
+
":nth-of-type",
|
|
1771
|
+
":nth-last-of-type",
|
|
909
1772
|
]),
|
|
910
1773
|
// Link pseudo-classes
|
|
911
|
-
link: new Set([
|
|
912
|
-
':link', ':visited', ':any-link', ':local-link', ':target'
|
|
913
|
-
]),
|
|
1774
|
+
link: new Set([":link", ":visited", ":any-link", ":local-link", ":target"]),
|
|
914
1775
|
// Input pseudo-classes
|
|
915
1776
|
input: new Set([
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
1777
|
+
":enabled",
|
|
1778
|
+
":disabled",
|
|
1779
|
+
":read-only",
|
|
1780
|
+
":read-write",
|
|
1781
|
+
":placeholder-shown",
|
|
1782
|
+
":default",
|
|
1783
|
+
":checked",
|
|
1784
|
+
":indeterminate",
|
|
1785
|
+
":valid",
|
|
1786
|
+
":invalid",
|
|
1787
|
+
":in-range",
|
|
1788
|
+
":out-of-range",
|
|
1789
|
+
":required",
|
|
1790
|
+
":optional",
|
|
919
1791
|
]),
|
|
920
1792
|
// Linguistic pseudo-classes
|
|
921
|
-
linguistic: new Set([
|
|
922
|
-
':lang', ':dir'
|
|
923
|
-
]),
|
|
1793
|
+
linguistic: new Set([":lang", ":dir"]),
|
|
924
1794
|
// Negation and matching
|
|
925
|
-
functional: new Set([
|
|
926
|
-
':not', ':is', ':where', ':has'
|
|
927
|
-
]),
|
|
1795
|
+
functional: new Set([":not", ":is", ":where", ":has"]),
|
|
928
1796
|
// All pseudo-classes that prevent inlining
|
|
929
1797
|
preventInlining: new Set([
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
1798
|
+
":hover",
|
|
1799
|
+
":active",
|
|
1800
|
+
":focus",
|
|
1801
|
+
":focus-within",
|
|
1802
|
+
":focus-visible",
|
|
1803
|
+
":visited",
|
|
1804
|
+
":target",
|
|
1805
|
+
":lang",
|
|
1806
|
+
":dir",
|
|
1807
|
+
":not",
|
|
1808
|
+
":is",
|
|
1809
|
+
":where",
|
|
1810
|
+
":has",
|
|
1811
|
+
]),
|
|
933
1812
|
};
|
|
934
1813
|
|
|
935
1814
|
// ============================================================================
|
|
@@ -943,11 +1822,11 @@ export const pseudoClasses = {
|
|
|
943
1822
|
*/
|
|
944
1823
|
export const additionalEditorNamespaces = new Set([
|
|
945
1824
|
// CorelDraw
|
|
946
|
-
|
|
1825
|
+
"http://www.corel.com/coreldraw/svg",
|
|
947
1826
|
// Gravit Designer
|
|
948
|
-
|
|
1827
|
+
"http://gravit.io/ns",
|
|
949
1828
|
// Affinity
|
|
950
|
-
|
|
1829
|
+
"http://serif.com/affinity",
|
|
951
1830
|
// Canva
|
|
952
|
-
|
|
1831
|
+
"http://canva.com/ns",
|
|
953
1832
|
]);
|