mask-border.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. (function() {
  2. var Declaration, MaskBorder,
  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;
  5. Declaration = require('../declaration');
  6. MaskBorder = (function(superClass) {
  7. extend(MaskBorder, superClass);
  8. function MaskBorder() {
  9. return MaskBorder.__super__.constructor.apply(this, arguments);
  10. }
  11. MaskBorder.names = ['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'];
  12. MaskBorder.prototype.normalize = function() {
  13. return this.name.replace('box-image', 'border');
  14. };
  15. MaskBorder.prototype.prefixed = function(prop, prefix) {
  16. if (prefix === '-webkit-') {
  17. return MaskBorder.__super__.prefixed.apply(this, arguments).replace('border', 'box-image');
  18. } else {
  19. return MaskBorder.__super__.prefixed.apply(this, arguments);
  20. }
  21. };
  22. return MaskBorder;
  23. })(Declaration);
  24. module.exports = MaskBorder;
  25. }).call(this);