The Stack Archive

Firefox sacrifices beauty in order to end browser freeze

Wed 10 Feb 2016

A new post at mozilla.org announces that Firefox 46 will finally cure the browser freeze syndrome known as ‘jank’ – the moment where scrolling becomes impossible because of a backlog of instructions – but that this improvement will cause some undesirable user experiences as well.

The current Firefox beta already deploys the asynchronous panning and zooming (APZ) that will bring an end to scroll ‘catch up’ in the final release of Firefox 46. APZ was developed by Mozilla for the mobile platform for touch-scroll events, and in 46 final will also be enabled for mousewheel and trackpad scrolling. While this means that page scrolling will not be held up by other queued and executing events, such as complex JavaScript operations related to CSS or to advertising, it does mean that the user will find themselves scrolling into areas of the page which aren’t quite ready to be seen yet.

‘Of course, nothing is free, and APZ comes at a cost. APZ does eliminate jank, but in some cases it does so by checkerboarding instead. Checkerboarding is what you get when you scroll faster than the browser can paint the page. When this happens, the content at your new scroll position hasn’t been painted yet, and so we just show a flat background color. (The term checkerboarding comes from the original iPhone implementation, which would show a checkerboard pattern.) Once the painting catches up, the content fills in.’

firefox-46-thread-handlingUser input such as page navigation has been handled by now (see image right) as part of the Firefox main event-handling protocols, which allowed JavaScripts and other secondary or ancillary events to delay the responsiveness of the page. Under the Electrolysis (e10s) implementation, the main browser is sandboxed from the content process.

‘Checkerboarding’ refers to the grid pattern which was seen in analogous scrolling circumstances in the earliest versions of the iPhone. In the field of graphics, the checkerboard is intended to represent transparency, or absence of pixel content.

The Mozilla post says that it was decided to trade jank freezes for what may prove to be a perplexing scrolling experience (particularly in complex pages or pages which employ lazy loading or scroll-driven effects, such as graphs which animate when they come into view) in order to avoid hangs, which are frequently mistaken for freeze loops. In such circumstances it is not always clear to the user whether a freeze has become critical, and frustrated attempts to clear the hang are likely to aggravate it.

Mozilla suggests that developers use CSS positioning rather than JavaScript to implement on-scroll effects, due to the problems that are likely to occur under the new Electrolysis-based scrolling model.


developers Firefox news
Send us a correction about this article Send us a news tip