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.
Files changed (86) hide show
  1. package/README.md +3 -3
  2. package/lib/CSSStyleDeclaration.js +31 -25
  3. package/lib/CSSStyleDeclaration.test.js +187 -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 +43 -30
  8. package/lib/parsers.test.js +8 -1
  9. package/lib/properties/azimuth.js +3 -6
  10. package/lib/properties/backgroundAttachment.js +2 -2
  11. package/lib/properties/backgroundColor.js +2 -2
  12. package/lib/properties/backgroundImage.js +2 -2
  13. package/lib/properties/backgroundPosition.js +3 -3
  14. package/lib/properties/backgroundRepeat.js +2 -2
  15. package/lib/properties/border.js +1 -1
  16. package/lib/properties/borderBottomColor.js +2 -2
  17. package/lib/properties/borderBottomStyle.js +2 -2
  18. package/lib/properties/borderBottomWidth.js +2 -2
  19. package/lib/properties/borderCollapse.js +2 -2
  20. package/lib/properties/borderColor.js +2 -2
  21. package/lib/properties/borderLeftColor.js +2 -2
  22. package/lib/properties/borderLeftStyle.js +2 -2
  23. package/lib/properties/borderLeftWidth.js +2 -2
  24. package/lib/properties/borderRightColor.js +2 -2
  25. package/lib/properties/borderRightStyle.js +2 -2
  26. package/lib/properties/borderRightWidth.js +2 -2
  27. package/lib/properties/borderSpacing.js +3 -3
  28. package/lib/properties/borderStyle.js +2 -2
  29. package/lib/properties/borderTopColor.js +2 -2
  30. package/lib/properties/borderTopStyle.js +2 -2
  31. package/lib/properties/borderTopWidth.js +2 -2
  32. package/lib/properties/borderWidth.js +2 -2
  33. package/lib/properties/bottom.js +2 -2
  34. package/lib/properties/clear.js +2 -2
  35. package/lib/properties/clip.js +4 -4
  36. package/lib/properties/color.js +2 -2
  37. package/lib/properties/cssFloat.js +2 -2
  38. package/lib/properties/flex.js +2 -4
  39. package/lib/properties/flexBasis.js +2 -2
  40. package/lib/properties/flexGrow.js +2 -2
  41. package/lib/properties/flexShrink.js +2 -2
  42. package/lib/properties/float.js +2 -2
  43. package/lib/properties/floodColor.js +2 -2
  44. package/lib/properties/font.js +1 -1
  45. package/lib/properties/fontFamily.js +2 -2
  46. package/lib/properties/fontSize.js +4 -4
  47. package/lib/properties/fontStyle.js +3 -3
  48. package/lib/properties/fontVariant.js +2 -2
  49. package/lib/properties/fontWeight.js +2 -2
  50. package/lib/properties/height.js +2 -2
  51. package/lib/properties/left.js +2 -2
  52. package/lib/properties/lightingColor.js +2 -2
  53. package/lib/properties/lineHeight.js +2 -2
  54. package/lib/properties/margin.js +10 -6
  55. package/lib/properties/marginBottom.js +1 -1
  56. package/lib/properties/marginLeft.js +1 -1
  57. package/lib/properties/marginRight.js +1 -1
  58. package/lib/properties/marginTop.js +1 -1
  59. package/lib/properties/opacity.js +2 -2
  60. package/lib/properties/outlineColor.js +2 -2
  61. package/lib/properties/padding.js +10 -6
  62. package/lib/properties/paddingBottom.js +1 -1
  63. package/lib/properties/paddingLeft.js +1 -1
  64. package/lib/properties/paddingRight.js +1 -1
  65. package/lib/properties/paddingTop.js +1 -1
  66. package/lib/properties/right.js +2 -2
  67. package/lib/properties/stopColor.js +2 -2
  68. package/lib/properties/textLineThroughColor.js +2 -2
  69. package/lib/properties/textOverlineColor.js +2 -2
  70. package/lib/properties/textUnderlineColor.js +2 -2
  71. package/lib/properties/top.js +2 -2
  72. package/lib/properties/webkitBorderAfterColor.js +2 -2
  73. package/lib/properties/webkitBorderBeforeColor.js +2 -2
  74. package/lib/properties/webkitBorderEndColor.js +2 -2
  75. package/lib/properties/webkitBorderStartColor.js +2 -2
  76. package/lib/properties/webkitColumnRuleColor.js +2 -2
  77. package/lib/properties/webkitMatchNearestMailBlockquoteColor.js +2 -2
  78. package/lib/properties/webkitTapHighlightColor.js +2 -2
  79. package/lib/properties/webkitTextEmphasisColor.js +2 -2
  80. package/lib/properties/webkitTextFillColor.js +2 -2
  81. package/lib/properties/webkitTextStrokeColor.js +2 -2
  82. package/lib/properties/width.js +2 -2
  83. package/lib/properties.js +11 -3
  84. package/lib/utils/colorSpace.js +13 -15
  85. package/lib/utils/getBasicPropertyDescriptor.js +2 -2
  86. package/package.json +14 -15
