cssstyle 5.3.5 → 5.3.7
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 +6 -5
- package/lib/generated/implementedProperties.js +1 -1
- package/lib/generated/properties.js +2034 -2348
- package/lib/generated/propertyDefinitions.js +13033 -0
- package/lib/normalize.js +1252 -1095
- package/lib/parsers.js +589 -253
- package/lib/properties/background.js +90 -80
- package/lib/properties/backgroundAttachment.js +12 -15
- package/lib/properties/backgroundClip.js +12 -15
- package/lib/properties/backgroundColor.js +9 -14
- package/lib/properties/backgroundImage.js +12 -27
- package/lib/properties/backgroundOrigin.js +12 -15
- package/lib/properties/backgroundPosition.js +30 -19
- package/lib/properties/backgroundRepeat.js +12 -8
- package/lib/properties/backgroundSize.js +23 -17
- package/lib/properties/border.js +31 -88
- package/lib/properties/borderBottom.js +31 -87
- package/lib/properties/borderBottomColor.js +9 -15
- package/lib/properties/borderBottomStyle.js +9 -14
- package/lib/properties/borderBottomWidth.js +12 -24
- package/lib/properties/borderCollapse.js +5 -10
- package/lib/properties/borderColor.js +18 -24
- package/lib/properties/borderLeft.js +31 -87
- package/lib/properties/borderLeftColor.js +9 -15
- package/lib/properties/borderLeftStyle.js +9 -14
- package/lib/properties/borderLeftWidth.js +12 -24
- package/lib/properties/borderRight.js +31 -87
- package/lib/properties/borderRightColor.js +9 -15
- package/lib/properties/borderRightStyle.js +9 -14
- package/lib/properties/borderRightWidth.js +12 -24
- package/lib/properties/borderSpacing.js +13 -10
- package/lib/properties/borderStyle.js +18 -24
- package/lib/properties/borderTop.js +31 -87
- package/lib/properties/borderTopColor.js +9 -15
- package/lib/properties/borderTopStyle.js +9 -14
- package/lib/properties/borderTopWidth.js +12 -24
- package/lib/properties/borderWidth.js +19 -37
- package/lib/properties/bottom.js +7 -18
- package/lib/properties/clear.js +5 -10
- package/lib/properties/clip.js +11 -6
- package/lib/properties/color.js +5 -11
- package/lib/properties/display.js +12 -9
- package/lib/properties/flex.js +56 -54
- package/lib/properties/flexBasis.js +11 -21
- package/lib/properties/flexGrow.js +11 -20
- package/lib/properties/flexShrink.js +11 -20
- package/lib/properties/float.js +5 -10
- package/lib/properties/floodColor.js +5 -11
- package/lib/properties/font.js +47 -34
- package/lib/properties/fontFamily.js +17 -13
- package/lib/properties/fontSize.js +12 -23
- package/lib/properties/fontStyle.js +15 -9
- package/lib/properties/fontVariant.js +12 -19
- package/lib/properties/fontWeight.js +15 -26
- package/lib/properties/height.js +8 -18
- package/lib/properties/left.js +7 -18
- package/lib/properties/lightingColor.js +5 -11
- package/lib/properties/lineHeight.js +11 -25
- package/lib/properties/margin.js +15 -33
- package/lib/properties/marginBottom.js +11 -21
- package/lib/properties/marginLeft.js +11 -21
- package/lib/properties/marginRight.js +11 -21
- package/lib/properties/marginTop.js +11 -21
- package/lib/properties/opacity.js +7 -19
- package/lib/properties/outlineColor.js +5 -11
- package/lib/properties/padding.js +16 -31
- package/lib/properties/paddingBottom.js +12 -22
- package/lib/properties/paddingLeft.js +12 -22
- package/lib/properties/paddingRight.js +12 -22
- package/lib/properties/paddingTop.js +12 -22
- package/lib/properties/right.js +7 -18
- package/lib/properties/stopColor.js +5 -11
- package/lib/properties/top.js +7 -18
- package/lib/properties/webkitBorderAfterColor.js +5 -11
- package/lib/properties/webkitBorderBeforeColor.js +5 -11
- package/lib/properties/webkitBorderEndColor.js +5 -11
- package/lib/properties/webkitBorderStartColor.js +5 -11
- package/lib/properties/webkitColumnRuleColor.js +5 -11
- package/lib/properties/webkitTapHighlightColor.js +5 -11
- package/lib/properties/webkitTextEmphasisColor.js +5 -11
- package/lib/properties/webkitTextFillColor.js +5 -11
- package/lib/properties/webkitTextStrokeColor.js +5 -11
- package/lib/properties/width.js +8 -18
- package/lib/utils/propertyDescriptors.js +49 -13
- package/lib/utils/strings.js +6 -0
- package/package.json +8 -27
|
@@ -10,7 +10,7 @@ const generatedProperties = require("./generated/properties");
|
|
|
10
10
|
const {
|
|
11
11
|
borderProperties,
|
|
12
12
|
getPositionValue,
|
|
13
|
-
|
|
13
|
+
normalizeProperties,
|
|
14
14
|
prepareBorderProperties,
|
|
15
15
|
prepareProperties,
|
|
16
16
|
shorthandProperties
|
|
@@ -150,7 +150,7 @@ class CSSStyleDeclaration {
|
|
|
150
150
|
}
|
|
151
151
|
properties.set(property, { property, value, priority });
|
|
152
152
|
}
|
|
153
|
-
const normalizedProperties =
|
|
153
|
+
const normalizedProperties = normalizeProperties(properties);
|
|
154
154
|
const parts = [];
|
|
155
155
|
for (const { property, value, priority } of normalizedProperties.values()) {
|
|
156
156
|
if (priority) {
|
|
@@ -174,8 +174,8 @@ class CSSStyleDeclaration {
|
|
|
174
174
|
if (this._parentRule || (this._ownerNode && this._setInProgress)) {
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
-
this._setInProgress = true;
|
|
178
177
|
try {
|
|
178
|
+
this._setInProgress = true;
|
|
179
179
|
const valueObj = parseCSS(
|
|
180
180
|
val,
|
|
181
181
|
{
|
|
@@ -246,8 +246,9 @@ class CSSStyleDeclaration {
|
|
|
246
246
|
}
|
|
247
247
|
} catch {
|
|
248
248
|
return;
|
|
249
|
+
} finally {
|
|
250
|
+
this._setInProgress = false;
|
|
249
251
|
}
|
|
250
|
-
this._setInProgress = false;
|
|
251
252
|
if (typeof this._onChange === "function") {
|
|
252
253
|
this._onChange(this.cssText);
|
|
253
254
|
}
|
|
@@ -349,7 +350,7 @@ class CSSStyleDeclaration {
|
|
|
349
350
|
const name = "NoModificationAllowedError";
|
|
350
351
|
throw new this._global.DOMException(msg, name);
|
|
351
352
|
}
|
|
352
|
-
const value = prepareValue(val
|
|
353
|
+
const value = prepareValue(val);
|
|
353
354
|
if (value === "") {
|
|
354
355
|
this[prop] = "";
|
|
355
356
|
this.removeProperty(prop);
|