You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2558 lines
57 KiB

4 years ago
  1. 'use strict';
  2. // http://www.w3.org/TR/SVG11/intro.html#Definitions
  3. exports.elemsGroups = {
  4. animation: ['animate', 'animateColor', 'animateMotion', 'animateTransform', 'set'],
  5. descriptive: ['desc', 'metadata', 'title'],
  6. shape: ['circle', 'ellipse', 'line', 'path', 'polygon', 'polyline', 'rect'],
  7. structural: ['defs', 'g', 'svg', 'symbol', 'use'],
  8. paintServer: ['solidColor', 'linearGradient', 'radialGradient', 'meshGradient', 'pattern', 'hatch'],
  9. nonRendering: ['linearGradient', 'radialGradient', 'pattern', 'clipPath', 'mask', 'marker', 'symbol', 'filter', 'solidColor'],
  10. container: ['a', 'defs', 'g', 'marker', 'mask', 'missing-glyph', 'pattern', 'svg', 'switch', 'symbol', 'foreignObject'],
  11. textContent: ['altGlyph', 'altGlyphDef', 'altGlyphItem', 'glyph', 'glyphRef', 'textPath', 'text', 'tref', 'tspan'],
  12. textContentChild: ['altGlyph', 'textPath', 'tref', 'tspan'],
  13. lightSource: ['feDiffuseLighting', 'feSpecularLighting', 'feDistantLight', 'fePointLight', 'feSpotLight'],
  14. filterPrimitive: ['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feFlood', 'feGaussianBlur', 'feImage', 'feMerge', 'feMorphology', 'feOffset', 'feSpecularLighting', 'feTile', 'feTurbulence']
  15. };
  16. exports.pathElems = ['path', 'glyph', 'missing-glyph'];
  17. // http://www.w3.org/TR/SVG11/intro.html#Definitions
  18. exports.attrsGroups = {
  19. animationAddition: ['additive', 'accumulate'],
  20. animationAttributeTarget: ['attributeType', 'attributeName'],
  21. animationEvent: ['onbegin', 'onend', 'onrepeat', 'onload'],
  22. animationTiming: ['begin', 'dur', 'end', 'min', 'max', 'restart', 'repeatCount', 'repeatDur', 'fill'],
  23. animationValue: ['calcMode', 'values', 'keyTimes', 'keySplines', 'from', 'to', 'by'],
  24. conditionalProcessing: ['requiredFeatures', 'requiredExtensions', 'systemLanguage'],
  25. core: ['id', 'tabindex', 'xml:base', 'xml:lang', 'xml:space'],
  26. graphicalEvent: ['onfocusin', 'onfocusout', 'onactivate', 'onclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onload'],
  27. presentation: [
  28. 'alignment-baseline',
  29. 'baseline-shift',
  30. 'clip',
  31. 'clip-path',
  32. 'clip-rule',
  33. 'color',
  34. 'color-interpolation',
  35. 'color-interpolation-filters',
  36. 'color-profile',
  37. 'color-rendering',
  38. 'cursor',
  39. 'direction',
  40. 'display',
  41. 'dominant-baseline',
  42. 'enable-background',
  43. 'fill',
  44. 'fill-opacity',
  45. 'fill-rule',
  46. 'filter',
  47. 'flood-color',
  48. 'flood-opacity',
  49. 'font-family',
  50. 'font-size',
  51. 'font-size-adjust',
  52. 'font-stretch',
  53. 'font-style',
  54. 'font-variant',
  55. 'font-weight',
  56. 'glyph-orientation-horizontal',
  57. 'glyph-orientation-vertical',
  58. 'image-rendering',
  59. 'letter-spacing',
  60. 'lighting-color',
  61. 'marker-end',
  62. 'marker-mid',
  63. 'marker-start',
  64. 'mask',
  65. 'opacity',
  66. 'overflow',
  67. 'paint-order',
  68. 'pointer-events',
  69. 'shape-rendering',
  70. 'stop-color',
  71. 'stop-opacity',
  72. 'stroke',
  73. 'stroke-dasharray',
  74. 'stroke-dashoffset',
  75. 'stroke-linecap',
  76. 'stroke-linejoin',
  77. 'stroke-miterlimit',
  78. 'stroke-opacity',
  79. 'stroke-width',
  80. 'text-anchor',
  81. 'text-decoration',
  82. 'text-overflow',
  83. 'text-rendering',
  84. 'transform',
  85. 'unicode-bidi',
  86. 'vector-effect',
  87. 'visibility',
  88. 'word-spacing',
  89. 'writing-mode'
  90. ],
  91. xlink: ['xlink:href', 'xlink:show', 'xlink:actuate', 'xlink:type', 'xlink:role', 'xlink:arcrole', 'xlink:title'],
  92. documentEvent: ['onunload', 'onabort', 'onerror', 'onresize', 'onscroll', 'onzoom'],
  93. filterPrimitive: ['x', 'y', 'width', 'height', 'result'],
  94. transferFunction: ['type', 'tableValues', 'slope', 'intercept', 'amplitude', 'exponent', 'offset']
  95. };
  96. exports.attrsGroupsDefaults = {
  97. core: {'xml:space': 'preserve'},
  98. filterPrimitive: {x: '0', y: '0', width: '100%', height: '100%'},
  99. presentation: {
  100. clip: 'auto',
  101. 'clip-path': 'none',
  102. 'clip-rule': 'nonzero',
  103. mask: 'none',
  104. opacity: '1',
  105. 'stop-color': '#000',
  106. 'stop-opacity': '1',
  107. 'fill-opacity': '1',
  108. 'fill-rule': 'nonzero',
  109. fill: '#000',
  110. stroke: 'none',
  111. 'stroke-width': '1',
  112. 'stroke-linecap': 'butt',
  113. 'stroke-linejoin': 'miter',
  114. 'stroke-miterlimit': '4',
  115. 'stroke-dasharray': 'none',
  116. 'stroke-dashoffset': '0',
  117. 'stroke-opacity': '1',
  118. 'paint-order': 'normal',
  119. 'vector-effect': 'none',
  120. display: 'inline',
  121. visibility: 'visible',
  122. 'marker-start': 'none',
  123. 'marker-mid': 'none',
  124. 'marker-end': 'none',
  125. 'color-interpolation': 'sRGB',
  126. 'color-interpolation-filters': 'linearRGB',
  127. 'color-rendering': 'auto',
  128. 'shape-rendering': 'auto',
  129. 'text-rendering': 'auto',
  130. 'image-rendering': 'auto',
  131. 'font-style': 'normal',
  132. 'font-variant': 'normal',
  133. 'font-weight': 'normal',
  134. 'font-stretch': 'normal',
  135. 'font-size': 'medium',
  136. 'font-size-adjust': 'none',
  137. kerning: 'auto',
  138. 'letter-spacing': 'normal',
  139. 'word-spacing': 'normal',
  140. 'text-decoration': 'none',
  141. 'text-anchor': 'start',
  142. 'text-overflow': 'clip',
  143. 'writing-mode': 'lr-tb',
  144. 'glyph-orientation-vertical': 'auto',
  145. 'glyph-orientation-horizontal': '0deg',
  146. direction: 'ltr',
  147. 'unicode-bidi': 'normal',
  148. 'dominant-baseline': 'auto',
  149. 'alignment-baseline': 'baseline',
  150. 'baseline-shift': 'baseline'
  151. },
  152. transferFunction: {slope: '1', intercept: '0', amplitude: '1', exponent: '1', offset: '0'}
  153. };
  154. // http://www.w3.org/TR/SVG11/eltindex.html
  155. exports.elems = {
  156. a: {
  157. attrsGroups: [
  158. 'conditionalProcessing',
  159. 'core',
  160. 'graphicalEvent',
  161. 'presentation',
  162. 'xlink'
  163. ],
  164. attrs: [
  165. 'class',
  166. 'style',
  167. 'externalResourcesRequired',
  168. 'transform',
  169. 'target'
  170. ],
  171. defaults: {
  172. target: '_self'
  173. },
  174. contentGroups: [
  175. 'animation',
  176. 'descriptive',
  177. 'shape',
  178. 'structural',
  179. 'paintServer'
  180. ],
  181. content: [
  182. 'a',
  183. 'altGlyphDef',
  184. 'clipPath',
  185. 'color-profile',
  186. 'cursor',
  187. 'filter',
  188. 'font',
  189. 'font-face',
  190. 'foreignObject',
  191. 'image',
  192. 'marker',
  193. 'mask',
  194. 'pattern',
  195. 'script',
  196. 'style',
  197. 'switch',
  198. 'text',
  199. 'view'
  200. ]
  201. },
  202. altGlyph: {
  203. attrsGroups: [
  204. 'conditionalProcessing',
  205. 'core',
  206. 'graphicalEvent',
  207. 'presentation',
  208. 'xlink'
  209. ],
  210. attrs: [
  211. 'class',
  212. 'style',
  213. 'externalResourcesRequired',
  214. 'x',
  215. 'y',
  216. 'dx',
  217. 'dy',
  218. 'glyphRef',
  219. 'format',
  220. 'rotate'
  221. ]
  222. },
  223. altGlyphDef: {
  224. attrsGroups: [
  225. 'core'
  226. ],
  227. content: [
  228. 'glyphRef'
  229. ]
  230. },
  231. altGlyphItem: {
  232. attrsGroups: [
  233. 'core'
  234. ],
  235. content: [
  236. 'glyphRef',
  237. 'altGlyphItem'
  238. ]
  239. },
  240. animate: {
  241. attrsGroups: [
  242. 'conditionalProcessing',
  243. 'core',
  244. 'animationAddition',
  245. 'animationAttributeTarget',
  246. 'animationEvent',
  247. 'animationTiming',
  248. 'animationValue',
  249. 'presentation',
  250. 'xlink'
  251. ],
  252. attrs: [
  253. 'externalResourcesRequired'
  254. ],
  255. contentGroups: [
  256. 'descriptive'
  257. ]
  258. },
  259. animateColor: {
  260. attrsGroups: [
  261. 'conditionalProcessing',
  262. 'core',
  263. 'animationEvent',
  264. 'xlink',
  265. 'animationAttributeTarget',
  266. 'animationTiming',
  267. 'animationValue',
  268. 'animationAddition',
  269. 'presentation'
  270. ],
  271. attrs: [
  272. 'externalResourcesRequired'
  273. ],
  274. contentGroups: [
  275. 'descriptive'
  276. ]
  277. },
  278. animateMotion: {
  279. attrsGroups: [
  280. 'conditionalProcessing',
  281. 'core',
  282. 'animationEvent',
  283. 'xlink',
  284. 'animationTiming',
  285. 'animationValue',
  286. 'animationAddition'
  287. ],
  288. attrs: [
  289. 'externalResourcesRequired',
  290. 'path',
  291. 'keyPoints',
  292. 'rotate',
  293. 'origin'
  294. ],
  295. defaults: {
  296. 'rotate': '0'
  297. },
  298. contentGroups: [
  299. 'descriptive'
  300. ],
  301. content: [
  302. 'mpath'
  303. ]
  304. },
  305. animateTransform: {
  306. attrsGroups: [
  307. 'conditionalProcessing',
  308. 'core',
  309. 'animationEvent',
  310. 'xlink',
  311. 'animationAttributeTarget',
  312. 'animationTiming',
  313. 'animationValue',
  314. 'animationAddition'
  315. ],
  316. attrs: [
  317. 'externalResourcesRequired',
  318. 'type'
  319. ],
  320. contentGroups: [
  321. 'descriptive'
  322. ]
  323. },
  324. circle: {
  325. attrsGroups: [
  326. 'conditionalProcessing',
  327. 'core',
  328. 'graphicalEvent',
  329. 'presentation'
  330. ],
  331. attrs: [
  332. 'class',
  333. 'style',
  334. 'externalResourcesRequired',
  335. 'transform',
  336. 'cx',
  337. 'cy',
  338. 'r'
  339. ],
  340. defaults: {
  341. cx: '0',
  342. cy: '0'
  343. },
  344. contentGroups: [
  345. 'animation',
  346. 'descriptive'
  347. ]
  348. },
  349. clipPath: {
  350. attrsGroups: [
  351. 'conditionalProcessing',
  352. 'core',
  353. 'presentation'
  354. ],
  355. attrs: [
  356. 'class',
  357. 'style',
  358. 'externalResourcesRequired',
  359. 'transform',
  360. 'clipPathUnits'
  361. ],
  362. defaults: {
  363. clipPathUnits: 'userSpaceOnUse'
  364. },
  365. contentGroups: [
  366. 'animation',
  367. 'descriptive',
  368. 'shape'
  369. ],
  370. content: [
  371. 'text',
  372. 'use'
  373. ]
  374. },
  375. 'color-profile': {
  376. attrsGroups: [
  377. 'core',
  378. 'xlink'
  379. ],
  380. attrs: [
  381. 'local',
  382. 'name',
  383. 'rendering-intent'
  384. ],
  385. defaults: {
  386. name: 'sRGB',
  387. 'rendering-intent': 'auto'
  388. },
  389. contentGroups: [
  390. 'descriptive'
  391. ]
  392. },
  393. cursor: {
  394. attrsGroups: [
  395. 'core',
  396. 'conditionalProcessing',
  397. 'xlink'
  398. ],
  399. attrs: [
  400. 'externalResourcesRequired',
  401. 'x',
  402. 'y'
  403. ],
  404. defaults: {
  405. x: '0',
  406. y: '0'
  407. },
  408. contentGroups: [
  409. 'descriptive'
  410. ]
  411. },
  412. defs: {
  413. attrsGroups: [
  414. 'conditionalProcessing',
  415. 'core',
  416. 'graphicalEvent',
  417. 'presentation'
  418. ],
  419. attrs: [
  420. 'class',
  421. 'style',
  422. 'externalResourcesRequired',
  423. 'transform'
  424. ],
  425. contentGroups: [
  426. 'animation',
  427. 'descriptive',
  428. 'shape',
  429. 'structural',
  430. 'paintServer'
  431. ],
  432. content: [
  433. 'a',
  434. 'altGlyphDef',
  435. 'clipPath',
  436. 'color-profile',
  437. 'cursor',
  438. 'filter',
  439. 'font',
  440. 'font-face',
  441. 'foreignObject',
  442. 'image',
  443. 'marker',
  444. 'mask',
  445. 'pattern',
  446. 'script',
  447. 'style',
  448. 'switch',
  449. 'text',
  450. 'view'
  451. ]
  452. },
  453. desc: {
  454. attrsGroups: [
  455. 'core'
  456. ],
  457. attrs: [
  458. 'class',
  459. 'style'
  460. ]
  461. },
  462. ellipse: {
  463. attrsGroups: [
  464. 'conditionalProcessing',
  465. 'core',
  466. 'graphicalEvent',
  467. 'presentation'
  468. ],
  469. attrs: [
  470. 'class',
  471. 'style',
  472. 'externalResourcesRequired',
  473. 'transform',
  474. 'cx',
  475. 'cy',
  476. 'rx',
  477. 'ry'
  478. ],
  479. defaults: {
  480. cx: '0',
  481. cy: '0'
  482. },
  483. contentGroups: [
  484. 'animation',
  485. 'descriptive'
  486. ]
  487. },
  488. feBlend: {
  489. attrsGroups: [
  490. 'core',
  491. 'presentation',
  492. 'filterPrimitive'
  493. ],
  494. attrs: [
  495. 'class',
  496. 'style',
  497. // TODO: in - 'If no value is provided and this is the first filter primitive,
  498. // then this filter primitive will use SourceGraphic as its input'
  499. 'in',
  500. 'in2',
  501. 'mode'
  502. ],
  503. defaults: {
  504. mode: 'normal'
  505. },
  506. content: [
  507. 'animate',
  508. 'set'
  509. ]
  510. },
  511. feColorMatrix: {
  512. attrsGroups: [
  513. 'core',
  514. 'presentation',
  515. 'filterPrimitive'
  516. ],
  517. attrs: [
  518. 'class',
  519. 'style',
  520. 'in',
  521. 'type',
  522. 'values'
  523. ],
  524. defaults: {
  525. type: 'matrix'
  526. },
  527. content: [
  528. 'animate',
  529. 'set'
  530. ]
  531. },
  532. feComponentTransfer: {
  533. attrsGroups: [
  534. 'core',
  535. 'presentation',
  536. 'filterPrimitive'
  537. ],
  538. attrs: [
  539. 'class',
  540. 'style',
  541. 'in'
  542. ],
  543. content: [
  544. 'feFuncA',
  545. 'feFuncB',
  546. 'feFuncG',
  547. 'feFuncR'
  548. ]
  549. },
  550. feComposite: {
  551. attrsGroups: [
  552. 'core',
  553. 'presentation',
  554. 'filterPrimitive'
  555. ],
  556. attrs: [
  557. 'class',
  558. 'style',
  559. 'in',
  560. 'in2',
  561. 'operator',
  562. 'k1',
  563. 'k2',
  564. 'k3',
  565. 'k4'
  566. ],
  567. defaults: {
  568. operator: 'over',
  569. k1: '0',
  570. k2: '0',
  571. k3: '0',
  572. k4: '0'
  573. },
  574. content: [
  575. 'animate',
  576. 'set'
  577. ]
  578. },
  579. feConvolveMatrix: {
  580. attrsGroups: [
  581. 'core',
  582. 'presentation',
  583. 'filterPrimitive'
  584. ],
  585. attrs: [
  586. 'class',
  587. 'style',
  588. 'in',
  589. 'order',
  590. 'kernelMatrix',
  591. // TODO: divisor - 'The default value is the sum of all values in kernelMatrix,
  592. // with the exception that if the sum is zero, then the divisor is set to 1'
  593. 'divisor',
  594. 'bias',
  595. // TODO: targetX - 'By default, the convolution matrix is centered in X over each
  596. // pixel of the input image (i.e., targetX = floor ( orderX / 2 ))'
  597. 'targetX',
  598. 'targetY',
  599. 'edgeMode',
  600. // TODO: kernelUnitLength - 'The first number is the <dx> value. The second number
  601. // is the <dy> value. If the <dy> value is not specified, it defaults to the same value as <dx>'
  602. 'kernelUnitLength',
  603. 'preserveAlpha'
  604. ],
  605. defaults: {
  606. order: '3',
  607. bias: '0',
  608. edgeMode: 'duplicate',
  609. preserveAlpha: 'false'
  610. },
  611. content: [
  612. 'animate',
  613. 'set'
  614. ]
  615. },
  616. feDiffuseLighting: {
  617. attrsGroups: [
  618. 'core',
  619. 'presentation',
  620. 'filterPrimitive'
  621. ],
  622. attrs: [
  623. 'class',
  624. 'style',
  625. 'in',
  626. 'surfaceScale',
  627. 'diffuseConstant',
  628. 'kernelUnitLength'
  629. ],
  630. defaults: {
  631. surfaceScale: '1',
  632. diffuseConstant: '1'
  633. },
  634. contentGroups: [
  635. 'descriptive'
  636. ],
  637. content: [
  638. // TODO: 'exactly one light source element, in any order'
  639. 'feDistantLight',
  640. 'fePointLight',
  641. 'feSpotLight'
  642. ]
  643. },
  644. feDisplacementMap: {
  645. attrsGroups: [
  646. 'core',
  647. 'presentation',
  648. 'filterPrimitive'
  649. ],
  650. attrs: [
  651. 'class',
  652. 'style',
  653. 'in',
  654. 'in2',
  655. 'scale',
  656. 'xChannelSelector',
  657. 'yChannelSelector'
  658. ],
  659. defaults: {
  660. scale: '0',
  661. xChannelSelector: 'A',
  662. yChannelSelector: 'A'
  663. },
  664. content: [
  665. 'animate',
  666. 'set'
  667. ]
  668. },
  669. feDistantLight: {
  670. attrsGroups: [
  671. 'core'
  672. ],
  673. attrs: [
  674. 'azimuth',
  675. 'elevation'
  676. ],
  677. defaults: {
  678. azimuth: '0',
  679. elevation: '0'
  680. },
  681. content: [
  682. 'animate',
  683. 'set'
  684. ]
  685. },
  686. feFlood: {
  687. attrsGroups: [
  688. 'core',
  689. 'presentation',
  690. 'filterPrimitive'
  691. ],
  692. attrs: [
  693. 'class',
  694. 'style'
  695. ],
  696. content: [
  697. 'animate',
  698. 'animateColor',
  699. 'set'
  700. ]
  701. },
  702. feFuncA: {
  703. attrsGroups: [
  704. 'core',
  705. 'transferFunction'
  706. ],
  707. content: [
  708. 'set',
  709. 'animate'
  710. ]
  711. },
  712. feFuncB: {
  713. attrsGroups: [
  714. 'core',
  715. 'transferFunction'
  716. ],
  717. content: [
  718. 'set',
  719. 'animate'
  720. ]
  721. },
  722. feFuncG: {
  723. attrsGroups: [
  724. 'core',
  725. 'transferFunction'
  726. ],
  727. content: [
  728. 'set',
  729. 'animate'
  730. ]
  731. },
  732. feFuncR: {
  733. attrsGroups: [
  734. 'core',
  735. 'transferFunction'
  736. ],
  737. content: [
  738. 'set',
  739. 'animate'
  740. ]
  741. },
  742. feGaussianBlur: {
  743. attrsGroups: [
  744. 'core',
  745. 'presentation',
  746. 'filterPrimitive'
  747. ],
  748. attrs: [
  749. 'class',
  750. 'style',
  751. 'in',
  752. 'stdDeviation'
  753. ],
  754. defaults: {
  755. stdDeviation: '0'
  756. },
  757. content: [
  758. 'set',
  759. 'animate'
  760. ]
  761. },
  762. feImage: {
  763. attrsGroups: [
  764. 'core',
  765. 'presentation',
  766. 'filterPrimitive',
  767. 'xlink'
  768. ],
  769. attrs: [
  770. 'class',
  771. 'style',
  772. 'externalResourcesRequired',
  773. 'preserveAspectRatio',
  774. 'href',
  775. 'xlink:href'
  776. ],
  777. defaults: {
  778. preserveAspectRatio: 'xMidYMid meet'
  779. },
  780. content: [
  781. 'animate',
  782. 'animateTransform',
  783. 'set'
  784. ]
  785. },
  786. feMerge: {
  787. attrsGroups: [
  788. 'core',
  789. 'presentation',
  790. 'filterPrimitive'
  791. ],
  792. attrs: [
  793. 'class',
  794. 'style'
  795. ],
  796. content: [
  797. 'feMergeNode'
  798. ]
  799. },
  800. feMergeNode: {
  801. attrsGroups: [
  802. 'core'
  803. ],
  804. attrs: [
  805. 'in'
  806. ],
  807. content: [
  808. 'animate',
  809. 'set'
  810. ]
  811. },
  812. feMorphology: {
  813. attrsGroups: [
  814. 'core',
  815. 'presentation',
  816. 'filterPrimitive'
  817. ],
  818. attrs: [
  819. 'class',
  820. 'style',
  821. 'in',
  822. 'operator',
  823. 'radius'
  824. ],
  825. defaults: {
  826. operator: 'erode',
  827. radius: '0'
  828. },
  829. content: [
  830. 'animate',
  831. 'set'
  832. ]
  833. },
  834. feOffset: {
  835. attrsGroups: [
  836. 'core',
  837. 'presentation',
  838. 'filterPrimitive'
  839. ],
  840. attrs: [
  841. 'class',
  842. 'style',
  843. 'in',
  844. 'dx',
  845. 'dy'
  846. ],
  847. defaults: {
  848. dx: '0',
  849. dy: '0'
  850. },
  851. content: [
  852. 'animate',
  853. 'set'
  854. ]
  855. },
  856. fePointLight: {
  857. attrsGroups: [
  858. 'core'
  859. ],
  860. attrs: [
  861. 'x',
  862. 'y',
  863. 'z'
  864. ],
  865. defaults: {
  866. x: '0',
  867. y: '0',
  868. z: '0'
  869. },
  870. content: [
  871. 'animate',
  872. 'set'
  873. ]
  874. },
  875. feSpecularLighting: {
  876. attrsGroups: [
  877. 'core',
  878. 'presentation',
  879. 'filterPrimitive'
  880. ],
  881. attrs: [
  882. 'class',
  883. 'style',
  884. 'in',
  885. 'surfaceScale',
  886. 'specularConstant',
  887. 'specularExponent',
  888. 'kernelUnitLength'
  889. ],
  890. defaults: {
  891. surfaceScale: '1',
  892. specularConstant: '1',
  893. specularExponent: '1'
  894. },
  895. contentGroups: [
  896. 'descriptive',
  897. // TODO: exactly one 'light source element'
  898. 'lightSource'
  899. ]
  900. },
  901. feSpotLight: {
  902. attrsGroups: [
  903. 'core'
  904. ],
  905. attrs: [
  906. 'x',
  907. 'y',
  908. 'z',
  909. 'pointsAtX',
  910. 'pointsAtY',
  911. 'pointsAtZ',
  912. 'specularExponent',
  913. 'limitingConeAngle'
  914. ],
  915. defaults: {
  916. x: '0',
  917. y: '0',
  918. z: '0',
  919. pointsAtX: '0',
  920. pointsAtY: '0',
  921. pointsAtZ: '0',
  922. specularExponent: '1'
  923. },
  924. content: [
  925. 'animate',
  926. 'set'
  927. ]
  928. },
  929. feTile: {
  930. attrsGroups: [
  931. 'core',
  932. 'presentation',
  933. 'filterPrimitive'
  934. ],
  935. attrs: [
  936. 'class',
  937. 'style',
  938. 'in'
  939. ],
  940. content: [
  941. 'animate',
  942. 'set'
  943. ]
  944. },
  945. feTurbulence: {
  946. attrsGroups: [
  947. 'core',
  948. 'presentation',
  949. 'filterPrimitive'
  950. ],
  951. attrs: [
  952. 'class',
  953. 'style',
  954. 'baseFrequency',
  955. 'numOctaves',
  956. 'seed',
  957. 'stitchTiles',
  958. 'type'
  959. ],
  960. defaults: {
  961. baseFrequency: '0',
  962. numOctaves: '1',
  963. seed: '0',
  964. stitchTiles: 'noStitch',
  965. type: 'turbulence'
  966. },
  967. content: [
  968. 'animate',
  969. 'set'
  970. ]
  971. },
  972. filter: {
  973. attrsGroups: [
  974. 'core',
  975. 'presentation',
  976. 'xlink'
  977. ],
  978. attrs: [
  979. 'class',
  980. 'style',
  981. 'externalResourcesRequired',
  982. 'x',
  983. 'y',
  984. 'width',
  985. 'height',
  986. 'filterRes',
  987. 'filterUnits',
  988. 'primitiveUnits',
  989. 'href',
  990. 'xlink:href'
  991. ],
  992. defaults: {
  993. primitiveUnits: 'userSpaceOnUse',
  994. x: '-10%',
  995. y: '-10%',
  996. width: '120%',
  997. height: '120%'
  998. },
  999. contentGroups: [
  1000. 'descriptive',
  1001. 'filterPrimitive'
  1002. ],
  1003. content: [
  1004. 'animate',
  1005. 'set'
  1006. ]
  1007. },
  1008. font: {
  1009. attrsGroups: [
  1010. 'core',
  1011. 'presentation'
  1012. ],
  1013. attrs: [
  1014. 'class',
  1015. 'style',
  1016. 'externalResourcesRequired',
  1017. 'horiz-origin-x',
  1018. 'horiz-origin-y',
  1019. 'horiz-adv-x',
  1020. 'vert-origin-x',
  1021. 'vert-origin-y',
  1022. 'vert-adv-y'
  1023. ],
  1024. defaults: {
  1025. 'horiz-origin-x': '0',
  1026. 'horiz-origin-y': '0'
  1027. },
  1028. contentGroups: [
  1029. 'descriptive'
  1030. ],
  1031. content: [
  1032. 'font-face',
  1033. 'glyph',
  1034. 'hkern',
  1035. 'missing-glyph',
  1036. 'vkern'
  1037. ]
  1038. },
  1039. 'font-face': {
  1040. attrsGroups: [
  1041. 'core'
  1042. ],
  1043. attrs: [
  1044. 'font-family',
  1045. 'font-style',
  1046. 'font-variant',
  1047. 'font-weight',
  1048. 'font-stretch',
  1049. 'font-size',
  1050. 'unicode-range',
  1051. 'units-per-em',
  1052. 'panose-1',
  1053. 'stemv',
  1054. 'stemh',
  1055. 'slope',
  1056. 'cap-height',
  1057. 'x-height',
  1058. 'accent-height',
  1059. 'ascent',
  1060. 'descent',
  1061. 'widths',
  1062. 'bbox',
  1063. 'ideographic',
  1064. 'alphabetic',
  1065. 'mathematical',
  1066. 'hanging',
  1067. 'v-ideographic',
  1068. 'v-alphabetic',
  1069. 'v-mathematical',
  1070. 'v-hanging',
  1071. 'underline-position',
  1072. 'underline-thickness',
  1073. 'strikethrough-position',
  1074. 'strikethrough-thickness',
  1075. 'overline-position',
  1076. 'overline-thickness'
  1077. ],
  1078. defaults: {
  1079. 'font-style': 'all',
  1080. 'font-variant': 'normal',
  1081. 'font-weight': 'all',
  1082. 'font-stretch': 'normal',
  1083. 'unicode-range': 'U+0-10FFFF',
  1084. 'units-per-em': '1000',
  1085. 'panose-1': '0 0 0 0 0 0 0 0 0 0',
  1086. 'slope': '0'
  1087. },
  1088. contentGroups: [
  1089. 'descriptive'
  1090. ],
  1091. content: [
  1092. // TODO: "at most one 'font-face-src' element"
  1093. 'font-face-src'
  1094. ]
  1095. },
  1096. // TODO: empty content
  1097. 'font-face-format': {
  1098. attrsGroups: [
  1099. 'core'
  1100. ],
  1101. attrs: [
  1102. 'string'
  1103. ]
  1104. },
  1105. 'font-face-name': {
  1106. attrsGroups: [
  1107. 'core'
  1108. ],
  1109. attrs: [
  1110. 'name'
  1111. ]
  1112. },
  1113. 'font-face-src': {
  1114. attrsGroups: [
  1115. 'core'
  1116. ],
  1117. content: [
  1118. 'font-face-name',
  1119. 'font-face-uri'
  1120. ]
  1121. },
  1122. 'font-face-uri': {
  1123. attrsGroups: [
  1124. 'core',
  1125. 'xlink'
  1126. ],
  1127. attrs: [
  1128. 'href',
  1129. 'xlink:href'
  1130. ],
  1131. content: [
  1132. 'font-face-format'
  1133. ]
  1134. },
  1135. foreignObject: {
  1136. attrsGroups: [
  1137. 'core',
  1138. 'conditionalProcessing',
  1139. 'graphicalEvent',
  1140. 'presentation'
  1141. ],
  1142. attrs: [
  1143. 'class',
  1144. 'style',
  1145. 'externalResourcesRequired',
  1146. 'transform',
  1147. 'x',
  1148. 'y',
  1149. 'width',
  1150. 'height'
  1151. ],
  1152. defaults: {
  1153. x: 0,
  1154. y: 0
  1155. }
  1156. },
  1157. g: {
  1158. attrsGroups: [
  1159. 'conditionalProcessing',
  1160. 'core',
  1161. 'graphicalEvent',
  1162. 'presentation'
  1163. ],
  1164. attrs: [
  1165. 'class',
  1166. 'style',
  1167. 'externalResourcesRequired',
  1168. 'transform'
  1169. ],
  1170. contentGroups: [
  1171. 'animation',
  1172. 'descriptive',
  1173. 'shape',
  1174. 'structural',
  1175. 'paintServer'
  1176. ],
  1177. content: [
  1178. 'a',
  1179. 'altGlyphDef',
  1180. 'clipPath',
  1181. 'color-profile',
  1182. 'cursor',
  1183. 'filter',
  1184. 'font',
  1185. 'font-face',
  1186. 'foreignObject',
  1187. 'image',
  1188. 'marker',
  1189. 'mask',
  1190. 'pattern',
  1191. 'script',
  1192. 'style',
  1193. 'switch',
  1194. 'text',
  1195. 'view'
  1196. ]
  1197. },
  1198. glyph: {
  1199. attrsGroups: [
  1200. 'core',
  1201. 'presentation'
  1202. ],
  1203. attrs: [
  1204. 'class',
  1205. 'style',
  1206. 'd',
  1207. 'horiz-adv-x',
  1208. 'vert-origin-x',
  1209. 'vert-origin-y',
  1210. 'vert-adv-y',
  1211. 'unicode',
  1212. 'glyph-name',
  1213. 'orientation',
  1214. 'arabic-form',
  1215. 'lang'
  1216. ],
  1217. defaults: {
  1218. 'arabic-form': 'initial'
  1219. },
  1220. contentGroups: [
  1221. 'animation',
  1222. 'descriptive',
  1223. 'shape',
  1224. 'structural',
  1225. 'paintServer'
  1226. ],
  1227. content: [
  1228. 'a',
  1229. 'altGlyphDef',
  1230. 'clipPath',
  1231. 'color-profile',
  1232. 'cursor',
  1233. 'filter',
  1234. 'font',
  1235. 'font-face',
  1236. 'foreignObject',
  1237. 'image',
  1238. 'marker',
  1239. 'mask',
  1240. 'pattern',
  1241. 'script',
  1242. 'style',
  1243. 'switch',
  1244. 'text',
  1245. 'view'
  1246. ],
  1247. },
  1248. glyphRef: {
  1249. attrsGroups: [
  1250. 'core',
  1251. 'presentation'
  1252. ],
  1253. attrs: [
  1254. 'class',
  1255. 'style',
  1256. 'd',
  1257. 'horiz-adv-x',
  1258. 'vert-origin-x',
  1259. 'vert-origin-y',
  1260. 'vert-adv-y'
  1261. ],
  1262. contentGroups: [
  1263. 'animation',
  1264. 'descriptive',
  1265. 'shape',
  1266. 'structural',
  1267. 'paintServer'
  1268. ],
  1269. content: [
  1270. 'a',
  1271. 'altGlyphDef',
  1272. 'clipPath',
  1273. 'color-profile',
  1274. 'cursor',
  1275. 'filter',
  1276. 'font',
  1277. 'font-face',
  1278. 'foreignObject',
  1279. 'image',
  1280. 'marker',
  1281. 'mask',
  1282. 'pattern',
  1283. 'script',
  1284. 'style',
  1285. 'switch',
  1286. 'text',
  1287. 'view'
  1288. ]
  1289. },
  1290. hatch: {
  1291. attrsGroups: [
  1292. 'core',
  1293. 'presentation',
  1294. 'xlink'
  1295. ],
  1296. attrs: [
  1297. 'class',
  1298. 'style',
  1299. 'x',
  1300. 'y',
  1301. 'pitch',
  1302. 'rotate',
  1303. 'hatchUnits',
  1304. 'hatchContentUnits',
  1305. 'transform'
  1306. ],
  1307. defaults: {
  1308. hatchUnits: 'objectBoundingBox',
  1309. hatchContentUnits: 'userSpaceOnUse',
  1310. x: '0',
  1311. y: '0',
  1312. pitch: '0',
  1313. rotate: '0'
  1314. },
  1315. contentGroups: [
  1316. 'animation',
  1317. 'descriptive'
  1318. ],
  1319. content: [
  1320. 'hatchPath'
  1321. ]
  1322. },
  1323. hatchPath: {
  1324. attrsGroups: [
  1325. 'core',
  1326. 'presentation',
  1327. 'xlink'
  1328. ],
  1329. attrs: [
  1330. 'class',
  1331. 'style',
  1332. 'd',
  1333. 'offset'
  1334. ],
  1335. defaults: {
  1336. offset: '0'
  1337. },
  1338. contentGroups: [
  1339. 'animation',
  1340. 'descriptive'
  1341. ]
  1342. },
  1343. hkern: {
  1344. attrsGroups: [
  1345. 'core'
  1346. ],
  1347. attrs: [
  1348. 'u1',
  1349. 'g1',
  1350. 'u2',
  1351. 'g2',
  1352. 'k'
  1353. ]
  1354. },
  1355. image: {
  1356. attrsGroups: [
  1357. 'core',
  1358. 'conditionalProcessing',
  1359. 'graphicalEvent',
  1360. 'xlink',
  1361. 'presentation'
  1362. ],
  1363. attrs: [
  1364. 'class',
  1365. 'style',
  1366. 'externalResourcesRequired',
  1367. 'preserveAspectRatio',
  1368. 'transform',
  1369. 'x',
  1370. 'y',
  1371. 'width',
  1372. 'height',
  1373. 'href',
  1374. 'xlink:href'
  1375. ],
  1376. defaults: {
  1377. x: '0',
  1378. y: '0',
  1379. preserveAspectRatio: 'xMidYMid meet'
  1380. },
  1381. contentGroups: [
  1382. 'animation',
  1383. 'descriptive'
  1384. ]
  1385. },
  1386. line: {
  1387. attrsGroups: [
  1388. 'conditionalProcessing',
  1389. 'core',
  1390. 'graphicalEvent',
  1391. 'presentation'
  1392. ],
  1393. attrs: [
  1394. 'class',
  1395. 'style',
  1396. 'externalResourcesRequired',
  1397. 'transform',
  1398. 'x1',
  1399. 'y1',
  1400. 'x2',
  1401. 'y2'
  1402. ],
  1403. defaults: {
  1404. x1: '0',
  1405. y1: '0',
  1406. x2: '0',
  1407. y2: '0'
  1408. },
  1409. contentGroups: [
  1410. 'animation',
  1411. 'descriptive'
  1412. ]
  1413. },
  1414. linearGradient: {
  1415. attrsGroups: [
  1416. 'core',
  1417. 'presentation',
  1418. 'xlink'
  1419. ],
  1420. attrs: [
  1421. 'class',
  1422. 'style',
  1423. 'externalResourcesRequired',
  1424. 'x1',
  1425. 'y1',
  1426. 'x2',
  1427. 'y2',
  1428. 'gradientUnits',
  1429. 'gradientTransform',
  1430. 'spreadMethod',
  1431. 'href',
  1432. 'xlink:href'
  1433. ],
  1434. defaults: {
  1435. x1: '0',
  1436. y1: '0',
  1437. x2: '100%',
  1438. y2: '0',
  1439. spreadMethod: 'pad'
  1440. },
  1441. contentGroups: [
  1442. 'descriptive'
  1443. ],
  1444. content: [
  1445. 'animate',
  1446. 'animateTransform',
  1447. 'set',
  1448. 'stop'
  1449. ]
  1450. },
  1451. marker: {
  1452. attrsGroups: [
  1453. 'core',
  1454. 'presentation'
  1455. ],
  1456. attrs: [
  1457. 'class',
  1458. 'style',
  1459. 'externalResourcesRequired',
  1460. 'viewBox',
  1461. 'preserveAspectRatio',
  1462. 'refX',
  1463. 'refY',
  1464. 'markerUnits',
  1465. 'markerWidth',
  1466. 'markerHeight',
  1467. 'orient'
  1468. ],
  1469. defaults: {
  1470. markerUnits: 'strokeWidth',
  1471. refX: '0',
  1472. refY: '0',
  1473. markerWidth: '3',
  1474. markerHeight: '3'
  1475. },
  1476. contentGroups: [
  1477. 'animation',
  1478. 'descriptive',
  1479. 'shape',
  1480. 'structural',
  1481. 'paintServer'
  1482. ],
  1483. content: [
  1484. 'a',
  1485. 'altGlyphDef',
  1486. 'clipPath',
  1487. 'color-profile',
  1488. 'cursor',
  1489. 'filter',
  1490. 'font',
  1491. 'font-face',
  1492. 'foreignObject',
  1493. 'image',
  1494. 'marker',
  1495. 'mask',
  1496. 'pattern',
  1497. 'script',
  1498. 'style',
  1499. 'switch',
  1500. 'text',
  1501. 'view'
  1502. ]
  1503. },
  1504. mask: {
  1505. attrsGroups: [
  1506. 'conditionalProcessing',
  1507. 'core',
  1508. 'presentation'
  1509. ],
  1510. attrs: [
  1511. 'class',
  1512. 'style',
  1513. 'externalResourcesRequired',
  1514. 'x',
  1515. 'y',
  1516. 'width',
  1517. 'height',
  1518. 'maskUnits',
  1519. 'maskContentUnits'
  1520. ],
  1521. defaults: {
  1522. maskUnits: 'objectBoundingBox',
  1523. maskContentUnits: 'userSpaceOnUse',
  1524. x: '-10%',
  1525. y: '-10%',
  1526. width: '120%',
  1527. height: '120%'
  1528. },
  1529. contentGroups: [
  1530. 'animation',
  1531. 'descriptive',
  1532. 'shape',
  1533. 'structural',
  1534. 'paintServer'
  1535. ],
  1536. content: [
  1537. 'a',
  1538. 'altGlyphDef',
  1539. 'clipPath',
  1540. 'color-profile',
  1541. 'cursor',
  1542. 'filter',
  1543. 'font',
  1544. 'font-face',
  1545. 'foreignObject',
  1546. 'image',
  1547. 'marker',
  1548. 'mask',
  1549. 'pattern',
  1550. 'script',
  1551. 'style',
  1552. 'switch',
  1553. 'text',
  1554. 'view'
  1555. ]
  1556. },
  1557. metadata: {
  1558. attrsGroups: [
  1559. 'core'
  1560. ]
  1561. },
  1562. 'missing-glyph': {
  1563. attrsGroups: [
  1564. 'core',
  1565. 'presentation'
  1566. ],
  1567. attrs: [
  1568. 'class',
  1569. 'style',
  1570. 'd',
  1571. 'horiz-adv-x',
  1572. 'vert-origin-x',
  1573. 'vert-origin-y',
  1574. 'vert-adv-y'
  1575. ],
  1576. contentGroups: [
  1577. 'animation',
  1578. 'descriptive',
  1579. 'shape',
  1580. 'structural',
  1581. 'paintServer'
  1582. ],
  1583. content: [
  1584. 'a',
  1585. 'altGlyphDef',
  1586. 'clipPath',
  1587. 'color-profile',
  1588. 'cursor',
  1589. 'filter',
  1590. 'font',
  1591. 'font-face',
  1592. 'foreignObject',
  1593. 'image',
  1594. 'marker',
  1595. 'mask',
  1596. 'pattern',
  1597. 'script',
  1598. 'style',
  1599. 'switch',
  1600. 'text',
  1601. 'view'
  1602. ]
  1603. },
  1604. mpath: {
  1605. attrsGroups: [
  1606. 'core',
  1607. 'xlink'
  1608. ],
  1609. attrs: [
  1610. 'externalResourcesRequired',
  1611. 'href',
  1612. 'xlink:href'
  1613. ],
  1614. contentGroups: [
  1615. 'descriptive'
  1616. ]
  1617. },
  1618. path: {
  1619. attrsGroups: [
  1620. 'conditionalProcessing',
  1621. 'core',
  1622. 'graphicalEvent',
  1623. 'presentation'
  1624. ],
  1625. attrs: [
  1626. 'class',
  1627. 'style',
  1628. 'externalResourcesRequired',
  1629. 'transform',
  1630. 'd',
  1631. 'pathLength'
  1632. ],
  1633. contentGroups: [
  1634. 'animation',
  1635. 'descriptive'
  1636. ]
  1637. },
  1638. pattern: {
  1639. attrsGroups: [
  1640. 'conditionalProcessing',
  1641. 'core',
  1642. 'presentation',
  1643. 'xlink'
  1644. ],
  1645. attrs: [
  1646. 'class',
  1647. 'style',
  1648. 'externalResourcesRequired',
  1649. 'viewBox',
  1650. 'preserveAspectRatio',
  1651. 'x',
  1652. 'y',
  1653. 'width',
  1654. 'height',
  1655. 'patternUnits',
  1656. 'patternContentUnits',
  1657. 'patternTransform',
  1658. 'href',
  1659. 'xlink:href'
  1660. ],
  1661. defaults: {
  1662. patternUnits: 'objectBoundingBox',
  1663. patternContentUnits: 'userSpaceOnUse',
  1664. x: '0',
  1665. y: '0',
  1666. width: '0',
  1667. height: '0',
  1668. preserveAspectRatio: 'xMidYMid meet'
  1669. },
  1670. contentGroups: [
  1671. 'animation',
  1672. 'descriptive',
  1673. 'paintServer',
  1674. 'shape',
  1675. 'structural'
  1676. ],
  1677. content: [
  1678. 'a',
  1679. 'altGlyphDef',
  1680. 'clipPath',
  1681. 'color-profile',
  1682. 'cursor',
  1683. 'filter',
  1684. 'font',
  1685. 'font-face',
  1686. 'foreignObject',
  1687. 'image',
  1688. 'marker',
  1689. 'mask',
  1690. 'pattern',
  1691. 'script',
  1692. 'style',
  1693. 'switch',
  1694. 'text',
  1695. 'view'
  1696. ]
  1697. },
  1698. polygon: {
  1699. attrsGroups: [
  1700. 'conditionalProcessing',
  1701. 'core',
  1702. 'graphicalEvent',
  1703. 'presentation'
  1704. ],
  1705. attrs: [
  1706. 'class',
  1707. 'style',
  1708. 'externalResourcesRequired',
  1709. 'transform',
  1710. 'points'
  1711. ],
  1712. contentGroups: [
  1713. 'animation',
  1714. 'descriptive'
  1715. ]
  1716. },
  1717. polyline: {
  1718. attrsGroups: [
  1719. 'conditionalProcessing',
  1720. 'core',
  1721. 'graphicalEvent',
  1722. 'presentation'
  1723. ],
  1724. attrs: [
  1725. 'class',
  1726. 'style',
  1727. 'externalResourcesRequired',
  1728. 'transform',
  1729. 'points'
  1730. ],
  1731. contentGroups: [
  1732. 'animation',
  1733. 'descriptive'
  1734. ]
  1735. },
  1736. radialGradient: {
  1737. attrsGroups: [
  1738. 'core',
  1739. 'presentation',
  1740. 'xlink'
  1741. ],
  1742. attrs: [
  1743. 'class',
  1744. 'style',
  1745. 'externalResourcesRequired',
  1746. 'cx',
  1747. 'cy',
  1748. 'r',
  1749. 'fx',
  1750. 'fy',
  1751. 'fr',
  1752. 'gradientUnits',
  1753. 'gradientTransform',
  1754. 'spreadMethod',
  1755. 'href',
  1756. 'xlink:href'
  1757. ],
  1758. defaults: {
  1759. gradientUnits: 'objectBoundingBox',
  1760. cx: '50%',
  1761. cy: '50%',
  1762. r: '50%'
  1763. },
  1764. contentGroups: [
  1765. 'descriptive'
  1766. ],
  1767. content: [
  1768. 'animate',
  1769. 'animateTransform',
  1770. 'set',
  1771. 'stop'
  1772. ]
  1773. },
  1774. meshGradient: {
  1775. attrsGroups: [
  1776. 'core',
  1777. 'presentation',
  1778. 'xlink'
  1779. ],
  1780. attrs: [
  1781. 'class',
  1782. 'style',
  1783. 'x',
  1784. 'y',
  1785. 'gradientUnits',
  1786. 'transform'
  1787. ],
  1788. contentGroups: [
  1789. 'descriptive',
  1790. 'paintServer',
  1791. 'animation',
  1792. ],
  1793. content: [
  1794. 'meshRow'
  1795. ]
  1796. },
  1797. meshRow: {
  1798. attrsGroups: [
  1799. 'core',
  1800. 'presentation'
  1801. ],
  1802. attrs: [
  1803. 'class',
  1804. 'style'
  1805. ],
  1806. contentGroups: [
  1807. 'descriptive'
  1808. ],
  1809. content: [
  1810. 'meshPatch'
  1811. ]
  1812. },
  1813. meshPatch: {
  1814. attrsGroups: [
  1815. 'core',
  1816. 'presentation'
  1817. ],
  1818. attrs: [
  1819. 'class',
  1820. 'style'
  1821. ],
  1822. contentGroups: [
  1823. 'descriptive'
  1824. ],
  1825. content: [
  1826. 'stop'
  1827. ]
  1828. },
  1829. rect: {
  1830. attrsGroups: [
  1831. 'conditionalProcessing',
  1832. 'core',
  1833. 'graphicalEvent',
  1834. 'presentation'
  1835. ],
  1836. attrs: [
  1837. 'class',
  1838. 'style',
  1839. 'externalResourcesRequired',
  1840. 'transform',
  1841. 'x',
  1842. 'y',
  1843. 'width',
  1844. 'height',
  1845. 'rx',
  1846. 'ry'
  1847. ],
  1848. defaults: {
  1849. x: '0',
  1850. y: '0'
  1851. },
  1852. contentGroups: [
  1853. 'animation',
  1854. 'descriptive'
  1855. ]
  1856. },
  1857. script: {
  1858. attrsGroups: [
  1859. 'core',
  1860. 'xlink'
  1861. ],
  1862. attrs: [
  1863. 'externalResourcesRequired',
  1864. 'type',
  1865. 'href',
  1866. 'xlink:href'
  1867. ]
  1868. },
  1869. set: {
  1870. attrsGroups: [
  1871. 'conditionalProcessing',
  1872. 'core',
  1873. 'animation',
  1874. 'xlink',
  1875. 'animationAttributeTarget',
  1876. 'animationTiming',
  1877. ],
  1878. attrs: [
  1879. 'externalResourcesRequired',
  1880. 'to'
  1881. ],
  1882. contentGroups: [
  1883. 'descriptive'
  1884. ]
  1885. },
  1886. solidColor: {
  1887. attrsGroups: [
  1888. 'core',
  1889. 'presentation'
  1890. ],
  1891. attrs: [
  1892. 'class',
  1893. 'style'
  1894. ],
  1895. contentGroups: [
  1896. 'paintServer'
  1897. ]
  1898. },
  1899. stop: {
  1900. attrsGroups: [
  1901. 'core',
  1902. 'presentation'
  1903. ],
  1904. attrs: [
  1905. 'class',
  1906. 'style',
  1907. 'offset',
  1908. 'path'
  1909. ],
  1910. content: [
  1911. 'animate',
  1912. 'animateColor',
  1913. 'set'
  1914. ]
  1915. },
  1916. style: {
  1917. attrsGroups: [
  1918. 'core'
  1919. ],
  1920. attrs: [
  1921. 'type',
  1922. 'media',
  1923. 'title'
  1924. ],
  1925. defaults: {
  1926. type: 'text/css'
  1927. }
  1928. },
  1929. svg: {
  1930. attrsGroups: [
  1931. 'conditionalProcessing',
  1932. 'core',
  1933. 'documentEvent',
  1934. 'graphicalEvent',
  1935. 'presentation'
  1936. ],
  1937. attrs: [
  1938. 'class',
  1939. 'style',
  1940. 'x',
  1941. 'y',
  1942. 'width',
  1943. 'height',
  1944. 'viewBox',
  1945. 'preserveAspectRatio',
  1946. 'zoomAndPan',
  1947. 'version',
  1948. 'baseProfile',
  1949. 'contentScriptType',
  1950. 'contentStyleType'
  1951. ],
  1952. defaults: {
  1953. x: '0',
  1954. y: '0',
  1955. width: '100%',
  1956. height: '100%',
  1957. preserveAspectRatio: 'xMidYMid meet',
  1958. zoomAndPan: 'magnify',
  1959. version: '1.1',
  1960. baseProfile: 'none',
  1961. contentScriptType: 'application/ecmascript',
  1962. contentStyleType: 'text/css'
  1963. },
  1964. contentGroups: [
  1965. 'animation',
  1966. 'descriptive',
  1967. 'shape',
  1968. 'structural',
  1969. 'paintServer'
  1970. ],
  1971. content: [
  1972. 'a',
  1973. 'altGlyphDef',
  1974. 'clipPath',
  1975. 'color-profile',
  1976. 'cursor',
  1977. 'filter',
  1978. 'font',
  1979. 'font-face',
  1980. 'foreignObject',
  1981. 'image',
  1982. 'marker',
  1983. 'mask',
  1984. 'pattern',
  1985. 'script',
  1986. 'style',
  1987. 'switch',
  1988. 'text',
  1989. 'view'
  1990. ]
  1991. },
  1992. switch: {
  1993. attrsGroups: [
  1994. 'conditionalProcessing',
  1995. 'core',
  1996. 'graphicalEvent',
  1997. 'presentation'
  1998. ],
  1999. attrs: [
  2000. 'class',
  2001. 'style',
  2002. 'externalResourcesRequired',
  2003. 'transform'
  2004. ],
  2005. contentGroups: [
  2006. 'animation',
  2007. 'descriptive',
  2008. 'shape'
  2009. ],
  2010. content: [
  2011. 'a',
  2012. 'foreignObject',
  2013. 'g',
  2014. 'image',
  2015. 'svg',
  2016. 'switch',
  2017. 'text',
  2018. 'use'
  2019. ]
  2020. },
  2021. symbol: {
  2022. attrsGroups: [
  2023. 'core',
  2024. 'graphicalEvent',
  2025. 'presentation'
  2026. ],
  2027. attrs: [
  2028. 'class',
  2029. 'style',
  2030. 'externalResourcesRequired',
  2031. 'preserveAspectRatio',
  2032. 'viewBox',
  2033. 'refX',
  2034. 'refY'
  2035. ],
  2036. defaults: {
  2037. refX: 0,
  2038. refY: 0
  2039. },
  2040. contentGroups: [
  2041. 'animation',
  2042. 'descriptive',
  2043. 'shape',
  2044. 'structural',
  2045. 'paintServer'
  2046. ],
  2047. content: [
  2048. 'a',
  2049. 'altGlyphDef',
  2050. 'clipPath',
  2051. 'color-profile',
  2052. 'cursor',
  2053. 'filter',
  2054. 'font',
  2055. 'font-face',
  2056. 'foreignObject',
  2057. 'image',
  2058. 'marker',
  2059. 'mask',
  2060. 'pattern',
  2061. 'script',
  2062. 'style',
  2063. 'switch',
  2064. 'text',
  2065. 'view'
  2066. ]
  2067. },
  2068. text: {
  2069. attrsGroups: [
  2070. 'conditionalProcessing',
  2071. 'core',
  2072. 'graphicalEvent',
  2073. 'presentation'
  2074. ],
  2075. attrs: [
  2076. 'class',
  2077. 'style',
  2078. 'externalResourcesRequired',
  2079. 'transform',
  2080. 'lengthAdjust',
  2081. 'x',
  2082. 'y',
  2083. 'dx',
  2084. 'dy',
  2085. 'rotate',
  2086. 'textLength'
  2087. ],
  2088. defaults: {
  2089. x: '0',
  2090. y: '0',
  2091. lengthAdjust: 'spacing'
  2092. },
  2093. contentGroups: [
  2094. 'animation',
  2095. 'descriptive',
  2096. 'textContentChild'
  2097. ],
  2098. content: [
  2099. 'a'
  2100. ]
  2101. },
  2102. textPath: {
  2103. attrsGroups: [
  2104. 'conditionalProcessing',
  2105. 'core',
  2106. 'graphicalEvent',
  2107. 'presentation',
  2108. 'xlink'
  2109. ],
  2110. attrs: [
  2111. 'class',
  2112. 'style',
  2113. 'externalResourcesRequired',
  2114. 'href',
  2115. 'xlink:href',
  2116. 'startOffset',
  2117. 'method',
  2118. 'spacing',
  2119. 'd'
  2120. ],
  2121. defaults: {
  2122. startOffset: '0',
  2123. method: 'align',
  2124. spacing: 'exact'
  2125. },
  2126. contentGroups: [
  2127. 'descriptive'
  2128. ],
  2129. content: [
  2130. 'a',
  2131. 'altGlyph',
  2132. 'animate',
  2133. 'animateColor',
  2134. 'set',
  2135. 'tref',
  2136. 'tspan'
  2137. ]
  2138. },
  2139. title: {
  2140. attrsGroups: [
  2141. 'core'
  2142. ],
  2143. attrs: [
  2144. 'class',
  2145. 'style'
  2146. ]
  2147. },
  2148. tref: {
  2149. attrsGroups: [
  2150. 'conditionalProcessing',
  2151. 'core',
  2152. 'graphicalEvent',
  2153. 'presentation',
  2154. 'xlink'
  2155. ],
  2156. attrs: [
  2157. 'class',
  2158. 'style',
  2159. 'externalResourcesRequired',
  2160. 'href',
  2161. 'xlink:href'
  2162. ],
  2163. contentGroups: [
  2164. 'descriptive'
  2165. ],
  2166. content: [
  2167. 'animate',
  2168. 'animateColor',
  2169. 'set'
  2170. ]
  2171. },
  2172. tspan: {
  2173. attrsGroups: [
  2174. 'conditionalProcessing',
  2175. 'core',
  2176. 'graphicalEvent',
  2177. 'presentation'
  2178. ],
  2179. attrs: [
  2180. 'class',
  2181. 'style',
  2182. 'externalResourcesRequired',
  2183. 'x',
  2184. 'y',
  2185. 'dx',
  2186. 'dy',
  2187. 'rotate',
  2188. 'textLength',
  2189. 'lengthAdjust'
  2190. ],
  2191. contentGroups: [
  2192. 'descriptive'
  2193. ],
  2194. content: [
  2195. 'a',
  2196. 'altGlyph',
  2197. 'animate',
  2198. 'animateColor',
  2199. 'set',
  2200. 'tref',
  2201. 'tspan'
  2202. ]
  2203. },
  2204. use: {
  2205. attrsGroups: [
  2206. 'core',
  2207. 'conditionalProcessing',
  2208. 'graphicalEvent',
  2209. 'presentation',
  2210. 'xlink'
  2211. ],
  2212. attrs: [
  2213. 'class',
  2214. 'style',
  2215. 'externalResourcesRequired',
  2216. 'transform',
  2217. 'x',
  2218. 'y',
  2219. 'width',
  2220. 'height',
  2221. 'href',
  2222. 'xlink:href'
  2223. ],
  2224. defaults: {
  2225. x: '0',
  2226. y: '0'
  2227. },
  2228. contentGroups: [
  2229. 'animation',
  2230. 'descriptive'
  2231. ]
  2232. },
  2233. view: {
  2234. attrsGroups: [
  2235. 'core'
  2236. ],
  2237. attrs: [
  2238. 'externalResourcesRequired',
  2239. 'viewBox',
  2240. 'preserveAspectRatio',
  2241. 'zoomAndPan',
  2242. 'viewTarget'
  2243. ],
  2244. contentGroups: [
  2245. 'descriptive'
  2246. ]
  2247. },
  2248. vkern: {
  2249. attrsGroups: [
  2250. 'core'
  2251. ],
  2252. attrs: [
  2253. 'u1',
  2254. 'g1',
  2255. 'u2',
  2256. 'g2',
  2257. 'k'
  2258. ]
  2259. }
  2260. };
  2261. // http://wiki.inkscape.org/wiki/index.php/Inkscape-specific_XML_attributes
  2262. exports.editorNamespaces = [
  2263. 'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd',
  2264. 'http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd',
  2265. 'http://www.inkscape.org/namespaces/inkscape',
  2266. 'http://www.bohemiancoding.com/sketch/ns',
  2267. 'http://ns.adobe.com/AdobeIllustrator/10.0/',
  2268. 'http://ns.adobe.com/Graphs/1.0/',
  2269. 'http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/',
  2270. 'http://ns.adobe.com/Variables/1.0/',
  2271. 'http://ns.adobe.com/SaveForWeb/1.0/',
  2272. 'http://ns.adobe.com/Extensibility/1.0/',
  2273. 'http://ns.adobe.com/Flows/1.0/',
  2274. 'http://ns.adobe.com/ImageReplacement/1.0/',
  2275. 'http://ns.adobe.com/GenericCustomNamespace/1.0/',
  2276. 'http://ns.adobe.com/XPath/1.0/',
  2277. 'http://schemas.microsoft.com/visio/2003/SVGExtensions/',
  2278. 'http://taptrix.com/vectorillustrator/svg_extensions',
  2279. 'http://www.figma.com/figma/ns',
  2280. 'http://purl.org/dc/elements/1.1/',
  2281. 'http://creativecommons.org/ns#',
  2282. 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
  2283. 'http://www.serif.com/',
  2284. 'http://www.vector.evaxdesign.sk'
  2285. ];
  2286. // http://www.w3.org/TR/SVG11/linking.html#processingIRI
  2287. exports.referencesProps = [
  2288. 'clip-path',
  2289. 'color-profile',
  2290. 'fill',
  2291. 'filter',
  2292. 'marker-start',
  2293. 'marker-mid',
  2294. 'marker-end',
  2295. 'mask',
  2296. 'stroke',
  2297. 'style'
  2298. ];
  2299. // http://www.w3.org/TR/SVG11/propidx.html
  2300. exports.inheritableAttrs = [
  2301. 'clip-rule',
  2302. 'color',
  2303. 'color-interpolation',
  2304. 'color-interpolation-filters',
  2305. 'color-profile',
  2306. 'color-rendering',
  2307. 'cursor',
  2308. 'direction',
  2309. 'dominant-baseline',
  2310. 'fill',
  2311. 'fill-opacity',
  2312. 'fill-rule',
  2313. 'font',
  2314. 'font-family',
  2315. 'font-size',
  2316. 'font-size-adjust',
  2317. 'font-stretch',
  2318. 'font-style',
  2319. 'font-variant',
  2320. 'font-weight',
  2321. 'glyph-orientation-horizontal',
  2322. 'glyph-orientation-vertical',
  2323. 'image-rendering',
  2324. 'letter-spacing',
  2325. 'marker',
  2326. 'marker-end',
  2327. 'marker-mid',
  2328. 'marker-start',
  2329. 'paint-order',
  2330. 'pointer-events',
  2331. 'shape-rendering',
  2332. 'stroke',
  2333. 'stroke-dasharray',
  2334. 'stroke-dashoffset',
  2335. 'stroke-linecap',
  2336. 'stroke-linejoin',
  2337. 'stroke-miterlimit',
  2338. 'stroke-opacity',
  2339. 'stroke-width',
  2340. 'text-anchor',
  2341. 'text-rendering',
  2342. 'transform',
  2343. 'visibility',
  2344. 'word-spacing',
  2345. 'writing-mode'
  2346. ];
  2347. exports.presentationNonInheritableGroupAttrs = [
  2348. 'display',
  2349. 'clip-path',
  2350. 'filter',
  2351. 'mask',
  2352. 'opacity',
  2353. 'text-decoration',
  2354. 'transform',
  2355. 'unicode-bidi',
  2356. 'visibility'
  2357. ];
  2358. // http://www.w3.org/TR/SVG11/single-page.html#types-ColorKeywords
  2359. exports.colorsNames = {
  2360. 'aliceblue': '#f0f8ff',
  2361. 'antiquewhite': '#faebd7',
  2362. 'aqua': '#0ff',
  2363. 'aquamarine': '#7fffd4',
  2364. 'azure': '#f0ffff',
  2365. 'beige': '#f5f5dc',
  2366. 'bisque': '#ffe4c4',
  2367. 'black': '#000',
  2368. 'blanchedalmond': '#ffebcd',
  2369. 'blue': '#00f',
  2370. 'blueviolet': '#8a2be2',
  2371. 'brown': '#a52a2a',
  2372. 'burlywood': '#deb887',
  2373. 'cadetblue': '#5f9ea0',
  2374. 'chartreuse': '#7fff00',
  2375. 'chocolate': '#d2691e',
  2376. 'coral': '#ff7f50',
  2377. 'cornflowerblue': '#6495ed',
  2378. 'cornsilk': '#fff8dc',
  2379. 'crimson': '#dc143c',
  2380. 'cyan': '#0ff',
  2381. 'darkblue': '#00008b',
  2382. 'darkcyan': '#008b8b',
  2383. 'darkgoldenrod': '#b8860b',
  2384. 'darkgray': '#a9a9a9',
  2385. 'darkgreen': '#006400',
  2386. 'darkgrey': '#a9a9a9',
  2387. 'darkkhaki': '#bdb76b',
  2388. 'darkmagenta': '#8b008b',
  2389. 'darkolivegreen': '#556b2f',
  2390. 'darkorange': '#ff8c00',
  2391. 'darkorchid': '#9932cc',
  2392. 'darkred': '#8b0000',
  2393. 'darksalmon': '#e9967a',
  2394. 'darkseagreen': '#8fbc8f',
  2395. 'darkslateblue': '#483d8b',
  2396. 'darkslategray': '#2f4f4f',
  2397. 'darkslategrey': '#2f4f4f',
  2398. 'darkturquoise': '#00ced1',
  2399. 'darkviolet': '#9400d3',
  2400. 'deeppink': '#ff1493',
  2401. 'deepskyblue': '#00bfff',
  2402. 'dimgray': '#696969',
  2403. 'dimgrey': '#696969',
  2404. 'dodgerblue': '#1e90ff',
  2405. 'firebrick': '#b22222',
  2406. 'floralwhite': '#fffaf0',
  2407. 'forestgreen': '#228b22',
  2408. 'fuchsia': '#f0f',
  2409. 'gainsboro': '#dcdcdc',
  2410. 'ghostwhite': '#f8f8ff',
  2411. 'gold': '#ffd700',
  2412. 'goldenrod': '#daa520',
  2413. 'gray': '#808080',
  2414. 'green': '#008000',
  2415. 'greenyellow': '#adff2f',
  2416. 'grey': '#808080',
  2417. 'honeydew': '#f0fff0',
  2418. 'hotpink': '#ff69b4',
  2419. 'indianred': '#cd5c5c',
  2420. 'indigo': '#4b0082',
  2421. 'ivory': '#fffff0',
  2422. 'khaki': '#f0e68c',
  2423. 'lavender': '#e6e6fa',
  2424. 'lavenderblush': '#fff0f5',
  2425. 'lawngreen': '#7cfc00',
  2426. 'lemonchiffon': '#fffacd',
  2427. 'lightblue': '#add8e6',
  2428. 'lightcoral': '#f08080',
  2429. 'lightcyan': '#e0ffff',
  2430. 'lightgoldenrodyellow': '#fafad2',
  2431. 'lightgray': '#d3d3d3',
  2432. 'lightgreen': '#90ee90',
  2433. 'lightgrey': '#d3d3d3',
  2434. 'lightpink': '#ffb6c1',
  2435. 'lightsalmon': '#ffa07a',
  2436. 'lightseagreen': '#20b2aa',
  2437. 'lightskyblue': '#87cefa',
  2438. 'lightslategray': '#789',
  2439. 'lightslategrey': '#789',
  2440. 'lightsteelblue': '#b0c4de',
  2441. 'lightyellow': '#ffffe0',
  2442. 'lime': '#0f0',
  2443. 'limegreen': '#32cd32',
  2444. 'linen': '#faf0e6',
  2445. 'magenta': '#f0f',
  2446. 'maroon': '#800000',
  2447. 'mediumaquamarine': '#66cdaa',
  2448. 'mediumblue': '#0000cd',
  2449. 'mediumorchid': '#ba55d3',
  2450. 'mediumpurple': '#9370db',
  2451. 'mediumseagreen': '#3cb371',
  2452. 'mediumslateblue': '#7b68ee',
  2453. 'mediumspringgreen': '#00fa9a',
  2454. 'mediumturquoise': '#48d1cc',
  2455. 'mediumvioletred': '#c71585',
  2456. 'midnightblue': '#191970',
  2457. 'mintcream': '#f5fffa',
  2458. 'mistyrose': '#ffe4e1',
  2459. 'moccasin': '#ffe4b5',
  2460. 'navajowhite': '#ffdead',
  2461. 'navy': '#000080',
  2462. 'oldlace': '#fdf5e6',
  2463. 'olive': '#808000',
  2464. 'olivedrab': '#6b8e23',
  2465. 'orange': '#ffa500',
  2466. 'orangered': '#ff4500',
  2467. 'orchid': '#da70d6',
  2468. 'palegoldenrod': '#eee8aa',
  2469. 'palegreen': '#98fb98',
  2470. 'paleturquoise': '#afeeee',
  2471. 'palevioletred': '#db7093',
  2472. 'papayawhip': '#ffefd5',
  2473. 'peachpuff': '#ffdab9',
  2474. 'peru': '#cd853f',
  2475. 'pink': '#ffc0cb',
  2476. 'plum': '#dda0dd',
  2477. 'powderblue': '#b0e0e6',
  2478. 'purple': '#800080',
  2479. 'rebeccapurple': '#639',
  2480. 'red': '#f00',
  2481. 'rosybrown': '#bc8f8f',
  2482. 'royalblue': '#4169e1',
  2483. 'saddlebrown': '#8b4513',
  2484. 'salmon': '#fa8072',
  2485. 'sandybrown': '#f4a460',
  2486. 'seagreen': '#2e8b57',
  2487. 'seashell': '#fff5ee',
  2488. 'sienna': '#a0522d',
  2489. 'silver': '#c0c0c0',
  2490. 'skyblue': '#87ceeb',
  2491. 'slateblue': '#6a5acd',
  2492. 'slategray': '#708090',
  2493. 'slategrey': '#708090',
  2494. 'snow': '#fffafa',
  2495. 'springgreen': '#00ff7f',
  2496. 'steelblue': '#4682b4',
  2497. 'tan': '#d2b48c',
  2498. 'teal': '#008080',
  2499. 'thistle': '#d8bfd8',
  2500. 'tomato': '#ff6347',
  2501. 'turquoise': '#40e0d0',
  2502. 'violet': '#ee82ee',
  2503. 'wheat': '#f5deb3',
  2504. 'white': '#fff',
  2505. 'whitesmoke': '#f5f5f5',
  2506. 'yellow': '#ff0',
  2507. 'yellowgreen': '#9acd32'
  2508. };
  2509. exports.colorsShortNames = {
  2510. '#f0ffff': 'azure',
  2511. '#f5f5dc': 'beige',
  2512. '#ffe4c4': 'bisque',
  2513. '#a52a2a': 'brown',
  2514. '#ff7f50': 'coral',
  2515. '#ffd700': 'gold',
  2516. '#808080': 'gray',
  2517. '#008000': 'green',
  2518. '#4b0082': 'indigo',
  2519. '#fffff0': 'ivory',
  2520. '#f0e68c': 'khaki',
  2521. '#faf0e6': 'linen',
  2522. '#800000': 'maroon',
  2523. '#000080': 'navy',
  2524. '#808000': 'olive',
  2525. '#ffa500': 'orange',
  2526. '#da70d6': 'orchid',
  2527. '#cd853f': 'peru',
  2528. '#ffc0cb': 'pink',
  2529. '#dda0dd': 'plum',
  2530. '#800080': 'purple',
  2531. '#f00': 'red',
  2532. '#ff0000': 'red',
  2533. '#fa8072': 'salmon',
  2534. '#a0522d': 'sienna',
  2535. '#c0c0c0': 'silver',
  2536. '#fffafa': 'snow',
  2537. '#d2b48c': 'tan',
  2538. '#008080': 'teal',
  2539. '#ff6347': 'tomato',
  2540. '#ee82ee': 'violet',
  2541. '#f5deb3': 'wheat'
  2542. };
  2543. // http://www.w3.org/TR/SVG11/single-page.html#types-DataTypeColor
  2544. exports.colorsProps = [
  2545. 'color', 'fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color'
  2546. ];