autoprefixer 9.8.7 → 10.0.2

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 (80) hide show
  1. package/CHANGELOG.md +999 -0
  2. package/README.md +0 -3
  3. package/bin/autoprefixer +11 -11
  4. package/data/prefixes.js +799 -545
  5. package/lib/at-rule.js +23 -50
  6. package/lib/autoprefixer.js +108 -97
  7. package/lib/brackets.js +31 -44
  8. package/lib/browsers.js +54 -71
  9. package/lib/declaration.js +122 -178
  10. package/lib/hacks/align-content.js +24 -54
  11. package/lib/hacks/align-items.js +23 -53
  12. package/lib/hacks/align-self.js +32 -60
  13. package/lib/hacks/animation.js +11 -29
  14. package/lib/hacks/appearance.js +19 -35
  15. package/lib/hacks/backdrop-filter.js +16 -31
  16. package/lib/hacks/background-clip.js +19 -36
  17. package/lib/hacks/background-size.js +16 -31
  18. package/lib/hacks/block-logical.js +28 -36
  19. package/lib/hacks/border-image.js +9 -27
  20. package/lib/hacks/border-radius.js +22 -44
  21. package/lib/hacks/break-props.js +38 -51
  22. package/lib/hacks/color-adjust.js +11 -30
  23. package/lib/hacks/cross-fade.js +29 -48
  24. package/lib/hacks/display-flex.js +32 -61
  25. package/lib/hacks/display-grid.js +12 -32
  26. package/lib/hacks/filter-value.js +8 -25
  27. package/lib/hacks/filter.js +13 -27
  28. package/lib/hacks/flex-basis.js +21 -54
  29. package/lib/hacks/flex-direction.js +41 -77
  30. package/lib/hacks/flex-flow.js +33 -61
  31. package/lib/hacks/flex-grow.js +16 -43
  32. package/lib/hacks/flex-shrink.js +21 -54
  33. package/lib/hacks/flex-spec.js +7 -10
  34. package/lib/hacks/flex-wrap.js +11 -32
  35. package/lib/hacks/flex.js +27 -58
  36. package/lib/hacks/fullscreen.js +10 -30
  37. package/lib/hacks/gradient.js +240 -330
  38. package/lib/hacks/grid-area.js +25 -43
  39. package/lib/hacks/grid-column-align.js +14 -34
  40. package/lib/hacks/grid-end.js +30 -45
  41. package/lib/hacks/grid-row-align.js +14 -34
  42. package/lib/hacks/grid-row-column.js +20 -39
  43. package/lib/hacks/grid-rows-columns.js +75 -99
  44. package/lib/hacks/grid-start.js +17 -39
  45. package/lib/hacks/grid-template-areas.js +59 -76
  46. package/lib/hacks/grid-template.js +40 -61
  47. package/lib/hacks/grid-utils.js +686 -716
  48. package/lib/hacks/image-rendering.js +24 -47
  49. package/lib/hacks/image-set.js +10 -30
  50. package/lib/hacks/inline-logical.js +26 -32
  51. package/lib/hacks/intrinsic.js +40 -53
  52. package/lib/hacks/justify-content.js +26 -57
  53. package/lib/hacks/mask-border.js +28 -36
  54. package/lib/hacks/mask-composite.js +41 -57
  55. package/lib/hacks/order.js +22 -52
  56. package/lib/hacks/overscroll-behavior.js +16 -37
  57. package/lib/hacks/pixelated.js +16 -40
  58. package/lib/hacks/place-self.js +18 -41
  59. package/lib/hacks/placeholder-shown.js +9 -28
  60. package/lib/hacks/placeholder.js +15 -38
  61. package/lib/hacks/text-decoration-skip-ink.js +14 -29
  62. package/lib/hacks/text-decoration.js +20 -31
  63. package/lib/hacks/text-emphasis-position.js +9 -28
  64. package/lib/hacks/transform-decl.js +43 -69
  65. package/lib/hacks/user-select.js +19 -27
  66. package/lib/hacks/writing-mode.js +19 -36
  67. package/lib/info.js +63 -93
  68. package/lib/old-selector.js +39 -60
  69. package/lib/old-value.js +17 -25
  70. package/lib/prefixer.js +83 -110
  71. package/lib/prefixes.js +233 -336
  72. package/lib/processor.js +420 -416
  73. package/lib/resolution.js +62 -98
  74. package/lib/selector.js +91 -139
  75. package/lib/supports.js +194 -246
  76. package/lib/transition.js +170 -265
  77. package/lib/utils.js +49 -72
  78. package/lib/value.js +77 -116
  79. package/lib/vendor.js +14 -0
  80. package/package.json +23 -12
