oxvg_collections 0.0.3

Collections of data and utilities about SVG
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
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
343
344
345
346
347
348
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
//! A collection of elements and attributes in SVG documents
use phf::{phf_map, phf_set};

/// A group is a category of some SVG name
pub trait Group<'a> {
    /// Returns whether the string belongs to the group
    fn matches<T>(&self, value: T) -> bool
    where
        T: Into<&'a str>,
    {
        self.set().contains(value.into())
    }

    /// Returns the group as a set
    fn set(&self) -> &'a phf::Set<&'static str>;
}

#[derive(Hash, PartialEq, Eq)]
/// The different types an element can belong to
pub enum ElementGroup {
    /// Elements used for animation
    Animation,
    /// Elements used for descriptions
    Descriptive,
    /// Elements used for shapes
    Shape,
    /// Elements used for document structure
    Structural,
    /// Elements used for painting
    PaintServer,
    /// Elements used for non-rendering tasks
    NonRendering,
    /// Elements used for containing specific elements
    Container,
    /// Elements used for typography
    TextContent,
    /// Elements used for typography content
    TextContentChild,
    /// Elements used for lighting
    LightSource,
    /// Elements used for filtering
    FilterPrimitive,
}

impl<'a> Group<'a> for ElementGroup {
    fn set(&self) -> &'a phf::Set<&'static str> {
        match self {
            Self::Animation => &ANIMATION,
            Self::Descriptive => &DESCRIPTIVE,
            Self::Shape => &SHAPE,
            Self::Structural => &STRUCTURAL,
            Self::PaintServer => &PAINT_SERVER,
            Self::NonRendering => &NON_RENDERING,
            Self::Container => &CONTAINER,
            Self::TextContent => &TEXT_CONTENT,
            Self::TextContentChild => &TEXT_CONTENT_CHILD,
            Self::LightSource => &LIGHT_SOURCE,
            Self::FilterPrimitive => &FILTER_PRIMITIVE,
        }
    }
}

// Element groups
/// See [`ElementGroup::Animation`]
pub static ANIMATION: phf::Set<&'static str> = phf_set! {
    "animate",
    "animateColor",
    "animateMotion",
    "animateTransform",
    "set"
};
/// See [`ElementGroup::Descriptive`]
pub static DESCRIPTIVE: phf::Set<&'static str> = phf_set! { "desc", "metadata", "title" };
/// See [`ElementGroup::Shape`]
pub static SHAPE: phf::Set<&'static str> =
    phf_set! { "circle", "ellipse", "line", "path", "polygon", "polyline", "rect" };
/// See [`ElementGroup::Structural`]
pub static STRUCTURAL: phf::Set<&'static str> = phf_set! { "defs", "g", "svg", "symbol", "use" };
/// See [`ElementGroup::PaintServer`]
pub static PAINT_SERVER: phf::Set<&'static str> = phf_set! {
    "hatch",
    "linearGradient",
    "meshGradient",
    "pattern",
    "radialGradient",
    "solidColor"
};
/// See [`ElementGroup::NonRendering`]
pub static NON_RENDERING: phf::Set<&'static str> = phf_set! {
    "clipPath",
    "filter",
    "linearGradient",
    "marker",
    "mask",
    "pattern",
    "radialGradient",
    "solidColor",
    "symbol"
};
/// See [`ElementGroup::Container`]
pub static CONTAINER: phf::Set<&'static str> = phf_set! {
    "a",
    "defs",
    "foreignObject",
    "g",
    "marker",
    "mask",
    "missing-glyph",
    "pattern",
    "svg",
    "switch",
    "symbol"
};
/// See [`ElementGroup::TextContent`]
pub static TEXT_CONTENT: phf::Set<&'static str> = phf_set! {
    "a",
    "altGlyph",
    "altGlyphDef",
    "alyGlyphItem",
    "glyph",
    "glyphRef",
    "text",
    "textPath",
    "tref",
    "tspan"
};
/// See [`ElementGroup::TextContentChild`]
pub static TEXT_CONTENT_CHILD: phf::Set<&'static str> =
    phf_set! { "altGlyph", "textPath", "tref", "tspan" };
