Summary: | Efficient low frequency animations | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jake Archibald <jaffathecake> |
Component: | Animations | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Normal | CC: | dino, graouts, jer.noble, simon.fraser, webkit-bug-importer, ysuzuki |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Description
Jake Archibald
2020-12-10 11:44:26 PST
Thanks for the info. Our long-term objective is web-exposed API that allows devs to express what frame rate their animation needs. Yeah, I think we need that too. I made some notes here https://github.com/whatwg/html/issues/5025 - seems important to allow multiple animations to exist on the same reduced frame rate timeline. I know you've thought about this more than me though, any API ideas? However, I think the unoptimised cases in this test are still worth fixing. Discrete - although a fixed frame rate would work here, it's already expressed in the animation keyframes. Mostly same values - this can't be fixed by a reduced frame rate. I've used this style of animation for a "recording" indicator. Like, a red circle that briefly fades from opacity 0.6 to 1, then back to 0.6, then stays at 0.6 for a few seconds. The fading should be high frequency, but the browser shouldn't run a high frequency timer while values aren't changing. Empty animation - this is an alternative to setTimeout but works with the document timeline timer, and doesn't tick when the document is hidden. I guess you could define this as a 0fps animation? But again this can be inferred. I had actually already planned to deal with discrete values, I'm still in the middle of implementing some remaining CSS properties for discrete animations. Mostly same values… that'll require a bit more thinking. Empty animations: that one's easy and I'll file a dedicated bug for this. Note that for steps() we have dedicated logic already. |