cssstyle 4.3.0 → 4.4.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/lib/CSSStyleDeclaration.js +545 -206
- package/lib/allExtraProperties.js +42 -60
- package/lib/allWebkitProperties.js +107 -187
- package/lib/generated/allProperties.js +615 -0
- package/lib/{implementedProperties.js → generated/implementedProperties.js} +11 -18
- package/lib/generated/properties.js +2574 -0
- package/lib/parsers.js +400 -544
- package/lib/properties/background.js +40 -13
- package/lib/properties/backgroundAttachment.js +23 -15
- package/lib/properties/backgroundColor.js +21 -19
- package/lib/properties/backgroundImage.js +19 -14
- package/lib/properties/backgroundPosition.js +35 -41
- package/lib/properties/backgroundRepeat.js +20 -20
- package/lib/properties/border.js +34 -25
- package/lib/properties/borderBottom.js +34 -11
- package/lib/properties/borderBottomColor.js +27 -8
- package/lib/properties/borderBottomStyle.js +42 -13
- package/lib/properties/borderBottomWidth.js +28 -8
- package/lib/properties/borderCollapse.js +16 -16
- package/lib/properties/borderColor.js +32 -18
- package/lib/properties/borderLeft.js +34 -11
- package/lib/properties/borderLeftColor.js +27 -8
- package/lib/properties/borderLeftStyle.js +42 -13
- package/lib/properties/borderLeftWidth.js +28 -8
- package/lib/properties/borderRight.js +34 -11
- package/lib/properties/borderRightColor.js +27 -8
- package/lib/properties/borderRightStyle.js +42 -13
- package/lib/properties/borderRightWidth.js +28 -8
- package/lib/properties/borderSpacing.js +31 -27
- package/lib/properties/borderStyle.js +43 -27
- package/lib/properties/borderTop.js +34 -11
- package/lib/properties/borderTopColor.js +27 -8
- package/lib/properties/borderTopStyle.js +42 -13
- package/lib/properties/borderTopWidth.js +28 -9
- package/lib/properties/borderWidth.js +32 -34
- package/lib/properties/bottom.js +23 -7
- package/lib/properties/clear.js +32 -8
- package/lib/properties/clip.js +33 -27
- package/lib/properties/color.js +23 -7
- package/lib/properties/flex.js +59 -29
- package/lib/properties/flexBasis.js +21 -16
- package/lib/properties/flexGrow.js +19 -10
- package/lib/properties/flexShrink.js +19 -10
- package/lib/properties/float.js +21 -6
- package/lib/properties/floodColor.js +23 -7
- package/lib/properties/font.js +120 -33
- package/lib/properties/fontFamily.js +59 -21
- package/lib/properties/fontSize.js +37 -28
- package/lib/properties/fontStyle.js +23 -9
- package/lib/properties/fontVariant.js +26 -8
- package/lib/properties/fontWeight.js +26 -23
- package/lib/properties/height.js +21 -14
- package/lib/properties/left.js +23 -7
- package/lib/properties/lightingColor.js +23 -7
- package/lib/properties/lineHeight.js +29 -16
- package/lib/properties/margin.js +42 -57
- package/lib/properties/marginBottom.js +34 -7
- package/lib/properties/marginLeft.js +34 -7
- package/lib/properties/marginRight.js +34 -7
- package/lib/properties/marginTop.js +34 -7
- package/lib/properties/opacity.js +39 -7
- package/lib/properties/outlineColor.js +23 -7
- package/lib/properties/padding.js +43 -51
- package/lib/properties/paddingBottom.js +36 -7
- package/lib/properties/paddingLeft.js +34 -7
- package/lib/properties/paddingRight.js +34 -7
- package/lib/properties/paddingTop.js +34 -7
- package/lib/properties/right.js +23 -7
- package/lib/properties/stopColor.js +23 -7
- package/lib/properties/top.js +23 -7
- package/lib/properties/webkitBorderAfterColor.js +23 -7
- package/lib/properties/webkitBorderBeforeColor.js +23 -7
- package/lib/properties/webkitBorderEndColor.js +23 -7
- package/lib/properties/webkitBorderStartColor.js +23 -7
- package/lib/properties/webkitColumnRuleColor.js +23 -7
- package/lib/properties/webkitTapHighlightColor.js +23 -7
- package/lib/properties/webkitTextEmphasisColor.js +23 -7
- package/lib/properties/webkitTextFillColor.js +23 -7
- package/lib/properties/webkitTextStrokeColor.js +23 -7
- package/lib/properties/width.js +21 -14
- package/lib/utils/camelize.js +35 -0
- package/lib/utils/propertyDescriptors.js +16 -0
- package/package.json +5 -4
- package/lib/allProperties.js +0 -529
- package/lib/constants.js +0 -6
- package/lib/named_colors.json +0 -152
- package/lib/properties/azimuth.js +0 -64
- package/lib/properties/cssFloat.js +0 -12
- package/lib/properties/textLineThroughColor.js +0 -14
- package/lib/properties/textOverlineColor.js +0 -14
- package/lib/properties/textUnderlineColor.js +0 -14
- package/lib/properties/webkitMatchNearestMailBlockquoteColor.js +0 -14
- package/lib/properties.js +0 -1672
- package/lib/utils/getBasicPropertyDescriptor.js +0 -14
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
4
|
|
|
5
|
-
module.exports.
|
|
6
|
-
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const keywords = ["normal", "italic", "oblique"];
|
|
7
|
+
return parsers.parseKeyword(v, keywords);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
module.exports.isValid = function isValid(v) {
|
|
11
|
+
if (v === "") {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return typeof module.exports.parse(v) === "string";
|
|
7
15
|
};
|
|
8
16
|
|
|
9
17
|
module.exports.definition = {
|
|
10
|
-
set
|
|
11
|
-
|
|
18
|
+
set(v) {
|
|
19
|
+
v = parsers.prepareValue(v, this._global);
|
|
20
|
+
if (parsers.hasVarFunc(v)) {
|
|
21
|
+
this._setProperty("font", "");
|
|
22
|
+
this._setProperty("font-style", v);
|
|
23
|
+
} else {
|
|
24
|
+
this._setProperty("font-style", module.exports.parse(v));
|
|
25
|
+
}
|
|
12
26
|
},
|
|
13
|
-
get
|
|
14
|
-
return this.getPropertyValue(
|
|
27
|
+
get() {
|
|
28
|
+
return this.getPropertyValue("font-style");
|
|
15
29
|
},
|
|
16
30
|
enumerable: true,
|
|
17
|
-
configurable: true
|
|
31
|
+
configurable: true
|
|
18
32
|
};
|
|
@@ -1,18 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const num = parsers.parseNumber(v, true);
|
|
7
|
+
if (num && parseFloat(num) <= 1000) {
|
|
8
|
+
return num;
|
|
9
|
+
}
|
|
10
|
+
const keywords = ["normal", "none", "small-caps"];
|
|
11
|
+
return parsers.parseKeyword(v, keywords);
|
|
12
|
+
};
|
|
4
13
|
|
|
5
14
|
module.exports.isValid = function isValid(v) {
|
|
6
|
-
|
|
15
|
+
if (v === "") {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return typeof module.exports.parse(v) === "string";
|
|
7
19
|
};
|
|
8
20
|
|
|
9
21
|
module.exports.definition = {
|
|
10
|
-
set
|
|
11
|
-
|
|
22
|
+
set(v) {
|
|
23
|
+
v = parsers.prepareValue(v, this._global);
|
|
24
|
+
if (parsers.hasVarFunc(v)) {
|
|
25
|
+
this._setProperty("font", "");
|
|
26
|
+
this._setProperty("font-valiant", v);
|
|
27
|
+
} else {
|
|
28
|
+
this._setProperty("font-variant", module.exports.parse(v));
|
|
29
|
+
}
|
|
12
30
|
},
|
|
13
|
-
get
|
|
14
|
-
return this.getPropertyValue(
|
|
31
|
+
get() {
|
|
32
|
+
return this.getPropertyValue("font-variant");
|
|
15
33
|
},
|
|
16
34
|
enumerable: true,
|
|
17
|
-
configurable: true
|
|
35
|
+
configurable: true
|
|
18
36
|
};
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'600',
|
|
14
|
-
'700',
|
|
15
|
-
'800',
|
|
16
|
-
'900',
|
|
17
|
-
'inherit',
|
|
18
|
-
];
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const num = parsers.parseNumber(v, true);
|
|
7
|
+
if (num && parseFloat(num) <= 1000) {
|
|
8
|
+
return num;
|
|
9
|
+
}
|
|
10
|
+
const keywords = ["normal", "bold", "lighter", "bolder"];
|
|
11
|
+
return parsers.parseKeyword(v, keywords);
|
|
12
|
+
};
|
|
19
13
|
|
|
20
14
|
module.exports.isValid = function isValid(v) {
|
|
21
|
-
|
|
15
|
+
if (v === "") {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return typeof module.exports.parse(v) === "string";
|
|
22
19
|
};
|
|
23
20
|
|
|
24
21
|
module.exports.definition = {
|
|
25
|
-
set
|
|
26
|
-
|
|
22
|
+
set(v) {
|
|
23
|
+
v = parsers.prepareValue(v, this._global);
|
|
24
|
+
if (parsers.hasVarFunc(v)) {
|
|
25
|
+
this._setProperty("font", "");
|
|
26
|
+
this._setProperty("font-weight", v);
|
|
27
|
+
} else {
|
|
28
|
+
this._setProperty("font-weight", module.exports.parse(v));
|
|
29
|
+
}
|
|
27
30
|
},
|
|
28
|
-
get
|
|
29
|
-
return this.getPropertyValue(
|
|
31
|
+
get() {
|
|
32
|
+
return this.getPropertyValue("font-weight");
|
|
30
33
|
},
|
|
31
34
|
enumerable: true,
|
|
32
|
-
configurable: true
|
|
35
|
+
configurable: true
|
|
33
36
|
};
|
package/lib/properties/height.js
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
4
|
|
|
5
|
-
function parse(v) {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const dim = parsers.parseMeasurement(v, true);
|
|
7
|
+
if (dim) {
|
|
8
|
+
return dim;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const keywords = ["auto", "min-content", "max-content", "fit-content"];
|
|
11
|
+
return parsers.parseKeyword(v, keywords);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports.isValid = function isValid(v) {
|
|
15
|
+
if (v === "") {
|
|
16
|
+
return true;
|
|
11
17
|
}
|
|
12
|
-
return
|
|
13
|
-
}
|
|
18
|
+
return typeof module.exports.parse(v) === "string";
|
|
19
|
+
};
|
|
14
20
|
|
|
15
21
|
module.exports.definition = {
|
|
16
|
-
set
|
|
17
|
-
|
|
22
|
+
set(v) {
|
|
23
|
+
v = parsers.prepareValue(v, this._global);
|
|
24
|
+
this._setProperty("height", module.exports.parse(v));
|
|
18
25
|
},
|
|
19
|
-
get
|
|
20
|
-
return this.getPropertyValue(
|
|
26
|
+
get() {
|
|
27
|
+
return this.getPropertyValue("height");
|
|
21
28
|
},
|
|
22
29
|
enumerable: true,
|
|
23
|
-
configurable: true
|
|
30
|
+
configurable: true
|
|
24
31
|
};
|
package/lib/properties/left.js
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const dim = parsers.parseMeasurement(v);
|
|
7
|
+
if (dim) {
|
|
8
|
+
return dim;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v, ["auto"]);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("left", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("left");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseColor(v);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "" || typeof parsers.parseKeyword(v) === "string") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return parsers.isValidColor(v);
|
|
18
|
+
};
|
|
4
19
|
|
|
5
20
|
module.exports.definition = {
|
|
6
|
-
set
|
|
7
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
this._setProperty("lighting-color", module.exports.parse(v));
|
|
8
24
|
},
|
|
9
|
-
get
|
|
10
|
-
return this.getPropertyValue(
|
|
25
|
+
get() {
|
|
26
|
+
return this.getPropertyValue("lighting-color");
|
|
11
27
|
},
|
|
12
28
|
enumerable: true,
|
|
13
|
-
configurable: true
|
|
29
|
+
configurable: true
|
|
14
30
|
};
|
|
@@ -1,26 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseKeyword(v, ["normal"]);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
const num = parsers.parseNumber(v, true);
|
|
11
|
+
if (num) {
|
|
12
|
+
return num;
|
|
13
|
+
}
|
|
14
|
+
return parsers.parseMeasurement(v, true);
|
|
15
|
+
};
|
|
5
16
|
|
|
6
17
|
module.exports.isValid = function isValid(v) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type === TYPES.NUMBER ||
|
|
12
|
-
type === TYPES.LENGTH ||
|
|
13
|
-
type === TYPES.PERCENT
|
|
14
|
-
);
|
|
18
|
+
if (v === "") {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
return typeof module.exports.parse(v) === "string";
|
|
15
22
|
};
|
|
16
23
|
|
|
17
24
|
module.exports.definition = {
|
|
18
|
-
set
|
|
19
|
-
|
|
25
|
+
set(v) {
|
|
26
|
+
v = parsers.prepareValue(v, this._global);
|
|
27
|
+
if (parsers.hasVarFunc(v)) {
|
|
28
|
+
this._setProperty("font", "");
|
|
29
|
+
this._setProperty("line-height", v);
|
|
30
|
+
} else {
|
|
31
|
+
this._setProperty("line-height", module.exports.parse(v));
|
|
32
|
+
}
|
|
20
33
|
},
|
|
21
|
-
get
|
|
22
|
-
return this.getPropertyValue(
|
|
34
|
+
get() {
|
|
35
|
+
return this.getPropertyValue("line-height");
|
|
23
36
|
},
|
|
24
37
|
enumerable: true,
|
|
25
|
-
configurable: true
|
|
38
|
+
configurable: true
|
|
26
39
|
};
|
package/lib/properties/margin.js
CHANGED
|
@@ -1,73 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var TYPES = parsers.TYPES;
|
|
3
|
+
const parsers = require("../parsers");
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
if (v.toLowerCase() === 'auto') {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
var type = parsers.valueType(v);
|
|
11
|
-
return (
|
|
12
|
-
type === TYPES.NULL_OR_EMPTY_STR ||
|
|
13
|
-
type === TYPES.LENGTH ||
|
|
14
|
-
type === TYPES.PERCENT ||
|
|
15
|
-
type === TYPES.CALC ||
|
|
16
|
-
(type === TYPES.INTEGER && (v === '0' || v === 0))
|
|
17
|
-
);
|
|
18
|
-
};
|
|
5
|
+
const positions = ["top", "right", "bottom", "left"];
|
|
19
6
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
7
|
+
module.exports.parse = function parse(v) {
|
|
8
|
+
const val = parsers.parseMeasurement(v, true);
|
|
9
|
+
if (val) {
|
|
10
|
+
return val;
|
|
24
11
|
}
|
|
25
|
-
return parsers.
|
|
12
|
+
return parsers.parseKeyword(v, ["auto"]);
|
|
26
13
|
};
|
|
27
14
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
'margin',
|
|
31
|
-
'',
|
|
32
|
-
function () {
|
|
15
|
+
module.exports.isValid = function isValid(v) {
|
|
16
|
+
if (v === "") {
|
|
33
17
|
return true;
|
|
34
|
-
},
|
|
35
|
-
function (v) {
|
|
36
|
-
return v;
|
|
37
18
|
}
|
|
38
|
-
);
|
|
19
|
+
return typeof module.exports.parse(v) === "string";
|
|
20
|
+
};
|
|
39
21
|
|
|
40
22
|
module.exports.definition = {
|
|
41
|
-
set
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
set(v) {
|
|
24
|
+
v = parsers.prepareValue(v, this._global);
|
|
25
|
+
if (parsers.hasVarFunc(v)) {
|
|
26
|
+
this._implicitSetter(
|
|
27
|
+
"margin",
|
|
28
|
+
"",
|
|
29
|
+
"",
|
|
30
|
+
module.exports.isValid,
|
|
31
|
+
module.exports.parse,
|
|
32
|
+
positions
|
|
33
|
+
);
|
|
34
|
+
this._setProperty("margin", v);
|
|
35
|
+
} else {
|
|
36
|
+
this._implicitSetter(
|
|
37
|
+
"margin",
|
|
38
|
+
"",
|
|
39
|
+
v,
|
|
40
|
+
module.exports.isValid,
|
|
41
|
+
module.exports.parse,
|
|
42
|
+
positions
|
|
43
|
+
);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
return;
|
|
45
|
+
},
|
|
46
|
+
get() {
|
|
47
|
+
const val = this._implicitGetter("margin", positions);
|
|
48
|
+
if (val === "") {
|
|
49
|
+
return this.getPropertyValue("margin");
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
case 'inherit':
|
|
54
|
-
case 'initial':
|
|
55
|
-
case 'unset':
|
|
56
|
-
case '':
|
|
57
|
-
myGlobal.call(this, V);
|
|
58
|
-
break;
|
|
59
|
-
|
|
60
|
-
default:
|
|
61
|
-
mySetter.call(this, v);
|
|
62
|
-
break;
|
|
51
|
+
if (parsers.hasVarFunc(val)) {
|
|
52
|
+
return "";
|
|
63
53
|
}
|
|
64
|
-
|
|
65
|
-
get: function () {
|
|
66
|
-
return this.getPropertyValue('margin');
|
|
54
|
+
return val;
|
|
67
55
|
},
|
|
68
56
|
enumerable: true,
|
|
69
|
-
configurable: true
|
|
57
|
+
configurable: true
|
|
70
58
|
};
|
|
71
|
-
|
|
72
|
-
module.exports.isValid = isValid;
|
|
73
|
-
module.exports.parser = parser;
|
|
@@ -1,13 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseMeasurement(v, true);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v, ["auto"]);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
5
19
|
|
|
6
20
|
module.exports.definition = {
|
|
7
|
-
set
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
if (parsers.hasVarFunc(v)) {
|
|
24
|
+
this._setProperty("margin", "");
|
|
25
|
+
this._setProperty("margin-bottom", v);
|
|
26
|
+
} else {
|
|
27
|
+
this._subImplicitSetter("margin", "bottom", v, module.exports.isValid, module.exports.parse, [
|
|
28
|
+
"top",
|
|
29
|
+
"right",
|
|
30
|
+
"bottom",
|
|
31
|
+
"left"
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
get() {
|
|
36
|
+
return this.getPropertyValue("margin-bottom");
|
|
10
37
|
},
|
|
11
38
|
enumerable: true,
|
|
12
|
-
configurable: true
|
|
39
|
+
configurable: true
|
|
13
40
|
};
|
|
@@ -1,13 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseMeasurement(v, true);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v, ["auto"]);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
5
19
|
|
|
6
20
|
module.exports.definition = {
|
|
7
|
-
set
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
if (parsers.hasVarFunc(v)) {
|
|
24
|
+
this._setProperty("margin", "");
|
|
25
|
+
this._setProperty("margin-left", v);
|
|
26
|
+
} else {
|
|
27
|
+
this._subImplicitSetter("margin", "left", v, module.exports.isValid, module.exports.parse, [
|
|
28
|
+
"top",
|
|
29
|
+
"right",
|
|
30
|
+
"bottom",
|
|
31
|
+
"left"
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
get() {
|
|
36
|
+
return this.getPropertyValue("margin-left");
|
|
10
37
|
},
|
|
11
38
|
enumerable: true,
|
|
12
|
-
configurable: true
|
|
39
|
+
configurable: true
|
|
13
40
|
};
|
|
@@ -1,13 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseMeasurement(v, true);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v, ["auto"]);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
5
19
|
|
|
6
20
|
module.exports.definition = {
|
|
7
|
-
set
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
if (parsers.hasVarFunc(v)) {
|
|
24
|
+
this._setProperty("margin", "");
|
|
25
|
+
this._setProperty("margin-right", v);
|
|
26
|
+
} else {
|
|
27
|
+
this._subImplicitSetter("margin", "right", v, module.exports.isValid, module.exports.parse, [
|
|
28
|
+
"top",
|
|
29
|
+
"right",
|
|
30
|
+
"bottom",
|
|
31
|
+
"left"
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
get() {
|
|
36
|
+
return this.getPropertyValue("margin-right");
|
|
10
37
|
},
|
|
11
38
|
enumerable: true,
|
|
12
|
-
configurable: true
|
|
39
|
+
configurable: true
|
|
13
40
|
};
|
|
@@ -1,13 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const parsers = require("../parsers");
|
|
4
|
+
|
|
5
|
+
module.exports.parse = function parse(v) {
|
|
6
|
+
const val = parsers.parseMeasurement(v, true);
|
|
7
|
+
if (val) {
|
|
8
|
+
return val;
|
|
9
|
+
}
|
|
10
|
+
return parsers.parseKeyword(v, ["auto"]);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports.isValid = function isValid(v) {
|
|
14
|
+
if (v === "") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return typeof module.exports.parse(v) === "string";
|
|
18
|
+
};
|
|
5
19
|
|
|
6
20
|
module.exports.definition = {
|
|
7
|
-
set
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
set(v) {
|
|
22
|
+
v = parsers.prepareValue(v, this._global);
|
|
23
|
+
if (parsers.hasVarFunc(v)) {
|
|
24
|
+
this._setProperty("margin", "");
|
|
25
|
+
this._setProperty("margin-top", v);
|
|
26
|
+
} else {
|
|
27
|
+
this._subImplicitSetter("margin", "top", v, module.exports.isValid, module.exports.parse, [
|
|
28
|
+
"top",
|
|
29
|
+
"right",
|
|
30
|
+
"bottom",
|
|
31
|
+
"left"
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
get() {
|
|
36
|
+
return this.getPropertyValue("margin-top");
|
|
10
37
|
},
|
|
11
38
|
enumerable: true,
|
|
12
|
-
configurable: true
|
|
39
|
+
configurable: true
|
|
13
40
|
};
|