autoprefixer 6.7.6 → 7.1.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 (66) hide show
  1. package/AUTHORS +1 -0
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +10 -16
  4. package/data/prefixes.js +551 -517
  5. package/lib/at-rule.js +55 -38
  6. package/lib/autoprefixer.js +89 -63
  7. package/lib/brackets.js +59 -39
  8. package/lib/browsers.js +102 -65
  9. package/lib/declaration.js +212 -121
  10. package/lib/hacks/align-content.js +65 -38
  11. package/lib/hacks/align-items.js +62 -38
  12. package/lib/hacks/align-self.js +63 -36
  13. package/lib/hacks/appearance.js +42 -0
  14. package/lib/hacks/background-size.js +29 -20
  15. package/lib/hacks/block-logical.js +36 -21
  16. package/lib/hacks/border-image.js +26 -16
  17. package/lib/hacks/border-radius.js +60 -39
  18. package/lib/hacks/break-props.js +69 -44
  19. package/lib/hacks/cross-fade.js +40 -37
  20. package/lib/hacks/display-flex.js +81 -31
  21. package/lib/hacks/display-grid.js +29 -19
  22. package/lib/hacks/filter-value.js +66 -45
  23. package/lib/hacks/filter.js +26 -17
  24. package/lib/hacks/flex-basis.js +60 -30
  25. package/lib/hacks/flex-direction.js +85 -53
  26. package/lib/hacks/flex-flow.js +67 -49
  27. package/lib/hacks/flex-grow.js +45 -26
  28. package/lib/hacks/flex-shrink.js +60 -30
  29. package/lib/hacks/flex-spec.js +18 -8
  30. package/lib/hacks/flex-values.js +39 -20
  31. package/lib/hacks/flex-wrap.js +29 -20
  32. package/lib/hacks/flex.js +68 -43
  33. package/lib/hacks/fullscreen.js +31 -21
  34. package/lib/hacks/gradient.js +462 -302
  35. package/lib/hacks/grid-column-align.js +55 -0
  36. package/lib/hacks/grid-end.js +53 -28
  37. package/lib/hacks/grid-row-align.js +39 -19
  38. package/lib/hacks/grid-start.js +80 -48
  39. package/lib/hacks/grid-template.js +91 -55
  40. package/lib/hacks/image-rendering.js +63 -33
  41. package/lib/hacks/image-set.js +28 -20
  42. package/lib/hacks/inline-logical.js +32 -17
  43. package/lib/hacks/intrinsic.js +66 -0
  44. package/lib/hacks/justify-content.js +69 -42
  45. package/lib/hacks/mask-border.js +36 -21
  46. package/lib/hacks/order.js +58 -35
  47. package/lib/hacks/pixelated.js +44 -30
  48. package/lib/hacks/placeholder.js +40 -25
  49. package/lib/hacks/text-emphasis-position.js +27 -20
  50. package/lib/hacks/transform-decl.js +94 -52
  51. package/lib/hacks/writing-mode.js +37 -27
  52. package/lib/info.js +117 -78
  53. package/lib/old-selector.js +84 -58
  54. package/lib/old-value.js +22 -20
  55. package/lib/prefixer.js +164 -95
  56. package/lib/prefixes.js +446 -351
  57. package/lib/processor.js +394 -278
  58. package/lib/resolution.js +135 -75
  59. package/lib/selector.js +145 -84
  60. package/lib/supports.js +330 -210
  61. package/lib/transition.js +396 -243
  62. package/lib/utils.js +84 -48
  63. package/lib/value.js +118 -80
  64. package/package.json +54 -14
  65. package/lib/hacks/justify-items.js +0 -31
  66. package/lib/hacks/stretch.js +0 -45