/// See [`ElementGroup::LightSource`]
pub static LIGHT_SOURCE: phf::Set<&'static str> = phf_set! {
    "feDiffuseLighting",
    "feDistantLight",
    "fePointLight",
    "feSpecularLighting",
    "feSpotLight"
};
/// See [`ElementGroup::FilterPrimitive`]
pub static FILTER_PRIMITIVE: phf::Set<&'static str> = phf_set! {
    "feBlend",
    "feColorMatrix",
    "feComponentTransfer",
    "feComposite",
    "feConvolveMatrix",
    "feDiffuseLighting",
    "feDisplacementMap",
    "feDropShadow",
    "feFlood",
    "feFuncA",
    "feFuncB",
    "feFuncG",
    "feFuncR",
    "feGaussianBlur",
    "feImage",
    "feMerge",
    "feMergeNode",
    "feMorphology",
    "feOffset",
    "feSpecularLighting",
    "feTile",
    "feTurbulence"
};

#[derive(Hash, PartialEq, Eq)]
/// The different types an attribute can belong to
pub enum AttrsGroups {
    /// Attributes used for animation addition
    AnimationAddition,
    /// Attributes used for animation targets
    AnimationAttributeTarget,
    /// Attributes used for animation events
    AnimationEvent,
    /// Attributes used for animation timing
    AnimationTiming,
    /// Attributes used for animation values
    AnimationValue,
    /// Attributes used for conditional processing
    ConditionalProcessing,
    /// Attributes used for any SVG element
    Core,
    /// Attributes used for graphical events
    GraphicalEvent,
    /// Attributes used for styling
    Presentation,
    /// Attributes used for xlink features
    XLink,
    /// Attributes used for document events
    DocumentEvent,
    /// Attributes used for document element events
    DocumentElementEvent,
    /// Attributes used for global events
    GlobalEvent,
    /// Attributes used for filter primitive elements
    FilterPrimitive,
    /// Attributes used for transfer functions
    TransferFunction,
}

impl<'a> Group<'a> for AttrsGroups {
    fn set(&self) -> &'a phf::Set<&'static str> {
        match self {
            Self::AnimationAddition => &ANIMATION_ADDITION,
            Self::AnimationAttributeTarget => &ANIMATION_ATTRIBUTE_TARGET,
            Self::AnimationEvent => &ANIMATION_EVENT,
            Self::AnimationTiming => &ANIMATION_TIMING,
            Self::AnimationValue => &ANIMATION_VALUE,
            Self::ConditionalProcessing => &CONDITIONAL_PROCESSING,
            Self::Core => &CORE,
            Self::GraphicalEvent => &GRAPHICAL_EVENT,
            Self::Presentation => &PRESENTATION,
            Self::XLink => &X_LINK,
            Self::DocumentEvent => &DOCUMENT_EVENT,
            Self::DocumentElementEvent => &DOCUMENT_ELEMENT_EVENT,
            Self::GlobalEvent => &GLOBAL_EVENT,
            Self::FilterPrimitive => &FILTER_PRIMITIVE,
            Self::TransferFunction => &TRANSFER_FUNCTION,
        }
    }
}

