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.
31 lines
575 B
31 lines
575 B
3 years ago
|
let Selector = require('../selector')
|
||
|
let utils = require('../utils')
|
||
|
|
||
|
class Autofill extends Selector {
|
||
|
constructor(name, prefixes, all) {
|
||
|
super(name, prefixes, all)
|
||
|
|
||
|
if (this.prefixes) {
|
||
|
this.prefixes = utils.uniq(
|
||
|
this.prefixes.map(i => {
|
||
|
return '-webkit-'
|
||
|
})
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return different selectors depend on prefix
|
||
|
*/
|
||
|
prefixed(prefix) {
|
||
|
if (prefix === '-webkit-') {
|
||
|
return ':-webkit-autofill'
|
||
|
}
|
||
|
return `:${prefix}autofill`
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Autofill.names = [':autofill']
|
||
|
|
||
|
module.exports = Autofill
|