Open birtles opened 6 years ago
Thanks for filing these. I will get back to this thread and fix the explainer after concluding the main promise of the feature mostly discussed in issues w3c/document-policy#10 and w3c/webappsec-permissions-policy#204.
Reviving this thread as the animation policy has been reworked. It no longer deals with composited animations and is now about disabling certain layout animations instead. Please, take another look.
Thanks for addressing my comments. I'm afraid the are still a few inaccuracies (e.g. there's no size
property in CSS, a number of transition events are omitted, etc.). Also the part about blocking animations should be rephrased in terms of discrete animation.
More importantly, however, I still don't think we'd be interested in implementing this--the animations()
feature in particular seems to encourage coding to the performance characteristics of a particular version of a particular user agent on particular hardware. layout-animations
too brings some similar concerns (since some UAs can sometimes animate position properties without re-running layout if the elements are absolutely positioned).
(apologies for the delayed response) Thanks for the comment's and corrections. I created the pull request w3c/webappsec-permissions-policy#239 to address the mentioned issues.
AFAIK on Chrome the aforementioned animations do not always lead to re-running layout; the policy is based on assuming the worst, i.e., if the animation can in general cause layout changes then it will be disabled. Understandably this would block certain animations which would not have caused re-layout; however the policy is meant to be a promise on decreasing the number of layout runs on a page and ideally lead to more responsive pages.
The feature policy description appears to have a lot of inaccuracies. e.g.
Or CSS animations, or Web Animations, or SVG SMIL, or JavaScript.
The animations still run on the CPU. The GPU is just used for much of the heavy-lifting of producing each animation frame.
Most CSS properties are not "interpolable". See how many properties have a
'discrete'
animation type in property-list.js.Furthermore, "interpolable" is not dependent just on the property, but on the specific values being used (e.g.
auto
cannot currently be smoothly interpolated with100px
).background-image
can be interpolated in Webkit-based engines (including Blink) usingcross-fade()
.