NEW218532
Animations of discrete properties should schedule animation frames sparingly
https://bugs.webkit.org/show_bug.cgi?id=218532
Summary Animations of discrete properties should schedule animation frames sparingly
Antoine Quint
Reported 2020-11-03 13:07:58 PST
As part of bug 218530, we're adding support for a new animation wrapper for CSS properties that support discrete animations only: DiscretePropertyWrapper. We should make it so that we don't schedule invalidation for animations of discrete properties at the full refresh rate but only at times when the property value will change.
Attachments
Radar WebKit Bug Importer
Comment 1 2020-11-03 13:08:26 PST
Antoine Quint
Comment 2 2020-11-16 10:04:24 PST
This means we'll have to resolve the timing function to predict the amount of time until we reach the mid-way point for the current interval.
Antoine Quint
Comment 3 2020-11-16 11:36:42 PST
First step towards this will be refactoring WebAnimation::timeToNextTick() into a KeyframeEffect method.
Antoine Quint
Comment 4 2024-01-03 06:50:37 PST
Thinking about this some more, this will require quite a bit of work to handle all cases: 1. we need to identify the keyframe range in which we are in 2. then we need to check whether the interpolation between the values in that range will yield a discrete animation, which cannot always be computed ahead of time since this could be affected by the CSS cascade (as would be the case with `inherit` values). 3. then we need to determine the time until this range reaches its midway point if the current progress is less than 0.5, this will involve resolving the relevant easing However, we could start with dealing with simple cases such as animations that only target discrete properties. But the complete solution definitely requires some non-trivial and potentially expensive work.
Note You need to log in before you can comment on or make changes to this bug.