2023-08-17 09:47:40 +00:00
|
|
|
let Declaration = require('../declaration')
|
2022-01-21 08:28:41 +00:00
|
|
|
|
2023-08-17 09:47:40 +00:00
|
|
|
class OverscrollBehavior extends Declaration {
|
|
|
|
/**
|
|
|
|
* Return property name by spec
|
|
|
|
*/
|
|
|
|
normalize() {
|
|
|
|
return 'overscroll-behavior'
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Change property name for IE
|
|
|
|
*/
|
2023-08-17 09:47:40 +00:00
|
|
|
prefixed(prop, prefix) {
|
|
|
|
return prefix + 'scroll-chaining'
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Change value for IE
|
|
|
|
*/
|
2023-08-17 09:47:40 +00:00
|
|
|
set(decl, prefix) {
|
2022-01-21 08:28:41 +00:00
|
|
|
if (decl.value === 'auto') {
|
2023-08-17 09:47:40 +00:00
|
|
|
decl.value = 'chained'
|
2022-01-21 08:28:41 +00:00
|
|
|
} else if (decl.value === 'none' || decl.value === 'contain') {
|
2023-08-17 09:47:40 +00:00
|
|
|
decl.value = 'none'
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
2023-08-17 09:47:40 +00:00
|
|
|
return super.set(decl, prefix)
|
|
|
|
}
|
|
|
|
}
|
2022-01-21 08:28:41 +00:00
|
|
|
|
2023-08-17 09:47:40 +00:00
|
|
|
OverscrollBehavior.names = ['overscroll-behavior', 'scroll-chaining']
|
2022-01-21 08:28:41 +00:00
|
|
|
|
2023-08-17 09:47:40 +00:00
|
|
|
module.exports = OverscrollBehavior
|