@@ -1,53 +1,83 @@
1
- (function() {
2
- var Declaration, ImageRendering,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- Declaration = require('../declaration');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- ImageRendering = (function(superClass) {
9
- extend(ImageRendering, superClass);
5
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
+
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
+
9
+ var Declaration = require('../declaration');
10
+
11
+ var ImageRendering = function (_Declaration) {
12
+ _inherits(ImageRendering, _Declaration);
10
13
 
11
14
  function ImageRendering() {
12
- return ImageRendering.__super__.constructor.apply(this, arguments);
13
- }
15
+ _classCallCheck(this, ImageRendering);
14
16
 
15
- ImageRendering.names = ['image-rendering', 'interpolation-mode'];
17
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
18
+ }
16
19
 
17
- ImageRendering.prototype.check = function(decl) {
18
- return decl.value === 'pixelated';
20
+ /**
21
+ * Add hack only for crisp-edges
22
+ */
23
+ ImageRendering.prototype.check = function check(decl) {
24
+ return decl.value === 'pixelated';
19
25
  };
20
26
 
21
- ImageRendering.prototype.prefixed = function(prop, prefix) {
22
- if (prefix === '-ms-') {
23
- return '-ms-interpolation-mode';
24
- } else {
25
- return ImageRendering.__super__.prefixed.apply(this, arguments);
26
- }
27
+ /**
28
+ * Change property name for IE
29
+ */
30
+
31
+
32
+ ImageRendering.prototype.prefixed = function prefixed(prop, prefix) {
33
+ if (prefix === '-ms-') {
34
+ return '-ms-interpolation-mode';
35
+ } else {
36
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
37
+ }
27
38
  };
28
39
 
29
- ImageRendering.prototype.set = function(decl, prefix) {
30
- if (prefix === '-ms-') {
31
- decl.prop = '-ms-interpolation-mode';
32
- decl.value = 'nearest-neighbor';
33
- return decl;
34
- } else {
35
- return ImageRendering.__super__.set.apply(this, arguments);
36
- }
40
+ /**
41
+ * Change property and value for IE
42
+ */
43
+
44
+
45
+ ImageRendering.prototype.set = function set(decl, prefix) {
46
+ if (prefix === '-ms-') {
47
+ decl.prop = '-ms-interpolation-mode';
48
+ decl.value = 'nearest-neighbor';
49
+ return decl;
50
+ } else {
51
+ return _Declaration.prototype.set.call(this, decl, prefix);
52
+ }
37
53
  };
38
54
 
39
- ImageRendering.prototype.normalize = function(prop) {
40
- return 'image-rendering';
55
+ /**
56
+ * Return property name by spec
57
+ */
58
+
59
+
60
+ ImageRendering.prototype.normalize = function normalize() {
61
+ return 'image-rendering';
41
62
  };
42
63
 
43
- ImageRendering.prototype.process = function(node, result) {
44
- return ImageRendering.__super__.process.apply(this, arguments);
64
+ /**
65
+ * Warn on old value
66
+ */
67
+
68
+
69
+ ImageRendering.prototype.process = function process(node, result) {
70
+ return _Declaration.prototype.process.call(this, node, result);
45
71
  };
46
72
 
47
73
  return ImageRendering;
74
+ }(Declaration);
48
75
 
49
- })(Declaration);
76
+ Object.defineProperty(ImageRendering, 'names', {
77
+ enumerable: true,
78
+ writable: true,
79
+ value: ['image-rendering', 'interpolation-mode']
80
+ });
50
81
 
51
- module.exports = ImageRendering;
52
82
 
53
- }).call(this);
83
+ module.exports = ImageRendering;
@@ -1,33 +1,41 @@
1
- (function() {
2
- var ImageSet, Value, list,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- list = require('postcss/lib/list');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- Value = require('../value');
5
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
9
6
 
10
- ImageSet = (function(superClass) {
11
- extend(ImageSet, superClass);
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
+
9
+ var Value = require('../value');
10
+
11
+ var ImageSet = function (_Value) {
12
+ _inherits(ImageSet, _Value);
12
13
 
13
14
  function ImageSet() {
14
- return ImageSet.__super__.constructor.apply(this, arguments);
15
- }
15
+ _classCallCheck(this, ImageSet);
16
16
 
17
- ImageSet.names = ['image-set'];
17
+ return _possibleConstructorReturn(this, _Value.apply(this, arguments));
18
+ }
18
19
 
19
- ImageSet.prototype.replace = function(string, prefix) {
20
- if (prefix === '-webkit-') {
21
- return ImageSet.__super__.replace.apply(this, arguments).replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2');
22
- } else {
23
- return ImageSet.__super__.replace.apply(this, arguments);
24
- }
20
+ /**
21
+ * Use non-standard name for WebKit and Firefox
22
+ */
23
+ ImageSet.prototype.replace = function replace(string, prefix) {
24
+ if (prefix === '-webkit-') {
25
+ return _Value.prototype.replace.call(this, string, prefix).replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2');
26
+ } else {
27
+ return _Value.prototype.replace.call(this, string, prefix);
28
+ }
25
29
  };
26
30
 
27
31
  return ImageSet;
32
+ }(Value);
28
33
 
29
- })(Value);
34
+ Object.defineProperty(ImageSet, 'names', {
35
+ enumerable: true,
36
+ writable: true,
37
+ value: ['image-set']
38
+ });
30
39
 
31
- module.exports = ImageSet;
32
40
 
33
- }).call(this);
41
+ module.exports = ImageSet;
@@ -1,31 +1,46 @@
1
- (function() {
2
- var Declaration, InlineLogical,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- Declaration = require('../declaration');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- InlineLogical = (function(superClass) {
9
- extend(InlineLogical, superClass);
5
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
+
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
+
9
+ var Declaration = require('../declaration');
10
+
11
+ var InlineLogical = function (_Declaration) {
12
+ _inherits(InlineLogical, _Declaration);
10
13
 
11
14
  function InlineLogical() {
12
- return InlineLogical.__super__.constructor.apply(this, arguments);
13
- }
15
+ _classCallCheck(this, InlineLogical);
14
16
 
15
- InlineLogical.names = ['border-inline-start', 'border-inline-end', 'margin-inline-start', 'margin-inline-end', 'padding-inline-start', 'padding-inline-end', 'border-start', 'border-end', 'margin-start', 'margin-end', 'padding-start', 'padding-end'];
17
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
18
+ }
16
19
 
17
- InlineLogical.prototype.prefixed = function(prop, prefix) {
18
- return prefix + prop.replace('-inline', '');
20
+ /**
21
+ * Use old syntax for -moz- and -webkit-
22
+ */
23
+ InlineLogical.prototype.prefixed = function prefixed(prop, prefix) {
24
+ return prefix + prop.replace('-inline', '');
19
25
  };
20
26
 
21
- InlineLogical.prototype.normalize = function(prop) {
22
- return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2');
27
+ /**
28
+ * Return property name by spec
29
+ */
30
+
31
+
32
+ InlineLogical.prototype.normalize = function normalize(prop) {
33
+ return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2');
23
34
  };
24
35
 
25
36
  return InlineLogical;
37
+ }(Declaration);
26
38
 
27
- })(Declaration);
39
+ Object.defineProperty(InlineLogical, 'names', {
40
+ enumerable: true,
41
+ writable: true,
42
+ value: ['border-inline-start', 'border-inline-end', 'margin-inline-start', 'margin-inline-end', 'padding-inline-start', 'padding-inline-end', 'border-start', 'border-end', 'margin-start', 'margin-end', 'padding-start', 'padding-end']
43
+ });
28
44
 
29
- module.exports = InlineLogical;
30
45
 
31
- }).call(this);
46
+ module.exports = InlineLogical;
@@ -0,0 +1,66 @@
1
+ 'use strict';
2
+
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+
5
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
+
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
+
9
+ var OldValue = require('../old-value');
10
+ var Value = require('../value');
11
+
12
+ function _regexp(name) {
13
+ return new RegExp('(^|[\\s,(])(' + name + '($|[\\s),]))', 'gi');
14
+ }
15
+
16
+ var Intrinsic = function (_Value) {
17
+ _inherits(Intrinsic, _Value);
18
+
19
+ function Intrinsic() {
20
+ _classCallCheck(this, Intrinsic);
21
+
22
+ return _possibleConstructorReturn(this, _Value.apply(this, arguments));
23
+ }
24
+
25
+ Intrinsic.prototype.regexp = function regexp() {
26
+ if (!this.regexpCache) this.regexpCache = _regexp(this.name);
27
+ return this.regexpCache;
28
+ };
29
+
30
+ Intrinsic.prototype.isStretch = function isStretch() {
31
+ return this.name === 'stretch' || this.name === 'fill' || this.name === 'fill-available';
32
+ };
33
+
34
+ Intrinsic.prototype.replace = function replace(string, prefix) {
35
+ if (prefix === '-moz-' && this.isStretch()) {
36
+ return string.replace(this.regexp(), '$1-moz-available$3');
37
+ } else if (prefix === '-webkit-' && this.isStretch()) {
38
+ return string.replace(this.regexp(), '$1-webkit-fill-available$3');
39
+ } else {
40
+ return _Value.prototype.replace.call(this, string, prefix);
41
+ }
42
+ };
43
+
44
+ Intrinsic.prototype.old = function old(prefix) {
45
+ var prefixed = prefix + this.name;
46
+ if (this.isStretch()) {
47
+ if (prefix === '-moz-') {
48
+ prefixed = '-moz-available';
49
+ } else if (prefix === '-webkit-') {
50
+ prefixed = '-webkit-fill-available';
51
+ }
52
+ }
53
+ return new OldValue(this.name, prefixed, prefixed, _regexp(prefixed));
54
+ };
55
+
56
+ return Intrinsic;
57
+ }(Value);
58
+
59
+ Object.defineProperty(Intrinsic, 'names', {
60
+ enumerable: true,
61
+ writable: true,
62
+ value: ['max-content', 'min-content', 'fit-content', 'fill', 'fill-available', 'stretch']
63
+ });
64
+
65
+
66
+ module.exports = Intrinsic;
@@ -1,62 +1,89 @@
1
- (function() {
2
- var Declaration, JustifyContent, flexSpec,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- flexSpec = require('./flex-spec');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- Declaration = require('../declaration');
5
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
9
6
 
10
- JustifyContent = (function(superClass) {
11
- extend(JustifyContent, superClass);
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
+
9
+ var flexSpec = require('./flex-spec');
10
+ var Declaration = require('../declaration');
11
+
12
+ var JustifyContent = function (_Declaration) {
13
+ _inherits(JustifyContent, _Declaration);
12
14
 
13
15
  function JustifyContent() {
14
- return JustifyContent.__super__.constructor.apply(this, arguments);
16
+ _classCallCheck(this, JustifyContent);
17
+
18
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
15
19
  }
16
20
 
17
- JustifyContent.names = ['justify-content', 'flex-pack', 'box-pack'];
21
+ /**
22
+ * Change property name for 2009 and 2012 specs
23
+ */
24
+ JustifyContent.prototype.prefixed = function prefixed(prop, prefix) {
25
+ var spec = void 0;
18
26
 
19
- JustifyContent.oldValues = {
20
- 'flex-end': 'end',
21
- 'flex-start': 'start',
22
- 'space-between': 'justify',
23
- 'space-around': 'distribute'
24
- };
27
+ var _flexSpec = flexSpec(prefix);
28
+
29
+ spec = _flexSpec[0];
30
+ prefix = _flexSpec[1];
25
31
 
26
- JustifyContent.prototype.prefixed = function(prop, prefix) {
27
- var ref, spec;
28
- ref = flexSpec(prefix), spec = ref[0], prefix = ref[1];
29
- if (spec === 2009) {
30
- return prefix + 'box-pack';
31
- } else if (spec === 2012) {
32
- return prefix + 'flex-pack';
33
- } else {
34
- return JustifyContent.__super__.prefixed.apply(this, arguments);
35
- }
32
+ if (spec === 2009) {
33
+ return prefix + 'box-pack';
34
+ } else if (spec === 2012) {
35
+ return prefix + 'flex-pack';
36
+ } else {
37
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
38
+ }
36
39
  };
37
40
 
38
- JustifyContent.prototype.normalize = function(prop) {
39
- return 'justify-content';
41
+ /**
42
+ * Return property name by final spec
43
+ */
44
+
45
+
46
+ JustifyContent.prototype.normalize = function normalize() {
47
+ return 'justify-content';
40
48
  };
41
49
 
42
- JustifyContent.prototype.set = function(decl, prefix) {
43
- var spec, value;
44
- spec = flexSpec(prefix)[0];
45
- if (spec === 2009 || spec === 2012) {
46
- value = JustifyContent.oldValues[decl.value] || decl.value;
47
- decl.value = value;
48
- if (spec !== 2009 || value !== 'distribute') {
49
- return JustifyContent.__super__.set.call(this, decl, prefix);
50
+ /**
51
+ * Change value for 2009 and 2012 specs
52
+ */
53
+
54
+
55
+ JustifyContent.prototype.set = function set(decl, prefix) {
56
+ var spec = flexSpec(prefix)[0];
57
+ if (spec === 2009 || spec === 2012) {
58
+ var value = JustifyContent.oldValues[decl.value] || decl.value;
59
+ decl.value = value;
60
+ if (spec !== 2009 || value !== 'distribute') {
61
+ return _Declaration.prototype.set.call(this, decl, prefix);
62
+ }
63
+ } else if (spec === 'final') {
64
+ return _Declaration.prototype.set.call(this, decl, prefix);
50
65
  }
51
- } else if (spec === 'final') {
52
- return JustifyContent.__super__.set.apply(this, arguments);
53
- }
66
+ return undefined;
54
67
  };
55
68
 
56
69
  return JustifyContent;
70
+ }(Declaration);
57
71
 
58
- })(Declaration);
72
+ Object.defineProperty(JustifyContent, 'names', {
73
+ enumerable: true,
74
+ writable: true,
75
+ value: ['justify-content', 'flex-pack', 'box-pack']
76
+ });
77
+ Object.defineProperty(JustifyContent, 'oldValues', {
78
+ enumerable: true,
79
+ writable: true,
80
+ value: {
81
+ 'flex-end': 'end',
82
+ 'flex-start': 'start',
83
+ 'space-between': 'justify',
84
+ 'space-around': 'distribute'
85
+ }
86
+ });
59
87
 
60
- module.exports = JustifyContent;
61
88
 
62
- }).call(this);
89
+ module.exports = JustifyContent;
@@ -1,35 +1,50 @@
1
- (function() {
2
- var Declaration, MaskBorder,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- Declaration = require('../declaration');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- MaskBorder = (function(superClass) {
9
- extend(MaskBorder, superClass);
5
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
+
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
+
9
+ var Declaration = require('../declaration');
10
+
11
+ var MaskBorder = function (_Declaration) {
12
+ _inherits(MaskBorder, _Declaration);
10
13
 
11
14
  function MaskBorder() {
12
- return MaskBorder.__super__.constructor.apply(this, arguments);
13
- }
15
+ _classCallCheck(this, MaskBorder);
14
16
 
15
- MaskBorder.names = ['mask-border', 'mask-border-source', 'mask-border-slice', 'mask-border-width', 'mask-border-outset', 'mask-border-repeat', 'mask-box-image', 'mask-box-image-source', 'mask-box-image-slice', 'mask-box-image-width', 'mask-box-image-outset', 'mask-box-image-repeat'];
17
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
18
+ }
16
19
 
17
- MaskBorder.prototype.normalize = function() {
18
- return this.name.replace('box-image', 'border');
20
+ /**
21
+ * Return property name by final spec
22
+ */
23
+ MaskBorder.prototype.normalize = function normalize() {
24
+ return this.name.replace('box-image', 'border');
19
25
  };
20
26
 
21
- MaskBorder.prototype.prefixed = function(prop, prefix) {
22
- if (prefix === '-webkit-') {
23
- return MaskBorder.__super__.prefixed.apply(this, arguments).replace('border', 'box-image');
24
- } else {
25
- return MaskBorder.__super__.prefixed.apply(this, arguments);
26
- }
27
+ /**
28
+ * Return flex property for 2012 spec
29
+ */
30
+
31
+
32
+ MaskBorder.prototype.prefixed = function prefixed(prop, prefix) {
33
+ if (prefix === '-webkit-') {
34
+ return _Declaration.prototype.prefixed.call(this, prop, prefix).replace('border', 'box-image');
35
+ } else {
36
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
37
+ }
27
38
  };
28
39
 
29
40
  return MaskBorder;
41
+ }(Declaration);
30
42
 
31
- })(Declaration);
43
+ Object.defineProperty(MaskBorder, 'names', {
44
+ enumerable: true,
45
+ writable: true,
46
+ value: ['mask-border', 'mask-border-source', 'mask-border-slice', 'mask-border-width', 'mask-border-outset', 'mask-border-repeat', 'mask-box-image', 'mask-box-image-source', 'mask-box-image-slice', 'mask-box-image-width', 'mask-box-image-outset', 'mask-box-image-repeat']
47
+ });
32
48
 
33
- module.exports = MaskBorder;
34
49
 
35
- }).call(this);
50
+ module.exports = MaskBorder;
@@ -1,52 +1,75 @@
1
- (function() {
2
- var Declaration, Order, flexSpec,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- flexSpec = require('./flex-spec');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- Declaration = require('../declaration');
5
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
9
6
 
10
- Order = (function(superClass) {
11
- extend(Order, superClass);
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
+
9
+ var flexSpec = require('./flex-spec');
10
+ var Declaration = require('../declaration');
11
+
12
+ var Order = function (_Declaration) {
13
+ _inherits(Order, _Declaration);
12
14
 
13
15
  function Order() {
14
- return Order.__super__.constructor.apply(this, arguments);
16
+ _classCallCheck(this, Order);
17
+
18
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
15
19
  }
16
20
 
17
- Order.names = ['order', 'flex-order', 'box-ordinal-group'];
18
-
19
- Order.prototype.prefixed = function(prop, prefix) {
20
- var ref, spec;
21
- ref = flexSpec(prefix), spec = ref[0], prefix = ref[1];
22
- if (spec === 2009) {
23
- return prefix + 'box-ordinal-group';
24
- } else if (spec === 2012) {
25
- return prefix + 'flex-order';
26
- } else {
27
- return Order.__super__.prefixed.apply(this, arguments);
28
- }
21
+ /**
22
+ * Change property name for 2009 and 2012 specs
23
+ */
24
+ Order.prototype.prefixed = function prefixed(prop, prefix) {
25
+ var spec = void 0;
26
+
27
+ var _flexSpec = flexSpec(prefix);
28
+
29
+ spec = _flexSpec[0];
30
+ prefix = _flexSpec[1];
31
+
32
+ if (spec === 2009) {
33
+ return prefix + 'box-ordinal-group';
34
+ } else if (spec === 2012) {
35
+ return prefix + 'flex-order';
36
+ } else {
37
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
38
+ }
29
39
  };
30
40
 
31
- Order.prototype.normalize = function(prop) {
32
- return 'order';
41
+ /**
42
+ * Return property name by final spec
43
+ */
44
+
45
+
46
+ Order.prototype.normalize = function normalize() {
47
+ return 'order';
33
48
  };
34
49
 
35
- Order.prototype.set = function(decl, prefix) {
36
- var spec;
37
- spec = flexSpec(prefix)[0];
38
- if (spec === 2009) {
39
- decl.value = (parseInt(decl.value) + 1).toString();
40
- return Order.__super__.set.call(this, decl, prefix);
41
- } else {
42
- return Order.__super__.set.apply(this, arguments);
43
- }
50
+ /**
51
+ * Fix value for 2009 spec
52
+ */
53
+
54
+
55
+ Order.prototype.set = function set(decl, prefix) {
56
+ var spec = flexSpec(prefix)[0];
57
+ if (spec === 2009 && /\d/.test(decl.value)) {
58
+ decl.value = (parseInt(decl.value) + 1).toString();
59
+ return _Declaration.prototype.set.call(this, decl, prefix);
60
+ } else {
61
+ return _Declaration.prototype.set.call(this, decl, prefix);
62
+ }
44
63
  };
45
64
 
46
65
  return Order;
66
+ }(Declaration);
47
67
 
48
- })(Declaration);
68
+ Object.defineProperty(Order, 'names', {
69
+ enumerable: true,
70
+ writable: true,
71
+ value: ['order', 'flex-order', 'box-ordinal-group']
72
+ });
49
73
 
50
- module.exports = Order;
51
74
 
52
- }).call(this);
75
+ module.exports = Order;