image-rendering.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. (function() {
  2. var Declaration, ImageRendering,
  3. __extends = 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. ImageRendering = (function(_super) {
  7. __extends(ImageRendering, _super);
  8. function ImageRendering() {
  9. return ImageRendering.__super__.constructor.apply(this, arguments);
  10. }
  11. ImageRendering.names = ['image-rendering', 'interpolation-mode'];
  12. ImageRendering.prototype.check = function(decl) {
  13. return decl.value === 'crisp-edges';
  14. };
  15. ImageRendering.prototype.prefixed = function(prop, prefix) {
  16. if (prefix === '-ms-') {
  17. return '-ms-interpolation-mode';
  18. } else {
  19. return ImageRendering.__super__.prefixed.apply(this, arguments);
  20. }
  21. };
  22. ImageRendering.prototype.set = function(decl, prefix) {
  23. if (prefix === '-ms-') {
  24. decl.prop = '-ms-interpolation-mode';
  25. decl.value = 'nearest-neighbor';
  26. return decl;
  27. } else {
  28. return ImageRendering.__super__.set.apply(this, arguments);
  29. }
  30. };
  31. ImageRendering.prototype.normalize = function(prop) {
  32. return 'image-rendering';
  33. };
  34. return ImageRendering;
  35. })(Declaration);
  36. module.exports = ImageRendering;
  37. }).call(this);