document-policy
document-policy copied to clipboard
[Feature policy: animations] What does "blocking" an animation mean?
- Do blocked animations still dispatch events?
- Does calling
Element.animate()
with a disallowed property throw? - If an animation specifies both allowed and disallowed properties, do the allowed ones still run?
Thanks for the issue. A blocked animation is expected to still run but at a very reduced sampling/interpolation rate. From the explainer
... These properties are "animated" by simply jumping from the initial to the final value at the midpoint of the animation.
so potentially the behavior could be an abrupt transition to the final state (perhaps in the middle or at the end of the interval).
Do blocked animations still dispatch events?
Yes, they should; and the behind-the-flag implementation on Chrome seems to support that as expected. In tested this on a demo page here by listening to the animationiteration
event.
If an animation specifies both allowed and disallowed properties, do the allowed ones still run?
Good point...maybe just disallow the whole animation (in favor of a more consistent and potentially simpler implementation).
... These properties are "animated" by simply jumping from the initial to the final value at the midpoint of the animation.
That sentence is in the context of describing how properties with an animation type of "discrete" currently animate. It doesn't define how "blocked" animations are expected to work with this policy.