cssstyle 2.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/CSSStyleDeclaration.js +31 -25
- package/lib/CSSStyleDeclaration.test.js +187 -6
- package/lib/allProperties.js +66 -9
- package/lib/allWebkitProperties.js +1 -1
- package/lib/implementedProperties.js +1 -1
- package/lib/parsers.js +43 -30
- package/lib/parsers.test.js +8 -1
- package/lib/properties/azimuth.js +3 -6
- package/lib/properties/backgroundAttachment.js +2 -2
- package/lib/properties/backgroundColor.js +2 -2
- package/lib/properties/backgroundImage.js +2 -2
- package/lib/properties/backgroundPosition.js +3 -3
- package/lib/properties/backgroundRepeat.js +2 -2
- package/lib/properties/border.js +1 -1
- package/lib/properties/borderBottomColor.js +2 -2
- package/lib/properties/borderBottomStyle.js +2 -2
- package/lib/properties/borderBottomWidth.js +2 -2
- package/lib/properties/borderCollapse.js +2 -2
- package/lib/properties/borderColor.js +2 -2
- package/lib/properties/borderLeftColor.js +2 -2
- package/lib/properties/borderLeftStyle.js +2 -2
- package/lib/properties/borderLeftWidth.js +2 -2
- package/lib/properties/borderRightColor.js +2 -2
- package/lib/properties/borderRightStyle.js +2 -2
- package/lib/properties/borderRightWidth.js +2 -2
- package/lib/properties/borderSpacing.js +3 -3
- package/lib/properties/borderStyle.js +2 -2
- package/lib/properties/borderTopColor.js +2 -2
- package/lib/properties/borderTopStyle.js +2 -2
- package/lib/properties/borderTopWidth.js +2 -2
- package/lib/properties/borderWidth.js +2 -2
- package/lib/properties/bottom.js +2 -2
- package/lib/properties/clear.js +2 -2
- package/lib/properties/clip.js +4 -4
- package/lib/properties/color.js +2 -2
- package/lib/properties/cssFloat.js +2 -2
- package/lib/properties/flex.js +2 -4
- package/lib/properties/flexBasis.js +2 -2
- package/lib/properties/flexGrow.js +2 -2
- package/lib/properties/flexShrink.js +2 -2
- package/lib/properties/float.js +2 -2
- package/lib/properties/floodColor.js +2 -2
- package/lib/properties/font.js +1 -1
- package/lib/properties/fontFamily.js +2 -2
- package/lib/properties/fontSize.js +4 -4
- package/lib/properties/fontStyle.js +3 -3
- package/lib/properties/fontVariant.js +2 -2
- package/lib/properties/fontWeight.js +2 -2
- package/lib/properties/height.js +2 -2
- package/lib/properties/left.js +2 -2
- package/lib/properties/lightingColor.js +2 -2
- package/lib/properties/lineHeight.js +2 -2
- package/lib/properties/margin.js +10 -6
- package/lib/properties/marginBottom.js +1 -1
- package/lib/properties/marginLeft.js +1 -1
- package/lib/properties/marginRight.js +1 -1
- package/lib/properties/marginTop.js +1 -1
- package/lib/properties/opacity.js +2 -2
- package/lib/properties/outlineColor.js +2 -2
- package/lib/properties/padding.js +10 -6
- package/lib/properties/paddingBottom.js +1 -1
- package/lib/properties/paddingLeft.js +1 -1
- package/lib/properties/paddingRight.js +1 -1
- package/lib/properties/paddingTop.js +1 -1
- package/lib/properties/right.js +2 -2
- package/lib/properties/stopColor.js +2 -2
- package/lib/properties/textLineThroughColor.js +2 -2
- package/lib/properties/textOverlineColor.js +2 -2
- package/lib/properties/textUnderlineColor.js +2 -2
- package/lib/properties/top.js +2 -2
- package/lib/properties/webkitBorderAfterColor.js +2 -2
- package/lib/properties/webkitBorderBeforeColor.js +2 -2
- package/lib/properties/webkitBorderEndColor.js +2 -2
- package/lib/properties/webkitBorderStartColor.js +2 -2
- package/lib/properties/webkitColumnRuleColor.js +2 -2
- package/lib/properties/webkitMatchNearestMailBlockquoteColor.js +2 -2
- package/lib/properties/webkitTapHighlightColor.js +2 -2
- package/lib/properties/webkitTextEmphasisColor.js +2 -2
- package/lib/properties/webkitTextFillColor.js +2 -2
- package/lib/properties/webkitTextStrokeColor.js +2 -2
- package/lib/properties/width.js +2 -2
- package/lib/properties.js +11 -3
- package/lib/utils/colorSpace.js +13 -15
- package/lib/utils/getBasicPropertyDescriptor.js +2 -2
- package/package.json +14 -15
package/lib/properties/clip.js
CHANGED
|
@@ -4,7 +4,7 @@ var parseMeasurement = require('../parsers').parseMeasurement;
|
|
|
4
4
|
|
|
5
5
|
var shape_regex = /^rect\((.*)\)$/i;
|
|
6
6
|
|
|
7
|
-
var parse = function(val) {
|
|
7
|
+
var parse = function (val) {
|
|
8
8
|
if (val === '' || val === null) {
|
|
9
9
|
return val;
|
|
10
10
|
}
|
|
@@ -23,7 +23,7 @@ var parse = function(val) {
|
|
|
23
23
|
if (parts.length !== 4) {
|
|
24
24
|
return undefined;
|
|
25
25
|
}
|
|
26
|
-
var valid = parts.every(function(part, index) {
|
|
26
|
+
var valid = parts.every(function (part, index) {
|
|
27
27
|
var measurement = parseMeasurement(part);
|
|
28
28
|
parts[index] = measurement;
|
|
29
29
|
return measurement !== undefined;
|
|
@@ -36,10 +36,10 @@ var parse = function(val) {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
module.exports.definition = {
|
|
39
|
-
set: function(v) {
|
|
39
|
+
set: function (v) {
|
|
40
40
|
this._setProperty('clip', parse(v));
|
|
41
41
|
},
|
|
42
|
-
get: function() {
|
|
42
|
+
get: function () {
|
|
43
43
|
return this.getPropertyValue('clip');
|
|
44
44
|
},
|
|
45
45
|
enumerable: true,
|
package/lib/properties/color.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
package/lib/properties/flex.js
CHANGED
|
@@ -17,10 +17,8 @@ module.exports.isValid = function isValid(v) {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
module.exports.definition = {
|
|
20
|
-
set: function(v) {
|
|
21
|
-
var normalizedValue = String(v)
|
|
22
|
-
.trim()
|
|
23
|
-
.toLowerCase();
|
|
20
|
+
set: function (v) {
|
|
21
|
+
var normalizedValue = String(v).trim().toLowerCase();
|
|
24
22
|
|
|
25
23
|
if (normalizedValue === 'none') {
|
|
26
24
|
myShorthandSetter.call(this, '0 0 auto');
|
|
@@ -17,10 +17,10 @@ module.exports.isValid = function isValid(v) {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
module.exports.definition = {
|
|
20
|
-
set: function(v) {
|
|
20
|
+
set: function (v) {
|
|
21
21
|
this._setProperty('flex-basis', parse(v));
|
|
22
22
|
},
|
|
23
|
-
get: function() {
|
|
23
|
+
get: function () {
|
|
24
24
|
return this.getPropertyValue('flex-basis');
|
|
25
25
|
},
|
|
26
26
|
enumerable: true,
|
|
@@ -8,10 +8,10 @@ module.exports.isValid = function isValid(v, positionAtFlexShorthand) {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
module.exports.definition = {
|
|
11
|
-
set: function(v) {
|
|
11
|
+
set: function (v) {
|
|
12
12
|
this._setProperty('flex-grow', parseNumber(v));
|
|
13
13
|
},
|
|
14
|
-
get: function() {
|
|
14
|
+
get: function () {
|
|
15
15
|
return this.getPropertyValue('flex-grow');
|
|
16
16
|
},
|
|
17
17
|
enumerable: true,
|
|
@@ -8,10 +8,10 @@ module.exports.isValid = function isValid(v, positionAtFlexShorthand) {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
module.exports.definition = {
|
|
11
|
-
set: function(v) {
|
|
11
|
+
set: function (v) {
|
|
12
12
|
this._setProperty('flex-shrink', parseNumber(v));
|
|
13
13
|
},
|
|
14
|
-
get: function() {
|
|
14
|
+
get: function () {
|
|
15
15
|
return this.getPropertyValue('flex-shrink');
|
|
16
16
|
},
|
|
17
17
|
enumerable: true,
|
package/lib/properties/float.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('flood-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('flood-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
package/lib/properties/font.js
CHANGED
|
@@ -28,7 +28,7 @@ var static_fonts = [
|
|
|
28
28
|
var setter = shorthandSetter('font', shorthand_for);
|
|
29
29
|
|
|
30
30
|
module.exports.definition = {
|
|
31
|
-
set: function(v) {
|
|
31
|
+
set: function (v) {
|
|
32
32
|
var short = shorthandParser(v, shorthand_for);
|
|
33
33
|
if (short !== undefined) {
|
|
34
34
|
return setter.call(this, v);
|
|
@@ -22,10 +22,10 @@ module.exports.isValid = function isValid(v) {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
module.exports.definition = {
|
|
25
|
-
set: function(v) {
|
|
25
|
+
set: function (v) {
|
|
26
26
|
this._setProperty('font-family', v);
|
|
27
27
|
},
|
|
28
|
-
get: function() {
|
|
28
|
+
get: function () {
|
|
29
29
|
return this.getPropertyValue('font-family');
|
|
30
30
|
},
|
|
31
31
|
enumerable: true,
|
|
@@ -7,7 +7,7 @@ var parseMeasurement = require('../parsers').parseMeasurement;
|
|
|
7
7
|
var absoluteSizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
|
|
8
8
|
var relativeSizes = ['larger', 'smaller'];
|
|
9
9
|
|
|
10
|
-
module.exports.isValid = function(v) {
|
|
10
|
+
module.exports.isValid = function (v) {
|
|
11
11
|
var type = valueType(v.toLowerCase());
|
|
12
12
|
return (
|
|
13
13
|
type === TYPES.LENGTH ||
|
|
@@ -21,16 +21,16 @@ function parse(v) {
|
|
|
21
21
|
const valueAsString = String(v).toLowerCase();
|
|
22
22
|
const optionalArguments = absoluteSizes.concat(relativeSizes);
|
|
23
23
|
const isOptionalArgument = optionalArguments.some(
|
|
24
|
-
stringValue => stringValue.toLowerCase() === valueAsString
|
|
24
|
+
(stringValue) => stringValue.toLowerCase() === valueAsString
|
|
25
25
|
);
|
|
26
26
|
return isOptionalArgument ? valueAsString : parseMeasurement(v);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
module.exports.definition = {
|
|
30
|
-
set: function(v) {
|
|
30
|
+
set: function (v) {
|
|
31
31
|
this._setProperty('font-size', parse(v));
|
|
32
32
|
},
|
|
33
|
-
get: function() {
|
|
33
|
+
get: function () {
|
|
34
34
|
return this.getPropertyValue('font-size');
|
|
35
35
|
},
|
|
36
36
|
enumerable: true,
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
var valid_styles = ['normal', 'italic', 'oblique', 'inherit'];
|
|
4
4
|
|
|
5
|
-
module.exports.isValid = function(v) {
|
|
5
|
+
module.exports.isValid = function (v) {
|
|
6
6
|
return valid_styles.indexOf(v.toLowerCase()) !== -1;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
module.exports.definition = {
|
|
10
|
-
set: function(v) {
|
|
10
|
+
set: function (v) {
|
|
11
11
|
this._setProperty('font-style', v);
|
|
12
12
|
},
|
|
13
|
-
get: function() {
|
|
13
|
+
get: function () {
|
|
14
14
|
return this.getPropertyValue('font-style');
|
|
15
15
|
},
|
|
16
16
|
enumerable: true,
|
|
@@ -7,10 +7,10 @@ module.exports.isValid = function isValid(v) {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
module.exports.definition = {
|
|
10
|
-
set: function(v) {
|
|
10
|
+
set: function (v) {
|
|
11
11
|
this._setProperty('font-variant', v);
|
|
12
12
|
},
|
|
13
|
-
get: function() {
|
|
13
|
+
get: function () {
|
|
14
14
|
return this.getPropertyValue('font-variant');
|
|
15
15
|
},
|
|
16
16
|
enumerable: true,
|
|
@@ -22,10 +22,10 @@ module.exports.isValid = function isValid(v) {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
module.exports.definition = {
|
|
25
|
-
set: function(v) {
|
|
25
|
+
set: function (v) {
|
|
26
26
|
this._setProperty('font-weight', v);
|
|
27
27
|
},
|
|
28
|
-
get: function() {
|
|
28
|
+
get: function () {
|
|
29
29
|
return this.getPropertyValue('font-weight');
|
|
30
30
|
},
|
|
31
31
|
enumerable: true,
|
package/lib/properties/height.js
CHANGED
|
@@ -13,10 +13,10 @@ function parse(v) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
module.exports.definition = {
|
|
16
|
-
set: function(v) {
|
|
16
|
+
set: function (v) {
|
|
17
17
|
this._setProperty('height', parse(v));
|
|
18
18
|
},
|
|
19
|
-
get: function() {
|
|
19
|
+
get: function () {
|
|
20
20
|
return this.getPropertyValue('height');
|
|
21
21
|
},
|
|
22
22
|
enumerable: true,
|
package/lib/properties/left.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseMeasurement = require('../parsers').parseMeasurement;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('left', parseMeasurement(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('left');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('lighting-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('lighting-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -15,10 +15,10 @@ module.exports.isValid = function isValid(v) {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
module.exports.definition = {
|
|
18
|
-
set: function(v) {
|
|
18
|
+
set: function (v) {
|
|
19
19
|
this._setProperty('line-height', v);
|
|
20
20
|
},
|
|
21
|
-
get: function() {
|
|
21
|
+
get: function () {
|
|
22
22
|
return this.getPropertyValue('line-height');
|
|
23
23
|
},
|
|
24
24
|
enumerable: true,
|
package/lib/properties/margin.js
CHANGED
|
@@ -3,19 +3,20 @@
|
|
|
3
3
|
var parsers = require('../parsers.js');
|
|
4
4
|
var TYPES = parsers.TYPES;
|
|
5
5
|
|
|
6
|
-
var isValid = function(v) {
|
|
6
|
+
var isValid = function (v) {
|
|
7
7
|
if (v.toLowerCase() === 'auto') {
|
|
8
8
|
return true;
|
|
9
9
|
}
|
|
10
10
|
var type = parsers.valueType(v);
|
|
11
11
|
return (
|
|
12
|
+
type === TYPES.NULL_OR_EMPTY_STR ||
|
|
12
13
|
type === TYPES.LENGTH ||
|
|
13
14
|
type === TYPES.PERCENT ||
|
|
14
15
|
(type === TYPES.INTEGER && (v === '0' || v === 0))
|
|
15
16
|
);
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
var parser = function(v) {
|
|
19
|
+
var parser = function (v) {
|
|
19
20
|
var V = v.toLowerCase();
|
|
20
21
|
if (V === 'auto') {
|
|
21
22
|
return V;
|
|
@@ -27,19 +28,22 @@ var mySetter = parsers.implicitSetter('margin', '', isValid, parser);
|
|
|
27
28
|
var myGlobal = parsers.implicitSetter(
|
|
28
29
|
'margin',
|
|
29
30
|
'',
|
|
30
|
-
function() {
|
|
31
|
+
function () {
|
|
31
32
|
return true;
|
|
32
33
|
},
|
|
33
|
-
function(v) {
|
|
34
|
+
function (v) {
|
|
34
35
|
return v;
|
|
35
36
|
}
|
|
36
37
|
);
|
|
37
38
|
|
|
38
39
|
module.exports.definition = {
|
|
39
|
-
set: function(v) {
|
|
40
|
+
set: function (v) {
|
|
40
41
|
if (typeof v === 'number') {
|
|
41
42
|
v = String(v);
|
|
42
43
|
}
|
|
44
|
+
if (v === null) {
|
|
45
|
+
v = '';
|
|
46
|
+
}
|
|
43
47
|
if (typeof v !== 'string') {
|
|
44
48
|
return;
|
|
45
49
|
}
|
|
@@ -57,7 +61,7 @@ module.exports.definition = {
|
|
|
57
61
|
break;
|
|
58
62
|
}
|
|
59
63
|
},
|
|
60
|
-
get: function() {
|
|
64
|
+
get: function () {
|
|
61
65
|
return this.getPropertyValue('margin');
|
|
62
66
|
},
|
|
63
67
|
enumerable: true,
|
|
@@ -5,7 +5,7 @@ var parsers = require('../parsers.js');
|
|
|
5
5
|
|
|
6
6
|
module.exports.definition = {
|
|
7
7
|
set: parsers.subImplicitSetter('margin', 'bottom', margin.isValid, margin.parser),
|
|
8
|
-
get: function() {
|
|
8
|
+
get: function () {
|
|
9
9
|
return this.getPropertyValue('margin-bottom');
|
|
10
10
|
},
|
|
11
11
|
enumerable: true,
|
|
@@ -5,7 +5,7 @@ var parsers = require('../parsers.js');
|
|
|
5
5
|
|
|
6
6
|
module.exports.definition = {
|
|
7
7
|
set: parsers.subImplicitSetter('margin', 'left', margin.isValid, margin.parser),
|
|
8
|
-
get: function() {
|
|
8
|
+
get: function () {
|
|
9
9
|
return this.getPropertyValue('margin-left');
|
|
10
10
|
},
|
|
11
11
|
enumerable: true,
|
|
@@ -5,7 +5,7 @@ var parsers = require('../parsers.js');
|
|
|
5
5
|
|
|
6
6
|
module.exports.definition = {
|
|
7
7
|
set: parsers.subImplicitSetter('margin', 'right', margin.isValid, margin.parser),
|
|
8
|
-
get: function() {
|
|
8
|
+
get: function () {
|
|
9
9
|
return this.getPropertyValue('margin-right');
|
|
10
10
|
},
|
|
11
11
|
enumerable: true,
|
|
@@ -5,7 +5,7 @@ var parsers = require('../parsers.js');
|
|
|
5
5
|
|
|
6
6
|
module.exports.definition = {
|
|
7
7
|
set: parsers.subImplicitSetter('margin', 'top', margin.isValid, margin.parser),
|
|
8
|
-
get: function() {
|
|
8
|
+
get: function () {
|
|
9
9
|
return this.getPropertyValue('margin-top');
|
|
10
10
|
},
|
|
11
11
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseNumber = require('../parsers').parseNumber;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('opacity', parseNumber(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('opacity');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('outline-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('outline-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
var parsers = require('../parsers.js');
|
|
4
4
|
var TYPES = parsers.TYPES;
|
|
5
5
|
|
|
6
|
-
var isValid = function(v) {
|
|
6
|
+
var isValid = function (v) {
|
|
7
7
|
var type = parsers.valueType(v);
|
|
8
8
|
return (
|
|
9
|
+
type === TYPES.NULL_OR_EMPTY_STR ||
|
|
9
10
|
type === TYPES.LENGTH ||
|
|
10
11
|
type === TYPES.PERCENT ||
|
|
11
12
|
(type === TYPES.INTEGER && (v === '0' || v === 0))
|
|
12
13
|
);
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
var parser = function(v) {
|
|
16
|
+
var parser = function (v) {
|
|
16
17
|
return parsers.parseMeasurement(v);
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -20,19 +21,22 @@ var mySetter = parsers.implicitSetter('padding', '', isValid, parser);
|
|
|
20
21
|
var myGlobal = parsers.implicitSetter(
|
|
21
22
|
'padding',
|
|
22
23
|
'',
|
|
23
|
-
function() {
|
|
24
|
+
function () {
|
|
24
25
|
return true;
|
|
25
26
|
},
|
|
26
|
-
function(v) {
|
|
27
|
+
function (v) {
|
|
27
28
|
return v;
|
|
28
29
|
}
|
|
29
30
|
);
|
|
30
31
|
|
|
31
32
|
module.exports.definition = {
|
|
32
|
-
set: function(v) {
|
|
33
|
+
set: function (v) {
|
|
33
34
|
if (typeof v === 'number') {
|
|
34
35
|
v = String(v);
|
|
35
36
|
}
|
|
37
|
+
if (v === null) {
|
|
38
|
+
v = '';
|
|
39
|
+
}
|
|
36
40
|
if (typeof v !== 'string') {
|
|
37
41
|
return;
|
|
38
42
|
}
|
|
@@ -50,7 +54,7 @@ module.exports.definition = {
|
|
|
50
54
|
break;
|
|
51
55
|
}
|
|
52
56
|
},
|
|
53
|
-
get: function() {
|
|
57
|
+
get: function () {
|
|
54
58
|
return this.getPropertyValue('padding');
|
|
55
59
|
},
|
|
56
60
|
enumerable: true,
|
|
@@ -5,7 +5,7 @@ var parsers = require('../parsers.js');
|
|
|
5
5
|
|
|
6
6
|
module.exports.definition = {
|
|
7
7
|
set: parsers.subImplicitSetter('padding', 'bottom', padding.isValid, padding.parser),
|
|
8
|
-
get: function() {
|
|
8
|
+
get: function () {
|
|
9
9
|
return this.getPropertyValue('padding-bottom');
|
|
10
10
|
},
|
|
11
11
|
enumerable: true,
|
|
@@ -5,7 +5,7 @@ var parsers = require('../parsers.js');
|
|
|
5
5
|
|
|
6
6
|
module.exports.definition = {
|
|
7
7
|
set: parsers.subImplicitSetter('padding', 'left', padding.isValid, padding.parser),
|
|
8
|
-
get: function() {
|
|
8
|
+
get: function () {
|
|
9
9
|
return this.getPropertyValue('padding-left');
|
|
10
10
|
},
|
|
11
11
|
enumerable: true,
|
|
@@ -5,7 +5,7 @@ var parsers = require('../parsers.js');
|
|
|
5
5
|
|
|
6
6
|
module.exports.definition = {
|
|
7
7
|
set: parsers.subImplicitSetter('padding', 'right', padding.isValid, padding.parser),
|
|
8
|
-
get: function() {
|
|
8
|
+
get: function () {
|
|
9
9
|
return this.getPropertyValue('padding-right');
|
|
10
10
|
},
|
|
11
11
|
enumerable: true,
|
|
@@ -5,7 +5,7 @@ var parsers = require('../parsers.js');
|
|
|
5
5
|
|
|
6
6
|
module.exports.definition = {
|
|
7
7
|
set: parsers.subImplicitSetter('padding', 'top', padding.isValid, padding.parser),
|
|
8
|
-
get: function() {
|
|
8
|
+
get: function () {
|
|
9
9
|
return this.getPropertyValue('padding-top');
|
|
10
10
|
},
|
|
11
11
|
enumerable: true,
|
package/lib/properties/right.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseMeasurement = require('../parsers').parseMeasurement;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('right', parseMeasurement(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('right');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('stop-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('stop-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('text-line-through-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('text-line-through-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('text-overline-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('text-overline-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('text-underline-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('text-underline-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
package/lib/properties/top.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseMeasurement = require('../parsers').parseMeasurement;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('top', parseMeasurement(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('top');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('-webkit-border-after-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('-webkit-border-after-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('-webkit-border-before-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('-webkit-border-before-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('-webkit-border-end-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('-webkit-border-end-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var parseColor = require('../parsers').parseColor;
|
|
4
4
|
|
|
5
5
|
module.exports.definition = {
|
|
6
|
-
set: function(v) {
|
|
6
|
+
set: function (v) {
|
|
7
7
|
this._setProperty('-webkit-border-start-color', parseColor(v));
|
|
8
8
|
},
|
|
9
|
-
get: function() {
|
|
9
|
+
get: function () {
|
|
10
10
|
return this.getPropertyValue('-webkit-border-start-color');
|
|
11
11
|
},
|
|
12
12
|
enumerable: true,
|