autoprefixer 10.2.2 → 10.2.6

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 (79) hide show
  1. package/README.md +3 -3
  2. package/data/prefixes.js +187 -91
  3. package/lib/at-rule.js +2 -2
  4. package/lib/autoprefixer.d.ts +3 -3
  5. package/lib/autoprefixer.js +28 -18
  6. package/lib/brackets.js +3 -3
  7. package/lib/browsers.js +6 -6
  8. package/lib/declaration.js +14 -14
  9. package/lib/hacks/align-content.js +3 -3
  10. package/lib/hacks/align-items.js +3 -3
  11. package/lib/hacks/align-self.js +4 -4
  12. package/lib/hacks/animation.js +1 -1
  13. package/lib/hacks/appearance.js +1 -1
  14. package/lib/hacks/backdrop-filter.js +1 -1
  15. package/lib/hacks/background-clip.js +2 -2
  16. package/lib/hacks/background-size.js +1 -1
  17. package/lib/hacks/block-logical.js +2 -2
  18. package/lib/hacks/border-image.js +1 -1
  19. package/lib/hacks/border-radius.js +2 -2
  20. package/lib/hacks/break-props.js +4 -4
  21. package/lib/hacks/color-adjust.js +2 -2
  22. package/lib/hacks/cross-fade.js +1 -1
  23. package/lib/hacks/display-flex.js +5 -5
  24. package/lib/hacks/display-grid.js +2 -2
  25. package/lib/hacks/filter-value.js +1 -1
  26. package/lib/hacks/filter.js +1 -1
  27. package/lib/hacks/flex-basis.js +3 -3
  28. package/lib/hacks/flex-direction.js +3 -3
  29. package/lib/hacks/flex-flow.js +1 -1
  30. package/lib/hacks/flex-grow.js +2 -2
  31. package/lib/hacks/flex-shrink.js +3 -3
  32. package/lib/hacks/flex-wrap.js +1 -1
  33. package/lib/hacks/flex.js +3 -3
  34. package/lib/hacks/fullscreen.js +1 -1
  35. package/lib/hacks/gradient.js +18 -18
  36. package/lib/hacks/grid-area.js +1 -1
  37. package/lib/hacks/grid-column-align.js +3 -3
  38. package/lib/hacks/grid-end.js +1 -1
  39. package/lib/hacks/grid-row-align.js +3 -3
  40. package/lib/hacks/grid-row-column.js +1 -1
  41. package/lib/hacks/grid-rows-columns.js +3 -3
  42. package/lib/hacks/grid-start.js +3 -3
  43. package/lib/hacks/grid-template-areas.js +2 -2
  44. package/lib/hacks/grid-template.js +1 -1
  45. package/lib/hacks/grid-utils.js +60 -48
  46. package/lib/hacks/image-rendering.js +5 -5
  47. package/lib/hacks/image-set.js +1 -1
  48. package/lib/hacks/inline-logical.js +2 -2
  49. package/lib/hacks/intrinsic.js +6 -6
  50. package/lib/hacks/justify-content.js +3 -3
  51. package/lib/hacks/mask-border.js +2 -2
  52. package/lib/hacks/mask-composite.js +1 -1
  53. package/lib/hacks/order.js +3 -3
  54. package/lib/hacks/overscroll-behavior.js +3 -3
  55. package/lib/hacks/pixelated.js +2 -2
  56. package/lib/hacks/place-self.js +1 -1
  57. package/lib/hacks/placeholder-shown.js +1 -1
  58. package/lib/hacks/placeholder.js +2 -2
  59. package/lib/hacks/text-decoration-skip-ink.js +1 -1
  60. package/lib/hacks/text-decoration.js +1 -1
  61. package/lib/hacks/text-emphasis-position.js +1 -1
  62. package/lib/hacks/transform-decl.js +4 -4
  63. package/lib/hacks/user-select.js +2 -2
  64. package/lib/hacks/writing-mode.js +1 -1
  65. package/lib/info.js +8 -4
  66. package/lib/old-selector.js +3 -3
  67. package/lib/old-value.js +2 -2
  68. package/lib/prefixer.js +13 -9
  69. package/lib/prefixes.js +124 -68
  70. package/lib/processor.js +14 -14
  71. package/lib/resolution.js +6 -6
  72. package/lib/selector.js +10 -10
  73. package/lib/supports.js +28 -20
  74. package/lib/transition.js +15 -15
  75. package/lib/utils.js +65 -67
  76. package/lib/value.js +7 -7
  77. package/lib/vendor.js +2 -2
  78. package/package.json +5 -5
  79. package/CHANGELOG.md +0 -1019
