1 | "use strict";
|
---|
2 |
|
---|
3 | function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
---|
4 |
|
---|
5 | function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
---|
6 |
|
---|
7 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
---|
8 |
|
---|
9 | var OldValue = require('../old-value');
|
---|
10 |
|
---|
11 | var Value = require('../value');
|
---|
12 |
|
---|
13 | var Pixelated = /*#__PURE__*/function (_Value) {
|
---|
14 | _inheritsLoose(Pixelated, _Value);
|
---|
15 |
|
---|
16 | function Pixelated() {
|
---|
17 | return _Value.apply(this, arguments) || this;
|
---|
18 | }
|
---|
19 |
|
---|
20 | var _proto = Pixelated.prototype;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Use non-standard name for WebKit and Firefox
|
---|
24 | */
|
---|
25 | _proto.replace = function replace(string, prefix) {
|
---|
26 | if (prefix === '-webkit-') {
|
---|
27 | return string.replace(this.regexp(), '$1-webkit-optimize-contrast');
|
---|
28 | }
|
---|
29 |
|
---|
30 | if (prefix === '-moz-') {
|
---|
31 | return string.replace(this.regexp(), '$1-moz-crisp-edges');
|
---|
32 | }
|
---|
33 |
|
---|
34 | return _Value.prototype.replace.call(this, string, prefix);
|
---|
35 | }
|
---|
36 | /**
|
---|
37 | * Different name for WebKit and Firefox
|
---|
38 | */
|
---|
39 | ;
|
---|
40 |
|
---|
41 | _proto.old = function old(prefix) {
|
---|
42 | if (prefix === '-webkit-') {
|
---|
43 | return new OldValue(this.name, '-webkit-optimize-contrast');
|
---|
44 | }
|
---|
45 |
|
---|
46 | if (prefix === '-moz-') {
|
---|
47 | return new OldValue(this.name, '-moz-crisp-edges');
|
---|
48 | }
|
---|
49 |
|
---|
50 | return _Value.prototype.old.call(this, prefix);
|
---|
51 | };
|
---|
52 |
|
---|
53 | return Pixelated;
|
---|
54 | }(Value);
|
---|
55 |
|
---|
56 | _defineProperty(Pixelated, "names", ['pixelated']);
|
---|
57 |
|
---|
58 | module.exports = Pixelated; |
---|