1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 04:10:04 +02:00

update modules

This commit is contained in:
s2
2020-07-20 16:16:07 +02:00
parent 783511ce12
commit 2b23424b86
785 changed files with 91905 additions and 56057 deletions

View File

@@ -56,6 +56,11 @@ CSSStyleDeclaration.prototype = {
this.removeProperty(name);
return;
}
var isCustomProperty = name.indexOf('--') === 0;
if (isCustomProperty) {
this._setProperty(name, value, priority);
return;
}
var lowercaseName = name.toLowerCase();
if (!allProperties.has(lowercaseName) && !allExtraProperties.has(lowercaseName)) {
return;

556
node_modules/cssstyle/lib/CSSStyleDeclaration.test.js generated vendored Normal file
View File

@@ -0,0 +1,556 @@
'use strict';
var { CSSStyleDeclaration } = require('./CSSStyleDeclaration');
var allProperties = require('./allProperties');
var allExtraProperties = require('./allExtraProperties');
var implementedProperties = require('./implementedProperties');
var parsers = require('./parsers');
var dashedProperties = [...allProperties, ...allExtraProperties];
var allowedProperties = dashedProperties.map(parsers.dashedToCamelCase);
implementedProperties = Array.from(implementedProperties).map(parsers.dashedToCamelCase);
var invalidProperties = implementedProperties.filter(prop => !allowedProperties.includes(prop));
describe('CSSStyleDeclaration', () => {
test('has only valid properties implemented', () => {
expect(invalidProperties.length).toEqual(0);
});
test('has all properties', () => {
var style = new CSSStyleDeclaration();
allProperties.forEach(property => {
expect(style.__lookupGetter__(property)).toBeTruthy();
expect(style.__lookupSetter__(property)).toBeTruthy();
});
});
test('has dashed properties', () => {
var style = new CSSStyleDeclaration();
dashedProperties.forEach(property => {
expect(style.__lookupGetter__(property)).toBeTruthy();
expect(style.__lookupSetter__(property)).toBeTruthy();
});
});
test('has all functions', () => {
var style = new CSSStyleDeclaration();
expect(typeof style.item).toEqual('function');
expect(typeof style.getPropertyValue).toEqual('function');
expect(typeof style.setProperty).toEqual('function');
expect(typeof style.getPropertyPriority).toEqual('function');
expect(typeof style.removeProperty).toEqual('function');
// TODO - deprecated according to MDN and not implemented at all, can we remove?
expect(typeof style.getPropertyCSSValue).toEqual('function');
});
test('has special properties', () => {
var style = new CSSStyleDeclaration();
expect(style.__lookupGetter__('cssText')).toBeTruthy();
expect(style.__lookupSetter__('cssText')).toBeTruthy();
expect(style.__lookupGetter__('length')).toBeTruthy();
expect(style.__lookupSetter__('length')).toBeTruthy();
expect(style.__lookupGetter__('parentRule')).toBeTruthy();
});
test('from style string', () => {
var style = new CSSStyleDeclaration();
style.cssText = 'color: blue; background-color: red; width: 78%; height: 50vh;';
expect(style.length).toEqual(4);
expect(style.cssText).toEqual('color: blue; background-color: red; width: 78%; height: 50vh;');
expect(style.getPropertyValue('color')).toEqual('blue');
expect(style.item(0)).toEqual('color');
expect(style[1]).toEqual('background-color');
expect(style.backgroundColor).toEqual('red');
style.cssText = '';
expect(style.cssText).toEqual('');
expect(style.length).toEqual(0);
});
test('from properties', () => {
var style = new CSSStyleDeclaration();
style.color = 'blue';
expect(style.length).toEqual(1);
expect(style[0]).toEqual('color');
expect(style.cssText).toEqual('color: blue;');
expect(style.item(0)).toEqual('color');
expect(style.color).toEqual('blue');
style.backgroundColor = 'red';
expect(style.length).toEqual(2);
expect(style[0]).toEqual('color');
expect(style[1]).toEqual('background-color');
expect(style.cssText).toEqual('color: blue; background-color: red;');
expect(style.backgroundColor).toEqual('red');
style.removeProperty('color');
expect(style[0]).toEqual('background-color');
});
test('shorthand properties', () => {
var style = new CSSStyleDeclaration();
style.background = 'blue url(http://www.example.com/some_img.jpg)';
expect(style.backgroundColor).toEqual('blue');
expect(style.backgroundImage).toEqual('url(http://www.example.com/some_img.jpg)');
expect(style.background).toEqual('blue url(http://www.example.com/some_img.jpg)');
style.border = '0 solid black';
expect(style.borderWidth).toEqual('0px');
expect(style.borderStyle).toEqual('solid');
expect(style.borderColor).toEqual('black');
expect(style.borderTopWidth).toEqual('0px');
expect(style.borderLeftStyle).toEqual('solid');
expect(style.borderBottomColor).toEqual('black');
style.font = '12em monospace';
expect(style.fontSize).toEqual('12em');
expect(style.fontFamily).toEqual('monospace');
});
test('width and height properties and null and empty strings', () => {
var style = new CSSStyleDeclaration();
style.height = 6;
expect(style.height).toEqual('');
style.width = 0;
expect(style.width).toEqual('0px');
style.height = '34%';
expect(style.height).toEqual('34%');
style.height = '100vh';
expect(style.height).toEqual('100vh');
style.height = '100vw';
expect(style.height).toEqual('100vw');
style.height = '';
expect(1).toEqual(style.length);
expect(style.cssText).toEqual('width: 0px;');
style.width = null;
expect(0).toEqual(style.length);
expect(style.cssText).toEqual('');
});
test('implicit properties', () => {
var style = new CSSStyleDeclaration();
style.borderWidth = 0;
expect(style.length).toEqual(1);
expect(style.borderWidth).toEqual('0px');
expect(style.borderTopWidth).toEqual('0px');
expect(style.borderBottomWidth).toEqual('0px');
expect(style.borderLeftWidth).toEqual('0px');
expect(style.borderRightWidth).toEqual('0px');
expect(style.cssText).toEqual('border-width: 0px;');
});
test('top, left, right, bottom properties', () => {
var style = new CSSStyleDeclaration();
style.top = 0;
style.left = '0%';
style.right = '5em';
style.bottom = '12pt';
expect(style.top).toEqual('0px');
expect(style.left).toEqual('0%');
expect(style.right).toEqual('5em');
expect(style.bottom).toEqual('12pt');
expect(style.length).toEqual(4);
expect(style.cssText).toEqual('top: 0px; left: 0%; right: 5em; bottom: 12pt;');
});
test('clear and clip properties', () => {
var style = new CSSStyleDeclaration();
style.clear = 'none';
expect(style.clear).toEqual('none');
style.clear = 'lfet';
expect(style.clear).toEqual('none');
style.clear = 'left';
expect(style.clear).toEqual('left');
style.clear = 'right';
expect(style.clear).toEqual('right');
style.clear = 'both';
expect(style.clear).toEqual('both');
style.clip = 'elipse(5px, 10px)';
expect(style.clip).toEqual('');
expect(style.length).toEqual(1);
style.clip = 'rect(0, 3Em, 2pt, 50%)';
expect(style.clip).toEqual('rect(0px, 3em, 2pt, 50%)');
expect(style.length).toEqual(2);
expect(style.cssText).toEqual('clear: both; clip: rect(0px, 3em, 2pt, 50%);');
});
test('colors', () => {
var style = new CSSStyleDeclaration();
style.color = 'rgba(0,0,0,0)';
expect(style.color).toEqual('rgba(0, 0, 0, 0)');
style.color = 'rgba(5%, 10%, 20%, 0.4)';
expect(style.color).toEqual('rgba(12, 25, 51, 0.4)');
style.color = 'rgb(33%, 34%, 33%)';
expect(style.color).toEqual('rgb(84, 86, 84)');
style.color = 'rgba(300, 200, 100, 1.5)';
expect(style.color).toEqual('rgb(255, 200, 100)');
style.color = 'hsla(0, 1%, 2%, 0.5)';
expect(style.color).toEqual('rgba(5, 5, 5, 0.5)');
style.color = 'hsl(0, 1%, 2%)';
expect(style.color).toEqual('rgb(5, 5, 5)');
style.color = 'rebeccapurple';
expect(style.color).toEqual('rebeccapurple');
style.color = 'transparent';
expect(style.color).toEqual('transparent');
style.color = 'currentcolor';
expect(style.color).toEqual('currentcolor');
style.color = '#ffffffff';
expect(style.color).toEqual('rgba(255, 255, 255, 1)');
style.color = '#fffa';
expect(style.color).toEqual('rgba(255, 255, 255, 0.667)');
style.color = '#ffffff66';
expect(style.color).toEqual('rgba(255, 255, 255, 0.4)');
});
test('short hand properties with embedded spaces', () => {
var style = new CSSStyleDeclaration();
style.background = 'rgb(0, 0, 0) url(/something/somewhere.jpg)';
expect(style.backgroundColor).toEqual('rgb(0, 0, 0)');
expect(style.backgroundImage).toEqual('url(/something/somewhere.jpg)');
expect(style.cssText).toEqual('background: rgb(0, 0, 0) url(/something/somewhere.jpg);');
style = new CSSStyleDeclaration();
style.border = ' 1px solid black ';
expect(style.border).toEqual('1px solid black');
});
test('setting shorthand properties to an empty string should clear all dependent properties', () => {
var style = new CSSStyleDeclaration();
style.borderWidth = '1px';
expect(style.cssText).toEqual('border-width: 1px;');
style.border = '';
expect(style.cssText).toEqual('');
});
test('setting implicit properties to an empty string should clear all dependent properties', () => {
var style = new CSSStyleDeclaration();
style.borderTopWidth = '1px';
expect(style.cssText).toEqual('border-top-width: 1px;');
style.borderWidth = '';
expect(style.cssText).toEqual('');
});
test('setting a shorthand property, whose shorthands are implicit properties, to an empty string should clear all dependent properties', () => {
var style = new CSSStyleDeclaration();
style.borderTopWidth = '1px';
expect(style.cssText).toEqual('border-top-width: 1px;');
style.border = '';
expect(style.cssText).toEqual('');
style.borderTop = '1px solid black';
expect(style.cssText).toEqual('border-top: 1px solid black;');
style.border = '';
expect(style.cssText).toEqual('');
});
test('setting border values to "none" should clear dependent values', () => {
var style = new CSSStyleDeclaration();
style.borderTopWidth = '1px';
expect(style.cssText).toEqual('border-top-width: 1px;');
style.border = 'none';
expect(style.cssText).toEqual('');
style.borderTopWidth = '1px';
expect(style.cssText).toEqual('border-top-width: 1px;');
style.borderTopStyle = 'none';
expect(style.cssText).toEqual('');
style.borderTopWidth = '1px';
expect(style.cssText).toEqual('border-top-width: 1px;');
style.borderTop = 'none';
expect(style.cssText).toEqual('');
style.borderTopWidth = '1px';
style.borderLeftWidth = '1px';
expect(style.cssText).toEqual('border-top-width: 1px; border-left-width: 1px;');
style.borderTop = 'none';
expect(style.cssText).toEqual('border-left-width: 1px;');
});
test('setting border to 0 should be okay', () => {
var style = new CSSStyleDeclaration();
style.border = 0;
expect(style.cssText).toEqual('border: 0px;');
});
test('setting values implicit and shorthand properties via csstext and setproperty should propagate to dependent properties', () => {
var style = new CSSStyleDeclaration();
style.cssText = 'border: 1px solid black;';
expect(style.cssText).toEqual('border: 1px solid black;');
expect(style.borderTop).toEqual('1px solid black');
style.border = '';
expect(style.cssText).toEqual('');
style.setProperty('border', '1px solid black');
expect(style.cssText).toEqual('border: 1px solid black;');
});
test('setting opacity should work', () => {
var style = new CSSStyleDeclaration();
style.setProperty('opacity', 0.75);
expect(style.cssText).toEqual('opacity: 0.75;');
style.opacity = '0.50';
expect(style.cssText).toEqual('opacity: 0.5;');
style.opacity = 1;
expect(style.cssText).toEqual('opacity: 1;');
});
test('width and height of auto should work', () => {
var style = new CSSStyleDeclaration();
style.width = 'auto';
expect(style.cssText).toEqual('width: auto;');
expect(style.width).toEqual('auto');
style = new CSSStyleDeclaration();
style.height = 'auto';
expect(style.cssText).toEqual('height: auto;');
expect(style.height).toEqual('auto');
});
test('padding and margin should set/clear shorthand properties', () => {
var style = new CSSStyleDeclaration();
var parts = ['Top', 'Right', 'Bottom', 'Left'];
var testParts = function(name, v, V) {
style[name] = v;
for (var i = 0; i < 4; i++) {
var part = name + parts[i];
expect(style[part]).toEqual(V[i]);
}
expect(style[name]).toEqual(v);
style[name] = '';
};
testParts('padding', '1px', ['1px', '1px', '1px', '1px']);
testParts('padding', '1px 2%', ['1px', '2%', '1px', '2%']);
testParts('padding', '1px 2px 3px', ['1px', '2px', '3px', '2px']);
testParts('padding', '1px 2px 3px 4px', ['1px', '2px', '3px', '4px']);
style.paddingTop = style.paddingRight = style.paddingBottom = style.paddingLeft = '1px';
testParts('padding', '', ['', '', '', '']);
testParts('margin', '1px', ['1px', '1px', '1px', '1px']);
testParts('margin', '1px auto', ['1px', 'auto', '1px', 'auto']);
testParts('margin', '1px 2% 3px', ['1px', '2%', '3px', '2%']);
testParts('margin', '1px 2px 3px 4px', ['1px', '2px', '3px', '4px']);
style.marginTop = style.marginRight = style.marginBottom = style.marginLeft = '1px';
testParts('margin', '', ['', '', '', '']);
});
test('padding and margin shorthands should set main properties', () => {
var style = new CSSStyleDeclaration();
var parts = ['Top', 'Right', 'Bottom', 'Left'];
var testParts = function(name, v, V) {
var expected;
for (var i = 0; i < 4; i++) {
style[name] = v;
style[name + parts[i]] = V;
expected = v.split(/ /);
expected[i] = V;
expected = expected.join(' ');
expect(style[name]).toEqual(expected);
}
};
testParts('padding', '1px 2px 3px 4px', '10px');
testParts('margin', '1px 2px 3px 4px', '10px');
testParts('margin', '1px 2px 3px 4px', 'auto');
});
test('setting a value to 0 should return the string value', () => {
var style = new CSSStyleDeclaration();
style.setProperty('fill-opacity', 0);
expect(style.fillOpacity).toEqual('0');
});
test('onchange callback should be called when the csstext changes', () => {
var style = new CSSStyleDeclaration(function(cssText) {
expect(cssText).toEqual('opacity: 0;');
});
style.setProperty('opacity', 0);
});
test('setting float should work the same as cssfloat', () => {
var style = new CSSStyleDeclaration();
style.float = 'left';
expect(style.cssFloat).toEqual('left');
});
test('setting improper css to csstext should not throw', () => {
var style = new CSSStyleDeclaration();
style.cssText = 'color: ';
expect(style.cssText).toEqual('');
style.color = 'black';
style.cssText = 'float: ';
expect(style.cssText).toEqual('');
});
test('url parsing works with quotes', () => {
var style = new CSSStyleDeclaration();
style.backgroundImage = 'url(http://some/url/here1.png)';
expect(style.backgroundImage).toEqual('url(http://some/url/here1.png)');
style.backgroundImage = "url('http://some/url/here2.png')";
expect(style.backgroundImage).toEqual('url(http://some/url/here2.png)');
style.backgroundImage = 'url("http://some/url/here3.png")';
expect(style.backgroundImage).toEqual('url(http://some/url/here3.png)');
});
test('setting 0 to a padding or margin works', () => {
var style = new CSSStyleDeclaration();
style.padding = 0;
expect(style.cssText).toEqual('padding: 0px;');
style.margin = '1em';
style.marginTop = '0';
expect(style.marginTop).toEqual('0px');
});
test('setting ex units to a padding or margin works', () => {
var style = new CSSStyleDeclaration();
style.padding = '1ex';
expect(style.cssText).toEqual('padding: 1ex;');
style.margin = '1em';
style.marginTop = '0.5ex';
expect(style.marginTop).toEqual('0.5ex');
});
test('setting null to background works', () => {
var style = new CSSStyleDeclaration();
style.background = 'red';
expect(style.cssText).toEqual('background: red;');
style.background = null;
expect(style.cssText).toEqual('');
});
test('flex properties should keep their values', () => {
var style = new CSSStyleDeclaration();
style.flexDirection = 'column';
expect(style.cssText).toEqual('flex-direction: column;');
style.flexDirection = 'row';
expect(style.cssText).toEqual('flex-direction: row;');
});
test('camelcase properties are not assigned with `.setproperty()`', () => {
var style = new CSSStyleDeclaration();
style.setProperty('fontSize', '12px');
expect(style.cssText).toEqual('');
});
test('casing is ignored in `.setproperty()`', () => {
var style = new CSSStyleDeclaration();
style.setProperty('FoNt-SiZe', '12px');
expect(style.fontSize).toEqual('12px');
expect(style.getPropertyValue('font-size')).toEqual('12px');
});
test('support non string entries in border-spacing', () => {
var style = new CSSStyleDeclaration();
style.borderSpacing = 0;
expect(style.cssText).toEqual('border-spacing: 0px;');
});
test('float should be valid property for `.setproperty()`', () => {
var style = new CSSStyleDeclaration();
style.setProperty('float', 'left');
expect(style.float).toEqual('left');
expect(style.getPropertyValue('float')).toEqual('left');
});
test('flex-shrink works', () => {
var style = new CSSStyleDeclaration();
style.setProperty('flex-shrink', 0);
expect(style.getPropertyValue('flex-shrink')).toEqual('0');
style.setProperty('flex-shrink', 1);
expect(style.getPropertyValue('flex-shrink')).toEqual('1');
expect(style.cssText).toEqual('flex-shrink: 1;');
});
test('flex-grow works', () => {
var style = new CSSStyleDeclaration();
style.setProperty('flex-grow', 2);
expect(style.getPropertyValue('flex-grow')).toEqual('2');
expect(style.cssText).toEqual('flex-grow: 2;');
});
test('flex-basis works', () => {
var style = new CSSStyleDeclaration();
style.setProperty('flex-basis', 0);
expect(style.getPropertyValue('flex-basis')).toEqual('0px');
style.setProperty('flex-basis', '250px');
expect(style.getPropertyValue('flex-basis')).toEqual('250px');
style.setProperty('flex-basis', '10em');
expect(style.getPropertyValue('flex-basis')).toEqual('10em');
style.setProperty('flex-basis', '30%');
expect(style.getPropertyValue('flex-basis')).toEqual('30%');
expect(style.cssText).toEqual('flex-basis: 30%;');
});
test('shorthand flex works', () => {
var style = new CSSStyleDeclaration();
style.setProperty('flex', 'none');
expect(style.getPropertyValue('flex-grow')).toEqual('0');
expect(style.getPropertyValue('flex-shrink')).toEqual('0');
expect(style.getPropertyValue('flex-basis')).toEqual('auto');
style.removeProperty('flex');
style.removeProperty('flex-basis');
style.setProperty('flex', 'auto');
expect(style.getPropertyValue('flex-grow')).toEqual('');
expect(style.getPropertyValue('flex-shrink')).toEqual('');
expect(style.getPropertyValue('flex-basis')).toEqual('auto');
style.removeProperty('flex');
style.setProperty('flex', '0 1 250px');
expect(style.getPropertyValue('flex')).toEqual('0 1 250px');
expect(style.getPropertyValue('flex-grow')).toEqual('0');
expect(style.getPropertyValue('flex-shrink')).toEqual('1');
expect(style.getPropertyValue('flex-basis')).toEqual('250px');
style.removeProperty('flex');
style.setProperty('flex', '2');
expect(style.getPropertyValue('flex-grow')).toEqual('2');
expect(style.getPropertyValue('flex-shrink')).toEqual('');
expect(style.getPropertyValue('flex-basis')).toEqual('');
style.removeProperty('flex');
style.setProperty('flex', '20%');
expect(style.getPropertyValue('flex-grow')).toEqual('');
expect(style.getPropertyValue('flex-shrink')).toEqual('');
expect(style.getPropertyValue('flex-basis')).toEqual('20%');
style.removeProperty('flex');
style.setProperty('flex', '2 2');
expect(style.getPropertyValue('flex-grow')).toEqual('2');
expect(style.getPropertyValue('flex-shrink')).toEqual('2');
expect(style.getPropertyValue('flex-basis')).toEqual('');
style.removeProperty('flex');
});
test('font-size get a valid value', () => {
var style = new CSSStyleDeclaration();
const invalidValue = '1r5px';
style.cssText = 'font-size: 15px';
expect(1).toEqual(style.length);
style.cssText = `font-size: ${invalidValue}`;
expect(0).toEqual(style.length);
expect(undefined).toEqual(style[0]);
});
test('getPropertyValue for custom properties in cssText', () => {
const style = new CSSStyleDeclaration();
style.cssText = '--foo: red';
expect(style.getPropertyValue('--foo')).toEqual('red');
});
test('getPropertyValue for custom properties with setProperty', () => {
const style = new CSSStyleDeclaration();
style.setProperty('--bar', 'blue');
expect(style.getPropertyValue('--bar')).toEqual('blue');
});
test('getPropertyValue for custom properties with object setter', () => {
const style = new CSSStyleDeclaration();
style['--baz'] = 'yellow';
expect(style.getPropertyValue('--baz')).toEqual('');
});
test('custom properties are case-sensitive', () => {
const style = new CSSStyleDeclaration();
style.cssText = '--fOo: purple';
expect(style.getPropertyValue('--foo')).toEqual('');
expect(style.getPropertyValue('--fOo')).toEqual('purple');
});
test('supports calc', () => {
const style = new CSSStyleDeclaration();
style.setProperty('width', 'calc(100% - 100px)');
expect(style.getPropertyValue('width')).toEqual('calc(100% - 100px)');
});
});

View File

@@ -5,244 +5,63 @@
* current specifications or drafts, but are handled by browsers nevertheless.
*/
var allExtraProperties = new Set();
module.exports = allExtraProperties;
allExtraProperties.add('background-position-x');
allExtraProperties.add('background-position-y');
allExtraProperties.add('background-repeat-x');
allExtraProperties.add('background-repeat-y');
allExtraProperties.add('color-interpolation');
allExtraProperties.add('color-profile');
allExtraProperties.add('color-rendering');
allExtraProperties.add('css-float');
allExtraProperties.add('enable-background');
allExtraProperties.add('fill');
allExtraProperties.add('fill-opacity');
allExtraProperties.add('fill-rule');
allExtraProperties.add('glyph-orientation-horizontal');
allExtraProperties.add('image-rendering');
allExtraProperties.add('kerning');
allExtraProperties.add('marker');
allExtraProperties.add('marker-end');
allExtraProperties.add('marker-mid');
allExtraProperties.add('marker-offset');
allExtraProperties.add('marker-start');
allExtraProperties.add('marks');
allExtraProperties.add('pointer-events');
allExtraProperties.add('shape-rendering');
allExtraProperties.add('size');
allExtraProperties.add('src');
allExtraProperties.add('stop-color');
allExtraProperties.add('stop-opacity');
allExtraProperties.add('stroke');
allExtraProperties.add('stroke-dasharray');
allExtraProperties.add('stroke-dashoffset');
allExtraProperties.add('stroke-linecap');
allExtraProperties.add('stroke-linejoin');
allExtraProperties.add('stroke-miterlimit');
allExtraProperties.add('stroke-opacity');
allExtraProperties.add('stroke-width');
allExtraProperties.add('text-anchor');
allExtraProperties.add('text-line-through');
allExtraProperties.add('text-line-through-color');
allExtraProperties.add('text-line-through-mode');
allExtraProperties.add('text-line-through-style');
allExtraProperties.add('text-line-through-width');
allExtraProperties.add('text-overline');
allExtraProperties.add('text-overline-color');
allExtraProperties.add('text-overline-mode');
allExtraProperties.add('text-overline-style');
allExtraProperties.add('text-overline-width');
allExtraProperties.add('text-rendering');
allExtraProperties.add('text-underline');
allExtraProperties.add('text-underline-color');
allExtraProperties.add('text-underline-mode');
allExtraProperties.add('text-underline-style');
allExtraProperties.add('text-underline-width');
allExtraProperties.add('unicode-range');
allExtraProperties.add('vector-effect');
allExtraProperties.add('webkit-animation');
allExtraProperties.add('webkit-animation-delay');
allExtraProperties.add('webkit-animation-direction');
allExtraProperties.add('webkit-animation-duration');
allExtraProperties.add('webkit-animation-fill-mode');
allExtraProperties.add('webkit-animation-iteration-count');
allExtraProperties.add('webkit-animation-name');
allExtraProperties.add('webkit-animation-play-state');
allExtraProperties.add('webkit-animation-timing-function');
allExtraProperties.add('webkit-appearance');
allExtraProperties.add('webkit-aspect-ratio');
allExtraProperties.add('webkit-backface-visibility');
allExtraProperties.add('webkit-background-clip');
allExtraProperties.add('webkit-background-composite');
allExtraProperties.add('webkit-background-origin');
allExtraProperties.add('webkit-background-size');
allExtraProperties.add('webkit-border-after');
allExtraProperties.add('webkit-border-after-color');
allExtraProperties.add('webkit-border-after-style');
allExtraProperties.add('webkit-border-after-width');
allExtraProperties.add('webkit-border-before');
allExtraProperties.add('webkit-border-before-color');
allExtraProperties.add('webkit-border-before-style');
allExtraProperties.add('webkit-border-before-width');
allExtraProperties.add('webkit-border-end');
allExtraProperties.add('webkit-border-end-color');
allExtraProperties.add('webkit-border-end-style');
allExtraProperties.add('webkit-border-end-width');
allExtraProperties.add('webkit-border-fit');
allExtraProperties.add('webkit-border-horizontal-spacing');
allExtraProperties.add('webkit-border-image');
allExtraProperties.add('webkit-border-radius');
allExtraProperties.add('webkit-border-start');
allExtraProperties.add('webkit-border-start-color');
allExtraProperties.add('webkit-border-start-style');
allExtraProperties.add('webkit-border-start-width');
allExtraProperties.add('webkit-border-vertical-spacing');
allExtraProperties.add('webkit-box-align');
allExtraProperties.add('webkit-box-direction');
allExtraProperties.add('webkit-box-flex');
allExtraProperties.add('webkit-box-flex-group');
allExtraProperties.add('webkit-box-lines');
allExtraProperties.add('webkit-box-ordinal-group');
allExtraProperties.add('webkit-box-orient');
allExtraProperties.add('webkit-box-pack');
allExtraProperties.add('webkit-box-reflect');
allExtraProperties.add('webkit-box-shadow');
allExtraProperties.add('webkit-color-correction');
allExtraProperties.add('webkit-column-axis');
allExtraProperties.add('webkit-column-break-after');
allExtraProperties.add('webkit-column-break-before');
allExtraProperties.add('webkit-column-break-inside');
allExtraProperties.add('webkit-column-count');
allExtraProperties.add('webkit-column-gap');
allExtraProperties.add('webkit-column-rule');
allExtraProperties.add('webkit-column-rule-color');
allExtraProperties.add('webkit-column-rule-style');
allExtraProperties.add('webkit-column-rule-width');
allExtraProperties.add('webkit-columns');
allExtraProperties.add('webkit-column-span');
allExtraProperties.add('webkit-column-width');
allExtraProperties.add('webkit-filter');
allExtraProperties.add('webkit-flex-align');
allExtraProperties.add('webkit-flex-direction');
allExtraProperties.add('webkit-flex-flow');
allExtraProperties.add('webkit-flex-item-align');
allExtraProperties.add('webkit-flex-line-pack');
allExtraProperties.add('webkit-flex-order');
allExtraProperties.add('webkit-flex-pack');
allExtraProperties.add('webkit-flex-wrap');
allExtraProperties.add('webkit-flow-from');
allExtraProperties.add('webkit-flow-into');
allExtraProperties.add('webkit-font-feature-settings');
allExtraProperties.add('webkit-font-kerning');
allExtraProperties.add('webkit-font-size-delta');
allExtraProperties.add('webkit-font-smoothing');
allExtraProperties.add('webkit-font-variant-ligatures');
allExtraProperties.add('webkit-highlight');
allExtraProperties.add('webkit-hyphenate-character');
allExtraProperties.add('webkit-hyphenate-limit-after');
allExtraProperties.add('webkit-hyphenate-limit-before');
allExtraProperties.add('webkit-hyphenate-limit-lines');
allExtraProperties.add('webkit-hyphens');
allExtraProperties.add('webkit-line-align');
allExtraProperties.add('webkit-line-box-contain');
allExtraProperties.add('webkit-line-break');
allExtraProperties.add('webkit-line-clamp');
allExtraProperties.add('webkit-line-grid');
allExtraProperties.add('webkit-line-snap');
allExtraProperties.add('webkit-locale');
allExtraProperties.add('webkit-logical-height');
allExtraProperties.add('webkit-logical-width');
allExtraProperties.add('webkit-margin-after');
allExtraProperties.add('webkit-margin-after-collapse');
allExtraProperties.add('webkit-margin-before');
allExtraProperties.add('webkit-margin-before-collapse');
allExtraProperties.add('webkit-margin-bottom-collapse');
allExtraProperties.add('webkit-margin-collapse');
allExtraProperties.add('webkit-margin-end');
allExtraProperties.add('webkit-margin-start');
allExtraProperties.add('webkit-margin-top-collapse');
allExtraProperties.add('webkit-marquee');
allExtraProperties.add('webkit-marquee-direction');
allExtraProperties.add('webkit-marquee-increment');
allExtraProperties.add('webkit-marquee-repetition');
allExtraProperties.add('webkit-marquee-speed');
allExtraProperties.add('webkit-marquee-style');
allExtraProperties.add('webkit-mask');
allExtraProperties.add('webkit-mask-attachment');
allExtraProperties.add('webkit-mask-box-image');
allExtraProperties.add('webkit-mask-box-image-outset');
allExtraProperties.add('webkit-mask-box-image-repeat');
allExtraProperties.add('webkit-mask-box-image-slice');
allExtraProperties.add('webkit-mask-box-image-source');
allExtraProperties.add('webkit-mask-box-image-width');
allExtraProperties.add('webkit-mask-clip');
allExtraProperties.add('webkit-mask-composite');
allExtraProperties.add('webkit-mask-image');
allExtraProperties.add('webkit-mask-origin');
allExtraProperties.add('webkit-mask-position');
allExtraProperties.add('webkit-mask-position-x');
allExtraProperties.add('webkit-mask-position-y');
allExtraProperties.add('webkit-mask-repeat');
allExtraProperties.add('webkit-mask-repeat-x');
allExtraProperties.add('webkit-mask-repeat-y');
allExtraProperties.add('webkit-mask-size');
allExtraProperties.add('webkit-match-nearest-mail-blockquote-color');
allExtraProperties.add('webkit-max-logical-height');
allExtraProperties.add('webkit-max-logical-width');
allExtraProperties.add('webkit-min-logical-height');
allExtraProperties.add('webkit-min-logical-width');
allExtraProperties.add('webkit-nbsp-mode');
allExtraProperties.add('webkit-overflow-scrolling');
allExtraProperties.add('webkit-padding-after');
allExtraProperties.add('webkit-padding-before');
allExtraProperties.add('webkit-padding-end');
allExtraProperties.add('webkit-padding-start');
allExtraProperties.add('webkit-perspective');
allExtraProperties.add('webkit-perspective-origin');
allExtraProperties.add('webkit-perspective-origin-x');
allExtraProperties.add('webkit-perspective-origin-y');
allExtraProperties.add('webkit-print-color-adjust');
allExtraProperties.add('webkit-region-break-after');
allExtraProperties.add('webkit-region-break-before');
allExtraProperties.add('webkit-region-break-inside');
allExtraProperties.add('webkit-region-overflow');
allExtraProperties.add('webkit-rtl-ordering');
allExtraProperties.add('webkit-svg-shadow');
allExtraProperties.add('webkit-tap-highlight-color');
allExtraProperties.add('webkit-text-combine');
allExtraProperties.add('webkit-text-decorations-in-effect');
allExtraProperties.add('webkit-text-emphasis');
allExtraProperties.add('webkit-text-emphasis-color');
allExtraProperties.add('webkit-text-emphasis-position');
allExtraProperties.add('webkit-text-emphasis-style');
allExtraProperties.add('webkit-text-fill-color');
allExtraProperties.add('webkit-text-orientation');
allExtraProperties.add('webkit-text-security');
allExtraProperties.add('webkit-text-size-adjust');
allExtraProperties.add('webkit-text-stroke');
allExtraProperties.add('webkit-text-stroke-color');
allExtraProperties.add('webkit-text-stroke-width');
allExtraProperties.add('webkit-transform');
allExtraProperties.add('webkit-transform-origin');
allExtraProperties.add('webkit-transform-origin-x');
allExtraProperties.add('webkit-transform-origin-y');
allExtraProperties.add('webkit-transform-origin-z');
allExtraProperties.add('webkit-transform-style');
allExtraProperties.add('webkit-transition');
allExtraProperties.add('webkit-transition-delay');
allExtraProperties.add('webkit-transition-duration');
allExtraProperties.add('webkit-transition-property');
allExtraProperties.add('webkit-transition-timing-function');
allExtraProperties.add('webkit-user-drag');
allExtraProperties.add('webkit-user-modify');
allExtraProperties.add('webkit-user-select');
allExtraProperties.add('webkit-wrap');
allExtraProperties.add('webkit-wrap-flow');
allExtraProperties.add('webkit-wrap-margin');
allExtraProperties.add('webkit-wrap-padding');
allExtraProperties.add('webkit-wrap-shape-inside');
allExtraProperties.add('webkit-wrap-shape-outside');
allExtraProperties.add('webkit-wrap-through');
allExtraProperties.add('webkit-writing-mode');
allExtraProperties.add('zoom');
var allWebkitProperties = require('./allWebkitProperties');
module.exports = new Set(
[
'background-position-x',
'background-position-y',
'background-repeat-x',
'background-repeat-y',
'color-interpolation',
'color-profile',
'color-rendering',
'css-float',
'enable-background',
'fill',
'fill-opacity',
'fill-rule',
'glyph-orientation-horizontal',
'image-rendering',
'kerning',
'marker',
'marker-end',
'marker-mid',
'marker-offset',
'marker-start',
'marks',
'pointer-events',
'shape-rendering',
'size',
'src',
'stop-color',
'stop-opacity',
'stroke',
'stroke-dasharray',
'stroke-dashoffset',
'stroke-linecap',
'stroke-linejoin',
'stroke-miterlimit',
'stroke-opacity',
'stroke-width',
'text-anchor',
'text-line-through',
'text-line-through-color',
'text-line-through-mode',
'text-line-through-style',
'text-line-through-width',
'text-overline',
'text-overline-color',
'text-overline-mode',
'text-overline-style',
'text-overline-width',
'text-rendering',
'text-underline',
'text-underline-color',
'text-underline-mode',
'text-underline-style',
'text-underline-width',
'unicode-range',
'vector-effect',
].concat(allWebkitProperties)
);

View File

@@ -1,457 +1,462 @@
'use strict';
// autogenerated - 2/3/2019
// autogenerated - 4/29/2020
/*
*
* https://www.w3.org/Style/CSS/all-properties.en.html
*/
var allProperties = new Set();
module.exports = allProperties;
allProperties.add('align-content');
allProperties.add('align-items');
allProperties.add('align-self');
allProperties.add('alignment-baseline');
allProperties.add('all');
allProperties.add('animation');
allProperties.add('animation-delay');
allProperties.add('animation-direction');
allProperties.add('animation-duration');
allProperties.add('animation-fill-mode');
allProperties.add('animation-iteration-count');
allProperties.add('animation-name');
allProperties.add('animation-play-state');
allProperties.add('animation-timing-function');
allProperties.add('appearance');
allProperties.add('azimuth');
allProperties.add('background');
allProperties.add('background-attachment');
allProperties.add('background-blend-mode');
allProperties.add('background-clip');
allProperties.add('background-color');
allProperties.add('background-image');
allProperties.add('background-origin');
allProperties.add('background-position');
allProperties.add('background-repeat');
allProperties.add('background-size');
allProperties.add('baseline-shift');
allProperties.add('block-overflow');
allProperties.add('block-size');
allProperties.add('bookmark-label');
allProperties.add('bookmark-level');
allProperties.add('bookmark-state');
allProperties.add('border');
allProperties.add('border-block');
allProperties.add('border-block-color');
allProperties.add('border-block-end');
allProperties.add('border-block-end-color');
allProperties.add('border-block-end-style');
allProperties.add('border-block-end-width');
allProperties.add('border-block-start');
allProperties.add('border-block-start-color');
allProperties.add('border-block-start-style');
allProperties.add('border-block-start-width');
allProperties.add('border-block-style');
allProperties.add('border-block-width');
allProperties.add('border-bottom');
allProperties.add('border-bottom-color');
allProperties.add('border-bottom-left-radius');
allProperties.add('border-bottom-right-radius');
allProperties.add('border-bottom-style');
allProperties.add('border-bottom-width');
allProperties.add('border-boundary');
allProperties.add('border-collapse');
allProperties.add('border-color');
allProperties.add('border-end-end-radius');
allProperties.add('border-end-start-radius');
allProperties.add('border-image');
allProperties.add('border-image-outset');
allProperties.add('border-image-repeat');
allProperties.add('border-image-slice');
allProperties.add('border-image-source');
allProperties.add('border-image-width');
allProperties.add('border-inline');
allProperties.add('border-inline-color');
allProperties.add('border-inline-end');
allProperties.add('border-inline-end-color');
allProperties.add('border-inline-end-style');
allProperties.add('border-inline-end-width');
allProperties.add('border-inline-start');
allProperties.add('border-inline-start-color');
allProperties.add('border-inline-start-style');
allProperties.add('border-inline-start-width');
allProperties.add('border-inline-style');
allProperties.add('border-inline-width');
allProperties.add('border-left');
allProperties.add('border-left-color');
allProperties.add('border-left-style');
allProperties.add('border-left-width');
allProperties.add('border-radius');
allProperties.add('border-right');
allProperties.add('border-right-color');
allProperties.add('border-right-style');
allProperties.add('border-right-width');
allProperties.add('border-spacing');
allProperties.add('border-start-end-radius');
allProperties.add('border-start-start-radius');
allProperties.add('border-style');
allProperties.add('border-top');
allProperties.add('border-top-color');
allProperties.add('border-top-left-radius');
allProperties.add('border-top-right-radius');
allProperties.add('border-top-style');
allProperties.add('border-top-width');
allProperties.add('border-width');
allProperties.add('bottom');
allProperties.add('box-decoration-break');
allProperties.add('box-shadow');
allProperties.add('box-sizing');
allProperties.add('box-snap');
allProperties.add('break-after');
allProperties.add('break-before');
allProperties.add('break-inside');
allProperties.add('caption-side');
allProperties.add('caret');
allProperties.add('caret-color');
allProperties.add('caret-shape');
allProperties.add('chains');
allProperties.add('clear');
allProperties.add('clip');
allProperties.add('clip-path');
allProperties.add('clip-rule');
allProperties.add('color');
allProperties.add('color-interpolation-filters');
allProperties.add('column-count');
allProperties.add('column-fill');
allProperties.add('column-gap');
allProperties.add('column-rule');
allProperties.add('column-rule-color');
allProperties.add('column-rule-style');
allProperties.add('column-rule-width');
allProperties.add('column-span');
allProperties.add('column-width');
allProperties.add('columns');
allProperties.add('contain');
allProperties.add('content');
allProperties.add('continue');
allProperties.add('counter-increment');
allProperties.add('counter-reset');
allProperties.add('counter-set');
allProperties.add('cue');
allProperties.add('cue-after');
allProperties.add('cue-before');
allProperties.add('cursor');
allProperties.add('direction');
allProperties.add('display');
allProperties.add('dominant-baseline');
allProperties.add('elevation');
allProperties.add('empty-cells');
allProperties.add('filter');
allProperties.add('flex');
allProperties.add('flex-basis');
allProperties.add('flex-direction');
allProperties.add('flex-flow');
allProperties.add('flex-grow');
allProperties.add('flex-shrink');
allProperties.add('flex-wrap');
allProperties.add('float');
allProperties.add('flood-color');
allProperties.add('flood-opacity');
allProperties.add('flow');
allProperties.add('flow-from');
allProperties.add('flow-into');
allProperties.add('font');
allProperties.add('font-family');
allProperties.add('font-feature-settings');
allProperties.add('font-kerning');
allProperties.add('font-language-override');
allProperties.add('font-max-size');
allProperties.add('font-min-size');
allProperties.add('font-optical-sizing');
allProperties.add('font-palette');
allProperties.add('font-size');
allProperties.add('font-size-adjust');
allProperties.add('font-stretch');
allProperties.add('font-style');
allProperties.add('font-synthesis');
allProperties.add('font-synthesis-small-caps');
allProperties.add('font-synthesis-style');
allProperties.add('font-synthesis-weight');
allProperties.add('font-variant');
allProperties.add('font-variant-alternates');
allProperties.add('font-variant-caps');
allProperties.add('font-variant-east-asian');
allProperties.add('font-variant-emoji');
allProperties.add('font-variant-ligatures');
allProperties.add('font-variant-numeric');
allProperties.add('font-variant-position');
allProperties.add('font-variation-settings');
allProperties.add('font-weight');
allProperties.add('footnote-display');
allProperties.add('footnote-policy');
allProperties.add('gap');
allProperties.add('glyph-orientation-vertical');
allProperties.add('grid');
allProperties.add('grid-area');
allProperties.add('grid-auto-columns');
allProperties.add('grid-auto-flow');
allProperties.add('grid-auto-rows');
allProperties.add('grid-column');
allProperties.add('grid-column-end');
allProperties.add('grid-column-start');
allProperties.add('grid-row');
allProperties.add('grid-row-end');
allProperties.add('grid-row-start');
allProperties.add('grid-template');
allProperties.add('grid-template-areas');
allProperties.add('grid-template-columns');
allProperties.add('grid-template-rows');
allProperties.add('hanging-punctuation');
allProperties.add('height');
allProperties.add('hyphenate-character');
allProperties.add('hyphenate-limit-chars');
allProperties.add('hyphenate-limit-last');
allProperties.add('hyphenate-limit-lines');
allProperties.add('hyphenate-limit-zone');
allProperties.add('hyphens');
allProperties.add('image-orientation');
allProperties.add('image-resolution');
allProperties.add('initial-letters');
allProperties.add('initial-letters-align');
allProperties.add('initial-letters-wrap');
allProperties.add('inline-size');
allProperties.add('inline-sizing');
allProperties.add('inset');
allProperties.add('inset-block');
allProperties.add('inset-block-end');
allProperties.add('inset-block-start');
allProperties.add('inset-inline');
allProperties.add('inset-inline-end');
allProperties.add('inset-inline-start');
allProperties.add('isolation');
allProperties.add('justify-content');
allProperties.add('justify-items');
allProperties.add('justify-self');
allProperties.add('left');
allProperties.add('letter-spacing');
allProperties.add('lighting-color');
allProperties.add('line-break');
allProperties.add('line-clamp');
allProperties.add('line-grid');
allProperties.add('line-height');
allProperties.add('line-padding');
allProperties.add('line-snap');
allProperties.add('list-style');
allProperties.add('list-style-image');
allProperties.add('list-style-position');
allProperties.add('list-style-type');
allProperties.add('margin');
allProperties.add('margin-block');
allProperties.add('margin-block-end');
allProperties.add('margin-block-start');
allProperties.add('margin-bottom');
allProperties.add('margin-inline');
allProperties.add('margin-inline-end');
allProperties.add('margin-inline-start');
allProperties.add('margin-left');
allProperties.add('margin-right');
allProperties.add('margin-top');
allProperties.add('margin-trim');
allProperties.add('marker-side');
allProperties.add('mask');
allProperties.add('mask-border');
allProperties.add('mask-border-mode');
allProperties.add('mask-border-outset');
allProperties.add('mask-border-repeat');
allProperties.add('mask-border-slice');
allProperties.add('mask-border-source');
allProperties.add('mask-border-width');
allProperties.add('mask-clip');
allProperties.add('mask-composite');
allProperties.add('mask-image');
allProperties.add('mask-mode');
allProperties.add('mask-origin');
allProperties.add('mask-position');
allProperties.add('mask-repeat');
allProperties.add('mask-size');
allProperties.add('mask-type');
allProperties.add('max-block-size');
allProperties.add('max-height');
allProperties.add('max-inline-size');
allProperties.add('max-lines');
allProperties.add('max-width');
allProperties.add('min-block-size');
allProperties.add('min-height');
allProperties.add('min-inline-size');
allProperties.add('min-width');
allProperties.add('mix-blend-mode');
allProperties.add('nav-down');
allProperties.add('nav-left');
allProperties.add('nav-right');
allProperties.add('nav-up');
allProperties.add('object-fit');
allProperties.add('object-position');
allProperties.add('offset');
allProperties.add('offset-after');
allProperties.add('offset-anchor');
allProperties.add('offset-before');
allProperties.add('offset-distance');
allProperties.add('offset-end');
allProperties.add('offset-path');
allProperties.add('offset-position');
allProperties.add('offset-rotate');
allProperties.add('offset-start');
allProperties.add('opacity');
allProperties.add('order');
allProperties.add('orphans');
allProperties.add('outline');
allProperties.add('outline-color');
allProperties.add('outline-offset');
allProperties.add('outline-style');
allProperties.add('outline-width');
allProperties.add('overflow');
allProperties.add('overflow-block');
allProperties.add('overflow-inline');
allProperties.add('overflow-wrap');
allProperties.add('overflow-x');
allProperties.add('overflow-y');
allProperties.add('padding');
allProperties.add('padding-block');
allProperties.add('padding-block-end');
allProperties.add('padding-block-start');
allProperties.add('padding-bottom');
allProperties.add('padding-inline');
allProperties.add('padding-inline-end');
allProperties.add('padding-inline-start');
allProperties.add('padding-left');
allProperties.add('padding-right');
allProperties.add('padding-top');
allProperties.add('page');
allProperties.add('page-break-after');
allProperties.add('page-break-before');
allProperties.add('page-break-inside');
allProperties.add('pause');
allProperties.add('pause-after');
allProperties.add('pause-before');
allProperties.add('pitch');
allProperties.add('pitch-range');
allProperties.add('place-content');
allProperties.add('place-items');
allProperties.add('place-self');
allProperties.add('play-during');
allProperties.add('position');
allProperties.add('presentation-level');
allProperties.add('quotes');
allProperties.add('region-fragment');
allProperties.add('resize');
allProperties.add('rest');
allProperties.add('rest-after');
allProperties.add('rest-before');
allProperties.add('richness');
allProperties.add('right');
allProperties.add('row-gap');
allProperties.add('ruby-align');
allProperties.add('ruby-merge');
allProperties.add('ruby-position');
allProperties.add('running');
allProperties.add('scroll-behavior');
allProperties.add('scroll-margin');
allProperties.add('scroll-margin-block');
allProperties.add('scroll-margin-block-end');
allProperties.add('scroll-margin-block-start');
allProperties.add('scroll-margin-bottom');
allProperties.add('scroll-margin-inline');
allProperties.add('scroll-margin-inline-end');
allProperties.add('scroll-margin-inline-start');
allProperties.add('scroll-margin-left');
allProperties.add('scroll-margin-right');
allProperties.add('scroll-margin-top');
allProperties.add('scroll-padding');
allProperties.add('scroll-padding-block');
allProperties.add('scroll-padding-block-end');
allProperties.add('scroll-padding-block-start');
allProperties.add('scroll-padding-bottom');
allProperties.add('scroll-padding-inline');
allProperties.add('scroll-padding-inline-end');
allProperties.add('scroll-padding-inline-start');
allProperties.add('scroll-padding-left');
allProperties.add('scroll-padding-right');
allProperties.add('scroll-padding-top');
allProperties.add('scroll-snap-align');
allProperties.add('scroll-snap-stop');
allProperties.add('scroll-snap-type');
allProperties.add('shape-image-threshold');
allProperties.add('shape-inside');
allProperties.add('shape-margin');
allProperties.add('shape-outside');
allProperties.add('speak');
allProperties.add('speak-as');
allProperties.add('speak-header');
allProperties.add('speak-numeral');
allProperties.add('speak-punctuation');
allProperties.add('speech-rate');
allProperties.add('stress');
allProperties.add('string-set');
allProperties.add('tab-size');
allProperties.add('table-layout');
allProperties.add('text-align');
allProperties.add('text-align-all');
allProperties.add('text-align-last');
allProperties.add('text-combine-upright');
allProperties.add('text-decoration');
allProperties.add('text-decoration-color');
allProperties.add('text-decoration-line');
allProperties.add('text-decoration-style');
allProperties.add('text-emphasis');
allProperties.add('text-emphasis-color');
allProperties.add('text-emphasis-position');
allProperties.add('text-emphasis-style');
allProperties.add('text-group-align');
allProperties.add('text-indent');
allProperties.add('text-justify');
allProperties.add('text-orientation');
allProperties.add('text-overflow');
allProperties.add('text-shadow');
allProperties.add('text-space-collapse');
allProperties.add('text-space-trim');
allProperties.add('text-spacing');
allProperties.add('text-transform');
allProperties.add('text-underline-position');
allProperties.add('text-wrap');
allProperties.add('top');
allProperties.add('transform');
allProperties.add('transform-box');
allProperties.add('transform-origin');
allProperties.add('transition');
allProperties.add('transition-delay');
allProperties.add('transition-duration');
allProperties.add('transition-property');
allProperties.add('transition-timing-function');
allProperties.add('unicode-bidi');
allProperties.add('user-select');
allProperties.add('vertical-align');
allProperties.add('visibility');
allProperties.add('voice-balance');
allProperties.add('voice-duration');
allProperties.add('voice-family');
allProperties.add('voice-pitch');
allProperties.add('voice-range');
allProperties.add('voice-rate');
allProperties.add('voice-stress');
allProperties.add('voice-volume');
allProperties.add('volume');
allProperties.add('white-space');
allProperties.add('widows');
allProperties.add('width');
allProperties.add('will-change');
allProperties.add('word-break');
allProperties.add('word-spacing');
allProperties.add('word-wrap');
allProperties.add('wrap-after');
allProperties.add('wrap-before');
allProperties.add('wrap-flow');
allProperties.add('wrap-inside');
allProperties.add('wrap-through');
allProperties.add('writing-mode');
allProperties.add('z-index');
module.exports = new Set([
'align-content',
'align-items',
'align-self',
'alignment-baseline',
'all',
'animation',
'animation-delay',
'animation-direction',
'animation-duration',
'animation-fill-mode',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-timing-function',
'appearance',
'azimuth',
'background',
'background-attachment',
'background-blend-mode',
'background-clip',
'background-color',
'background-image',
'background-origin',
'background-position',
'background-repeat',
'background-size',
'baseline-shift',
'block-overflow',
'block-size',
'bookmark-label',
'bookmark-level',
'bookmark-state',
'border',
'border-block',
'border-block-color',
'border-block-end',
'border-block-end-color',
'border-block-end-style',
'border-block-end-width',
'border-block-start',
'border-block-start-color',
'border-block-start-style',
'border-block-start-width',
'border-block-style',
'border-block-width',
'border-bottom',
'border-bottom-color',
'border-bottom-left-radius',
'border-bottom-right-radius',
'border-bottom-style',
'border-bottom-width',
'border-boundary',
'border-collapse',
'border-color',
'border-end-end-radius',
'border-end-start-radius',
'border-image',
'border-image-outset',
'border-image-repeat',
'border-image-slice',
'border-image-source',
'border-image-width',
'border-inline',
'border-inline-color',
'border-inline-end',
'border-inline-end-color',
'border-inline-end-style',
'border-inline-end-width',
'border-inline-start',
'border-inline-start-color',
'border-inline-start-style',
'border-inline-start-width',
'border-inline-style',
'border-inline-width',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-radius',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-start-end-radius',
'border-start-start-radius',
'border-style',
'border-top',
'border-top-color',
'border-top-left-radius',
'border-top-right-radius',
'border-top-style',
'border-top-width',
'border-width',
'bottom',
'box-decoration-break',
'box-shadow',
'box-sizing',
'box-snap',
'break-after',
'break-before',
'break-inside',
'caption-side',
'caret',
'caret-color',
'caret-shape',
'chains',
'clear',
'clip',
'clip-path',
'clip-rule',
'color',
'color-adjust',
'color-interpolation-filters',
'color-scheme',
'column-count',
'column-fill',
'column-gap',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'column-span',
'column-width',
'columns',
'contain',
'content',
'continue',
'counter-increment',
'counter-reset',
'counter-set',
'cue',
'cue-after',
'cue-before',
'cursor',
'direction',
'display',
'dominant-baseline',
'elevation',
'empty-cells',
'filter',
'flex',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-grow',
'flex-shrink',
'flex-wrap',
'float',
'flood-color',
'flood-opacity',
'flow',
'flow-from',
'flow-into',
'font',
'font-family',
'font-feature-settings',
'font-kerning',
'font-language-override',
'font-optical-sizing',
'font-palette',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-synthesis',
'font-synthesis-small-caps',
'font-synthesis-style',
'font-synthesis-weight',
'font-variant',
'font-variant-alternates',
'font-variant-caps',
'font-variant-east-asian',
'font-variant-emoji',
'font-variant-ligatures',
'font-variant-numeric',
'font-variant-position',
'font-variation-settings',
'font-weight',
'footnote-display',
'footnote-policy',
'forced-color-adjust',
'gap',
'glyph-orientation-vertical',
'grid',
'grid-area',
'grid-auto-columns',
'grid-auto-flow',
'grid-auto-rows',
'grid-column',
'grid-column-end',
'grid-column-start',
'grid-row',
'grid-row-end',
'grid-row-start',
'grid-template',
'grid-template-areas',
'grid-template-columns',
'grid-template-rows',
'hanging-punctuation',
'height',
'hyphenate-character',
'hyphenate-limit-chars',
'hyphenate-limit-last',
'hyphenate-limit-lines',
'hyphenate-limit-zone',
'hyphens',
'image-orientation',
'image-rendering',
'image-resolution',
'initial-letters',
'initial-letters-align',
'initial-letters-wrap',
'inline-size',
'inline-sizing',
'inset',
'inset-block',
'inset-block-end',
'inset-block-start',
'inset-inline',
'inset-inline-end',
'inset-inline-start',
'isolation',
'justify-content',
'justify-items',
'justify-self',
'left',
'letter-spacing',
'lighting-color',
'line-break',
'line-clamp',
'line-grid',
'line-height',
'line-padding',
'line-snap',
'list-style',
'list-style-image',
'list-style-position',
'list-style-type',
'margin',
'margin-block',
'margin-block-end',
'margin-block-start',
'margin-bottom',
'margin-inline',
'margin-inline-end',
'margin-inline-start',
'margin-left',
'margin-right',
'margin-top',
'marker-side',
'mask',
'mask-border',
'mask-border-mode',
'mask-border-outset',
'mask-border-repeat',
'mask-border-slice',
'mask-border-source',
'mask-border-width',
'mask-clip',
'mask-composite',
'mask-image',
'mask-mode',
'mask-origin',
'mask-position',
'mask-repeat',
'mask-size',
'mask-type',
'max-block-size',
'max-height',
'max-inline-size',
'max-lines',
'max-width',
'min-block-size',
'min-height',
'min-inline-size',
'min-width',
'mix-blend-mode',
'nav-down',
'nav-left',
'nav-right',
'nav-up',
'object-fit',
'object-position',
'offset',
'offset-after',
'offset-anchor',
'offset-before',
'offset-distance',
'offset-end',
'offset-path',
'offset-position',
'offset-rotate',
'offset-start',
'opacity',
'order',
'orphans',
'outline',
'outline-color',
'outline-offset',
'outline-style',
'outline-width',
'overflow',
'overflow-block',
'overflow-inline',
'overflow-wrap',
'overflow-x',
'overflow-y',
'padding',
'padding-block',
'padding-block-end',
'padding-block-start',
'padding-bottom',
'padding-inline',
'padding-inline-end',
'padding-inline-start',
'padding-left',
'padding-right',
'padding-top',
'page',
'page-break-after',
'page-break-before',
'page-break-inside',
'pause',
'pause-after',
'pause-before',
'pitch',
'pitch-range',
'place-content',
'place-items',
'place-self',
'play-during',
'position',
'quotes',
'region-fragment',
'resize',
'rest',
'rest-after',
'rest-before',
'richness',
'right',
'row-gap',
'ruby-align',
'ruby-merge',
'ruby-position',
'running',
'scroll-behavior',
'scroll-margin',
'scroll-margin-block',
'scroll-margin-block-end',
'scroll-margin-block-start',
'scroll-margin-bottom',
'scroll-margin-inline',
'scroll-margin-inline-end',
'scroll-margin-inline-start',
'scroll-margin-left',
'scroll-margin-right',
'scroll-margin-top',
'scroll-padding',
'scroll-padding-block',
'scroll-padding-block-end',
'scroll-padding-block-start',
'scroll-padding-bottom',
'scroll-padding-inline',
'scroll-padding-inline-end',
'scroll-padding-inline-start',
'scroll-padding-left',
'scroll-padding-right',
'scroll-padding-top',
'scroll-snap-align',
'scroll-snap-stop',
'scroll-snap-type',
'shape-image-threshold',
'shape-inside',
'shape-margin',
'shape-outside',
'spatial-navigation-action',
'spatial-navigation-contain',
'spatial-navigation-function',
'speak',
'speak-as',
'speak-header',
'speak-numeral',
'speak-punctuation',
'speech-rate',
'stress',
'string-set',
'tab-size',
'table-layout',
'text-align',
'text-align-all',
'text-align-last',
'text-combine-upright',
'text-decoration',
'text-decoration-color',
'text-decoration-line',
'text-decoration-style',
'text-emphasis',
'text-emphasis-color',
'text-emphasis-position',
'text-emphasis-style',
'text-group-align',
'text-indent',
'text-justify',
'text-orientation',
'text-overflow',
'text-shadow',
'text-space-collapse',
'text-space-trim',
'text-spacing',
'text-transform',
'text-underline-position',
'text-wrap',
'top',
'transform',
'transform-box',
'transform-origin',
'transition',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'unicode-bidi',
'user-select',
'vertical-align',
'visibility',
'voice-balance',
'voice-duration',
'voice-family',
'voice-pitch',
'voice-range',
'voice-rate',
'voice-stress',
'voice-volume',
'volume',
'white-space',
'widows',
'width',
'will-change',
'word-boundary-detection',
'word-boundary-expansion',
'word-break',
'word-spacing',
'word-wrap',
'wrap-after',
'wrap-before',
'wrap-flow',
'wrap-inside',
'wrap-through',
'writing-mode',
'z-index',
]);

194
node_modules/cssstyle/lib/allWebkitProperties.js generated vendored Normal file
View File

@@ -0,0 +1,194 @@
'use strict';
/**
* This file contains all implemented properties that are not a part of any
* current specifications or drafts, but are handled by browsers nevertheless.
*/
module.exports = [
'animation',
'animation-delay',
'animation-direction',
'animation-duration',
'animation-fill-mode',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-timing-function',
'appearance',
'aspect-ratio',
'backface-visibility',
'background-clip',
'background-composite',
'background-origin',
'background-size',
'border-after',
'border-after-color',
'border-after-style',
'border-after-width',
'border-before',
'border-before-color',
'border-before-style',
'border-before-width',
'border-end',
'border-end-color',
'border-end-style',
'border-end-width',
'border-fit',
'border-horizontal-spacing',
'border-image',
'border-radius',
'border-start',
'border-start-color',
'border-start-style',
'border-start-width',
'border-vertical-spacing',
'box-align',
'box-direction',
'box-flex',
'box-flex-group',
'box-lines',
'box-ordinal-group',
'box-orient',
'box-pack',
'box-reflect',
'box-shadow',
'color-correction',
'column-axis',
'column-break-after',
'column-break-before',
'column-break-inside',
'column-count',
'column-gap',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'columns',
'column-span',
'column-width',
'filter',
'flex-align',
'flex-direction',
'flex-flow',
'flex-item-align',
'flex-line-pack',
'flex-order',
'flex-pack',
'flex-wrap',
'flow-from',
'flow-into',
'font-feature-settings',
'font-kerning',
'font-size-delta',
'font-smoothing',
'font-variant-ligatures',
'highlight',
'hyphenate-character',
'hyphenate-limit-after',
'hyphenate-limit-before',
'hyphenate-limit-lines',
'hyphens',
'line-align',
'line-box-contain',
'line-break',
'line-clamp',
'line-grid',
'line-snap',
'locale',
'logical-height',
'logical-width',
'margin-after',
'margin-after-collapse',
'margin-before',
'margin-before-collapse',
'margin-bottom-collapse',
'margin-collapse',
'margin-end',
'margin-start',
'margin-top-collapse',
'marquee',
'marquee-direction',
'marquee-increment',
'marquee-repetition',
'marquee-speed',
'marquee-style',
'mask',
'mask-attachment',
'mask-box-image',
'mask-box-image-outset',
'mask-box-image-repeat',
'mask-box-image-slice',
'mask-box-image-source',
'mask-box-image-width',
'mask-clip',
'mask-composite',
'mask-image',
'mask-origin',
'mask-position',
'mask-position-x',
'mask-position-y',
'mask-repeat',
'mask-repeat-x',
'mask-repeat-y',
'mask-size',
'match-nearest-mail-blockquote-color',
'max-logical-height',
'max-logical-width',
'min-logical-height',
'min-logical-width',
'nbsp-mode',
'overflow-scrolling',
'padding-after',
'padding-before',
'padding-end',
'padding-start',
'perspective',
'perspective-origin',
'perspective-origin-x',
'perspective-origin-y',
'print-color-adjust',
'region-break-after',
'region-break-before',
'region-break-inside',
'region-overflow',
'rtl-ordering',
'svg-shadow',
'tap-highlight-color',
'text-combine',
'text-decorations-in-effect',
'text-emphasis',
'text-emphasis-color',
'text-emphasis-position',
'text-emphasis-style',
'text-fill-color',
'text-orientation',
'text-security',
'text-size-adjust',
'text-stroke',
'text-stroke-color',
'text-stroke-width',
'transform',
'transform-origin',
'transform-origin-x',
'transform-origin-y',
'transform-origin-z',
'transform-style',
'transition',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'user-drag',
'user-modify',
'user-select',
'wrap',
'wrap-flow',
'wrap-margin',
'wrap-padding',
'wrap-shape-inside',
'wrap-shape-outside',
'wrap-through',
'writing-mode',
'zoom',
].map(prop => 'webkit-' + prop);

View File

@@ -1,6 +1,6 @@
'use strict';
// autogenerated - 7/15/2019
// autogenerated - 4/29/2020
/*
*

41
node_modules/cssstyle/lib/parsers.js generated vendored
View File

@@ -5,6 +5,7 @@
'use strict';
const namedColors = require('./named_colors.json');
const { hslToRgb } = require('./utils/colorSpace');
exports.TYPES = {
INTEGER: 1,
@@ -17,18 +18,20 @@ exports.TYPES = {
ANGLE: 8,
KEYWORD: 9,
NULL_OR_EMPTY_STR: 10,
CALC: 11,
};
// rough regular expressions
var integerRegEx = /^[-+]?[0-9]+$/;
var numberRegEx = /^[-+]?[0-9]*\.[0-9]+$/;
var lengthRegEx = /^(0|[-+]?[0-9]*\.?[0-9]+(in|cm|em|mm|pt|pc|px|ex|rem|vh|vw))$/;
var numberRegEx = /^[-+]?[0-9]*\.?[0-9]+$/;
var lengthRegEx = /^(0|[-+]?[0-9]*\.?[0-9]+(in|cm|em|mm|pt|pc|px|ex|rem|vh|vw|ch))$/;
var percentRegEx = /^[-+]?[0-9]*\.?[0-9]+%$/;
var urlRegEx = /^url\(\s*([^)]*)\s*\)$/;
var stringRegEx = /^("[^"]*"|'[^']*')$/;
var colorRegEx1 = /^#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])?$/;
var colorRegEx1 = /^#([0-9a-fA-F]{3,4}){1,2}$/;
var colorRegEx2 = /^rgb\(([^)]*)\)$/;
var colorRegEx3 = /^rgba\(([^)]*)\)$/;
var calcRegEx = /^calc\(([^)]*)\)$/;
var colorRegEx4 = /^hsla?\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*(,\s*(-?\d+|-?\d*.\d+)\s*)?\)/;
var angleRegEx = /^([-+]?[0-9]*\.?[0-9]+)(deg|grad|rad)$/;
@@ -60,6 +63,9 @@ exports.valueType = function valueType(val) {
if (urlRegEx.test(val)) {
return exports.TYPES.URL;
}
if (calcRegEx.test(val)) {
return exports.TYPES.CALC;
}
if (stringRegEx.test(val)) {
return exports.TYPES.STRING;
}
@@ -69,6 +75,7 @@ exports.valueType = function valueType(val) {
if (colorRegEx1.test(val)) {
return exports.TYPES.COLOR;
}
var res = colorRegEx2.exec(val);
var parts;
if (res !== null) {
@@ -92,7 +99,7 @@ exports.valueType = function valueType(val) {
}
if (
parts.slice(0, 3).every(percentRegEx.test.bind(percentRegEx)) ||
parts.every(integerRegEx.test.bind(integerRegEx))
parts.slice(0, 3).every(integerRegEx.test.bind(integerRegEx))
) {
if (numberRegEx.test(parts[3])) {
return exports.TYPES.COLOR;
@@ -200,6 +207,11 @@ exports.parsePercent = function parsePercent(val) {
// either a length or a percent
exports.parseMeasurement = function parseMeasurement(val) {
var type = exports.valueType(val);
if (type === exports.TYPES.CALC) {
return val;
}
var length = exports.parseLength(val);
if (length !== undefined) {
return length;
@@ -287,15 +299,26 @@ exports.parseColor = function parseColor(val) {
alpha = 1;
var parts;
var res = colorRegEx1.exec(val);
// is it #aaa or #ababab
// is it #aaa, #ababab, #aaaa, #abababaa
if (res) {
var defaultHex = val.substr(1);
var hex = val.substr(1);
if (hex.length === 3) {
if (hex.length === 3 || hex.length === 4) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
if (defaultHex.length === 4) {
hex = hex + defaultHex[3] + defaultHex[3];
}
}
red = parseInt(hex.substr(0, 2), 16);
green = parseInt(hex.substr(2, 2), 16);
blue = parseInt(hex.substr(4, 2), 16);
if (hex.length === 8) {
var hexAlpha = hex.substr(6, 2);
var hexAlphaToRgbaAlpha = Number((parseInt(hexAlpha, 16) / 255).toFixed(3));
return 'rgba(' + red + ', ' + green + ', ' + blue + ', ' + hexAlphaToRgbaAlpha + ')';
}
return 'rgb(' + red + ', ' + green + ', ' + blue + ')';
}
@@ -367,10 +390,12 @@ exports.parseColor = function parseColor(val) {
if (_alpha && numberRegEx.test(_alpha)) {
alpha = parseFloat(_alpha);
}
const [r, g, b] = hslToRgb(hue, saturation / 100, lightness / 100);
if (!_alphaString || alpha === 1) {
return 'hsl(' + hue + ', ' + saturation + '%, ' + lightness + '%)';
return 'rgb(' + r + ', ' + g + ', ' + b + ')';
}
return 'hsla(' + hue + ', ' + saturation + '%, ' + lightness + '%, ' + alpha + ')';
return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + alpha + ')';
}
if (type === exports.TYPES.COLOR) {

139
node_modules/cssstyle/lib/parsers.test.js generated vendored Normal file
View File

@@ -0,0 +1,139 @@
'use strict';
const parsers = require('./parsers');
describe('valueType', () => {
it('returns color for red', () => {
let input = 'red';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.COLOR);
});
it('returns color for #nnnnnn', () => {
let input = '#fefefe';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.COLOR);
});
it('returns color for rgb(n, n, n)', () => {
let input = 'rgb(10, 10, 10)';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.COLOR);
});
it('returns color for rgb(p, p, p)', () => {
let input = 'rgb(10%, 10%, 10%)';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.COLOR);
});
it('returns color for rgba(n, n, n, n)', () => {
let input = 'rgba(10, 10, 10, 1)';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.COLOR);
});
it('returns color for rgba(n, n, n, n) with decimal alpha', () => {
let input = 'rgba(10, 10, 10, 0.5)';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.COLOR);
});
it('returns color for rgba(p, p, p, n)', () => {
let input = 'rgba(10%, 10%, 10%, 1)';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.COLOR);
});
it('returns color for rgba(p, p, p, n) with decimal alpha', () => {
let input = 'rgba(10%, 10%, 10%, 0.5)';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.COLOR);
});
it('returns length for 100ch', () => {
let input = '100ch';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.LENGTH);
});
it('returns calc from calc(100px * 2)', () => {
let input = 'calc(100px * 2)';
let output = parsers.valueType(input);
expect(output).toEqual(parsers.TYPES.CALC);
});
});
describe('parseInteger', () => {
it.todo('test');
});
describe('parseNumber', () => {
it.todo('test');
});
describe('parseLength', () => {
it.todo('test');
});
describe('parsePercent', () => {
it.todo('test');
});
describe('parseMeasurement', () => {
it.todo('test');
});
describe('parseUrl', () => {
it.todo('test');
});
describe('parseString', () => {
it.todo('test');
});
describe('parseColor', () => {
it('should convert hsl to rgb values', () => {
let input = 'hsla(0, 1%, 2%)';
let output = parsers.parseColor(input);
expect(output).toEqual('rgb(5, 5, 5)');
});
it('should convert hsla to rgba values', () => {
let input = 'hsla(0, 1%, 2%, 0.5)';
let output = parsers.parseColor(input);
expect(output).toEqual('rgba(5, 5, 5, 0.5)');
});
it.todo('Add more tests');
});
describe('parseAngle', () => {
it.todo('test');
});
describe('parseKeyword', () => {
it.todo('test');
});
describe('dashedToCamelCase', () => {
it.todo('test');
});
describe('shorthandParser', () => {
it.todo('test');
});
describe('shorthandSetter', () => {
it.todo('test');
});
describe('shorthandGetter', () => {
it.todo('test');
});
describe('implicitSetter', () => {
it.todo('test');
});
describe('subImplicitSetter', () => {
it.todo('test');
});
describe('camelToDashed', () => {
it.todo('test');
});

View File

@@ -1,6 +1,6 @@
'use strict';
// autogenerated - 7/15/2019
// autogenerated - 4/29/2020
/*
*
@@ -1040,9 +1040,16 @@ fontSize_export_isValid = function (v) {
return type === external_dependency_parsers_0.TYPES.LENGTH || type === external_dependency_parsers_0.TYPES.PERCENT || type === external_dependency_parsers_0.TYPES.KEYWORD && fontSize_local_var_absoluteSizes.indexOf(v.toLowerCase()) !== -1 || type === external_dependency_parsers_0.TYPES.KEYWORD && fontSize_local_var_relativeSizes.indexOf(v.toLowerCase()) !== -1;
};
function fontSize_local_fn_parse(v) {
const valueAsString = String(v).toLowerCase();
const optionalArguments = fontSize_local_var_absoluteSizes.concat(fontSize_local_var_relativeSizes);
const isOptionalArgument = optionalArguments.some(stringValue => stringValue.toLowerCase() === valueAsString);
return isOptionalArgument ? valueAsString : external_dependency_parsers_0.parseMeasurement(v);
}
fontSize_export_definition = {
set: function (v) {
this._setProperty('font-size', v);
this._setProperty('font-size', fontSize_local_fn_parse(v));
},
get: function () {
return this.getPropertyValue('font-size');

View File

@@ -2,6 +2,7 @@
var TYPES = require('../parsers').TYPES;
var valueType = require('../parsers').valueType;
var parseMeasurement = require('../parsers').parseMeasurement;
var absoluteSizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
var relativeSizes = ['larger', 'smaller'];
@@ -16,9 +17,18 @@ module.exports.isValid = function(v) {
);
};
function parse(v) {
const valueAsString = String(v).toLowerCase();
const optionalArguments = absoluteSizes.concat(relativeSizes);
const isOptionalArgument = optionalArguments.some(
stringValue => stringValue.toLowerCase() === valueAsString
);
return isOptionalArgument ? valueAsString : parseMeasurement(v);
}
module.exports.definition = {
set: function(v) {
this._setProperty('font-size', v);
this._setProperty('font-size', parse(v));
},
get: function() {
return this.getPropertyValue('font-size');

21
node_modules/cssstyle/lib/utils/colorSpace.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
const hueToRgb = (t1, t2, hue) => {
if (hue < 0) hue += 6;
if (hue >= 6) hue -= 6;
if (hue < 1) return (t2 - t1) * hue + t1;
else if (hue < 3) return t2;
else if (hue < 4) return (t2 - t1) * (4 - hue) + t1;
else return t1;
};
// https://www.w3.org/TR/css-color-4/#hsl-to-rgb
exports.hslToRgb = (hue, sat, light) => {
const t2 = light <= 0.5 ? light * (sat + 1) : light + sat - light * sat;
const t1 = light * 2 - t2;
const r = hueToRgb(t1, t2, hue + 2);
const g = hueToRgb(t1, t2, hue);
const b = hueToRgb(t1, t2, hue - 2);
return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];
};