3 ms·
I could imagine it has to do with the fact that CSS is declarative and exposes a lot less "internals" to the user than JS does. This allows browsers to do a who
by xg15 10y ago
I could imagine it has to do with the fact that CSS is declarative and exposes a lot less "internals" to the user than JS does. This allows browsers to do a whole lot of optimisations (parallel execution, culling, delegation to GPU) without risk of breaking anything. With JS on the other hand, browsers must be careful to keep up the illusion of sequential, single-threaded execution because that's what JS code assumes.