@@ -191,4 +191,4 @@ module.exports = [
191
191
  'wrap-through',
192
192
  'writing-mode',
193
193
  'zoom',
194
- ].map(prop => 'webkit-' + prop);
194
+ ].map((prop) => 'webkit-' + prop);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- // autogenerated - 4/29/2020
3
+ // autogenerated - 12/28/2023
4
4
 
5
5
  /*
6
6
  *
package/lib/parsers.js CHANGED
@@ -32,7 +32,8 @@ var colorRegEx1 = /^#([0-9a-fA-F]{3,4}){1,2}$/;
32
32
  var colorRegEx2 = /^rgb\(([^)]*)\)$/;
33
33
  var colorRegEx3 = /^rgba\(([^)]*)\)$/;
34
34
  var calcRegEx = /^calc\(([^)]*)\)$/;
35
- var colorRegEx4 = /^hsla?\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*(,\s*(-?\d+|-?\d*.\d+)\s*)?\)/;
35
+ var colorRegEx4 =
36
+ /^hsla?\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*(,\s*(-?\d+|-?\d*.\d+)\s*)?\)/;
36
37
  var angleRegEx = /^([-+]?[0-9]*\.?[0-9]+)(deg|grad|rad)$/;
37
38
 
38
39
  // This will return one of the above types based on the passed in string
@@ -448,7 +449,7 @@ exports.parseKeyword = function parseKeyword(val, valid_keywords) {
448
449
  };
449
450
 
450
451
  // utility to translate from border-width to borderWidth
451
- var dashedToCamelCase = function(dashed) {
452
+ var dashedToCamelCase = function (dashed) {
452
453
  var i;
453
454
  var camel = '';
454
455
  var nextCap = false;
@@ -468,7 +469,7 @@ var is_space = /\s/;
468
469
  var opening_deliminators = ['"', "'", '('];
469
470
  var closing_deliminators = ['"', "'", ')'];
470
471
  // this splits on whitespace, but keeps quoted and parened parts together
471
- var getParts = function(str) {
472
+ var getParts = function (str) {
472
473
  var deliminator_stack = [];
473
474
  var length = str.length;
474
475
  var i;
@@ -521,7 +522,7 @@ exports.shorthandParser = function parse(v, shorthand_for) {
521
522
  var obj = {};
522
523
  var type = exports.valueType(v);
523
524
  if (type === exports.TYPES.NULL_OR_EMPTY_STR) {
524
- Object.keys(shorthand_for).forEach(function(property) {
525
+ Object.keys(shorthand_for).forEach(function (property) {
525
526
  obj[property] = '';
526
527
  });
527
528
  return obj;
@@ -540,9 +541,9 @@ exports.shorthandParser = function parse(v, shorthand_for) {
540
541
  }
541
542
  var parts = getParts(v);
542
543
  var valid = true;
543
- parts.forEach(function(part, i) {
544
+ parts.forEach(function (part, i) {
544
545
  var part_valid = false;
545
- Object.keys(shorthand_for).forEach(function(property) {
546
+ Object.keys(shorthand_for).forEach(function (property) {
546
547
  if (shorthand_for[property].isValid(part, i)) {
547
548
  part_valid = true;
548
549
  obj[property] = part;
@@ -556,14 +557,14 @@ exports.shorthandParser = function parse(v, shorthand_for) {
556
557
  return obj;
557
558
  };
558
559
 
559
- exports.shorthandSetter = function(property, shorthand_for) {
560
- return function(v) {
560
+ exports.shorthandSetter = function (property, shorthand_for) {
561
+ return function (v) {
561
562
  var obj = exports.shorthandParser(v, shorthand_for);
562
563
  if (obj === undefined) {
563
564
  return;
564
565
  }
565
566
  //console.log('shorthandSetter for:', property, 'obj:', obj);
566
- Object.keys(obj).forEach(function(subprop) {
567
+ Object.keys(obj).forEach(function (subprop) {
567
568
  // in case subprop is an implicit property, this will clear
568
569
  // *its* subpropertiesX
569
570
  var camel = dashedToCamelCase(subprop);
@@ -576,7 +577,7 @@ exports.shorthandSetter = function(property, shorthand_for) {
576
577
  this._values[subprop] = obj[subprop];
577
578
  }
578
579
  }, this);
579
- Object.keys(shorthand_for).forEach(function(subprop) {
580
+ Object.keys(shorthand_for).forEach(function (subprop) {
580
581
  if (!obj.hasOwnProperty(subprop)) {
581
582
  this.removeProperty(subprop);
582
583
  delete this._values[subprop];
@@ -594,16 +595,16 @@ exports.shorthandSetter = function(property, shorthand_for) {
594
595
  };
595
596
  };
596
597
 
597
- exports.shorthandGetter = function(property, shorthand_for) {
598
- return function() {
598
+ exports.shorthandGetter = function (property, shorthand_for) {
599
+ return function () {
599
600
  if (this._values[property] !== undefined) {
600
601
  return this.getPropertyValue(property);
601
602
  }
602
603
  return Object.keys(shorthand_for)
603
- .map(function(subprop) {
604
+ .map(function (subprop) {
604
605
  return this.getPropertyValue(subprop);
605
606
  }, this)
606
- .filter(function(value) {
607
+ .filter(function (value) {
607
608
  return value !== '';
608
609
  })
609
610
  .join(' ');
@@ -615,14 +616,14 @@ exports.shorthandGetter = function(property, shorthand_for) {
615
616
  // if two, the first applies to the top and bottom, and the second to left and right
616
617
  // if three, the first applies to the top, the second to left and right, the third bottom
617
618
  // if four, top, right, bottom, left
618
- exports.implicitSetter = function(property_before, property_after, isValid, parser) {
619
+ exports.implicitSetter = function (property_before, property_after, isValid, parser) {
619
620
  property_after = property_after || '';
620
621
  if (property_after !== '') {
621
622
  property_after = '-' + property_after;
622
623
  }
623
624
  var part_names = ['top', 'right', 'bottom', 'left'];
624
625
 
625
- return function(v) {
626
+ return function (v) {
626
627
  if (typeof v === 'number') {
627
628
  v = v.toString();
628
629
  }
@@ -643,7 +644,7 @@ exports.implicitSetter = function(property_before, property_after, isValid, pars
643
644
  return undefined;
644
645
  }
645
646
 
646
- parts = parts.map(function(part) {
647
+ parts = parts.map(function (part) {
647
648
  return parser(part);
648
649
  });
649
650
  this._setProperty(property_before + property_after, parts.join(' '));
@@ -674,14 +675,17 @@ exports.implicitSetter = function(property_before, property_after, isValid, pars
674
675
  // sub-parts are set. If so, it sets the shorthand version and removes
675
676
  // the individual parts from the cssText.
676
677
  //
677
- exports.subImplicitSetter = function(prefix, part, isValid, parser) {
678
+ exports.subImplicitSetter = function (prefix, part, isValid, parser) {
678
679
  var property = prefix + '-' + part;
679
680
  var subparts = [prefix + '-top', prefix + '-right', prefix + '-bottom', prefix + '-left'];
680
681
 
681
- return function(v) {
682
+ return function (v) {
682
683
  if (typeof v === 'number') {
683
684
  v = v.toString();
684
685
  }
686
+ if (v === null) {
687
+ v = '';
688
+ }
685
689
  if (typeof v !== 'string') {
686
690
  return undefined;
687
691
  }
@@ -690,19 +694,28 @@ exports.subImplicitSetter = function(prefix, part, isValid, parser) {
690
694
  }
691
695
  v = parser(v);
692
696
  this._setProperty(property, v);
693
- var parts = [];
694
- for (var i = 0; i < 4; i++) {
695
- if (this._values[subparts[i]] == null || this._values[subparts[i]] === '') {
696
- break;
697
- }
698
- parts.push(this._values[subparts[i]]);
699
- }
700
- if (parts.length === 4) {
701
- for (i = 0; i < 4; i++) {
697
+
698
+ var combinedPriority = this.getPropertyPriority(prefix);
699
+ var parts = subparts.map((subpart) => this._values[subpart]);
700
+ var priorities = subparts.map((subpart) => this.getPropertyPriority(subpart));
701
+ // Combine into a single property if all values are set and have the same priority
702
+ if (
703
+ parts.every((p) => p !== '' && p != null) &&
704
+ priorities.every((p) => p === priorities[0]) &&
705
+ priorities[0] === combinedPriority
706
+ ) {
707
+ for (var i = 0; i < subparts.length; i++) {
702
708
  this.removeProperty(subparts[i]);
703
709
  this._values[subparts[i]] = parts[i];
704
710
  }
705
- this._setProperty(prefix, parts.join(' '));
711
+ this._setProperty(prefix, parts.join(' '), priorities[0]);
712
+ } else {
713
+ this.removeProperty(prefix);
714
+ for (var j = 0; j < subparts.length; j++) {
715
+ // The property we're setting won't be important, the rest will either keep their priority or inherit it from the combined property
716
+ var priority = subparts[j] === property ? '' : priorities[j] || combinedPriority;
717
+ this._setProperty(subparts[j], parts[j], priority);
718
+ }
706
719
  }
707
720
  return v;
708
721
  };
@@ -711,7 +724,7 @@ exports.subImplicitSetter = function(prefix, part, isValid, parser) {
711
724
  var camel_to_dashed = /[A-Z]/g;
712
725
  var first_segment = /^\([^-]\)-/;
713
726
  var vendor_prefixes = ['o', 'moz', 'ms', 'webkit'];
714
- exports.camelToDashed = function(camel_case) {
727
+ exports.camelToDashed = function (camel_case) {
715
728
  var match;
716
729
  var dashed = camel_case.replace(camel_to_dashed, '-$&').toLowerCase();
717
730
  match = dashed.match(first_segment);
@@ -107,7 +107,14 @@ describe('parseColor', () => {
107
107
 
108
108
  expect(output).toEqual('rgba(5, 5, 5, 0.5)');
109
109
  });
110
-
110
+ it.each([
111
+ [120, 'rgb(0, 255, 0)'],
112
+ [240, 'rgb(0, 0, 255)'],
113
+ ])('should convert not zero hsl with non zero hue %s to %s', (hue, rgbValue) => {
114
+ let input = 'hsl(' + hue + ', 100%, 50%)';
115
+ let output = parsers.parseColor(input);
116
+ expect(output).toEqual(rgbValue);
117
+ });
111
118
  it.todo('Add more tests');
112
119
  });
113
120
  describe('parseAngle', () => {
@@ -3,16 +3,13 @@
3
3
  var parsers = require('../parsers');
4
4
 
5
5
  module.exports.definition = {
6
- set: function(v) {
6
+ set: function (v) {
7
7
  var valueType = parsers.valueType(v);
8
8
  if (valueType === parsers.TYPES.ANGLE) {
9
9
  return this._setProperty('azimuth', parsers.parseAngle(v));
10
10
  }
11
11
  if (valueType === parsers.TYPES.KEYWORD) {
12
- var keywords = v
13
- .toLowerCase()
14
- .trim()
15
- .split(/\s+/);
12
+ var keywords = v.toLowerCase().trim().split(/\s+/);
16
13
  var hasBehind = false;
17
14
  if (keywords.length > 2) {
18
15
  return;
@@ -59,7 +56,7 @@ module.exports.definition = {
59
56
  }
60
57
  }
61
58
  },
62
- get: function() {
59
+ get: function () {
63
60
  return this.getPropertyValue('azimuth');
64
61
  },
65
62
  enumerable: true,
@@ -10,13 +10,13 @@ var isValid = (module.exports.isValid = function isValid(v) {
10
10
  });
11
11
 
12
12
  module.exports.definition = {
13
- set: function(v) {
13
+ set: function (v) {
14
14
  if (!isValid(v)) {
15
15
  return;
16
16
  }
17
17
  this._setProperty('background-attachment', v);
18
18
  },
19
- get: function() {
19
+ get: function () {
20
20
  return this.getPropertyValue('background-attachment');
21
21
  },
22
22
  enumerable: true,
@@ -21,14 +21,14 @@ module.exports.isValid = function isValid(v) {
21
21
  };
22
22
 
23
23
  module.exports.definition = {
24
- set: function(v) {
24
+ set: function (v) {
25
25
  var parsed = parse(v);
26
26
  if (parsed === undefined) {
27
27
  return;
28
28
  }
29
29
  this._setProperty('background-color', parsed);
30
30
  },
31
- get: function() {
31
+ get: function () {
32
32
  return this.getPropertyValue('background-color');
33
33
  },
34
34
  enumerable: true,
@@ -21,10 +21,10 @@ module.exports.isValid = function isValid(v) {
21
21
  };
22
22
 
23
23
  module.exports.definition = {
24
- set: function(v) {
24
+ set: function (v) {
25
25
  this._setProperty('background-image', parse(v));
26
26
  },
27
- get: function() {
27
+ get: function () {
28
28
  return this.getPropertyValue('background-image');
29
29
  },
30
30
  enumerable: true,
@@ -13,7 +13,7 @@ var parse = function parse(v) {
13
13
  return undefined;
14
14
  }
15
15
  var types = [];
16
- parts.forEach(function(part, index) {
16
+ parts.forEach(function (part, index) {
17
17
  types[index] = parsers.valueType(part);
18
18
  });
19
19
  if (parts.length === 1) {
@@ -47,10 +47,10 @@ module.exports.isValid = function isValid(v) {
47
47
  };
48
48
 
49
49
  module.exports.definition = {
50
- set: function(v) {
50
+ set: function (v) {
51
51
  this._setProperty('background-position', parse(v));
52
52
  },
53
- get: function() {
53
+ get: function () {
54
54
  return this.getPropertyValue('background-position');
55
55
  },
56
56
  enumerable: true,
@@ -21,10 +21,10 @@ module.exports.isValid = function isValid(v) {
21
21
  };
22
22
 
23
23
  module.exports.definition = {
24
- set: function(v) {
24
+ set: function (v) {
25
25
  this._setProperty('background-repeat', parse(v));
26
26
  },
27
- get: function() {
27
+ get: function () {
28
28
  return this.getPropertyValue('background-repeat');
29
29
  },
30
30
  enumerable: true,
@@ -13,7 +13,7 @@ var myShorthandSetter = shorthandSetter('border', shorthand_for);
13
13
  var myShorthandGetter = shorthandGetter('border', shorthand_for);
14
14
 
15
15
  module.exports.definition = {
16
- set: function(v) {
16
+ set: function (v) {
17
17
  if (v.toString().toLowerCase() === 'none') {
18
18
  v = '';
19
19
  }
@@ -3,12 +3,12 @@
3
3
  var isValid = (module.exports.isValid = require('./borderColor').isValid);
4
4
 
5
5
  module.exports.definition = {
6
- set: function(v) {
6
+ set: function (v) {
7
7
  if (isValid(v)) {
8
8
  this._setProperty('border-bottom-color', v);
9
9
  }
10
10
  },
11
- get: function() {
11
+ get: function () {
12
12
  return this.getPropertyValue('border-bottom-color');
13
13
  },
14
14
  enumerable: true,
@@ -4,7 +4,7 @@ var isValid = require('./borderStyle').isValid;
4
4
  module.exports.isValid = isValid;
5
5
 
6
6
  module.exports.definition = {
7
- set: function(v) {
7
+ set: function (v) {
8
8
  if (isValid(v)) {
9
9
  if (v.toLowerCase() === 'none') {
10
10
  v = '';
@@ -13,7 +13,7 @@ module.exports.definition = {
13
13
  this._setProperty('border-bottom-style', v);
14
14
  }
15
15
  },
16
- get: function() {
16
+ get: function () {
17
17
  return this.getPropertyValue('border-bottom-style');
18
18
  },
19
19
  enumerable: true,
@@ -3,12 +3,12 @@
3
3
  var isValid = (module.exports.isValid = require('./borderWidth').isValid);
4
4
 
5
5
  module.exports.definition = {
6
- set: function(v) {
6
+ set: function (v) {
7
7
  if (isValid(v)) {
8
8
  this._setProperty('border-bottom-width', v);
9
9
  }
10
10
  },
11
- get: function() {
11
+ get: function () {
12
12
  return this.getPropertyValue('border-bottom-width');
13
13
  },
14
14
  enumerable: true,
@@ -15,10 +15,10 @@ var parse = function parse(v) {
15
15
  };
16
16
 
17
17
  module.exports.definition = {
18
- set: function(v) {
18
+ set: function (v) {
19
19
  this._setProperty('border-collapse', parse(v));
20
20
  },
21
- get: function() {
21
+ get: function () {
22
22
  return this.getPropertyValue('border-collapse');
23
23
  },
24
24
  enumerable: true,
@@ -13,7 +13,7 @@ module.exports.isValid = function parse(v) {
13
13
  };
14
14
  var isValid = module.exports.isValid;
15
15
 
16
- var parser = function(v) {
16
+ var parser = function (v) {
17
17
  if (isValid(v)) {
18
18
  return v.toLowerCase();
19
19
  }
@@ -22,7 +22,7 @@ var parser = function(v) {
22
22
 
23
23
  module.exports.definition = {
24
24
  set: implicitSetter('border', 'color', isValid, parser),
25
- get: function() {
25
+ get: function () {
26
26
  return this.getPropertyValue('border-color');
27
27
  },
28
28
  enumerable: true,
@@ -3,12 +3,12 @@
3
3
  var isValid = (module.exports.isValid = require('./borderColor').isValid);
4
4
 
5
5
  module.exports.definition = {
6
- set: function(v) {
6
+ set: function (v) {
7
7
  if (isValid(v)) {
8
8
  this._setProperty('border-left-color', v);
9
9
  }
10
10
  },
11
- get: function() {
11
+ get: function () {
12
12
  return this.getPropertyValue('border-left-color');
13
13
  },
14
14
  enumerable: true,
@@ -4,7 +4,7 @@ var isValid = require('./borderStyle').isValid;
4
4
  module.exports.isValid = isValid;
5
5
 
6
6
  module.exports.definition = {
7
- set: function(v) {
7
+ set: function (v) {
8
8
  if (isValid(v)) {
9
9
  if (v.toLowerCase() === 'none') {
10
10
  v = '';
@@ -13,7 +13,7 @@ module.exports.definition = {
13
13
  this._setProperty('border-left-style', v);
14
14
  }
15
15
  },
16
- get: function() {
16
+ get: function () {
17
17
  return this.getPropertyValue('border-left-style');
18
18
  },
19
19
  enumerable: true,
@@ -3,12 +3,12 @@
3
3
  var isValid = (module.exports.isValid = require('./borderWidth').isValid);
4
4
 
5
5
  module.exports.definition = {
6
- set: function(v) {
6
+ set: function (v) {
7
7
  if (isValid(v)) {
8
8
  this._setProperty('border-left-width', v);
9
9
  }
10
10
  },
11
- get: function() {
11
+ get: function () {
12
12
  return this.getPropertyValue('border-left-width');
13
13
  },
14
14
  enumerable: true,
@@ -3,12 +3,12 @@
3
3
  var isValid = (module.exports.isValid = require('./borderColor').isValid);
4
4
 
5
5
  module.exports.definition = {
6
- set: function(v) {
6
+ set: function (v) {
7
7
  if (isValid(v)) {
8
8
  this._setProperty('border-right-color', v);
9
9
  }
10
10
  },
11
- get: function() {
11
+ get: function () {
12
12
  return this.getPropertyValue('border-right-color');
13
13
  },
14
14
  enumerable: true,
@@ -4,7 +4,7 @@ var isValid = require('./borderStyle').isValid;
4
4
  module.exports.isValid = isValid;
5
5
 
6
6
  module.exports.definition = {
7
- set: function(v) {
7
+ set: function (v) {
8
8
  if (isValid(v)) {
9
9
  if (v.toLowerCase() === 'none') {
10
10
  v = '';
@@ -13,7 +13,7 @@ module.exports.definition = {
13
13
  this._setProperty('border-right-style', v);
14
14
  }
15
15
  },
16
- get: function() {
16
+ get: function () {
17
17
  return this.getPropertyValue('border-right-style');
18
18
  },
19
19
  enumerable: true,
@@ -3,12 +3,12 @@
3
3
  var isValid = (module.exports.isValid = require('./borderWidth').isValid);
4
4
 
5
5
  module.exports.definition = {
6
- set: function(v) {
6
+ set: function (v) {
7
7
  if (isValid(v)) {
8
8
  this._setProperty('border-right-width', v);
9
9
  }
10
10
  },
11
- get: function() {
11
+ get: function () {
12
12
  return this.getPropertyValue('border-right-width');
13
13
  },
14
14
  enumerable: true,
@@ -20,7 +20,7 @@ var parse = function parse(v) {
20
20
  if (parts.length !== 1 && parts.length !== 2) {
21
21
  return undefined;
22
22
  }
23
- parts.forEach(function(part) {
23
+ parts.forEach(function (part) {
24
24
  if (parsers.valueType(part) !== parsers.TYPES.LENGTH) {
25
25
  return undefined;
26
26
  }
@@ -30,10 +30,10 @@ var parse = function parse(v) {
30
30
  };
31
31
 
32
32
  module.exports.definition = {
33
- set: function(v) {
33
+ set: function (v) {
34
34
  this._setProperty('border-spacing', parse(v));
35
35
  },
36
- get: function() {
36
+ get: function () {
37
37
  return this.getPropertyValue('border-spacing');
38
38
  },
39
39
  enumerable: true,
@@ -21,7 +21,7 @@ module.exports.isValid = function parse(v) {
21
21
  };
22
22
  var isValid = module.exports.isValid;
23
23
 
24
- var parser = function(v) {
24
+ var parser = function (v) {
25
25
  if (isValid(v)) {
26
26
  return v.toLowerCase();
27
27
  }
@@ -30,7 +30,7 @@ var parser = function(v) {
30
30
 
31
31
  module.exports.definition = {
32
32
  set: implicitSetter('border', 'style', isValid, parser),
33
- get: function() {
33
+ get: function () {
34
34
  return this.getPropertyValue('border-style');
35
35
  },
36
36
  enumerable: true,
@@ -3,12 +3,12 @@
3
3
  var isValid = (module.exports.isValid = require('./borderColor').isValid);
4
4
 
5
5
  module.exports.definition = {
6
- set: function(v) {
6
+ set: function (v) {
7
7
  if (isValid(v)) {
8
8
  this._setProperty('border-top-color', v);
9
9
  }
10
10
  },
11
- get: function() {
11
+ get: function () {
12
12
  return this.getPropertyValue('border-top-color');
13
13
  },
14
14
  enumerable: true,
@@ -4,7 +4,7 @@ var isValid = require('./borderStyle').isValid;
4
4
  module.exports.isValid = isValid;
5
5
 
6
6
  module.exports.definition = {
7
- set: function(v) {
7
+ set: function (v) {
8
8
  if (isValid(v)) {
9
9
  if (v.toLowerCase() === 'none') {
10
10
  v = '';
@@ -13,7 +13,7 @@ module.exports.definition = {
13
13
  this._setProperty('border-top-style', v);
14
14
  }
15
15
  },
16
- get: function() {
16
+ get: function () {
17
17
  return this.getPropertyValue('border-top-style');
18
18
  },
19
19
  enumerable: true,
@@ -4,12 +4,12 @@ var isValid = require('./borderWidth').isValid;
4
4
  module.exports.isValid = isValid;
5
5
 
6
6
  module.exports.definition = {
7
- set: function(v) {
7
+ set: function (v) {
8
8
  if (isValid(v)) {
9
9
  this._setProperty('border-top-width', v);
10
10
  }
11
11
  },
12
- get: function() {
12
+ get: function () {
13
13
  return this.getPropertyValue('border-top-width');
14
14
  },
15
15
  enumerable: true,
@@ -25,7 +25,7 @@ module.exports.isValid = function parse(v) {
25
25
  };
26
26
  var isValid = module.exports.isValid;
27
27
 
28
- var parser = function(v) {
28
+ var parser = function (v) {
29
29
  var length = parsers.parseLength(v);
30
30
  if (length !== undefined) {
31
31
  return length;
@@ -38,7 +38,7 @@ var parser = function(v) {
38
38
 
39
39
  module.exports.definition = {
40
40
  set: implicitSetter('border', 'width', isValid, parser),
41
- get: function() {
41
+ get: function () {
42
42
  return this.getPropertyValue('border-width');
43
43
  },
44
44
  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('bottom', parseMeasurement(v));
8
8
  },
9
- get: function() {
9
+ get: function () {
10
10
  return this.getPropertyValue('bottom');
11
11
  },
12
12
  enumerable: true,
@@ -5,10 +5,10 @@ var parseKeyword = require('../parsers').parseKeyword;
5
5
  var clear_keywords = ['none', 'left', 'right', 'both', 'inherit'];
6
6
 
7
7
  module.exports.definition = {
8
- set: function(v) {
8
+ set: function (v) {
9
9
  this._setProperty('clear', parseKeyword(v, clear_keywords));
10
10
  },
11
- get: function() {
11
+ get: function () {
12
12
  return this.getPropertyValue('clear');
13
13
  },
14
14
  enumerable: true,