cssstyle 5.2.0 → 5.3.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.
Files changed (88) hide show
  1. package/lib/CSSStyleDeclaration.js +250 -254
  2. package/lib/generated/allProperties.js +39 -1
  3. package/lib/generated/implementedProperties.js +2219 -80
  4. package/lib/generated/properties.js +5253 -1904
  5. package/lib/normalize.js +1417 -0
  6. package/lib/parsers.js +372 -389
  7. package/lib/properties/background.js +76 -63
  8. package/lib/properties/backgroundAttachment.js +37 -22
  9. package/lib/properties/backgroundClip.js +37 -22
  10. package/lib/properties/backgroundColor.js +35 -15
  11. package/lib/properties/backgroundImage.js +49 -19
  12. package/lib/properties/backgroundOrigin.js +37 -22
  13. package/lib/properties/backgroundPosition.js +145 -128
  14. package/lib/properties/backgroundRepeat.js +55 -48
  15. package/lib/properties/backgroundSize.js +86 -46
  16. package/lib/properties/border.js +139 -22
  17. package/lib/properties/borderBottom.js +137 -21
  18. package/lib/properties/borderBottomColor.js +41 -16
  19. package/lib/properties/borderBottomStyle.js +39 -30
  20. package/lib/properties/borderBottomWidth.js +49 -16
  21. package/lib/properties/borderCollapse.js +32 -8
  22. package/lib/properties/borderColor.js +96 -23
  23. package/lib/properties/borderLeft.js +137 -21
  24. package/lib/properties/borderLeftColor.js +41 -16
  25. package/lib/properties/borderLeftStyle.js +39 -30
  26. package/lib/properties/borderLeftWidth.js +49 -16
  27. package/lib/properties/borderRight.js +137 -21
  28. package/lib/properties/borderRightColor.js +41 -16
  29. package/lib/properties/borderRightStyle.js +39 -30
  30. package/lib/properties/borderRightWidth.js +49 -16
  31. package/lib/properties/borderSpacing.js +42 -25
  32. package/lib/properties/borderStyle.js +96 -34
  33. package/lib/properties/borderTop.js +131 -15
  34. package/lib/properties/borderTopColor.js +41 -16
  35. package/lib/properties/borderTopStyle.js +39 -30
  36. package/lib/properties/borderTopWidth.js +49 -16
  37. package/lib/properties/borderWidth.js +108 -23
  38. package/lib/properties/bottom.js +40 -12
  39. package/lib/properties/clear.js +32 -22
  40. package/lib/properties/clip.js +46 -32
  41. package/lib/properties/color.js +34 -13
  42. package/lib/properties/display.js +169 -179
  43. package/lib/properties/flex.js +137 -38
  44. package/lib/properties/flexBasis.js +43 -14
  45. package/lib/properties/flexGrow.js +42 -9
  46. package/lib/properties/flexShrink.js +42 -9
  47. package/lib/properties/float.js +32 -9
  48. package/lib/properties/floodColor.js +34 -13
  49. package/lib/properties/font.js +145 -44
  50. package/lib/properties/fontFamily.js +66 -67
  51. package/lib/properties/fontSize.js +43 -26
  52. package/lib/properties/fontStyle.js +42 -11
  53. package/lib/properties/fontVariant.js +52 -15
  54. package/lib/properties/fontWeight.js +47 -15
  55. package/lib/properties/height.js +40 -13
  56. package/lib/properties/left.js +40 -12
  57. package/lib/properties/lightingColor.js +34 -13
  58. package/lib/properties/lineHeight.js +45 -18
  59. package/lib/properties/margin.js +73 -36
  60. package/lib/properties/marginBottom.js +43 -19
  61. package/lib/properties/marginLeft.js +43 -19
  62. package/lib/properties/marginRight.js +43 -19
  63. package/lib/properties/marginTop.js +43 -19
  64. package/lib/properties/opacity.js +41 -28
  65. package/lib/properties/outlineColor.js +34 -13
  66. package/lib/properties/padding.js +71 -36
  67. package/lib/properties/paddingBottom.js +44 -21
  68. package/lib/properties/paddingLeft.js +44 -19
  69. package/lib/properties/paddingRight.js +44 -19
  70. package/lib/properties/paddingTop.js +44 -19
  71. package/lib/properties/right.js +40 -12
  72. package/lib/properties/stopColor.js +34 -13
  73. package/lib/properties/top.js +40 -12
  74. package/lib/properties/webkitBorderAfterColor.js +34 -13
  75. package/lib/properties/webkitBorderBeforeColor.js +34 -13
  76. package/lib/properties/webkitBorderEndColor.js +34 -13
  77. package/lib/properties/webkitBorderStartColor.js +34 -13
  78. package/lib/properties/webkitColumnRuleColor.js +34 -13
  79. package/lib/properties/webkitTapHighlightColor.js +34 -13
  80. package/lib/properties/webkitTextEmphasisColor.js +34 -13
  81. package/lib/properties/webkitTextFillColor.js +34 -13
  82. package/lib/properties/webkitTextStrokeColor.js +34 -13
  83. package/lib/properties/width.js +40 -13
  84. package/lib/{allWebkitProperties.js → utils/allExtraProperties.js} +42 -1
  85. package/lib/utils/propertyDescriptors.js +6 -3
  86. package/package.json +11 -10
  87. package/lib/allExtraProperties.js +0 -49
  88. package/lib/shorthandProperties.js +0 -21
