Google Chrome compositor-driven animation affected by jam in main thread

雨燕双飞 提交于 2019-12-23 03:40:19

问题


Here is the fiddle showing the puzzler:

https://jsfiddle.net/1rk65nxj/

I am animating this .spinner element using CSS animation. The element itself is promoted to its own compositing layer using will-change: transform and translateZ(0) for fallback.

Now, i jam the main thread doing something like:

var i = 999999; 

while ( i > 0) {
    i--;
}

Since CSS animations are compositor-driven page updates, I expected the main thread jam not to halt the spinner but it does.

Now, the weird thing is, if I change the position of the element from relative to absolute, the main thread jam does not halt the spinner.

Any explanation on why position: absolute makes the animation compositor-driven and position: relative not?

On Google Chrome Version 48.0.2564.116 (64-bit), Mac OS X El Capitan.


回答1:


This appears to be a bug in Chrome. I've filed it here: https://bugs.chromium.org/p/chromium/issues/detail?id=592803



来源:https://stackoverflow.com/questions/35851897/google-chrome-compositor-driven-animation-affected-by-jam-in-main-thread

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!