HTML5 Scrolling Performance
html5rocks.com
html5rocks.com
Pages that use scroll event handlers, however, place limits on what browsers can do to improve scrolling performance. Scroll events have to be interleaved with the painting that occurs during a scroll, otherwise any movement of onscreen elements that the event handler performs will appear out of sync with respect to the rest of the scrolling. The single threaded nature of JavaScript in web pages means that this event delivery requires bypassing the multithreading scrolling optimisation I mentioned above. Reducing, or preferably eleminating, these event handlers can result in dramatically smoother scrolling. Improvements to web technologies have been proposed in order to aid this. For instance, scroll events are often seen implementing headers that are in the flow of the page and then stick to the top of the viewport as the user scrolls downwards. "position: sticky", a means of achieving this effect without JavaScript, was recently proposed on the CSS standards mailing list [1] in order to help future developers unintentionally causing their pages to scroll in a jittery manner.
[1] http://lists.w3.org/Archives/Public/www-style/2012Jun/0627.h...