package/lib/info.js CHANGED
@@ -1,21 +1,25 @@
1
1
  let browserslist = require('browserslist')
2
2
 
3
- function capitalize (str) {
3
+ function capitalize(str) {
4
4
  return str.slice(0, 1).toUpperCase() + str.slice(1)
5
5
  }
6
6
 
7
7
  const NAMES = {
8
8
  ie: 'IE',
9
9
  ie_mob: 'IE Mobile',
10
- ios_saf: 'iOS',
10
+ ios_saf: 'iOS Safari',
11
11
  op_mini: 'Opera Mini',
12
12
  op_mob: 'Opera Mobile',
13
13
  and_chr: 'Chrome for Android',
14
14
  and_ff: 'Firefox for Android',
15
- and_uc: 'UC for Android'
15
+ and_uc: 'UC for Android',
16
+ and_qq: 'QQ Browser',
17
+ kaios: 'KaiOS Browser',
18
+ baidu: 'Baidu Browser',
19
+ samsung: 'Samsung Internet'
16
20
  }
17
21
 
18
- function prefix (name, prefixes, note) {
22
+ function prefix(name, prefixes, note) {
19
23
  let out = ` ${name}`
20
24
  if (note) out += ' *'
21
25
  out += ': '
@@ -1,5 +1,5 @@
1
1
  class OldSelector {
2
- constructor (selector, prefix) {
2
+ constructor(selector, prefix) {
3
3
  this.prefix = prefix
4
4
  this.prefixed = selector.prefixed(this.prefix)
5
5
  this.regexp = selector.regexp(this.prefix)
@@ -15,7 +15,7 @@ class OldSelector {
15
15
  /**
16
16
  * Is rule a hack without unprefixed version bottom
17
17
  */
18
- isHack (rule) {
18
+ isHack(rule) {
19
19
  let index = rule.parent.index(rule) + 1
20
20
  let rules = rule.parent.nodes
21
21
 
@@ -50,7 +50,7 @@ class OldSelector {
50
50
  /**
51
51
  * Does rule contain an unnecessary prefixed selector
52
52
  */
53
- check (rule) {
53
+ check(rule) {
54
54
  if (!rule.selector.includes(this.prefixed)) {
55
55
  return false
56
56
  }
package/lib/old-value.js CHANGED
@@ -1,7 +1,7 @@
1
1
  let utils = require('./utils')
2
2
 
3
3
  class OldValue {
4
- constructor (unprefixed, prefixed, string, regexp) {
4
+ constructor(unprefixed, prefixed, string, regexp) {
5
5
  this.unprefixed = unprefixed
6
6
  this.prefixed = prefixed
7
7
  this.string = string || prefixed
@@ -11,7 +11,7 @@ class OldValue {
11
11
  /**
12
12
  * Check, that value contain old value
13
13
  */
14
- check (value) {
14
+ check(value) {
15
15
  if (value.includes(this.string)) {
16
16
  return !!value.match(this.regexp)
17
17
  }
package/lib/prefixer.js CHANGED
@@ -5,7 +5,7 @@ let utils = require('./utils')
5
5
  /**
6
6
  * Recursively clone objects
7
7
  */
8
- function clone (obj, parent) {
8
+ function clone(obj, parent) {
9
9
  let cloned = new obj.constructor()
10
10
 
11
11
  for (let i of Object.keys(obj || {})) {
@@ -18,7 +18,11 @@ function clone (obj, parent) {
18
18
  cloned[i] = value
19
19
  } else if (Array.isArray(value)) {
20
20
  cloned[i] = value.map(x => clone(x, cloned))
21
- } else if (i !== '_autoprefixerPrefix' && i !== '_autoprefixerValues') {
21
+ } else if (
22
+ i !== '_autoprefixerPrefix' &&
23
+ i !== '_autoprefixerValues' &&
24
+ i !== 'proxyCache'
25
+ ) {
22
26
  if (typeof value === 'object' && value !== null) {
23
27
  value = clone(value, cloned)
24
28
  }
@@ -33,7 +37,7 @@ class Prefixer {
33
37
  /**
34
38
  * Add hack to selected names
35
39
  */
36
- static hack (klass) {
40
+ static hack(klass) {
37
41
  if (!this.hacks) {
38
42
  this.hacks = {}
39
43
  }
@@ -46,7 +50,7 @@ class Prefixer {
46
50
  /**
47
51
  * Load hacks for some names
48
52
  */
49
- static load (name, prefixes, all) {
53
+ static load(name, prefixes, all) {
50
54
  let Klass = this.hacks && this.hacks[name]
51
55
  if (Klass) {
52
56
  return new Klass(name, prefixes, all)
@@ -58,7 +62,7 @@ class Prefixer {
58
62
  /**
59
63
  * Clone node and clean autprefixer custom caches
60
64
  */
61
- static clone (node, overrides) {
65
+ static clone(node, overrides) {
62
66
  let cloned = clone(node)
63
67
  for (let name in overrides) {
64
68
  cloned[name] = overrides[name]
@@ -66,7 +70,7 @@ class Prefixer {
66
70
  return cloned
67
71
  }
68
72
 
69
- constructor (name, prefixes, all) {
73
+ constructor(name, prefixes, all) {
70
74
  this.prefixes = prefixes
71
75
  this.name = name
72
76
  this.all = all
@@ -75,7 +79,7 @@ class Prefixer {
75
79
  /**
76
80
  * Find prefix in node parents
77
81
  */
78
- parentPrefix (node) {
82
+ parentPrefix(node) {
79
83
  let prefix
80
84
 
81
85
  if (typeof node._autoprefixerPrefix !== 'undefined') {
@@ -108,7 +112,7 @@ class Prefixer {
108
112
  /**
109
113
  * Clone node with prefixes
110
114
  */
111
- process (node, result) {
115
+ process(node, result) {
112
116
  if (!this.check(node)) {
113
117
  return undefined
114
118
  }
@@ -132,7 +136,7 @@ class Prefixer {
132
136
  /**
133
137
  * Shortcut for Prefixer.clone
134
138
  */
135
- clone (node, overrides) {
139
+ clone(node, overrides) {
136
140
  return Prefixer.clone(node, overrides)
137
141
  }
138
142
  }
package/lib/prefixes.js CHANGED
@@ -9,66 +9,122 @@ let Selector = require('./selector')
9
9
  let AtRule = require('./at-rule')
10
10
  let Value = require('./value')
11
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'))
12
+ let hackFullscreen = require('./hacks/fullscreen')
13
+ let hackPlaceholder = require('./hacks/placeholder')
14
+ let hackPlaceholderShown = require('./hacks/placeholder-shown')
15
+ let hackFlex = require('./hacks/flex')
16
+ let hackOrder = require('./hacks/order')
17
+ let hackFilter = require('./hacks/filter')
18
+ let hackGridEnd = require('./hacks/grid-end')
19
+ let hackAnimation = require('./hacks/animation')
20
+ let hackFlexFlow = require('./hacks/flex-flow')
21
+ let hackFlexGrow = require('./hacks/flex-grow')
22
+ let hackFlexWrap = require('./hacks/flex-wrap')
23
+ let hackGridArea = require('./hacks/grid-area')
24
+ let hackPlaceSelf = require('./hacks/place-self')
25
+ let hackGridStart = require('./hacks/grid-start')
26
+ let hackAlignSelf = require('./hacks/align-self')
27
+ let hackAppearance = require('./hacks/appearance')
28
+ let hackFlexBasis = require('./hacks/flex-basis')
29
+ let hackMaskBorder = require('./hacks/mask-border')
30
+ let hackMaskComposite = require('./hacks/mask-composite')
31
+ let hackAlignItems = require('./hacks/align-items')
32
+ let hackUserSelect = require('./hacks/user-select')
33
+ let hackFlexShrink = require('./hacks/flex-shrink')
34
+ let hackBreakProps = require('./hacks/break-props')
35
+ let hackColorAdjust = require('./hacks/color-adjust')
36
+ let hackWritingMode = require('./hacks/writing-mode')
37
+ let hackBorderImage = require('./hacks/border-image')
38
+ let hackAlignContent = require('./hacks/align-content')
39
+ let hackBorderRadius = require('./hacks/border-radius')
40
+ let hackBlockLogical = require('./hacks/block-logical')
41
+ let hackGridTemplate = require('./hacks/grid-template')
42
+ let hackInlineLogical = require('./hacks/inline-logical')
43
+ let hackGridRowAlign = require('./hacks/grid-row-align')
44
+ let hackTransformDecl = require('./hacks/transform-decl')
45
+ let hackFlexDirection = require('./hacks/flex-direction')
46
+ let hackImageRendering = require('./hacks/image-rendering')
47
+ let hackBackdropFilter = require('./hacks/backdrop-filter')
48
+ let hackBackgroundClip = require('./hacks/background-clip')
49
+ let hackTextDecoration = require('./hacks/text-decoration')
50
+ let hackJustifyContent = require('./hacks/justify-content')
51
+ let hackBackgroundSize = require('./hacks/background-size')
52
+ let hackGridRowColumn = require('./hacks/grid-row-column')
53
+ let hackGridRowsColumns = require('./hacks/grid-rows-columns')
54
+ let hackGridColumnAlign = require('./hacks/grid-column-align')
55
+ let hackOverscrollBehavior = require('./hacks/overscroll-behavior')
56
+ let hackGridTemplateAreas = require('./hacks/grid-template-areas')
57
+ let hackTextEmphasisPosition = require('./hacks/text-emphasis-position')
58
+ let hackTextDecorationSkipInk = require('./hacks/text-decoration-skip-ink')
59
+ let hackGradient = require('./hacks/gradient')
60
+ let hackIntrinsic = require('./hacks/intrinsic')
61
+ let hackPixelated = require('./hacks/pixelated')
62
+ let hackImageSet = require('./hacks/image-set')
63
+ let hackCrossFade = require('./hacks/cross-fade')
64
+ let hackDisplayFlex = require('./hacks/display-flex')
65
+ let hackDisplayGrid = require('./hacks/display-grid')
66
+ let hackFilterValue = require('./hacks/filter-value')
67
+
68
+ Selector.hack(hackFullscreen)
69
+ Selector.hack(hackPlaceholder)
70
+ Selector.hack(hackPlaceholderShown)
71
+ Declaration.hack(hackFlex)
72
+ Declaration.hack(hackOrder)
73
+ Declaration.hack(hackFilter)
74
+ Declaration.hack(hackGridEnd)
75
+ Declaration.hack(hackAnimation)
76
+ Declaration.hack(hackFlexFlow)
77
+ Declaration.hack(hackFlexGrow)
78
+ Declaration.hack(hackFlexWrap)
79
+ Declaration.hack(hackGridArea)
80
+ Declaration.hack(hackPlaceSelf)
81
+ Declaration.hack(hackGridStart)
82
+ Declaration.hack(hackAlignSelf)
83
+ Declaration.hack(hackAppearance)
84
+ Declaration.hack(hackFlexBasis)
85
+ Declaration.hack(hackMaskBorder)
86
+ Declaration.hack(hackMaskComposite)
87
+ Declaration.hack(hackAlignItems)
88
+ Declaration.hack(hackUserSelect)
89
+ Declaration.hack(hackFlexShrink)
90
+ Declaration.hack(hackBreakProps)
91
+ Declaration.hack(hackColorAdjust)
92
+ Declaration.hack(hackWritingMode)
93
+ Declaration.hack(hackBorderImage)
94
+ Declaration.hack(hackAlignContent)
95
+ Declaration.hack(hackBorderRadius)
96
+ Declaration.hack(hackBlockLogical)
97
+ Declaration.hack(hackGridTemplate)
98
+ Declaration.hack(hackInlineLogical)
99
+ Declaration.hack(hackGridRowAlign)
100
+ Declaration.hack(hackTransformDecl)
101
+ Declaration.hack(hackFlexDirection)
102
+ Declaration.hack(hackImageRendering)
103
+ Declaration.hack(hackBackdropFilter)
104
+ Declaration.hack(hackBackgroundClip)
105
+ Declaration.hack(hackTextDecoration)
106
+ Declaration.hack(hackJustifyContent)
107
+ Declaration.hack(hackBackgroundSize)
108
+ Declaration.hack(hackGridRowColumn)
109
+ Declaration.hack(hackGridRowsColumns)
110
+ Declaration.hack(hackGridColumnAlign)
111
+ Declaration.hack(hackOverscrollBehavior)
112
+ Declaration.hack(hackGridTemplateAreas)
113
+ Declaration.hack(hackTextEmphasisPosition)
114
+ Declaration.hack(hackTextDecorationSkipInk)
115
+ Value.hack(hackGradient)
116
+ Value.hack(hackIntrinsic)
117
+ Value.hack(hackPixelated)
118
+ Value.hack(hackImageSet)
119
+ Value.hack(hackCrossFade)
120
+ Value.hack(hackDisplayFlex)
121
+ Value.hack(hackDisplayGrid)
122
+ Value.hack(hackFilterValue)
67
123
 
68
124
  let declsCache = new Map()
69
125
 
70
126
  class Prefixes {
71
- constructor (data, browsers, options = {}) {
127
+ constructor(data, browsers, options = {}) {
72
128
  this.data = data
73
129
  this.browsers = browsers
74
130
  this.options = options
@@ -80,7 +136,7 @@ class Prefixes {
80
136
  /**
81
137
  * Return clone instance to remove all prefixes
82
138
  */
83
- cleaner () {
139
+ cleaner() {
84
140
  if (this.cleanerCache) {
85
141
  return this.cleanerCache
86
142
  }
@@ -98,7 +154,7 @@ class Prefixes {
98
154
  /**
99
155
  * Select prefixes from data, which is necessary for selected browsers
100
156
  */
101
- select (list) {
157
+ select(list) {
102
158
  let selected = { add: {}, remove: {} }
103
159
 
104
160
  for (let name in list) {
@@ -155,7 +211,7 @@ class Prefixes {
155
211
  /**
156
212
  * Sort vendor prefixes
157
213
  */
158
- sort (prefixes) {
214
+ sort(prefixes) {
159
215
  return prefixes.sort((a, b) => {
160
216
  let aLength = utils.removeNote(a).length
161
217
  let bLength = utils.removeNote(b).length
@@ -171,7 +227,7 @@ class Prefixes {
171
227
  /**
172
228
  * Cache prefixes data to fast CSS processing
173
229
  */
174
- preprocess (selected) {
230
+ preprocess(selected) {
175
231
  let add = {
176
232
  'selectors': [],
177
233
  '@supports': new Supports(Prefixes, this)
@@ -266,7 +322,7 @@ class Prefixes {
266
322
  /**
267
323
  * Declaration loader with caching
268
324
  */
269
- decl (prop) {
325
+ decl(prop) {
270
326
  if (!declsCache.has(prop)) {
271
327
  declsCache.set(prop, Declaration.load(prop))
272
328
  }
@@ -277,7 +333,7 @@ class Prefixes {
277
333
  /**
278
334
  * Return unprefixed version of property
279
335
  */
280
- unprefixed (prop) {
336
+ unprefixed(prop) {
281
337
  let value = this.normalize(vendor.unprefixed(prop))
282
338
  if (value === 'flex-direction') {
283
339
  value = 'flex-flow'
@@ -288,14 +344,14 @@ class Prefixes {
288
344
  /**
289
345
  * Normalize prefix for remover
290
346
  */
291
- normalize (prop) {
347
+ normalize(prop) {
292
348
  return this.decl(prop).normalize(prop)
293
349
  }
294
350
 
295
351
  /**
296
352
  * Return prefixed version of property
297
353
  */
298
- prefixed (prop, prefix) {
354
+ prefixed(prop, prefix) {
299
355
  prop = vendor.unprefixed(prop)
300
356
  return this.decl(prop).prefixed(prop, prefix)
301
357
  }
@@ -303,7 +359,7 @@ class Prefixes {
303
359
  /**
304
360
  * Return values, which must be prefixed in selected property
305
361
  */
306
- values (type, prop) {
362
+ values(type, prop) {
307
363
  let data = this[type]
308
364
 
309
365
  let global = data['*'] && data['*'].values
@@ -319,7 +375,7 @@ class Prefixes {
319
375
  /**
320
376
  * Group declaration by unprefixed property to check them
321
377
  */
322
- group (decl) {
378
+ group(decl) {
323
379
  let rule = decl.parent
324
380
  let index = rule.index(decl)
325
381
  let { length } = rule.nodes
@@ -355,10 +411,10 @@ class Prefixes {
355
411
  }
356
412
 
357
413
  return {
358
- up (callback) {
414
+ up(callback) {
359
415
  return checker(-1, callback)
360
416
  },
361
- down (callback) {
417
+ down(callback) {
362
418
  return checker(+1, callback)
363
419
  }
364
420
  }
package/lib/processor.js CHANGED
@@ -23,27 +23,27 @@ const SIZES = [
23
23
  'max-block-size'
24
24
  ]
25
25
 
26
- function hasGridTemplate (decl) {
26
+ function hasGridTemplate(decl) {
27
27
  return decl.parent.some(
28
28
  i => i.prop === 'grid-template' || i.prop === 'grid-template-areas'
29
29
  )
30
30
  }
31
31
 
32
- function hasRowsAndColumns (decl) {
32
+ function hasRowsAndColumns(decl) {
33
33
  let hasRows = decl.parent.some(i => i.prop === 'grid-template-rows')
34
34
  let hasColumns = decl.parent.some(i => i.prop === 'grid-template-columns')
35
35
  return hasRows && hasColumns
36
36
  }
37
37
 
38
38
  class Processor {
39
- constructor (prefixes) {
39
+ constructor(prefixes) {
40
40
  this.prefixes = prefixes
41
41
  }
42
42
 
43
43
  /**
44
44
  * Add necessary prefixes
45
45
  */
46
- add (css, result) {
46
+ add(css, result) {
47
47
  // At-rules
48
48
  let resolution = this.prefixes.add['@resolution']
49
49
  let keyframes = this.prefixes.add['@keyframes']
@@ -84,7 +84,7 @@ class Processor {
84
84
  })
85
85
  })
86
86
 
87
- function insideGrid (decl) {
87
+ function insideGrid(decl) {
88
88
  return decl.parent.nodes.some(node => {
89
89
  if (node.type !== 'decl') return false
90
90
  let displayGrid =
@@ -94,7 +94,7 @@ class Processor {
94
94
  return displayGrid || gridTemplate || gridGap
95
95
  })
96
96
  }
97
- function insideFlex (decl) {
97
+ function insideFlex(decl) {
98
98
  return decl.parent.some(node => {
99
99
  return node.prop === 'display' && /(inline-)?flex/.test(node.value)
100
100
  })
@@ -391,7 +391,7 @@ class Processor {
391
391
  /**
392
392
  * Remove unnecessary pefixes
393
393
  */
394
- remove (css, result) {
394
+ remove(css, result) {
395
395
  // At-rules
396
396
  let resolution = this.prefixes.remove['@resolution']
397
397
 
@@ -479,14 +479,14 @@ class Processor {
479
479
  /**
480
480
  * Some rare old values, which is not in standard
481
481
  */
482
- withHackValue (decl) {
482
+ withHackValue(decl) {
483
483
  return decl.prop === '-webkit-background-clip' && decl.value === 'text'
484
484
  }
485
485
 
486
486
  /**
487
487
  * Check for grid/flexbox options.
488
488
  */
489
- disabledValue (node, result) {
489
+ disabledValue(node, result) {
490
490
  if (this.gridStatus(node, result) === false && node.type === 'decl') {
491
491
  if (node.prop === 'display' && node.value.includes('grid')) {
492
492
  return true
@@ -504,7 +504,7 @@ class Processor {
504
504
  /**
505
505
  * Check for grid/flexbox options.
506
506
  */
507
- disabledDecl (node, result) {
507
+ disabledDecl(node, result) {
508
508
  if (this.gridStatus(node, result) === false && node.type === 'decl') {
509
509
  if (node.prop.includes('grid') || node.prop === 'justify-items') {
510
510
  return true
@@ -523,7 +523,7 @@ class Processor {
523
523
  /**
524
524
  * Check for control comment and global options
525
525
  */
526
- disabled (node, result) {
526
+ disabled(node, result) {
527
527
  if (!node) return false
528
528
 
529
529
  if (node._autoprefixerDisabled !== undefined) {
@@ -581,7 +581,7 @@ class Processor {
581
581
  /**
582
582
  * Normalize spaces in cascade declaration group
583
583
  */
584
- reduceSpaces (decl) {
584
+ reduceSpaces(decl) {
585
585
  let stop = false
586
586
  this.prefixes.group(decl).up(() => {
587
587
  stop = true
@@ -613,7 +613,7 @@ class Processor {
613
613
  /**
614
614
  * Is it flebox or grid rule
615
615
  */
616
- displayType (decl) {
616
+ displayType(decl) {
617
617
  for (let i of decl.parent.nodes) {
618
618
  if (i.prop !== 'display') {
619
619
  continue
@@ -634,7 +634,7 @@ class Processor {
634
634
  /**
635
635
  * Set grid option via control comment
636
636
  */
637
- gridStatus (node, result) {
637
+ gridStatus(node, result) {
638
638
  if (!node) return false
639
639
 
640
640
  if (node._autoprefixerGridStatus !== undefined) {
package/lib/resolution.js CHANGED
@@ -1,4 +1,4 @@
1
- let Fraction = require('fraction.js')
1
+ let FractionJs = require('fraction.js')
2
2
 
3
3
  let Prefixer = require('./prefixer')
4
4
  let utils = require('./utils')
@@ -10,7 +10,7 @@ class Resolution extends Prefixer {
10
10
  /**
11
11
  * Return prefixed query name
12
12
  */
13
- prefixName (prefix, name) {
13
+ prefixName(prefix, name) {
14
14
  if (prefix === '-moz-') {
15
15
  return name + '--moz-device-pixel-ratio'
16
16
  } else {
@@ -21,8 +21,8 @@ class Resolution extends Prefixer {
21
21
  /**
22
22
  * Return prefixed query
23
23
  */
24
- prefixQuery (prefix, name, colon, value, units) {
25
- value = new Fraction(value)
24
+ prefixQuery(prefix, name, colon, value, units) {
25
+ value = new FractionJs(value)
26
26
 
27
27
  // 1dpcm = 2.54dpi
28
28
  // 1dppx = 96dpi
@@ -42,7 +42,7 @@ class Resolution extends Prefixer {
42
42
  /**
43
43
  * Remove prefixed queries
44
44
  */
45
- clean (rule) {
45
+ clean(rule) {
46
46
  if (!this.bad) {
47
47
  this.bad = []
48
48
  for (let prefix of this.prefixes) {
@@ -59,7 +59,7 @@ class Resolution extends Prefixer {
59
59
  /**
60
60
  * Add prefixed queries
61
61
  */
62
- process (rule) {
62
+ process(rule) {
63
63
  let parent = this.parentPrefix(rule)
64
64
  let prefixes = parent ? [parent] : this.prefixes
65
65
 
package/lib/selector.js CHANGED
@@ -6,7 +6,7 @@ let Browsers = require('./browsers')
6
6
  let utils = require('./utils')
7
7
 
8
8
  class Selector extends Prefixer {
9
- constructor (name, prefixes, all) {
9
+ constructor(name, prefixes, all) {
10
10
  super(name, prefixes, all)
11
11
  this.regexpCache = new Map()
12
12
  }
@@ -14,7 +14,7 @@ class Selector extends Prefixer {
14
14
  /**
15
15
  * Is rule selectors need to be prefixed
16
16
  */
17
- check (rule) {
17
+ check(rule) {
18
18
  if (rule.selector.includes(this.name)) {
19
19
  return !!rule.selector.match(this.regexp())
20
20
  }
@@ -25,14 +25,14 @@ class Selector extends Prefixer {
25
25
  /**
26
26
  * Return prefixed version of selector
27
27
  */
28
- prefixed (prefix) {
28
+ prefixed(prefix) {
29
29
  return this.name.replace(/^(\W*)/, `$1${prefix}`)
30
30
  }
31
31
 
32
32
  /**
33
33
  * Lazy loadRegExp for name
34
34
  */
35
- regexp (prefix) {
35
+ regexp(prefix) {
36
36
  if (!this.regexpCache.has(prefix)) {
37
37
  let name = prefix ? this.prefixed(prefix) : this.name
38
38
  this.regexpCache.set(
@@ -47,14 +47,14 @@ class Selector extends Prefixer {
47
47
  /**
48
48
  * All possible prefixes
49
49
  */
50
- possible () {
50
+ possible() {
51
51
  return Browsers.prefixes()
52
52
  }
53
53
 
54
54
  /**
55
55
  * Return all possible selector prefixes
56
56
  */
57
- prefixeds (rule) {
57
+ prefixeds(rule) {
58
58
  if (rule._autoprefixerPrefixeds) {
59
59
  if (rule._autoprefixerPrefixeds[this.name]) {
60
60
  return rule._autoprefixerPrefixeds
@@ -86,7 +86,7 @@ class Selector extends Prefixer {
86
86
  /**
87
87
  * Is rule already prefixed before
88
88
  */
89
- already (rule, prefixeds, prefix) {
89
+ already(rule, prefixeds, prefix) {
90
90
  let index = rule.parent.index(rule) - 1
91
91
 
92
92
  while (index >= 0) {
@@ -121,14 +121,14 @@ class Selector extends Prefixer {
121
121
  /**
122
122
  * Replace selectors by prefixed one
123
123
  */
124
- replace (selector, prefix) {
124
+ replace(selector, prefix) {
125
125
  return selector.replace(this.regexp(), `$1${this.prefixed(prefix)}`)
126
126
  }
127
127
 
128
128
  /**
129
129
  * Clone and add prefixes for at-rule
130
130
  */
131
- add (rule, prefix) {
131
+ add(rule, prefix) {
132
132
  let prefixeds = this.prefixeds(rule)
133
133
 
134
134
  if (this.already(rule, prefixeds, prefix)) {
@@ -142,7 +142,7 @@ class Selector extends Prefixer {
142
142
  /**
143
143
  * Return function to fast find prefixed selector
144
144
  */
145
- old (prefix) {
145
+ old(prefix) {
146
146
  return new OldSelector(this, prefix)
147
147
  }
148
148
  }