2 ms·
> We need better scroll APIs for sure, but in DOM JavaScript API not in CSS If it's in CSS, the browser can fundamentally optimize it better. DOM APIs have to
by pcwalton 12y ago
> We need better scroll APIs for sure, but in DOM JavaScript API not in CSS
If it's in CSS, the browser can fundamentally optimize it better. DOM APIs have to run on the JS thread ("main thread") and contend with GC pauses, image decoding (in some browsers), layout (in all mainstream browsers), painting (in most browsers) and so forth. However, if it's in CSS, it can be proxied out to the compositor thread, which runs very little. This makes a huge difference in responsiveness.