autofill.js 531 B

1234567891011121314151617181920212223242526
  1. let Selector = require('../selector')
  2. let utils = require('../utils')
  3. class Autofill extends Selector {
  4. constructor(name, prefixes, all) {
  5. super(name, prefixes, all)
  6. if (this.prefixes) {
  7. this.prefixes = utils.uniq(this.prefixes.map(() => '-webkit-'))
  8. }
  9. }
  10. /**
  11. * Return different selectors depend on prefix
  12. */
  13. prefixed(prefix) {
  14. if (prefix === '-webkit-') {
  15. return ':-webkit-autofill'
  16. }
  17. return `:${prefix}autofill`
  18. }
  19. }
  20. Autofill.names = [':autofill']
  21. module.exports = Autofill