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.
34 lines
677 B
34 lines
677 B
2 years ago
|
let Declaration = require('../declaration')
|
||
|
|
||
|
class OverscrollBehavior extends Declaration {
|
||
|
/**
|
||
|
* Change property name for IE
|
||
|
*/
|
||
|
prefixed(prop, prefix) {
|
||
|
return prefix + 'scroll-chaining'
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return property name by spec
|
||
|
*/
|
||
|
normalize() {
|
||
|
return 'overscroll-behavior'
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Change value for IE
|
||
|
*/
|
||
|
set(decl, prefix) {
|
||
|
if (decl.value === 'auto') {
|
||
|
decl.value = 'chained'
|
||
|
} else if (decl.value === 'none' || decl.value === 'contain') {
|
||
|
decl.value = 'none'
|
||
|
}
|
||
|
return super.set(decl, prefix)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
OverscrollBehavior.names = ['overscroll-behavior', 'scroll-chaining']
|
||
|
|
||
|
module.exports = OverscrollBehavior
|