text-emphasis-position.js 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. (function() {
  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;
  5. Declaration = require('../declaration');
  6. TextEmphasisPosition = (function(superClass) {
  7. extend(TextEmphasisPosition, superClass);
  8. function TextEmphasisPosition() {
  9. return TextEmphasisPosition.__super__.constructor.apply(this, arguments);
  10. }
  11. TextEmphasisPosition.names = ['text-emphasis-position'];
  12. TextEmphasisPosition.prototype.set = function(decl, prefix) {
  13. if (prefix === '-webkit-') {
  14. decl.value = decl.value.replace(/\s*(right|left)\s*/i, '');
  15. return TextEmphasisPosition.__super__.set.call(this, decl, prefix);
  16. } else {
  17. return TextEmphasisPosition.__super__.set.apply(this, arguments);
  18. }
  19. };
  20. return TextEmphasisPosition;
  21. })(Declaration);
  22. module.exports = TextEmphasisPosition;
  23. }).call(this);