Animating CSS width or height no longer force a Main Thread animation (in Chrome, under the right conditions)
bram.us·7h·
Discuss: Hacker News
Flag this post

🤩 There’s a very – VERY! – exciting animations/performance change available in Chrome Canary:

Under the right conditions, width/height animations will no longer automatically force a Main Thread animation, but can be allowed to run on the Compositor.

~

So, we’ve always been told that animating CSS width and height is bad from a performance perspective, as that causes Layout to happen. This still is true.

Animating width or height requires Layout … but perhaps that’s not always needed?

~

Taking a step back: to determine if an animation can run on the compositor or not, Blink (Chrome’s engine) does a bunch of checks. One of those is a check for the presence of width or height in the keyframes. If you are animating those, the animation is forced to run on the…

Similar Posts

Loading similar posts...