When my AJAX request is in progress, an animated GIF is displayed to show activity. However, I have noticed that the animation freezes while the response from the request is being processed by a script that heavily updates the DOM.
After researching this issue, it appears that the reason for the freezing animation is due to the fact that the GIF animation and javascript are running on the same thread, as modern browsers like Chrome, Firefox, Safari, and IE are truly single-threaded. Is this interpretation accurate for all mainstream browsers?
Furthermore, why is the browser designed in this way? Could there be a possibility for the browser to allocate a separate thread for GIF animations so they don't freeze during the execution of javascript code?
Update
Here, you can find an interesting page discussing the use of pure CSS3 animations. Although these animations still freeze in Firefox, there may be hopes for improvements in the future. It seems like using CSS for animations rather than GIFs could be a better option.