mask-border.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. 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; }
  4. 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; }
  5. var Declaration = require('../declaration');
  6. var MaskBorder = function (_Declaration) {
  7. _inherits(MaskBorder, _Declaration);
  8. function MaskBorder() {
  9. _classCallCheck(this, MaskBorder);
  10. return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
  11. }
  12. /**
  13. * Return property name by final spec
  14. */
  15. MaskBorder.prototype.normalize = function normalize() {
  16. return this.name.replace('box-image', 'border');
  17. };
  18. /**
  19. * Return flex property for 2012 spec
  20. */
  21. MaskBorder.prototype.prefixed = function prefixed(prop, prefix) {
  22. var result = _Declaration.prototype.prefixed.call(this, prop, prefix);
  23. if (prefix === '-webkit-') {
  24. result = result.replace('border', 'box-image');
  25. }
  26. return result;
  27. };
  28. return MaskBorder;
  29. }(Declaration);
  30. Object.defineProperty(MaskBorder, 'names', {
  31. enumerable: true,
  32. writable: true,
  33. value: ['mask-border', 'mask-border-source', 'mask-border-slice', 'mask-border-width', 'mask-border-outset', 'mask-border-repeat', 'mask-box-image', 'mask-box-image-source', 'mask-box-image-slice', 'mask-box-image-width', 'mask-box-image-outset', 'mask-box-image-repeat']
  34. });
  35. module.exports = MaskBorder;