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,55 +1,82 @@
1
- (function() {
2
- var AlignSelf, Declaration, 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
- AlignSelf = (function(superClass) {
11
- extend(AlignSelf, 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 AlignSelf = function (_Declaration) {
13
+ _inherits(AlignSelf, _Declaration);
12
14
 
13
15
  function AlignSelf() {
14
- return AlignSelf.__super__.constructor.apply(this, arguments);
16
+ _classCallCheck(this, AlignSelf);
17
+
18
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
15
19
  }
16
20
 
17
- AlignSelf.names = ['align-self', 'flex-item-align'];
21
+ /**
22
+ * Change property name for 2012 specs
23
+ */
24
+ AlignSelf.prototype.prefixed = function prefixed(prop, prefix) {
25
+ var spec = void 0;
18
26
 
19
- AlignSelf.oldValues = {
20
- 'flex-end': 'end',
21
- 'flex-start': 'start'
22
- };
27
+ var _flexSpec = flexSpec(prefix);
28
+
29
+ spec = _flexSpec[0];
30
+ prefix = _flexSpec[1];
23
31
 
24
- AlignSelf.prototype.prefixed = function(prop, prefix) {
25
- var ref, spec;
26
- ref = flexSpec(prefix), spec = ref[0], prefix = ref[1];
27
- if (spec === 2012) {
28
- return prefix + 'flex-item-align';
29
- } else {
30
- return AlignSelf.__super__.prefixed.apply(this, arguments);
31
- }
32
+ if (spec === 2012) {
33
+ return prefix + 'flex-item-align';
34
+ } else {
35
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
36
+ }
32
37
  };
33
38
 
34
- AlignSelf.prototype.normalize = function(prop) {
35
- return 'align-self';
39
+ /**
40
+ * Return property name by final spec
41
+ */
42
+
43
+
44
+ AlignSelf.prototype.normalize = function normalize() {
45
+ return 'align-self';
36
46
  };
37
47
 
38
- AlignSelf.prototype.set = function(decl, prefix) {
39
- var spec;
40
- spec = flexSpec(prefix)[0];
41
- if (spec === 2012) {
42
- decl.value = AlignSelf.oldValues[decl.value] || decl.value;
43
- return AlignSelf.__super__.set.call(this, decl, prefix);
44
- } else if (spec === 'final') {
45
- return AlignSelf.__super__.set.apply(this, arguments);
46
- }
48
+ /**
49
+ * Change value for 2012 spec and ignore prefix for 2009
50
+ */
51
+
52
+
53
+ AlignSelf.prototype.set = function set(decl, prefix) {
54
+ var spec = flexSpec(prefix)[0];
55
+ if (spec === 2012) {
56
+ decl.value = AlignSelf.oldValues[decl.value] || decl.value;
57
+ return _Declaration.prototype.set.call(this, decl, prefix);
58
+ } else if (spec === 'final') {
59
+ return _Declaration.prototype.set.call(this, decl, prefix);
60
+ }
61
+ return undefined;
47
62
  };
48
63
 
49
64
  return AlignSelf;
65
+ }(Declaration);
50
66
 
51
- })(Declaration);
67
+ Object.defineProperty(AlignSelf, 'names', {
68
+ enumerable: true,
69
+ writable: true,
70
+ value: ['align-self', 'flex-item-align']
71
+ });
72
+ Object.defineProperty(AlignSelf, 'oldValues', {
73
+ enumerable: true,
74
+ writable: true,
75
+ value: {
76
+ 'flex-end': 'end',
77
+ 'flex-start': 'start'
78
+ }
79
+ });
52
80
 
53
- module.exports = AlignSelf;
54
81
 
55
- }).call(this);
82
+ module.exports = AlignSelf;
@@ -0,0 +1,42 @@
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 Declaration = require('../declaration');
10
+ var utils = require('../utils');
11
+
12
+ var Appearance = function (_Declaration) {
13
+ _inherits(Appearance, _Declaration);
14
+
15
+ function Appearance(name, prefixes, all) {
16
+ _classCallCheck(this, Appearance);
17
+
18
+ var _this = _possibleConstructorReturn(this, _Declaration.call(this, name, prefixes, all));
19
+
20
+ if (_this.prefixes) {
21
+ _this.prefixes = utils.uniq(_this.prefixes.map(function (i) {
22
+ if (i === '-ms-') {
23
+ return '-webkit-';
24
+ } else {
25
+ return i;
26
+ }
27
+ }));
28
+ }
29
+ return _this;
30
+ }
31
+
32
+ return Appearance;
33
+ }(Declaration);
34
+
35
+ Object.defineProperty(Appearance, 'names', {
36
+ enumerable: true,
37
+ writable: true,
38
+ value: ['appearance']
39
+ });
40
+
41
+
42
+ module.exports = Appearance;
@@ -1,32 +1,41 @@
1
- (function() {
2
- var BackgroundSize, Declaration,
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
- BackgroundSize = (function(superClass) {
9
- extend(BackgroundSize, 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 BackgroundSize = function (_Declaration) {
12
+ _inherits(BackgroundSize, _Declaration);
10
13
 
11
14
  function BackgroundSize() {
12
- return BackgroundSize.__super__.constructor.apply(this, arguments);
13
- }
15
+ _classCallCheck(this, BackgroundSize);
14
16
 
15
- BackgroundSize.names = ['background-size'];
17
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
18
+ }
16
19
 
17
- BackgroundSize.prototype.set = function(decl, prefix) {
18
- var value;
19
- value = decl.value.toLowerCase();
20
- if (prefix === '-webkit-' && value.indexOf(' ') === -1 && value !== 'contain' && value !== 'cover') {
21
- decl.value = decl.value + ' ' + decl.value;
22
- }
23
- return BackgroundSize.__super__.set.call(this, decl, prefix);
20
+ /**
21
+ * Duplication parameter for -webkit- browsers
22
+ */
23
+ BackgroundSize.prototype.set = function set(decl, prefix) {
24
+ var value = decl.value.toLowerCase();
25
+ if (prefix === '-webkit-' && value.indexOf(' ') === -1 && value !== 'contain' && value !== 'cover') {
26
+ decl.value = decl.value + ' ' + decl.value;
27
+ }
28
+ return _Declaration.prototype.set.call(this, decl, prefix);
24
29
  };
25
30
 
26
31
  return BackgroundSize;
32
+ }(Declaration);
27
33
 
28
- })(Declaration);
34
+ Object.defineProperty(BackgroundSize, 'names', {
35
+ enumerable: true,
36
+ writable: true,
37
+ value: ['background-size']
38
+ });
29
39
 
30
- module.exports = BackgroundSize;
31
40
 
32
- }).call(this);
41
+ module.exports = BackgroundSize;
@@ -1,35 +1,50 @@
1
- (function() {
2
- var BlockLogical, Declaration,
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
- BlockLogical = (function(superClass) {
9
- extend(BlockLogical, 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 BlockLogical = function (_Declaration) {
12
+ _inherits(BlockLogical, _Declaration);
10
13
 
11
14
  function BlockLogical() {
12
- return BlockLogical.__super__.constructor.apply(this, arguments);
13
- }
15
+ _classCallCheck(this, BlockLogical);
14
16
 
15
- BlockLogical.names = ['border-block-start', 'border-block-end', 'margin-block-start', 'margin-block-end', 'padding-block-start', 'padding-block-end', 'border-before', 'border-after', 'margin-before', 'margin-after', 'padding-before', 'padding-after'];
17
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
18
+ }
16
19
 
17
- BlockLogical.prototype.prefixed = function(prop, prefix) {
18
- return prefix + (prop.indexOf('-start') !== -1 ? prop.replace('-block-start', '-before') : prop.replace('-block-end', '-after'));
20
+ /**
21
+ * Use old syntax for -moz- and -webkit-
22
+ */
23
+ BlockLogical.prototype.prefixed = function prefixed(prop, prefix) {
24
+ return prefix + (prop.indexOf('-start') !== -1 ? prop.replace('-block-start', '-before') : prop.replace('-block-end', '-after'));
19
25
  };
20
26
 
21
- BlockLogical.prototype.normalize = function(prop) {
22
- if (prop.indexOf('-before') !== -1) {
23
- return prop.replace('-before', '-block-start');
24
- } else {
25
- return prop.replace('-after', '-block-end');
26
- }
27
+ /**
28
+ * Return property name by spec
29
+ */
30
+
31
+
32
+ BlockLogical.prototype.normalize = function normalize(prop) {
33
+ if (prop.indexOf('-before') !== -1) {
34
+ return prop.replace('-before', '-block-start');
35
+ } else {
36
+ return prop.replace('-after', '-block-end');
37
+ }
27
38
  };
28
39
 
29
40
  return BlockLogical;
41
+ }(Declaration);
30
42
 
31
- })(Declaration);
43
+ Object.defineProperty(BlockLogical, 'names', {
44
+ enumerable: true,
45
+ writable: true,
46
+ value: ['border-block-start', 'border-block-end', 'margin-block-start', 'margin-block-end', 'padding-block-start', 'padding-block-end', 'border-before', 'border-after', 'margin-before', 'margin-after', 'padding-before', 'padding-after']
47
+ });
32
48
 
33
- module.exports = BlockLogical;
34
49
 
35
- }).call(this);
50
+ module.exports = BlockLogical;
@@ -1,28 +1,38 @@
1
- (function() {
2
- var BorderImage, Declaration,
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
- BorderImage = (function(superClass) {
9
- extend(BorderImage, 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 BorderImage = function (_Declaration) {
12
+ _inherits(BorderImage, _Declaration);
10
13
 
11
14
  function BorderImage() {
12
- return BorderImage.__super__.constructor.apply(this, arguments);
13
- }
15
+ _classCallCheck(this, BorderImage);
14
16
 
15
- BorderImage.names = ['border-image'];
17
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
18
+ }
16
19
 
17
- BorderImage.prototype.set = function(decl, prefix) {
18
- decl.value = decl.value.replace(/\s+fill(\s)/, '$1');
19
- return BorderImage.__super__.set.call(this, decl, prefix);
20
+ /**
21
+ * Remove fill parameter for prefixed declarations
22
+ */
23
+ BorderImage.prototype.set = function set(decl, prefix) {
24
+ decl.value = decl.value.replace(/\s+fill(\s)/, '$1');
25
+ return _Declaration.prototype.set.call(this, decl, prefix);
20
26
  };
21
27
 
22
28
  return BorderImage;
29
+ }(Declaration);
23
30
 
24
- })(Declaration);
31
+ Object.defineProperty(BorderImage, 'names', {
32
+ enumerable: true,
33
+ writable: true,
34
+ value: ['border-image']
35
+ });
25
36
 
26
- module.exports = BorderImage;
27
37
 
28
- }).call(this);
38
+ module.exports = BorderImage;
@@ -1,56 +1,77 @@
1
- (function() {
2
- var BorderRadius, Declaration,
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
- BorderRadius = (function(superClass) {
9
- var hor, i, j, len, len1, mozilla, normal, ref, ref1, ver;
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; }
10
6
 
11
- extend(BorderRadius, 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; }
12
8
 
13
- function BorderRadius() {
14
- return BorderRadius.__super__.constructor.apply(this, arguments);
15
- }
16
-
17
- BorderRadius.names = ['border-radius'];
9
+ var Declaration = require('../declaration');
18
10
 
19
- BorderRadius.toMozilla = {};
11
+ var BorderRadius = function (_Declaration) {
12
+ _inherits(BorderRadius, _Declaration);
20
13
 
21
- BorderRadius.toNormal = {};
14
+ function BorderRadius() {
15
+ _classCallCheck(this, BorderRadius);
22
16
 
23
- ref = ['top', 'bottom'];
24
- for (i = 0, len = ref.length; i < len; i++) {
25
- ver = ref[i];
26
- ref1 = ['left', 'right'];
27
- for (j = 0, len1 = ref1.length; j < len1; j++) {
28
- hor = ref1[j];
29
- normal = "border-" + ver + "-" + hor + "-radius";
30
- mozilla = "border-radius-" + ver + hor;
31
- BorderRadius.names.push(normal);
32
- BorderRadius.names.push(mozilla);
33
- BorderRadius.toMozilla[normal] = mozilla;
34
- BorderRadius.toNormal[mozilla] = normal;
35
- }
17
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
36
18
  }
37
19
 
38
- BorderRadius.prototype.prefixed = function(prop, prefix) {
39
- if (prefix === '-moz-') {
40
- return prefix + (BorderRadius.toMozilla[prop] || prop);
41
- } else {
42
- return BorderRadius.__super__.prefixed.apply(this, arguments);
43
- }
20
+ /**
21
+ * Change syntax, when add Mozilla prefix
22
+ */
23
+ BorderRadius.prototype.prefixed = function prefixed(prop, prefix) {
24
+ if (prefix === '-moz-') {
25
+ return prefix + (BorderRadius.toMozilla[prop] || prop);
26
+ } else {
27
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
28
+ }
44
29
  };
45
30
 
46
- BorderRadius.prototype.normalize = function(prop) {
47
- return BorderRadius.toNormal[prop] || prop;
31
+ /**
32
+ * Return unprefixed version of property
33
+ */
34
+
35
+
36
+ BorderRadius.prototype.normalize = function normalize(prop) {
37
+ return BorderRadius.toNormal[prop] || prop;
48
38
  };
49
39
 
50
40
  return BorderRadius;
41
+ }(Declaration);
51
42
 
52
- })(Declaration);
43
+ Object.defineProperty(BorderRadius, 'names', {
44
+ enumerable: true,
45
+ writable: true,
46
+ value: ['border-radius']
47
+ });
48
+ Object.defineProperty(BorderRadius, 'toMozilla', {
49
+ enumerable: true,
50
+ writable: true,
51
+ value: {}
52
+ });
53
+ Object.defineProperty(BorderRadius, 'toNormal', {
54
+ enumerable: true,
55
+ writable: true,
56
+ value: {}
57
+ });
58
+ var _arr = ['top', 'bottom'];
53
59
 
54
- module.exports = BorderRadius;
55
60
 
56
- }).call(this);
61
+ for (var _i = 0; _i < _arr.length; _i++) {
62
+ var ver = _arr[_i];var _arr2 = ['left', 'right'];
63
+
64
+ for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
65
+ var hor = _arr2[_i2];
66
+ var normal = 'border-' + ver + '-' + hor + '-radius';
67
+ var mozilla = 'border-radius-' + ver + hor;
68
+
69
+ BorderRadius.names.push(normal);
70
+ BorderRadius.names.push(mozilla);
71
+
72
+ BorderRadius.toMozilla[normal] = mozilla;
73
+ BorderRadius.toNormal[mozilla] = normal;
74
+ }
75
+ }
76
+
77
+ module.exports = BorderRadius;
@@ -1,64 +1,89 @@
1
- (function() {
2
- var BreakProps, Declaration,
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
- BreakProps = (function(superClass) {
9
- extend(BreakProps, 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 BreakProps = function (_Declaration) {
12
+ _inherits(BreakProps, _Declaration);
10
13
 
11
14
  function BreakProps() {
12
- return BreakProps.__super__.constructor.apply(this, arguments);
13
- }
15
+ _classCallCheck(this, BreakProps);
14
16
 
15
- BreakProps.names = ['break-inside', 'page-break-inside', 'column-break-inside', 'break-before', 'page-break-before', 'column-break-before', 'break-after', 'page-break-after', 'column-break-after'];
17
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
18
+ }
16
19
 
17
- BreakProps.prototype.prefixed = function(prop, prefix) {
18
- if (prefix === '-webkit-') {
19
- return '-webkit-column-' + prop;
20
- } else if (prefix === '-moz-') {
21
- return 'page-' + prop;
22
- } else {
23
- return BreakProps.__super__.prefixed.apply(this, arguments);
24
- }
20
+ /**
21
+ * Change name for -webkit- and -moz- prefix
22
+ */
23
+ BreakProps.prototype.prefixed = function prefixed(prop, prefix) {
24
+ if (prefix === '-webkit-') {
25
+ return '-webkit-column-' + prop;
26
+ } else if (prefix === '-moz-') {
27
+ return 'page-' + prop;
28
+ } else {
29
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
30
+ }
25
31
  };
26
32
 
27
- BreakProps.prototype.normalize = function(prop) {
28
- if (prop.indexOf('inside') !== -1) {
29
- return 'break-inside';
30
- } else if (prop.indexOf('before') !== -1) {
31
- return 'break-before';
32
- } else if (prop.indexOf('after') !== -1) {
33
- return 'break-after';
34
- }
33
+ /**
34
+ * Return property name by final spec
35
+ */
36
+
37
+
38
+ BreakProps.prototype.normalize = function normalize(prop) {
39
+ if (prop.indexOf('inside') !== -1) {
40
+ return 'break-inside';
41
+ } else if (prop.indexOf('before') !== -1) {
42
+ return 'break-before';
43
+ } else if (prop.indexOf('after') !== -1) {
44
+ return 'break-after';
45
+ }
46
+ return undefined;
35
47
  };
36
48
 
37
- BreakProps.prototype.set = function(decl, prefix) {
38
- var v;
39
- v = decl.value;
40
- if (decl.prop === 'break-inside' && v === 'avoid-column' || v === 'avoid-page') {
41
- decl.value = 'avoid';
42
- }
43
- return BreakProps.__super__.set.apply(this, arguments);
49
+ /**
50
+ * Change prefixed value for avoid-column and avoid-page
51
+ */
52
+
53
+
54
+ BreakProps.prototype.set = function set(decl, prefix) {
55
+ var v = decl.value;
56
+ if (decl.prop === 'break-inside' && v === 'avoid-column' || v === 'avoid-page') {
57
+ decl.value = 'avoid';
58
+ }
59
+ return _Declaration.prototype.set.call(this, decl, prefix);
44
60
  };
45
61
 
46
- BreakProps.prototype.insert = function(decl, prefix, prefixes) {
47
- if (decl.prop !== 'break-inside') {
48
- return BreakProps.__super__.insert.apply(this, arguments);
49
- } else if (decl.value === 'avoid-region') {
62
+ /**
63
+ * Don’t prefix some values
64
+ */
50
65
 
51
- } else if (decl.value === 'avoid-page' && prefix === '-webkit-') {
52
66
 
53
- } else {
54
- return BreakProps.__super__.insert.apply(this, arguments);
55
- }
67
+ BreakProps.prototype.insert = function insert(decl, prefix, prefixes) {
68
+ if (decl.prop !== 'break-inside') {
69
+ return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
70
+ } else if (decl.value === 'avoid-region') {
71
+ return undefined;
72
+ } else if (decl.value === 'avoid-page' && prefix === '-webkit-') {
73
+ return undefined;
74
+ } else {
75
+ return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
76
+ }
56
77
  };
57
78
 
58
79
  return BreakProps;
80
+ }(Declaration);
59
81
 
60
- })(Declaration);
82
+ Object.defineProperty(BreakProps, 'names', {
83
+ enumerable: true,
84
+ writable: true,
85
+ value: ['break-inside', 'page-break-inside', 'column-break-inside', 'break-before', 'page-break-before', 'column-break-before', 'break-after', 'page-break-after', 'column-break-after']
86
+ });
61
87
 
62
- module.exports = BreakProps;
63
88
 
64
- }).call(this);
89
+ module.exports = BreakProps;