package/lib/prefixes.js CHANGED
@@ -1,471 +1,368 @@
1
- "use strict";
2
-
3
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
- var vendor = require('postcss').vendor;
10
-
11
- var Declaration = require('./declaration');
12
-
13
- var Resolution = require('./resolution');
14
-
15
- var Transition = require('./transition');
16
-
17
- var Processor = require('./processor');
18
-
19
- var Supports = require('./supports');
20
-
21
- var Browsers = require('./browsers');
22
-
23
- var Selector = require('./selector');
24
-
25
- var AtRule = require('./at-rule');
26
-
27
- var Value = require('./value');
28
-
29
- var utils = require('./utils');
30
-
31
- Selector.hack(require('./hacks/fullscreen'));
32
- Selector.hack(require('./hacks/placeholder'));
33
- Selector.hack(require('./hacks/placeholder-shown'));
34
- Declaration.hack(require('./hacks/flex'));
35
- Declaration.hack(require('./hacks/order'));
36
- Declaration.hack(require('./hacks/filter'));
37
- Declaration.hack(require('./hacks/grid-end'));
38
- Declaration.hack(require('./hacks/animation'));
39
- Declaration.hack(require('./hacks/flex-flow'));
40
- Declaration.hack(require('./hacks/flex-grow'));
41
- Declaration.hack(require('./hacks/flex-wrap'));
42
- Declaration.hack(require('./hacks/grid-area'));
43
- Declaration.hack(require('./hacks/place-self'));
44
- Declaration.hack(require('./hacks/grid-start'));
45
- Declaration.hack(require('./hacks/align-self'));
46
- Declaration.hack(require('./hacks/appearance'));
47
- Declaration.hack(require('./hacks/flex-basis'));
48
- Declaration.hack(require('./hacks/mask-border'));
49
- Declaration.hack(require('./hacks/mask-composite'));
50
- Declaration.hack(require('./hacks/align-items'));
51
- Declaration.hack(require('./hacks/user-select'));
52
- Declaration.hack(require('./hacks/flex-shrink'));
53
- Declaration.hack(require('./hacks/break-props'));
54
- Declaration.hack(require('./hacks/color-adjust'));
55
- Declaration.hack(require('./hacks/writing-mode'));
56
- Declaration.hack(require('./hacks/border-image'));
57
- Declaration.hack(require('./hacks/align-content'));
58
- Declaration.hack(require('./hacks/border-radius'));
59
- Declaration.hack(require('./hacks/block-logical'));
60
- Declaration.hack(require('./hacks/grid-template'));
61
- Declaration.hack(require('./hacks/inline-logical'));
62
- Declaration.hack(require('./hacks/grid-row-align'));
63
- Declaration.hack(require('./hacks/transform-decl'));
64
- Declaration.hack(require('./hacks/flex-direction'));
65
- Declaration.hack(require('./hacks/image-rendering'));
66
- Declaration.hack(require('./hacks/backdrop-filter'));
67
- Declaration.hack(require('./hacks/background-clip'));
68
- Declaration.hack(require('./hacks/text-decoration'));
69
- Declaration.hack(require('./hacks/justify-content'));
70
- Declaration.hack(require('./hacks/background-size'));
71
- Declaration.hack(require('./hacks/grid-row-column'));
72
- Declaration.hack(require('./hacks/grid-rows-columns'));
73
- Declaration.hack(require('./hacks/grid-column-align'));
74
- Declaration.hack(require('./hacks/overscroll-behavior'));
75
- Declaration.hack(require('./hacks/grid-template-areas'));
76
- Declaration.hack(require('./hacks/text-emphasis-position'));
77
- Declaration.hack(require('./hacks/text-decoration-skip-ink'));
78
- Value.hack(require('./hacks/gradient'));
79
- Value.hack(require('./hacks/intrinsic'));
80
- Value.hack(require('./hacks/pixelated'));
81
- Value.hack(require('./hacks/image-set'));
82
- Value.hack(require('./hacks/cross-fade'));
83
- Value.hack(require('./hacks/display-flex'));
84
- Value.hack(require('./hacks/display-grid'));
85
- Value.hack(require('./hacks/filter-value'));
86
- var declsCache = {};
87
-
88
- var Prefixes = /*#__PURE__*/function () {
89
- function Prefixes(data, browsers, options) {
90
- if (options === void 0) {
91
- options = {};
92
- }
93
-
94
- this.data = data;
95
- this.browsers = browsers;
96
- this.options = options;
97
-
98
- var _this$preprocess = this.preprocess(this.select(this.data));
99
-
100
- this.add = _this$preprocess[0];
101
- this.remove = _this$preprocess[1];
102
- this.transition = new Transition(this);
103
- this.processor = new Processor(this);
1
+ let vendor = require('./vendor')
2
+ let Declaration = require('./declaration')
3
+ let Resolution = require('./resolution')
4
+ let Transition = require('./transition')
5
+ let Processor = require('./processor')
6
+ let Supports = require('./supports')
7
+ let Browsers = require('./browsers')
8
+ let Selector = require('./selector')
9
+ let AtRule = require('./at-rule')
10
+ let Value = require('./value')
11
+ let utils = require('./utils')
12
+ Selector.hack(require('./hacks/fullscreen'))
13
+ Selector.hack(require('./hacks/placeholder'))
14
+ Selector.hack(require('./hacks/placeholder-shown'))
15
+ Declaration.hack(require('./hacks/flex'))
16
+ Declaration.hack(require('./hacks/order'))
17
+ Declaration.hack(require('./hacks/filter'))
18
+ Declaration.hack(require('./hacks/grid-end'))
19
+ Declaration.hack(require('./hacks/animation'))
20
+ Declaration.hack(require('./hacks/flex-flow'))
21
+ Declaration.hack(require('./hacks/flex-grow'))
22
+ Declaration.hack(require('./hacks/flex-wrap'))
23
+ Declaration.hack(require('./hacks/grid-area'))
24
+ Declaration.hack(require('./hacks/place-self'))
25
+ Declaration.hack(require('./hacks/grid-start'))
26
+ Declaration.hack(require('./hacks/align-self'))
27
+ Declaration.hack(require('./hacks/appearance'))
28
+ Declaration.hack(require('./hacks/flex-basis'))
29
+ Declaration.hack(require('./hacks/mask-border'))
30
+ Declaration.hack(require('./hacks/mask-composite'))
31
+ Declaration.hack(require('./hacks/align-items'))
32
+ Declaration.hack(require('./hacks/user-select'))
33
+ Declaration.hack(require('./hacks/flex-shrink'))
34
+ Declaration.hack(require('./hacks/break-props'))
35
+ Declaration.hack(require('./hacks/color-adjust'))
36
+ Declaration.hack(require('./hacks/writing-mode'))
37
+ Declaration.hack(require('./hacks/border-image'))
38
+ Declaration.hack(require('./hacks/align-content'))
39
+ Declaration.hack(require('./hacks/border-radius'))
40
+ Declaration.hack(require('./hacks/block-logical'))
41
+ Declaration.hack(require('./hacks/grid-template'))
42
+ Declaration.hack(require('./hacks/inline-logical'))
43
+ Declaration.hack(require('./hacks/grid-row-align'))
44
+ Declaration.hack(require('./hacks/transform-decl'))
45
+ Declaration.hack(require('./hacks/flex-direction'))
46
+ Declaration.hack(require('./hacks/image-rendering'))
47
+ Declaration.hack(require('./hacks/backdrop-filter'))
48
+ Declaration.hack(require('./hacks/background-clip'))
49
+ Declaration.hack(require('./hacks/text-decoration'))
50
+ Declaration.hack(require('./hacks/justify-content'))
51
+ Declaration.hack(require('./hacks/background-size'))
52
+ Declaration.hack(require('./hacks/grid-row-column'))
53
+ Declaration.hack(require('./hacks/grid-rows-columns'))
54
+ Declaration.hack(require('./hacks/grid-column-align'))
55
+ Declaration.hack(require('./hacks/overscroll-behavior'))
56
+ Declaration.hack(require('./hacks/grid-template-areas'))
57
+ Declaration.hack(require('./hacks/text-emphasis-position'))
58
+ Declaration.hack(require('./hacks/text-decoration-skip-ink'))
59
+ Value.hack(require('./hacks/gradient'))
60
+ Value.hack(require('./hacks/intrinsic'))
61
+ Value.hack(require('./hacks/pixelated'))
62
+ Value.hack(require('./hacks/image-set'))
63
+ Value.hack(require('./hacks/cross-fade'))
64
+ Value.hack(require('./hacks/display-flex'))
65
+ Value.hack(require('./hacks/display-grid'))
66
+ Value.hack(require('./hacks/filter-value'))
67
+
68
+ let declsCache = new Map()
69
+
70
+ class Prefixes {
71
+ constructor (data, browsers, options = {}) {
72
+ this.data = data
73
+ this.browsers = browsers
74
+ this.options = options
75
+ ;[this.add, this.remove] = this.preprocess(this.select(this.data))
76
+ this.transition = new Transition(this)
77
+ this.processor = new Processor(this)
104
78
  }
79
+
105
80
  /**
106
81
  * Return clone instance to remove all prefixes
107
82
  */
108
-
109
-
110
- var _proto = Prefixes.prototype;
111
-
112
- _proto.cleaner = function cleaner() {
83
+ cleaner () {
113
84
  if (this.cleanerCache) {
114
- return this.cleanerCache;
85
+ return this.cleanerCache
115
86
  }
116
87
 
117
88
  if (this.browsers.selected.length) {
118
- var empty = new Browsers(this.browsers.data, []);
119
- this.cleanerCache = new Prefixes(this.data, empty, this.options);
89
+ let empty = new Browsers(this.browsers.data, [])
90
+ this.cleanerCache = new Prefixes(this.data, empty, this.options)
120
91
  } else {
121
- return this;
92
+ return this
122
93
  }
123
94
 
124
- return this.cleanerCache;
95
+ return this.cleanerCache
125
96
  }
97
+
126
98
  /**
127
99
  * Select prefixes from data, which is necessary for selected browsers
128
100
  */
129
- ;
101
+ select (list) {
102
+ let selected = { add: {}, remove: {} }
130
103
 
131
- _proto.select = function select(list) {
132
- var _this = this;
133
-
134
- var selected = {
135
- add: {},
136
- remove: {}
137
- };
138
-
139
- var _loop = function _loop(name) {
140
- var data = list[name];
141
- var add = data.browsers.map(function (i) {
142
- var params = i.split(' ');
104
+ for (let name in list) {
105
+ let data = list[name]
106
+ let add = data.browsers.map(i => {
107
+ let params = i.split(' ')
143
108
  return {
144
- browser: params[0] + " " + params[1],
109
+ browser: `${params[0]} ${params[1]}`,
145
110
  note: params[2]
146
- };
147
- });
148
- var notes = add.filter(function (i) {
149
- return i.note;
150
- }).map(function (i) {
151
- return _this.browsers.prefix(i.browser) + " " + i.note;
152
- });
153
- notes = utils.uniq(notes);
154
- add = add.filter(function (i) {
155
- return _this.browsers.isSelected(i.browser);
156
- }).map(function (i) {
157
- var prefix = _this.browsers.prefix(i.browser);
158
-
159
- if (i.note) {
160
- return prefix + " " + i.note;
161
- } else {
162
- return prefix;
163
111
  }
164
- });
165
- add = _this.sort(utils.uniq(add));
112
+ })
113
+
114
+ let notes = add
115
+ .filter(i => i.note)
116
+ .map(i => `${this.browsers.prefix(i.browser)} ${i.note}`)
117
+ notes = utils.uniq(notes)
118
+
119
+ add = add
120
+ .filter(i => this.browsers.isSelected(i.browser))
121
+ .map(i => {
122
+ let prefix = this.browsers.prefix(i.browser)
123
+ if (i.note) {
124
+ return `${prefix} ${i.note}`
125
+ } else {
126
+ return prefix
127
+ }
128
+ })
129
+ add = this.sort(utils.uniq(add))
166
130
 
167
- if (_this.options.flexbox === 'no-2009') {
168
- add = add.filter(function (i) {
169
- return !i.includes('2009');
170
- });
131
+ if (this.options.flexbox === 'no-2009') {
132
+ add = add.filter(i => !i.includes('2009'))
171
133
  }
172
134
 
173
- var all = data.browsers.map(function (i) {
174
- return _this.browsers.prefix(i);
175
- });
176
-
135
+ let all = data.browsers.map(i => this.browsers.prefix(i))
177
136
  if (data.mistakes) {
178
- all = all.concat(data.mistakes);
137
+ all = all.concat(data.mistakes)
179
138
  }
180
-
181
- all = all.concat(notes);
182
- all = utils.uniq(all);
139
+ all = all.concat(notes)
140
+ all = utils.uniq(all)
183
141
 
184
142
  if (add.length) {
185
- selected.add[name] = add;
186
-
143
+ selected.add[name] = add
187
144
  if (add.length < all.length) {
188
- selected.remove[name] = all.filter(function (i) {
189
- return !add.includes(i);
190
- });
145
+ selected.remove[name] = all.filter(i => !add.includes(i))
191
146
  }
192
147
  } else {
193
- selected.remove[name] = all;
148
+ selected.remove[name] = all
194
149
  }
195
- };
196
-
197
- for (var name in list) {
198
- _loop(name);
199
150
  }
200
151
 
201
- return selected;
152
+ return selected
202
153
  }
154
+
203
155
  /**
204
156
  * Sort vendor prefixes
205
157
  */
206
- ;
207
-
208
- _proto.sort = function sort(prefixes) {
209
- return prefixes.sort(function (a, b) {
210
- var aLength = utils.removeNote(a).length;
211
- var bLength = utils.removeNote(b).length;
158
+ sort (prefixes) {
159
+ return prefixes.sort((a, b) => {
160
+ let aLength = utils.removeNote(a).length
161
+ let bLength = utils.removeNote(b).length
212
162
 
213
163
  if (aLength === bLength) {
214
- return b.length - a.length;
164
+ return b.length - a.length
215
165
  } else {
216
- return bLength - aLength;
166
+ return bLength - aLength
217
167
  }
218
- });
168
+ })
219
169
  }
170
+
220
171
  /**
221
172
  * Cache prefixes data to fast CSS processing
222
173
  */
223
- ;
224
-
225
- _proto.preprocess = function preprocess(selected) {
226
- var add = {
174
+ preprocess (selected) {
175
+ let add = {
227
176
  'selectors': [],
228
177
  '@supports': new Supports(Prefixes, this)
229
- };
230
-
231
- for (var name in selected.add) {
232
- var prefixes = selected.add[name];
233
-
178
+ }
179
+ for (let name in selected.add) {
180
+ let prefixes = selected.add[name]
234
181
  if (name === '@keyframes' || name === '@viewport') {
235
- add[name] = new AtRule(name, prefixes, this);
182
+ add[name] = new AtRule(name, prefixes, this)
236
183
  } else if (name === '@resolution') {
237
- add[name] = new Resolution(name, prefixes, this);
184
+ add[name] = new Resolution(name, prefixes, this)
238
185
  } else if (this.data[name].selector) {
239
- add.selectors.push(Selector.load(name, prefixes, this));
186
+ add.selectors.push(Selector.load(name, prefixes, this))
240
187
  } else {
241
- var props = this.data[name].props;
188
+ let props = this.data[name].props
242
189
 
243
190
  if (props) {
244
- var value = Value.load(name, prefixes, this);
245
-
246
- for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done;) {
247
- var prop = _step.value;
248
-
191
+ let value = Value.load(name, prefixes, this)
192
+ for (let prop of props) {
249
193
  if (!add[prop]) {
250
- add[prop] = {
251
- values: []
252
- };
194
+ add[prop] = { values: [] }
253
195
  }
254
-
255
- add[prop].values.push(value);
196
+ add[prop].values.push(value)
256
197
  }
257
198
  } else {
258
- var values = add[name] && add[name].values || [];
259
- add[name] = Declaration.load(name, prefixes, this);
260
- add[name].values = values;
199
+ let values = (add[name] && add[name].values) || []
200
+ add[name] = Declaration.load(name, prefixes, this)
201
+ add[name].values = values
261
202
  }
262
203
  }
263
204
  }
264
205
 
265
- var remove = {
266
- selectors: []
267
- };
268
-
269
- for (var _name in selected.remove) {
270
- var _prefixes = selected.remove[_name];
271
-
272
- if (this.data[_name].selector) {
273
- var selector = Selector.load(_name, _prefixes);
274
-
275
- for (var _iterator2 = _createForOfIteratorHelperLoose(_prefixes), _step2; !(_step2 = _iterator2()).done;) {
276
- var prefix = _step2.value;
277
- remove.selectors.push(selector.old(prefix));
206
+ let remove = { selectors: [] }
207
+ for (let name in selected.remove) {
208
+ let prefixes = selected.remove[name]
209
+ if (this.data[name].selector) {
210
+ let selector = Selector.load(name, prefixes)
211
+ for (let prefix of prefixes) {
212
+ remove.selectors.push(selector.old(prefix))
278
213
  }
279
- } else if (_name === '@keyframes' || _name === '@viewport') {
280
- for (var _iterator3 = _createForOfIteratorHelperLoose(_prefixes), _step3; !(_step3 = _iterator3()).done;) {
281
- var _prefix = _step3.value;
282
-
283
- var prefixed = "@" + _prefix + _name.slice(1);
284
-
285
- remove[prefixed] = {
286
- remove: true
287
- };
214
+ } else if (name === '@keyframes' || name === '@viewport') {
215
+ for (let prefix of prefixes) {
216
+ let prefixed = `@${prefix}${name.slice(1)}`
217
+ remove[prefixed] = { remove: true }
288
218
  }
289
- } else if (_name === '@resolution') {
290
- remove[_name] = new Resolution(_name, _prefixes, this);
219
+ } else if (name === '@resolution') {
220
+ remove[name] = new Resolution(name, prefixes, this)
291
221
  } else {
292
- var _props = this.data[_name].props;
293
-
294
- if (_props) {
295
- var _value = Value.load(_name, [], this);
296
-
297
- for (var _iterator4 = _createForOfIteratorHelperLoose(_prefixes), _step4; !(_step4 = _iterator4()).done;) {
298
- var _prefix2 = _step4.value;
299
-
300
- var old = _value.old(_prefix2);
301
-
222
+ let props = this.data[name].props
223
+ if (props) {
224
+ let value = Value.load(name, [], this)
225
+ for (let prefix of prefixes) {
226
+ let old = value.old(prefix)
302
227
  if (old) {
303
- for (var _iterator5 = _createForOfIteratorHelperLoose(_props), _step5; !(_step5 = _iterator5()).done;) {
304
- var _prop = _step5.value;
305
-
306
- if (!remove[_prop]) {
307
- remove[_prop] = {};
228
+ for (let prop of props) {
229
+ if (!remove[prop]) {
230
+ remove[prop] = {}
308
231
  }
309
-
310
- if (!remove[_prop].values) {
311
- remove[_prop].values = [];
232
+ if (!remove[prop].values) {
233
+ remove[prop].values = []
312
234
  }
313
-
314
- remove[_prop].values.push(old);
235
+ remove[prop].values.push(old)
315
236
  }
316
237
  }
317
238
  }
318
239
  } else {
319
- for (var _iterator6 = _createForOfIteratorHelperLoose(_prefixes), _step6; !(_step6 = _iterator6()).done;) {
320
- var p = _step6.value;
321
- var olds = this.decl(_name).old(_name, p);
322
-
323
- if (_name === 'align-self') {
324
- var a = add[_name] && add[_name].prefixes;
325
-
240
+ for (let p of prefixes) {
241
+ let olds = this.decl(name).old(name, p)
242
+ if (name === 'align-self') {
243
+ let a = add[name] && add[name].prefixes
326
244
  if (a) {
327
245
  if (p === '-webkit- 2009' && a.includes('-webkit-')) {
328
- continue;
246
+ continue
329
247
  } else if (p === '-webkit-' && a.includes('-webkit- 2009')) {
330
- continue;
248
+ continue
331
249
  }
332
250
  }
333
251
  }
334
-
335
- for (var _iterator7 = _createForOfIteratorHelperLoose(olds), _step7; !(_step7 = _iterator7()).done;) {
336
- var _prefixed = _step7.value;
337
-
338
- if (!remove[_prefixed]) {
339
- remove[_prefixed] = {};
252
+ for (let prefixed of olds) {
253
+ if (!remove[prefixed]) {
254
+ remove[prefixed] = {}
340
255
  }
341
-
342
- remove[_prefixed].remove = true;
256
+ remove[prefixed].remove = true
343
257
  }
344
258
  }
345
259
  }
346
260
  }
347
261
  }
348
262
 
349
- return [add, remove];
263
+ return [add, remove]
350
264
  }
351
- /**
352
- * Declaration loader with caching
353
- */
354
- ;
355
-
356
- _proto.decl = function decl(prop) {
357
- var decl = declsCache[prop];
358
265
 
359
- if (decl) {
360
- return decl;
361
- } else {
362
- declsCache[prop] = Declaration.load(prop);
363
- return declsCache[prop];
266
+ /**
267
+ * Declaration loader with caching
268
+ */
269
+ decl (prop) {
270
+ if (!declsCache.has(prop)) {
271
+ declsCache.set(prop, Declaration.load(prop))
364
272
  }
273
+
274
+ return declsCache.get(prop)
365
275
  }
276
+
366
277
  /**
367
278
  * Return unprefixed version of property
368
279
  */
369
- ;
370
-
371
- _proto.unprefixed = function unprefixed(prop) {
372
- var value = this.normalize(vendor.unprefixed(prop));
373
-
280
+ unprefixed (prop) {
281
+ let value = this.normalize(vendor.unprefixed(prop))
374
282
  if (value === 'flex-direction') {
375
- value = 'flex-flow';
283
+ value = 'flex-flow'
376
284
  }
377
-
378
- return value;
285
+ return value
379
286
  }
287
+
380
288
  /**
381
289
  * Normalize prefix for remover
382
290
  */
383
- ;
384
-
385
- _proto.normalize = function normalize(prop) {
386
- return this.decl(prop).normalize(prop);
291
+ normalize (prop) {
292
+ return this.decl(prop).normalize(prop)
387
293
  }
294
+
388
295
  /**
389
296
  * Return prefixed version of property
390
297
  */
391
- ;
392
-
393
- _proto.prefixed = function prefixed(prop, prefix) {
394
- prop = vendor.unprefixed(prop);
395
- return this.decl(prop).prefixed(prop, prefix);
298
+ prefixed (prop, prefix) {
299
+ prop = vendor.unprefixed(prop)
300
+ return this.decl(prop).prefixed(prop, prefix)
396
301
  }
302
+
397
303
  /**
398
304
  * Return values, which must be prefixed in selected property
399
305
  */
400
- ;
306
+ values (type, prop) {
307
+ let data = this[type]
401
308
 
402
- _proto.values = function values(type, prop) {
403
- var data = this[type];
404
- var global = data['*'] && data['*'].values;
405
- var values = data[prop] && data[prop].values;
309
+ let global = data['*'] && data['*'].values
310
+ let values = data[prop] && data[prop].values
406
311
 
407
312
  if (global && values) {
408
- return utils.uniq(global.concat(values));
313
+ return utils.uniq(global.concat(values))
409
314
  } else {
410
- return global || values || [];
315
+ return global || values || []
411
316
  }
412
317
  }
318
+
413
319
  /**
414
320
  * Group declaration by unprefixed property to check them
415
321
  */
416
- ;
417
-
418
- _proto.group = function group(decl) {
419
- var _this2 = this;
420
-
421
- var rule = decl.parent;
422
- var index = rule.index(decl);
423
- var length = rule.nodes.length;
424
- var unprefixed = this.unprefixed(decl.prop);
425
-
426
- var checker = function checker(step, callback) {
427
- index += step;
428
-
322
+ group (decl) {
323
+ let rule = decl.parent
324
+ let index = rule.index(decl)
325
+ let { length } = rule.nodes
326
+ let unprefixed = this.unprefixed(decl.prop)
327
+
328
+ let checker = (step, callback) => {
329
+ index += step
429
330
  while (index >= 0 && index < length) {
430
- var other = rule.nodes[index];
431
-
331
+ let other = rule.nodes[index]
432
332
  if (other.type === 'decl') {
433
333
  if (step === -1 && other.prop === unprefixed) {
434
334
  if (!Browsers.withPrefix(other.value)) {
435
- break;
335
+ break
436
336
  }
437
337
  }
438
338
 
439
- if (_this2.unprefixed(other.prop) !== unprefixed) {
440
- break;
339
+ if (this.unprefixed(other.prop) !== unprefixed) {
340
+ break
441
341
  } else if (callback(other) === true) {
442
- return true;
342
+ return true
443
343
  }
444
344
 
445
345
  if (step === +1 && other.prop === unprefixed) {
446
346
  if (!Browsers.withPrefix(other.value)) {
447
- break;
347
+ break
448
348
  }
449
349
  }
450
350
  }
451
351
 
452
- index += step;
352
+ index += step
453
353
  }
454
-
455
- return false;
456
- };
354
+ return false
355
+ }
457
356
 
458
357
  return {
459
- up: function up(callback) {
460
- return checker(-1, callback);
358
+ up (callback) {
359
+ return checker(-1, callback)
461
360
  },
462
- down: function down(callback) {
463
- return checker(+1, callback);
361
+ down (callback) {
362
+ return checker(+1, callback)
464
363
  }
465
- };
466
- };
467
-
468
- return Prefixes;
469
- }();
364
+ }
365
+ }
366
+ }
470
367
 
471
- module.exports = Prefixes;
368
+ module.exports = Prefixes