user-select.js 578 B

12345678910111213141516171819202122232425262728
  1. let Declaration = require('../declaration')
  2. class UserSelect extends Declaration {
  3. /**
  4. * Change prefixed value for IE
  5. */
  6. set(decl, prefix) {
  7. if (prefix === '-ms-' && decl.value === 'contain') {
  8. decl.value = 'element'
  9. }
  10. return super.set(decl, prefix)
  11. }
  12. /**
  13. * Avoid prefixing all in IE
  14. */
  15. insert(decl, prefix, prefixes) {
  16. if (decl.value === 'all' && prefix === '-ms-') {
  17. return undefined
  18. } else {
  19. return super.insert(decl, prefix, prefixes)
  20. }
  21. }
  22. }
  23. UserSelect.names = ['user-select']
  24. module.exports = UserSelect