// NOTE: Can't seem to macronise this
/// Attributes used for events
pub static EVENT_ATTRS: phf::Set<&'static str> = phf_set! {
    // ANIMATION_EVENT
    "onbegin",
    "onend",
    "onrepeat",
    "onload",
    // DOCUMENT_EVENT
    "onabort",
    "onerror",
    "onresize",
    "onscroll",
    "onunload",
    "onzoom",
    // DOCUMENT_ELEMENT_EVENT
    "oncopy",
    "oncut",
    "onpaste",
    // GLOBAL_EVENT (NOTE: Deduplicated)
    "oncancel",
    "oncanplay",
    "oncanplaythrough",
    "onchange",
    "onclick",
    "onclose",
    "oncuechange",
    "ondblclick",
    "ondrag",
    "ondragend",
    "ondragenter",
    "ondragleave",
    "ondragover",
    "ondragstart",
    "ondrop",
    "ondurationchange",
    "onemptied",
    "onended",
    "onfocus",
    "oninput",
    "oninvalid",
    "onkeydown",
    "onkeypress",
    "onkeyup",
    "onloadeddata",
    "onloadedmetadata",
    "onloadstart",
    "onmousedown",
    "onmouseenter",
    "onmouseleave",
    "onmousemove",
    "onmouseout",
    "onmouseover",
    "onmouseup",
    "onmousewheel",
    "onpause",
    "onplay",
    "onplaying",
    "onprogress",
    "onratechange",
    "onreset",
    "onseeked",
    "onseeking",
    "onselect",
    "onshow",
    "onstalled",
    "onsubmit",
    "onsuspend",
    "ontimeupdate",
    "ontoggle",
    "onvolumechange",
    "onwaiting",
    // GRAPHICAL_EVENT (NOTE: Deduplicated)
    "onactivate",
    "onfocusin",
    "onfocusout",
};

// Attrs groups
/// See [`AttrsGroups::AnimationAddition`]
pub static ANIMATION_ADDITION: phf::Set<&'static str> = phf_set! { "additive", "accumulate" };
/// See [`AttrsGroups::AnimationAttributeTarget`]
pub static ANIMATION_ATTRIBUTE_TARGET: phf::Set<&'static str> =
    phf_set! { "attributeType", "attributeName" };
/// See [`AttrsGroups::AnimationEvent`]
pub static ANIMATION_EVENT: phf::Set<&'static str> =
    phf_set! { "onbegin", "onend", "onrepeat", "onload" };
/// See [`AttrsGroups::AnimationTiming`]
pub static ANIMATION_TIMING: phf::Set<&'static str> = phf_set! {
    "begin",
    "dur",
    "end",
    "fill",
    "max",
    "min",
    "repeatCount",
    "repeatDur",
    "restart",
};
/// See [`AttrsGroups::AnimationValue`]
pub static ANIMATION_VALUE: phf::Set<&'static str> = phf_set! {
    "by",
    "calcMode",
    "from",
    "keySplines",
    "keyTimes",
    "to",
    "values",
};
/// See [`AttrsGroups::ConditionalProcessing`]
pub static CONDITIONAL_PROCESSING: phf::Set<&'static str> =
    phf_set! { "requiredExtensions", "requiredFeatures", "systemLanguage", };
/// See [`AttrsGroups::Core`]
pub static CORE: phf::Set<&'static str> =
    phf_set! { "id", "tabindex", "xml:base", "xml:lang", "xml:space" };
/// See [`AttrsGroups::GraphicalEvent`]
pub static GRAPHICAL_EVENT: phf::Set<&'static str> = phf_set! {
    "onactivate",
    "onclick",
    "onfocusin",
    "onfocusout",
    "onload",
    "onmousedown",
    "onmousemove",
    "onmouseout",
    "onmouseover",
    "onmouseup",
};
/// See [`AttrsGroups::Presentation`]
pub static PRESENTATION: phf::Set<&'static str> = phf_set! {
    "alignment-baseline",
    "baseline-shift",
    "clip-path",
    "clip-rule",
    "clip",
    "color-interpolation-filters",
    "color-interpolation",
    "color-profile",
    "color-rendering",
    "color",
    "cursor",
    "direction",
    "display",
    "dominant-baseline",
    "enable-background",
    "fill-opacity",
    "fill-rule",
    "fill",
    "filter",
    "flood-color",
    "flood-opacity",
    "font-family",
    "font-size-adjust",
    "font-size",
    "font-stretch",
    "font-style",
    "font-variant",
    "font-weight",
    "glyph-orientation-horizontal",
    "glyph-orientation-vertical",
    "image-rendering",
    "letter-spacing",
    "lighting-color",
    "marker-end",
    "marker-mid",
    "marker-start",
    "mask",
    "opacity",
    "overflow",
    "paint-order",
    "pointer-events",
    "shape-rendering",
    "stop-color",
    "stop-opacity",
    "stroke-dasharray",
    "stroke-dashoffset",
    "stroke-linecap",
    "stroke-linejoin",
    "stroke-miterlimit",
    "stroke-opacity",
    "stroke-width",
    "stroke",
    "text-anchor",
    "text-decoration",
    "text-overflow",
    "text-rendering",
    "transform-origin",
    "transform",
    "unicode-bidi",
    "vector-effect",
    "visibility",
    "word-spacing",
    "writing-mode",
};
/// See [`AttrsGroups::XLink`]
pub static X_LINK: phf::Set<&'static str> = phf_set! {
    "xlink:actuate",
    "xlink:arcrole",
    "xlink:href",
    "xlink:role",
    "xlink:show",
    "xlink:title",
    "xlink:type",
};
/// See [`AttrsGroups::DocumentEvent`]
pub static DOCUMENT_EVENT: phf::Set<&'static str> =
    phf_set! {"onabort", "onerror", "onresize", "onscroll", "onunload", "onzoom",};
