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.

24 lines
568 B

  1. 'use strict';
  2. var parsers = require('../parsers');
  3. var isValid = (module.exports.isValid = function isValid(v) {
  4. return (
  5. parsers.valueType(v) === parsers.TYPES.KEYWORD &&
  6. (v.toLowerCase() === 'scroll' || v.toLowerCase() === 'fixed' || v.toLowerCase() === 'inherit')
  7. );
  8. });
  9. module.exports.definition = {
  10. set: function(v) {
  11. if (!isValid(v)) {
  12. return;
  13. }
  14. this._setProperty('background-attachment', v);
  15. },
  16. get: function() {
  17. return this.getPropertyValue('background-attachment');
  18. },
  19. enumerable: true,
  20. configurable: true,
  21. };