autoprefixer 6.7.7 → 7.1.1
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.
- package/AUTHORS +1 -0
- package/CHANGELOG.md +23 -0
- package/README.md +9 -15
- package/data/prefixes.js +551 -517
- package/lib/at-rule.js +55 -38
- package/lib/autoprefixer.js +89 -63
- package/lib/brackets.js +59 -39
- package/lib/browsers.js +102 -65
- package/lib/declaration.js +212 -121
- package/lib/hacks/align-content.js +65 -38
- package/lib/hacks/align-items.js +62 -38
- package/lib/hacks/align-self.js +63 -36
- package/lib/hacks/appearance.js +42 -0
- package/lib/hacks/background-size.js +29 -20
- package/lib/hacks/block-logical.js +36 -21
- package/lib/hacks/border-image.js +26 -16
- package/lib/hacks/border-radius.js +60 -39
- package/lib/hacks/break-props.js +69 -44
- package/lib/hacks/cross-fade.js +40 -37
- package/lib/hacks/display-flex.js +81 -31
- package/lib/hacks/display-grid.js +29 -19
- package/lib/hacks/filter-value.js +66 -45
- package/lib/hacks/filter.js +26 -17
- package/lib/hacks/flex-basis.js +60 -30
- package/lib/hacks/flex-direction.js +85 -53
- package/lib/hacks/flex-flow.js +67 -49
- package/lib/hacks/flex-grow.js +45 -26
- package/lib/hacks/flex-shrink.js +60 -30
- package/lib/hacks/flex-spec.js +18 -8
- package/lib/hacks/flex-values.js +39 -20
- package/lib/hacks/flex-wrap.js +29 -20
- package/lib/hacks/flex.js +68 -43
- package/lib/hacks/fullscreen.js +31 -21
- package/lib/hacks/gradient.js +462 -302
- package/lib/hacks/grid-column-align.js +55 -0
- package/lib/hacks/grid-end.js +53 -28
- package/lib/hacks/grid-row-align.js +39 -19
- package/lib/hacks/grid-start.js +80 -48
- package/lib/hacks/grid-template.js +91 -55
- package/lib/hacks/image-rendering.js +63 -33
- package/lib/hacks/image-set.js +28 -20
- package/lib/hacks/inline-logical.js +32 -17
- package/lib/hacks/intrinsic.js +73 -0
- package/lib/hacks/justify-content.js +69 -42
- package/lib/hacks/mask-border.js +36 -21
- package/lib/hacks/order.js +58 -35
- package/lib/hacks/pixelated.js +44 -30
- package/lib/hacks/placeholder.js +40 -25
- package/lib/hacks/text-emphasis-position.js +27 -20
- package/lib/hacks/transform-decl.js +94 -52
- package/lib/hacks/writing-mode.js +37 -27
- package/lib/info.js +117 -78
- package/lib/old-selector.js +84 -58
- package/lib/old-value.js +22 -20
- package/lib/prefixer.js +164 -95
- package/lib/prefixes.js +446 -351
- package/lib/processor.js +394 -278
- package/lib/resolution.js +135 -75
- package/lib/selector.js +145 -84
- package/lib/supports.js +330 -210
- package/lib/transition.js +396 -243
- package/lib/utils.js +84 -48
- package/lib/value.js +118 -80
- package/package.json +53 -13
- package/lib/hacks/justify-items.js +0 -31
- package/lib/hacks/stretch.js +0 -45
package/lib/hacks/cross-fade.js
CHANGED
|
@@ -1,53 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
var CrossFade, OldValue, Value, list, utils,
|
|
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
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
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
|
-
|
|
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; }
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
var Value = require('../value');
|
|
10
|
+
var list = require('postcss/lib/list');
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
var CrossFade = function (_Value) {
|
|
13
|
+
_inherits(CrossFade, _Value);
|
|
16
14
|
|
|
17
15
|
function CrossFade() {
|
|
18
|
-
|
|
16
|
+
_classCallCheck(this, CrossFade);
|
|
17
|
+
|
|
18
|
+
return _possibleConstructorReturn(this, _Value.apply(this, arguments));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
CrossFade.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
CrossFade.prototype.replace = function replace(string, prefix) {
|
|
22
|
+
var _this2 = this;
|
|
23
|
+
|
|
24
|
+
return list.space(string).map(function (value) {
|
|
25
|
+
if (value.slice(0, +_this2.name.length + 1) !== _this2.name + '(') {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var close = value.lastIndexOf(')');
|
|
30
|
+
var after = value.slice(close + 1);
|
|
31
|
+
var args = value.slice(_this2.name.length + 1, close);
|
|
32
|
+
|
|
33
|
+
if (prefix === '-webkit-') {
|
|
34
|
+
var match = args.match(/\d*.?\d+%?/);
|
|
35
|
+
if (match) {
|
|
36
|
+
args = args.slice(match[0].length).trim();
|
|
37
|
+
args += ', ' + match[0];
|
|
38
|
+
} else {
|
|
39
|
+
args += ', 0.5';
|
|
40
|
+
}
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
})(this)).join(' ');
|
|
42
|
+
return prefix + _this2.name + '(' + args + ')' + after;
|
|
43
|
+
}).join(' ');
|
|
45
44
|
};
|
|
46
45
|
|
|
47
46
|
return CrossFade;
|
|
47
|
+
}(Value);
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Object.defineProperty(CrossFade, 'names', {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: ['cross-fade']
|
|
53
|
+
});
|
|
50
54
|
|
|
51
|
-
module.exports = CrossFade;
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
module.exports = CrossFade;
|
|
@@ -1,52 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
var DisplayFlex, OldValue, Value, 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
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
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
|
-
|
|
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; }
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
var flexSpec = require('./flex-spec');
|
|
10
|
+
var OldValue = require('../old-value');
|
|
11
|
+
var Value = require('../value');
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
var DisplayFlex = function (_Value) {
|
|
14
|
+
_inherits(DisplayFlex, _Value);
|
|
16
15
|
|
|
17
16
|
function DisplayFlex(name, prefixes) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.name
|
|
21
|
-
|
|
17
|
+
_classCallCheck(this, DisplayFlex);
|
|
18
|
+
|
|
19
|
+
var _this = _possibleConstructorReturn(this, _Value.call(this, name, prefixes));
|
|
20
|
+
|
|
21
|
+
if (name === 'display-flex') {
|
|
22
|
+
_this.name = 'flex';
|
|
23
|
+
}
|
|
24
|
+
return _this;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Faster check for flex value
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
DisplayFlex.prototype.check = function check(decl) {
|
|
33
|
+
return decl.prop === 'display' && decl.value === this.name;
|
|
26
34
|
};
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Return value by spec
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
DisplayFlex.prototype.prefixed = function prefixed(prefix) {
|
|
42
|
+
var spec = void 0,
|
|
43
|
+
value = void 0;
|
|
44
|
+
|
|
45
|
+
var _flexSpec = flexSpec(prefix);
|
|
46
|
+
|
|
47
|
+
spec = _flexSpec[0];
|
|
48
|
+
prefix = _flexSpec[1];
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
if (spec === 2009) {
|
|
52
|
+
if (this.name === 'flex') {
|
|
53
|
+
value = 'box';
|
|
54
|
+
} else {
|
|
55
|
+
value = 'inline-box';
|
|
56
|
+
}
|
|
57
|
+
} else if (spec === 2012) {
|
|
58
|
+
if (this.name === 'flex') {
|
|
59
|
+
value = 'flexbox';
|
|
60
|
+
} else {
|
|
61
|
+
value = 'inline-flexbox';
|
|
62
|
+
}
|
|
63
|
+
} else if (spec === 'final') {
|
|
64
|
+
value = this.name;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return prefix + value;
|
|
32
68
|
};
|
|
33
69
|
|
|
34
|
-
|
|
35
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Add prefix to value depend on flebox spec version
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
DisplayFlex.prototype.replace = function replace(string, prefix) {
|
|
76
|
+
return this.prefixed(prefix);
|
|
36
77
|
};
|
|
37
78
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Change value for old specs
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
DisplayFlex.prototype.old = function old(prefix) {
|
|
85
|
+
var prefixed = this.prefixed(prefix);
|
|
86
|
+
if (prefixed) {
|
|
87
|
+
return new OldValue(this.name, prefixed);
|
|
88
|
+
}
|
|
89
|
+
return undefined;
|
|
44
90
|
};
|
|
45
91
|
|
|
46
92
|
return DisplayFlex;
|
|
93
|
+
}(Value);
|
|
47
94
|
|
|
48
|
-
|
|
95
|
+
Object.defineProperty(DisplayFlex, 'names', {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
writable: true,
|
|
98
|
+
value: ['display-flex', 'inline-flex']
|
|
99
|
+
});
|
|
49
100
|
|
|
50
|
-
module.exports = DisplayFlex;
|
|
51
101
|
|
|
52
|
-
|
|
102
|
+
module.exports = DisplayFlex;
|
|
@@ -1,34 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
var DisplayGrid, OldValue, Value, 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
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
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
|
-
|
|
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; }
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
extend(DisplayGrid, superClass);
|
|
9
|
+
var Value = require('../value');
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
var DisplayGrid = function (_Value) {
|
|
12
|
+
_inherits(DisplayGrid, _Value);
|
|
16
13
|
|
|
17
14
|
function DisplayGrid(name, prefixes) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.name
|
|
21
|
-
|
|
15
|
+
_classCallCheck(this, DisplayGrid);
|
|
16
|
+
|
|
17
|
+
var _this = _possibleConstructorReturn(this, _Value.call(this, name, prefixes));
|
|
18
|
+
|
|
19
|
+
if (name === 'display-grid') {
|
|
20
|
+
_this.name = 'grid';
|
|
21
|
+
}
|
|
22
|
+
return _this;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Faster check for flex value
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
DisplayGrid.prototype.check = function check(decl) {
|
|
31
|
+
return decl.prop === 'display' && decl.value === this.name;
|
|
26
32
|
};
|
|
27
33
|
|
|
28
34
|
return DisplayGrid;
|
|
35
|
+
}(Value);
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
Object.defineProperty(DisplayGrid, 'names', {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
writable: true,
|
|
40
|
+
value: ['display-grid', 'inline-grid']
|
|
41
|
+
});
|
|
31
42
|
|
|
32
|
-
module.exports = DisplayGrid;
|
|
33
43
|
|
|
34
|
-
|
|
44
|
+
module.exports = DisplayGrid;
|
|
@@ -1,72 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
var FilterValue, OldFilterValue, OldValue, Value, utils,
|
|
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
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
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
|
-
|
|
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; }
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
var OldValue = require('../old-value');
|
|
10
|
+
var Value = require('../value');
|
|
11
|
+
var utils = require('../utils');
|
|
12
|
+
|
|
13
|
+
var OldFilterValue = function (_OldValue) {
|
|
14
|
+
_inherits(OldFilterValue, _OldValue);
|
|
14
15
|
|
|
15
16
|
function OldFilterValue() {
|
|
16
|
-
|
|
17
|
+
_classCallCheck(this, OldFilterValue);
|
|
18
|
+
|
|
19
|
+
return _possibleConstructorReturn(this, _OldValue.apply(this, arguments));
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Clean -webkit-filter from properties list
|
|
24
|
+
*/
|
|
25
|
+
OldFilterValue.prototype.clean = function clean(decl) {
|
|
26
|
+
var _this2 = this;
|
|
27
|
+
|
|
28
|
+
decl.value = utils.editList(decl.value, function (props) {
|
|
29
|
+
if (props.every(function (i) {
|
|
30
|
+
return i.indexOf(_this2.unprefixed) !== 0;
|
|
31
|
+
})) {
|
|
32
|
+
return props;
|
|
33
|
+
}
|
|
34
|
+
return props.filter(function (i) {
|
|
35
|
+
return i.indexOf(_this2.prefixed) === -1;
|
|
36
|
+
});
|
|
37
|
+
});
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
return OldFilterValue;
|
|
41
|
+
}(OldValue);
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
var FilterValue = function (_Value) {
|
|
44
|
+
_inherits(FilterValue, _Value);
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
function FilterValue(name, prefixes) {
|
|
47
|
+
_classCallCheck(this, FilterValue);
|
|
40
48
|
|
|
41
|
-
|
|
49
|
+
var _this3 = _possibleConstructorReturn(this, _Value.call(this, name, prefixes));
|
|
42
50
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
51
|
+
if (name === 'filter-function') {
|
|
52
|
+
_this3.name = 'filter';
|
|
53
|
+
}
|
|
54
|
+
return _this3;
|
|
48
55
|
}
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Use prefixed and unprefixed filter for WebKit
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
FilterValue.prototype.replace = function replace(value, prefix) {
|
|
63
|
+
if (prefix === '-webkit-' && value.indexOf('filter(') === -1) {
|
|
64
|
+
if (value.indexOf('-webkit-filter') === -1) {
|
|
65
|
+
return _Value.prototype.replace.call(this, value, prefix) + ', ' + value;
|
|
66
|
+
} else {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
54
69
|
} else {
|
|
55
|
-
|
|
70
|
+
return _Value.prototype.replace.call(this, value, prefix);
|
|
56
71
|
}
|
|
57
|
-
} else {
|
|
58
|
-
return FilterValue.__super__.replace.apply(this, arguments);
|
|
59
|
-
}
|
|
60
72
|
};
|
|
61
73
|
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Clean -webkit-filter
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
FilterValue.prototype.old = function old(prefix) {
|
|
80
|
+
return new OldFilterValue(this.name, prefix + this.name);
|
|
64
81
|
};
|
|
65
82
|
|
|
66
83
|
return FilterValue;
|
|
84
|
+
}(Value);
|
|
67
85
|
|
|
68
|
-
|
|
86
|
+
Object.defineProperty(FilterValue, 'names', {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
writable: true,
|
|
89
|
+
value: ['filter', 'filter-function']
|
|
90
|
+
});
|
|
69
91
|
|
|
70
|
-
module.exports = FilterValue;
|
|
71
92
|
|
|
72
|
-
|
|
93
|
+
module.exports = FilterValue;
|
package/lib/hacks/filter.js
CHANGED
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, Filter,
|
|
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
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
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 Filter = function (_Declaration) {
|
|
12
|
+
_inherits(Filter, _Declaration);
|
|
10
13
|
|
|
11
14
|
function Filter() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, Filter);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Check is it Internet Explorer filter
|
|
22
|
+
*/
|
|
23
|
+
Filter.prototype.check = function check(decl) {
|
|
24
|
+
var v = decl.value;
|
|
25
|
+
return v.toLowerCase().indexOf('alpha(') === -1 && v.indexOf('DXImageTransform.Microsoft') === -1 && v.indexOf('data:image/svg+xml') === -1;
|
|
21
26
|
};
|
|
22
27
|
|
|
23
28
|
return Filter;
|
|
29
|
+
}(Declaration);
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
Object.defineProperty(Filter, 'names', {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: ['filter']
|
|
35
|
+
});
|
|
26
36
|
|
|
27
|
-
module.exports = Filter;
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
module.exports = Filter;
|
package/lib/hacks/flex-basis.js
CHANGED
|
@@ -1,47 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, FlexBasis, 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
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
|
|
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 FlexBasis = function (_Declaration) {
|
|
13
|
+
_inherits(FlexBasis, _Declaration);
|
|
12
14
|
|
|
13
15
|
function FlexBasis() {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
+
_classCallCheck(this, FlexBasis);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Return property name by final spec
|
|
23
|
+
*/
|
|
24
|
+
FlexBasis.prototype.normalize = function normalize() {
|
|
25
|
+
return 'flex-basis';
|
|
21
26
|
};
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Return flex property for 2012 spec
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
FlexBasis.prototype.prefixed = function prefixed(prop, prefix) {
|
|
34
|
+
var spec = void 0;
|
|
35
|
+
|
|
36
|
+
var _flexSpec = flexSpec(prefix);
|
|
37
|
+
|
|
38
|
+
spec = _flexSpec[0];
|
|
39
|
+
prefix = _flexSpec[1];
|
|
40
|
+
|
|
41
|
+
if (spec === 2012) {
|
|
42
|
+
return prefix + 'flex-preferred-size';
|
|
43
|
+
} else {
|
|
44
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
45
|
+
}
|
|
31
46
|
};
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Ignore 2009 spec and use flex property for 2012
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
FlexBasis.prototype.set = function set(decl, prefix) {
|
|
54
|
+
var spec = void 0;
|
|
55
|
+
|
|
56
|
+
var _flexSpec2 = flexSpec(prefix);
|
|
57
|
+
|
|
58
|
+
spec = _flexSpec2[0];
|
|
59
|
+
prefix = _flexSpec2[1];
|
|
60
|
+
|
|
61
|
+
if (spec === 2012 || spec === 'final') {
|
|
62
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
39
65
|
};
|
|
40
66
|
|
|
41
67
|
return FlexBasis;
|
|
68
|
+
}(Declaration);
|
|
42
69
|
|
|
43
|
-
|
|
70
|
+
Object.defineProperty(FlexBasis, 'names', {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
writable: true,
|
|
73
|
+
value: ['flex-basis', 'flex-preferred-size']
|
|
74
|
+
});
|
|
44
75
|
|
|
45
|
-
module.exports = FlexBasis;
|
|
46
76
|
|
|
47
|
-
|
|
77
|
+
module.exports = FlexBasis;
|