/// See [`AttrsGroups::DocumentElementEvent`]
pub static DOCUMENT_ELEMENT_EVENT: phf::Set<&'static str> = phf_set! {"oncopy", "oncut", "onpaste"};
/// See [`AttrsGroups::GlobalEvent`]
pub static GLOBAL_EVENT: phf::Set<&'static str> = phf_set! {
    "oncancel",
    "oncanplay",
    "oncanplaythrough",
    "onchange",
    "onclick",
    "onclose",
    "oncuechange",
    "ondblclick",
    "ondrag",
    "ondragend",
    "ondragenter",
    "ondragleave",
    "ondragover",
    "ondragstart",
    "ondrop",
    "ondurationchange",
    "onemptied",
    "onended",
    "onerror",
    "onfocus",
    "oninput",
    "oninvalid",
    "onkeydown",
    "onkeypress",
    "onkeyup",
    "onload",
    "onloadeddata",
    "onloadedmetadata",
    "onloadstart",
    "onmousedown",
    "onmouseenter",
    "onmouseleave",
    "onmousemove",
    "onmouseout",
    "onmouseover",
    "onmouseup",
    "onmousewheel",
    "onpause",
    "onplay",
    "onplaying",
    "onprogress",
    "onratechange",
    "onreset",
    "onresize",
    "onscroll",
    "onseeked",
    "onseeking",
    "onselect",
    "onshow",
    "onstalled",
    "onsubmit",
    "onsuspend",
    "ontimeupdate",
    "ontoggle",
    "onvolumechange",
    "onwaiting",
};
/// See [`AttrsGroups::FilterPrimitive`]
pub static FILTER_PRIMITIVE_ATTRS: phf::Set<&'static str> =
    phf_set! {"x", "y", "width", "height", "result"};
/// See [`AttrsGroups::TransferFunction`]
pub static TRANSFER_FUNCTION: phf::Set<&'static str> = phf_set! {
    "amplitude",
    "exponent",
    "intercept",
    "offset",
    "slope",
    "tableValues",
    "type",
};

impl AttrsGroups {
    /// Returns the default values for a given attribute group
    pub fn defaults(&self) -> Option<&phf::Map<&'static str, &'static str>> {
        match self {
            Self::Core => Some(&CORE_DEFAULTS),
            Self::Presentation => Some(&PRESENTATION_DEFAULTS),
            Self::TransferFunction => Some(&TRANSFER_FUNCTION_DEFAULTS),
            _ => None,
        }
    }

    /// Returns the default values for an attribute group's static set
    pub fn defaults_from_static<'a>(
        static_set: &'a phf::Set<&str>,
    ) -> Option<&'a phf::Map<&'static str, &'static str>> {
        let key = static_set.map.key;
        if key == CORE.map.key {
            Some(&CORE_DEFAULTS)
        } else if key == PRESENTATION.map.key {
            Some(&PRESENTATION_DEFAULTS)
        } else if key == TRANSFER_FUNCTION.map.key {
            Some(&TRANSFER_FUNCTION_DEFAULTS)
        } else {
            None
        }
    }
}

