Skip to content

Commit

Permalink
Use presentation attibures instead of all styling properties.
Browse files Browse the repository at this point in the history
Fixes svg#528
  • Loading branch information
GreLI committed Apr 5, 2016
1 parent 3d93e8f commit 2f88a38
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 74 deletions.
73 changes: 0 additions & 73 deletions plugins/_collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -2296,79 +2296,6 @@ exports.referencesProps = [
'style'
];

// http://www.w3.org/TR/SVG/styling.html#SVGStylingProperties
exports.stylingProps = [
'font',
'font-family',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-variant',
'font-weight',
'direction',
'letter-spacing',
'text-decoration',
'unicode-bidi',
'white-space',
'word-spacing',
'clip',
'color',
'cursor',
'display',
'overflow',
'visibility',
'clip-path',
'clip-rule',
'mask',
'opacity',
'enable-background',
'filter',
'flood-color',
'flood-opacity',
'lighting-color',
'solid-color',
'solid-opacity',
'stop-color',
'stop-opacity',
'pointer-events',
'buffered-rendering',
'color-interpolation',
'color-interpolation-filters',
'color-profile',
'color-rendering',
'fill',
'fill-opacity',
'fill-rule',
'image-rendering',
'marker',
'marker-end',
'marker-mid',
'marker-start',
'shape-rendering',
'stroke',
'stroke-dasharray',
'stroke-dashoffset',
'stroke-linecap',
'stroke-linejoin',
'stroke-miterlimit',
'stroke-opacity',
'stroke-width',
'paint-order',
'vector-effect',
'viewport-fill',
'viewport-fill-opacity',
'text-rendering',
'alignment-baseline',
'baseline-shift',
'dominant-baseline',
'glyph-orientation-horizontal',
'glyph-orientation-vertical',
'kerning',
'text-anchor',
'writing-mode'
];

// http://www.w3.org/TR/SVG/propidx.html
exports.inheritableAttrs = [
'clip-rule',
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertStyleToAttrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.active = true;
exports.description = 'converts style to attributes';

var EXTEND = require('whet.extend'),
stylingProps = require('./_collections').stylingProps,
stylingProps = require('./_collections').attrsGroups.presentation,
rEscape = '\\\\(?:[0-9a-f]{1,6}\\s?|\\r\\n|.)', // Like \" or \2051. Code points consume one space.
rAttr = '\\s*(' + g('[^:;\\\\]', rEscape) + '*?)\\s*', // attribute name like ‘fill’
rSingleQuotes = "'(?:[^'\\n\\r\\\\]|" + rEscape + ")*?(?:'|$)", // string in single quotes: 'smth'
Expand Down
2 changes: 2 additions & 0 deletions test/plugins/convertStyleToAttrs.02.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f88a38

Please sign in to comment.