You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.8 KiB

4 years ago
  1. "use strict";
  2. 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; }
  3. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
  4. 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; }
  5. var OldValue = require('../old-value');
  6. var Value = require('../value');
  7. var Pixelated =
  8. /*#__PURE__*/
  9. function (_Value) {
  10. _inheritsLoose(Pixelated, _Value);
  11. function Pixelated() {
  12. return _Value.apply(this, arguments) || this;
  13. }
  14. var _proto = Pixelated.prototype;
  15. /**
  16. * Use non-standard name for WebKit and Firefox
  17. */
  18. _proto.replace = function replace(string, prefix) {
  19. if (prefix === '-webkit-') {
  20. return string.replace(this.regexp(), '$1-webkit-optimize-contrast');
  21. }
  22. if (prefix === '-moz-') {
  23. return string.replace(this.regexp(), '$1-moz-crisp-edges');
  24. }
  25. return _Value.prototype.replace.call(this, string, prefix);
  26. }
  27. /**
  28. * Different name for WebKit and Firefox
  29. */
  30. ;
  31. _proto.old = function old(prefix) {
  32. if (prefix === '-webkit-') {
  33. return new OldValue(this.name, '-webkit-optimize-contrast');
  34. }
  35. if (prefix === '-moz-') {
  36. return new OldValue(this.name, '-moz-crisp-edges');
  37. }
  38. return _Value.prototype.old.call(this, prefix);
  39. };
  40. return Pixelated;
  41. }(Value);
  42. _defineProperty(Pixelated, "names", ['pixelated']);
  43. module.exports = Pixelated;