// Attrs groups defaults
static CORE_DEFAULTS: phf::Map<&'static str, &'static str> = phf_map!("xml:space" => "default");
static PRESENTATION_DEFAULTS: phf::Map<&'static str, &'static str> = phf_map!(
    "clip" => "auto",
    "clip-path" => "none",
    "clip-rule" => "nonzero",
    "mask" => "none",
    "opacity" => "1",
    "stop-color" => "#000",
    "stop-opacity" => "1",
    "fill-opacity" => "1",
    "fill-rule" => "nonzero",
    "fill" => "#000",
    "stroke" => "none",
    "stroke-width" => "1",
    "stroke-linecap" => "butt",
    "stroke-linejoin" => "miter",
    "stroke-miterlimit" => "4",
    "stroke-dasharray" => "none",
    "stroke-dashoffset" => "0",
    "stroke-opacity" => "1",
    "paint-order" => "normal",
    "vector-effect" => "none",
    "display" => "inline",
    "visibility" => "visible",
    "marker-start" => "none",
    "marker-mid" => "none",
    "marker-end" => "none",
    "color-interpolation" => "sRGB",
    "color-interpolation-filters" => "linearRGB",
    "color-rendering" => "auto",
    "shape-rendering" => "auto",
    "text-rendering" => "auto",
    "image-rendering" => "auto",
    "font-style" => "normal",
    "font-variant" => "normal",
    "font-weight" => "normal",
    "font-stretch" => "normal",
    "font-size" => "medium",
    "font-size-adjust" => "none",
    "kerning" => "auto",
    "letter-spacing" => "normal",
    "word-spacing" => "normal",
    "text-decoration" => "none",
    "text-anchor" => "start",
    "text-overflow" => "clip",
    "writing-mode" => "lr-tb",
    "glyph-orientation-vertical" => "auto",
    "glyph-orientation-horizontal" => "0deg",
    "direction" => "ltr",
    "unicode-bidi" => "normal",
    "dominant-baseline" => "auto",
    "alignment-baseline" => "baseline",
    "baseline-shift" => "baseline",
);
static TRANSFER_FUNCTION_DEFAULTS: phf::Map<&'static str, &'static str> = phf_map!(
    "slope" => "1",
    "intercept" => "0",
    "amplitude" => "1",
    "exponent" => "1",
    "offset" => "0",
);

/// Elements that use paths
pub static PATH_ELEMS: phf::Set<&'static str> = phf_set!("glyph", "missing-glyph", "path");
/// Attributes that can be inherited
pub static INHERITABLE_ATTRS: phf::Set<&'static str> = phf_set!(
    "clip-rule",
    "color-interpolation-filters",
    "color-interpolation",
    "color-profile",
    "color-rendering",
    "color",
    "cursor",
    "direction",
    "dominant-baseline",
    "fill-opacity",
    "fill-rule",
    "fill",
    "font-family",
    "font-size-adjust",
    "font-size",
    "font-stretch",
    "font-style",
    "font-variant",
    "font-weight",
    "font",
    "glyph-orientation-horizontal",
    "glyph-orientation-vertical",
    "image-rendering",
    "letter-spacing",
    "marker-end",
    "marker-mid",
    "marker-start",
    "marker",
    "paint-order",
    "pointer-events",
    "shape-rendering",
    "stroke-dasharray",
    "stroke-dashoffset",
    "stroke-linecap",
    "stroke-linejoin",
    "stroke-miterlimit",
    "stroke-opacity",
    "stroke-width",
    "stroke",
    "text-anchor",
    "text-rendering",
    "transform",
    "visibility",
    "word-spacing",
    "writing-mode",
);
/// Presentation attributes that aren't inherited
pub static PRESENTATION_NON_INHERITABLE_GROUP_ATTRS: phf::Set<&'static str> = phf_set!(
    "clip-path",
    "display",
    "filter",
    "mask",
    "opacity",
    "text-decoration",
    "transform",
    "unicode-bidi",
);
/// Attributes that may reference other elements by id
pub static REFERENCES_PROPS: phf::Set<&'static str> = phf_set!(
    "clip-path",
    "color-profile",
    "fill",
    "filter",
    "marker-end",
    "marker-mid",
    "marker-start",
    "mask",
    "stroke",
    "style",
);
/// Pseudoclasses used to select display state
pub static PSEUDO_DISPLAY_STATE: phf::Set<&'static str> =
    phf_set!("fullscreen", "modal", "picture-in-picture");
