cssstyle 2.3.0 → 3.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.
Files changed (84) hide show
  1. package/README.md +1 -1
  2. package/lib/CSSStyleDeclaration.js +18 -18
  3. package/lib/CSSStyleDeclaration.test.js +6 -6
  4. package/lib/allProperties.js +66 -9
  5. package/lib/allWebkitProperties.js +1 -1
  6. package/lib/implementedProperties.js +1 -1
  7. package/lib/parsers.js +21 -20
  8. package/lib/properties/azimuth.js +3 -6
  9. package/lib/properties/backgroundAttachment.js +2 -2
  10. package/lib/properties/backgroundColor.js +2 -2
  11. package/lib/properties/backgroundImage.js +2 -2
  12. package/lib/properties/backgroundPosition.js +3 -3
  13. package/lib/properties/backgroundRepeat.js +2 -2
  14. package/lib/properties/border.js +1 -1
  15. package/lib/properties/borderBottomColor.js +2 -2
  16. package/lib/properties/borderBottomStyle.js +2 -2
  17. package/lib/properties/borderBottomWidth.js +2 -2
  18. package/lib/properties/borderCollapse.js +2 -2
  19. package/lib/properties/borderColor.js +2 -2
  20. package/lib/properties/borderLeftColor.js +2 -2
  21. package/lib/properties/borderLeftStyle.js +2 -2
  22. package/lib/properties/borderLeftWidth.js +2 -2
  23. package/lib/properties/borderRightColor.js +2 -2
  24. package/lib/properties/borderRightStyle.js +2 -2
  25. package/lib/properties/borderRightWidth.js +2 -2
  26. package/lib/properties/borderSpacing.js +3 -3
  27. package/lib/properties/borderStyle.js +2 -2
  28. package/lib/properties/borderTopColor.js +2 -2
  29. package/lib/properties/borderTopStyle.js +2 -2
  30. package/lib/properties/borderTopWidth.js +2 -2
  31. package/lib/properties/borderWidth.js +2 -2
  32. package/lib/properties/bottom.js +2 -2
  33. package/lib/properties/clear.js +2 -2
  34. package/lib/properties/clip.js +4 -4
  35. package/lib/properties/color.js +2 -2
  36. package/lib/properties/cssFloat.js +2 -2
  37. package/lib/properties/flex.js +2 -4
  38. package/lib/properties/flexBasis.js +2 -2
  39. package/lib/properties/flexGrow.js +2 -2
  40. package/lib/properties/flexShrink.js +2 -2
  41. package/lib/properties/float.js +2 -2
  42. package/lib/properties/floodColor.js +2 -2
  43. package/lib/properties/font.js +1 -1
  44. package/lib/properties/fontFamily.js +2 -2
  45. package/lib/properties/fontSize.js +4 -4
  46. package/lib/properties/fontStyle.js +3 -3
  47. package/lib/properties/fontVariant.js +2 -2
  48. package/lib/properties/fontWeight.js +2 -2
  49. package/lib/properties/height.js +2 -2
  50. package/lib/properties/left.js +2 -2
  51. package/lib/properties/lightingColor.js +2 -2
  52. package/lib/properties/lineHeight.js +2 -2
  53. package/lib/properties/margin.js +6 -6
  54. package/lib/properties/marginBottom.js +1 -1
  55. package/lib/properties/marginLeft.js +1 -1
  56. package/lib/properties/marginRight.js +1 -1
  57. package/lib/properties/marginTop.js +1 -1
  58. package/lib/properties/opacity.js +2 -2
  59. package/lib/properties/outlineColor.js +2 -2
  60. package/lib/properties/padding.js +6 -6
  61. package/lib/properties/paddingBottom.js +1 -1
  62. package/lib/properties/paddingLeft.js +1 -1
  63. package/lib/properties/paddingRight.js +1 -1
  64. package/lib/properties/paddingTop.js +1 -1
  65. package/lib/properties/right.js +2 -2
  66. package/lib/properties/stopColor.js +2 -2
  67. package/lib/properties/textLineThroughColor.js +2 -2
  68. package/lib/properties/textOverlineColor.js +2 -2
  69. package/lib/properties/textUnderlineColor.js +2 -2
  70. package/lib/properties/top.js +2 -2
  71. package/lib/properties/webkitBorderAfterColor.js +2 -2
  72. package/lib/properties/webkitBorderBeforeColor.js +2 -2
  73. package/lib/properties/webkitBorderEndColor.js +2 -2
  74. package/lib/properties/webkitBorderStartColor.js +2 -2
  75. package/lib/properties/webkitColumnRuleColor.js +2 -2
  76. package/lib/properties/webkitMatchNearestMailBlockquoteColor.js +2 -2
  77. package/lib/properties/webkitTapHighlightColor.js +2 -2
  78. package/lib/properties/webkitTextEmphasisColor.js +2 -2
  79. package/lib/properties/webkitTextFillColor.js +2 -2
  80. package/lib/properties/webkitTextStrokeColor.js +2 -2
  81. package/lib/properties/width.js +2 -2
  82. package/lib/properties.js +1 -1
  83. package/lib/utils/getBasicPropertyDescriptor.js +2 -2
  84. package/package.json +15 -15