@@ -1,11 +1,14 @@
1
1
  "use strict";
2
2
 
3
- const prepareValue = require("../parsers").prepareValue;
3
+ const parsers = require("../parsers");
4
4
 
5
- module.exports.getPropertyDescriptor = function getPropertyDescriptor(property) {
5
+ exports.getPropertyDescriptor = function getPropertyDescriptor(property) {
6
6
  return {
7
7
  set(v) {
8
- this._setProperty(property, prepareValue(v));
8
+ v = parsers.parsePropertyValue(property, v, {
9
+ globalObject: this._global
10
+ });
11
+ this._setProperty(property, v);
9
12
  },
10
13
  get() {
11
14
  return this.getPropertyValue(property);
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "CSSStyleDeclaration",
7
7
  "StyleSheet"
8
8
  ],
9
- "version": "5.2.0",
9
+ "version": "5.3.0",
10
10
  "homepage": "https://github.com/jsdom/cssstyle",
11
11
  "maintainers": [
12
12
  {
@@ -42,17 +42,18 @@
42
42
  "css-tree": "^3.1.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@babel/generator": "^7.26.9",
46
- "@babel/parser": "^7.26.9",
47
- "@babel/traverse": "^7.26.9",
48
- "@babel/types": "^7.26.9",
45
+ "@babel/generator": "^7.28.0",
46
+ "@babel/parser": "^7.28.0",
47
+ "@babel/traverse": "^7.28.0",
48
+ "@babel/types": "^7.28.2",
49
49
  "@domenic/eslint-config": "^4.0.1",
50
- "eslint": "^9.22.0",
51
- "eslint-config-prettier": "^10.1.1",
52
- "eslint-plugin-prettier": "^5.2.3",
53
- "globals": "^16.0.0",
50
+ "@webref/css": "^6.23.6",
51
+ "eslint": "^9.32.0",
52
+ "eslint-config-prettier": "^10.1.8",
53
+ "eslint-plugin-prettier": "^5.5.3",
54
+ "globals": "^16.3.0",
54
55
  "npm-run-all": "^4.1.5",
55
- "prettier": "^3.5.3",
56
+ "prettier": "^3.6.2",
56
57
  "resolve": "^1.22.10"
57
58
  },
58
59
  "scripts": {
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * This file contains all implemented properties that are not a part of any
5
- * current specifications or drafts, but are handled by browsers nevertheless.
6
- */
7
-
8
- const allWebkitProperties = require("./allWebkitProperties");
9
-
10
- module.exports = new Set([
11
- "background-position-x",
12
- "background-position-y",
13
- "background-repeat-x",
14
- "background-repeat-y",
15
- "color-interpolation",
16
- "color-profile",
17
- "color-rendering",
18
- "enable-background",
19
- "glyph-orientation-horizontal",
20
- "kerning",
21
- "marker-offset",
22
- "marks",
23
- "pointer-events",
24
- "shape-rendering",
25
- "size",
26
- "src",
27
- "stop-color",
28
- "stop-opacity",
29
- "text-anchor",
30
- "text-line-through",
31
- "text-line-through-color",
32
- "text-line-through-mode",
33
- "text-line-through-style",
34
- "text-line-through-width",
35
- "text-overline",
36
- "text-overline-color",
37
- "text-overline-mode",
38
- "text-overline-style",
39
- "text-overline-width",
40
- "text-rendering",
41
- "text-underline",
42
- "text-underline-color",
43
- "text-underline-mode",
44
- "text-underline-style",
45
- "text-underline-width",
46
- "unicode-range",
47
- "vector-effect",
48
- ...allWebkitProperties
49
- ]);
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- const background = require("./properties/background");
4
- const border = require("./properties/border");
5
- const borderTop = require("./properties/borderTop");
6
- const borderRight = require("./properties/borderRight");
7
- const borderBottom = require("./properties/borderBottom");
8
- const borderLeft = require("./properties/borderLeft");
9
- const flex = require("./properties/flex");
10
- const font = require("./properties/font");
11
-
12
- module.exports.shorthandProperties = new Map([
13
- ["background", background.shorthandFor],
14
- ["border", border.shorthandFor],
15
- ["border-top", borderTop.shorthandFor],
16
- ["border-right", borderRight.shorthandFor],
17
- ["border-bottom", borderBottom.shorthandFor],
18
- ["border-left", borderLeft.shorthandFor],
19
- ["flex", flex.shorthandFor],
20
- ["font", font.shorthandFor]
21
- ]);