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/pixelated.js
CHANGED
|
@@ -1,45 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
var OldValue, Pixelated, Value,
|
|
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 OldValue = require('../old-value');
|
|
10
|
+
var Value = require('../value');
|
|
11
|
+
|
|
12
|
+
var Pixelated = function (_Value) {
|
|
13
|
+
_inherits(Pixelated, _Value);
|
|
12
14
|
|
|
13
15
|
function Pixelated() {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
+
_classCallCheck(this, Pixelated);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
return _possibleConstructorReturn(this, _Value.apply(this, arguments));
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Use non-standard name for WebKit and Firefox
|
|
23
|
+
*/
|
|
24
|
+
Pixelated.prototype.replace = function replace(string, prefix) {
|
|
25
|
+
if (prefix === '-webkit-') {
|
|
26
|
+
return string.replace(this.regexp(), '$1-webkit-optimize-contrast');
|
|
27
|
+
} else if (prefix === '-moz-') {
|
|
28
|
+
return string.replace(this.regexp(), '$1-moz-crisp-edges');
|
|
29
|
+
} else {
|
|
30
|
+
return _Value.prototype.replace.call(this, string, prefix);
|
|
31
|
+
}
|
|
27
32
|
};
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Different name for WebKit and Firefox
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
Pixelated.prototype.old = function old(prefix) {
|
|
40
|
+
if (prefix === '-webkit-') {
|
|
41
|
+
return new OldValue(this.name, '-webkit-optimize-contrast');
|
|
42
|
+
} else if (prefix === '-moz-') {
|
|
43
|
+
return new OldValue(this.name, '-moz-crisp-edges');
|
|
44
|
+
} else {
|
|
45
|
+
return _Value.prototype.old.call(this, prefix);
|
|
46
|
+
}
|
|
37
47
|
};
|
|
38
48
|
|
|
39
49
|
return Pixelated;
|
|
50
|
+
}(Value);
|
|
40
51
|
|
|
41
|
-
|
|
52
|
+
Object.defineProperty(Pixelated, 'names', {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
value: ['pixelated']
|
|
56
|
+
});
|
|
42
57
|
|
|
43
|
-
module.exports = Pixelated;
|
|
44
58
|
|
|
45
|
-
|
|
59
|
+
module.exports = Pixelated;
|
package/lib/hacks/placeholder.js
CHANGED
|
@@ -1,39 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
var Placeholder, Selector,
|
|
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 Selector = require('../selector');
|
|
10
|
+
|
|
11
|
+
var Placeholder = function (_Selector) {
|
|
12
|
+
_inherits(Placeholder, _Selector);
|
|
10
13
|
|
|
11
14
|
function Placeholder() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, Placeholder);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Selector.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Add old mozilla to possible prefixes
|
|
22
|
+
*/
|
|
23
|
+
Placeholder.prototype.possible = function possible() {
|
|
24
|
+
return _Selector.prototype.possible.call(this).concat('-moz- old');
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Return different selectors depend on prefix
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
Placeholder.prototype.prefixed = function prefixed(prefix) {
|
|
33
|
+
if (prefix === '-webkit-') {
|
|
34
|
+
return '::-webkit-input-placeholder';
|
|
35
|
+
} else if (prefix === '-ms-') {
|
|
36
|
+
return ':-ms-input-placeholder';
|
|
37
|
+
} else if (prefix === '-moz- old') {
|
|
38
|
+
return ':-moz-placeholder';
|
|
39
|
+
} else {
|
|
40
|
+
return '::' + prefix + 'placeholder';
|
|
41
|
+
}
|
|
31
42
|
};
|
|
32
43
|
|
|
33
44
|
return Placeholder;
|
|
45
|
+
}(Selector);
|
|
34
46
|
|
|
35
|
-
|
|
47
|
+
Object.defineProperty(Placeholder, 'names', {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
writable: true,
|
|
50
|
+
value: [':placeholder-shown', '::placeholder']
|
|
51
|
+
});
|
|
36
52
|
|
|
37
|
-
module.exports = Placeholder;
|
|
38
53
|
|
|
39
|
-
|
|
54
|
+
module.exports = Placeholder;
|
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, TextEmphasisPosition,
|
|
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 TextEmphasisPosition = function (_Declaration) {
|
|
12
|
+
_inherits(TextEmphasisPosition, _Declaration);
|
|
10
13
|
|
|
11
14
|
function TextEmphasisPosition() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, TextEmphasisPosition);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
TextEmphasisPosition.prototype.set = function(decl, prefix) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
TextEmphasisPosition.prototype.set = function set(decl, prefix) {
|
|
21
|
+
if (prefix === '-webkit-') {
|
|
22
|
+
decl.value = decl.value.replace(/\s*(right|left)\s*/i, '');
|
|
23
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
24
|
+
} else {
|
|
25
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
26
|
+
}
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
return TextEmphasisPosition;
|
|
30
|
+
}(Declaration);
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
Object.defineProperty(TextEmphasisPosition, 'names', {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: ['text-emphasis-position']
|
|
36
|
+
});
|
|
29
37
|
|
|
30
|
-
module.exports = TextEmphasisPosition;
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
module.exports = TextEmphasisPosition;
|
|
@@ -1,74 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, TransformDecl,
|
|
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 TransformDecl = function (_Declaration) {
|
|
12
|
+
_inherits(TransformDecl, _Declaration);
|
|
10
13
|
|
|
11
14
|
function TransformDecl() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, TransformDecl);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Recursively check all parents for @keyframes
|
|
22
|
+
*/
|
|
23
|
+
TransformDecl.prototype.keyframeParents = function keyframeParents(decl) {
|
|
24
|
+
var parent = decl.parent;
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
while (parent) {
|
|
27
|
+
if (parent.type === 'atrule' && parent.name === 'keyframes') {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
var _parent = parent;
|
|
31
|
+
parent = _parent.parent;
|
|
25
32
|
}
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
33
|
+
return false;
|
|
29
34
|
};
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (decl.value.indexOf(func + "(") !== -1) {
|
|
40
|
-
return true;
|
|
36
|
+
/**
|
|
37
|
+
* Is transform caontain 3D commands
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
TransformDecl.prototype.contain3d = function contain3d(decl) {
|
|
42
|
+
if (decl.prop === 'transform-origin') {
|
|
43
|
+
return false;
|
|
41
44
|
}
|
|
42
|
-
}
|
|
43
|
-
return false;
|
|
44
|
-
};
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
for (var _iterator = TransformDecl.functions3d, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
|
47
|
+
var _ref;
|
|
48
|
+
|
|
49
|
+
if (_isArray) {
|
|
50
|
+
if (_i >= _iterator.length) break;
|
|
51
|
+
_ref = _iterator[_i++];
|
|
52
|
+
} else {
|
|
53
|
+
_i = _iterator.next();
|
|
54
|
+
if (_i.done) break;
|
|
55
|
+
_ref = _i.value;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var func = _ref;
|
|
59
|
+
|
|
60
|
+
if (decl.value.indexOf(func + '(') !== -1) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return false;
|
|
52
66
|
};
|
|
53
67
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Replace rotateZ to rotate for IE 9
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
TransformDecl.prototype.set = function set(decl, prefix) {
|
|
74
|
+
decl = _Declaration.prototype.set.call(this, decl, prefix);
|
|
75
|
+
if (prefix === '-ms-') {
|
|
76
|
+
decl.value = decl.value.replace(/rotateZ/gi, 'rotate');
|
|
58
77
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
78
|
+
return decl;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Don't add prefix for IE in keyframes
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
TransformDecl.prototype.insert = function insert(decl, prefix, prefixes) {
|
|
87
|
+
if (prefix === '-ms-') {
|
|
88
|
+
if (!this.contain3d(decl) && !this.keyframeParents(decl)) {
|
|
89
|
+
return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
|
|
90
|
+
}
|
|
91
|
+
} else if (prefix === '-o-') {
|
|
92
|
+
if (!this.contain3d(decl)) {
|
|
93
|
+
return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
|
|
62
97
|
}
|
|
63
|
-
|
|
64
|
-
return TransformDecl.__super__.insert.apply(this, arguments);
|
|
65
|
-
}
|
|
98
|
+
return undefined;
|
|
66
99
|
};
|
|
67
100
|
|
|
68
101
|
return TransformDecl;
|
|
102
|
+
}(Declaration);
|
|
69
103
|
|
|
70
|
-
|
|
104
|
+
Object.defineProperty(TransformDecl, 'names', {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
writable: true,
|
|
107
|
+
value: ['transform', 'transform-origin']
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(TransformDecl, 'functions3d', {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
writable: true,
|
|
112
|
+
value: ['matrix3d', 'translate3d', 'translateZ', 'scale3d', 'scaleZ', 'rotate3d', 'rotateX', 'rotateY', 'perspective']
|
|
113
|
+
});
|
|
71
114
|
|
|
72
|
-
module.exports = TransformDecl;
|
|
73
115
|
|
|
74
|
-
|
|
116
|
+
module.exports = TransformDecl;
|
|
@@ -1,38 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, WritingMode,
|
|
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
|
-
extend(WritingMode, 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; }
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
return WritingMode.__super__.constructor.apply(this, arguments);
|
|
13
|
-
}
|
|
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; }
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
var Declaration = require('../declaration');
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
var WritingMode = function (_Declaration) {
|
|
12
|
+
_inherits(WritingMode, _Declaration);
|
|
13
|
+
|
|
14
|
+
function WritingMode() {
|
|
15
|
+
_classCallCheck(this, WritingMode);
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
WritingMode.prototype.set = function set(decl, prefix) {
|
|
21
|
+
if (prefix === '-ms-') {
|
|
22
|
+
decl.value = WritingMode.msValues[decl.value] || decl.value;
|
|
23
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
24
|
+
} else {
|
|
25
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
26
|
+
}
|
|
30
27
|
};
|
|
31
28
|
|
|
32
29
|
return WritingMode;
|
|
30
|
+
}(Declaration);
|
|
31
|
+
|
|
32
|
+
Object.defineProperty(WritingMode, 'names', {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: ['writing-mode']
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(WritingMode, 'msValues', {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
writable: true,
|
|
40
|
+
value: {
|
|
41
|
+
'horizontal-tb': 'lr-tb',
|
|
42
|
+
'vertical-rl': 'tb-rl',
|
|
43
|
+
'vertical-lr': 'tb-lr'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
33
46
|
|
|
34
|
-
})(Declaration);
|
|
35
|
-
|
|
36
|
-
module.exports = WritingMode;
|
|
37
47
|
|
|
38
|
-
|
|
48
|
+
module.exports = WritingMode;
|