@@ -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,
@@ -3,7 +3,7 @@
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
  }
@@ -15,7 +15,7 @@ var isValid = function(v) {
15
15
  );
16
16
  };
17
17
 
18
- var parser = function(v) {
18
+ var parser = function (v) {
19
19
  var V = v.toLowerCase();
20
20
  if (V === 'auto') {
21
21
  return V;
@@ -27,16 +27,16 @@ var mySetter = parsers.implicitSetter('margin', '', isValid, parser);
27
27
  var myGlobal = parsers.implicitSetter(
28
28
  'margin',
29
29
  '',
30
- function() {
30
+ function () {
31
31
  return true;
32
32
  },
33
- function(v) {
33
+ function (v) {
34
34
  return v;
35
35
  }
36
36
  );
37
37
 
38
38
  module.exports.definition = {
39
- set: function(v) {
39
+ set: function (v) {
40
40
  if (typeof v === 'number') {
41
41
  v = String(v);
42
42
  }
@@ -57,7 +57,7 @@ module.exports.definition = {
57
57
  break;
58
58
  }
59
59
  },
60
- get: function() {
60
+ get: function () {
61
61
  return this.getPropertyValue('margin');
62
62
  },
63
63
  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,7 +3,7 @@
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
9
  type === TYPES.LENGTH ||
@@ -12,7 +12,7 @@ var isValid = function(v) {
12
12
  );
13
13
  };
14
14
 
15
- var parser = function(v) {
15
+ var parser = function (v) {
16
16
  return parsers.parseMeasurement(v);
17
17
  };
18
18
 
@@ -20,16 +20,16 @@ var mySetter = parsers.implicitSetter('padding', '', isValid, parser);
20
20
  var myGlobal = parsers.implicitSetter(
21
21
  'padding',
22
22
  '',
23
- function() {
23
+ function () {
24
24
  return true;
25
25
  },
26
- function(v) {
26
+ function (v) {
27
27
  return v;
28
28
  }
29
29
  );
30
30
 
31
31
  module.exports.definition = {
32
- set: function(v) {
32
+ set: function (v) {
33
33
  if (typeof v === 'number') {
34
34
  v = String(v);
35
35
  }
@@ -50,7 +50,7 @@ module.exports.definition = {
50
50
  break;
51
51
  }
52
52
  },
53
- get: function() {
53
+ get: function () {
54
54
  return this.getPropertyValue('padding');
55
55
  },
56
56
  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,
@@ -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,
@@ -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,
@@ -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-column-rule-color', parseColor(v));
8
8
  },
9
- get: function() {
9
+ get: function () {
10
10
  return this.getPropertyValue('-webkit-column-rule-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-match-nearest-mail-blockquote-color', parseColor(v));
8
8
  },
9
- get: function() {
9
+ get: function () {
10
10
  return this.getPropertyValue('-webkit-match-nearest-mail-blockquote-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-tap-highlight-color', parseColor(v));
8
8
  },
9
- get: function() {
9
+ get: function () {
10
10
  return this.getPropertyValue('-webkit-tap-highlight-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-text-emphasis-color', parseColor(v));
8
8
  },
9
- get: function() {
9
+ get: function () {
10
10
  return this.getPropertyValue('-webkit-text-emphasis-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-text-fill-color', parseColor(v));
8
8
  },
9
- get: function() {
9
+ get: function () {
10
10
  return this.getPropertyValue('-webkit-text-fill-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-text-stroke-color', parseColor(v));
8
8
  },
9
- get: function() {
9
+ get: function () {
10
10
  return this.getPropertyValue('-webkit-text-stroke-color');
11
11
  },
12
12
  enumerable: true,
@@ -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('width', parse(v));
18
18
  },
19
- get: function() {
19
+ get: function () {
20
20
  return this.getPropertyValue('width');
21
21
  },
22
22
  enumerable: true,
package/lib/properties.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- // autogenerated - 4/29/2020
3
+ // autogenerated - 2/12/2023
4
4
 
5
5
  /*
6
6
  *
@@ -2,10 +2,10 @@
2
2
 
3
3
  module.exports = function getBasicPropertyDescriptor(name) {
4
4
  return {
5
- set: function(v) {
5
+ set: function (v) {
6
6
  this._setProperty(name, v);
7
7
  },
8
- get: function() {
8
+ get: function () {
9
9
  return this.getPropertyValue(name);
10
10
  },
11
11
  enumerable: true,
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "CSSStyleDeclaration",
7
7
  "StyleSheet"
8
8
  ],
9
- "version": "2.3.0",
9
+ "version": "3.0.0",
10
10
  "homepage": "https://github.com/jsdom/cssstyle",
11
11
  "maintainers": [
12
12
  {
@@ -37,21 +37,21 @@
37
37
  ],
38
38
  "main": "./lib/CSSStyleDeclaration.js",
39
39
  "dependencies": {
40
- "cssom": "~0.3.6"
40
+ "rrweb-cssom": "^0.6.0"
41
41
  },
42
42
  "devDependencies": {
43
- "babel-generator": "~6.26.1",
44
- "babel-traverse": "~6.26.0",
45
- "babel-types": "~6.26.0",
46
- "babylon": "~6.18.0",
47
- "eslint": "~6.0.0",
48
- "eslint-config-prettier": "~6.0.0",
49
- "eslint-plugin-prettier": "~3.1.0",
50
- "jest": "^24.8.0",
43
+ "babel-generator": "^6.26.1",
44
+ "babel-traverse": "^6.26.0",
45
+ "babel-types": "^6.26.0",
46
+ "babylon": "^6.18.0",
47
+ "eslint": "^8.32.0",
48
+ "eslint-config-prettier": "^8.6.0",
49
+ "eslint-plugin-prettier": "^4.2.1",
50
+ "jest": "^29.3.1",
51
+ "minipass-fetch": "^3.0.1",
51
52
  "npm-run-all": "^4.1.5",
52
- "prettier": "~1.18.0",
53
- "request": "^2.88.0",
54
- "resolve": "~1.11.1"
53
+ "prettier": "^2.8.3",
54
+ "resolve": "^1.22.1"
55
55
  },
56
56
  "scripts": {
57
57
  "download": "node ./scripts/download_latest_properties.js && eslint lib/allProperties.js --fix",
@@ -62,11 +62,11 @@
62
62
  "lint:fix": "eslint . --fix --max-warnings 0",
63
63
  "prepublishOnly": "npm run lint && npm run test",
64
64
  "test": "npm run generate && jest",
65
- "test-ci": "npm run lint && npm run test && codecov",
65
+ "test-ci": "npm run lint && npm run test",
66
66
  "update-authors": "git log --format=\"%aN <%aE>\" | sort -f | uniq > AUTHORS"
67
67
  },
68
68
  "license": "MIT",
69
69
  "engines": {
70
- "node": ">=8"
70
+ "node": ">=14"
71
71
  }
72
72
  }