/// Pseudoclasses used to select input state
pub static PSEUDO_INPUT: phf::Set<&'static str> = phf_set!(
    "autofill",
    "blank",
    "checked",
    "default",
    "disabled",
    "enabled",
    "in-range",
    "indetermined",
    "invalid",
    "optional",
    "out-of-range",
    "placeholder-shown",
    "read-only",
    "read-write",
    "required",
    "user-invalid",
    "valid",
);
/// Pseudoclasses used to select language state
pub static PSEUDO_LINGUISTIC: phf::Set<&'static str> = phf_set!("dir", "lang");
/// Pseudoclasses used to select link state
pub static PSEUDO_LOCATION: phf::Set<&'static str> = phf_set!(
    "any-link",
    "link",
    "local-link",
    "scope",
    "target-within",
    "target",
    "visited",
);
/// Pseudoclasses used to select media state
pub static PSEUDO_RESOURCE_STATE: phf::Set<&'static str> = phf_set!("playing", "paused");
/// Pseudoclasses used to select temporal state
pub static PSEUDO_TIME_DIMENSIONAL: phf::Set<&'static str> = phf_set!("current", "past", "future");
/// Pseudoclasses used to select DOM state
pub static PSEUDO_TREE_STRUCTURAL: phf::Set<&'static str> = phf_set!(
    "empty",
    "first-child",
    "first-of-type",
    "last-child",
    "last-of-type",
    "nth-child",
    "nth-last-child",
    "nth-last-of-type",
    "nth-of-type",
    "only-child",
    "only-of-type",
    "root",
);
/// Pseudoclasses used to select user state
pub static PSEUDO_USER_ACTION: phf::Set<&'static str> =
    phf_set!("active", "focus-visible", "focus-within", "focus", "hover");
/// Pseudoclasses used to select logical state
pub static PSEUDO_FUNCTIONAL: phf::Set<&'static str> = phf_set!("is", "not", "where", "has");
/// Namespaces used by vector editors
pub static EDITOR_NAMESPACES: phf::Set<&'static str> = phf_set!(
    "http://creativecommons.org/ns#",
    "http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd",
    "http://ns.adobe.com/AdobeIllustrator/10.0/",
    "http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/",
    "http://ns.adobe.com/Extensibility/1.0/",
    "http://ns.adobe.com/Flows/1.0/",
    "http://ns.adobe.com/GenericCustomNamespace/1.0/",
    "http://ns.adobe.com/Graphs/1.0/",
    "http://ns.adobe.com/ImageReplacement/1.0/",
    "http://ns.adobe.com/SaveForWeb/1.0/",
    "http://ns.adobe.com/Variables/1.0/",
    "http://ns.adobe.com/XPath/1.0/",
    "http://purl.org/dc/elements/1.1/",
    "http://schemas.microsoft.com/visio/2003/SVGExtensions/",
    "http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",
    "http://taptrix.com/vectorillustrator/svg_extensions",
    "http://www.bohemiancoding.com/sketch/ns",
    "http://www.figma.com/figma/ns",
    "http://www.inkscape.org/namespaces/inkscape",
    "http://www.serif.com/",
    "http://www.vector.evaxdesign.sk",
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
);
/// SVG attributes that reference a color
pub static COLORS_PROPS: phf::Set<&'static str> = phf_set!(
    "color",
    "fill",
    "flood-color",
    "lighting-color",
    "stop-color",
    "stroke"
);