Firefox 3.6 a1: new CSS features, faster JavaScript

Mozilla has released the first alpha of Firefox 3.6. Ars takes a look at the …

On Friday, Mozilla announced the availability of the first Firefox 3.6 alpha release. It introduces several new features and brings a number of performance improvements to the popular open source Web browser.

Firefox 3.5 was officially launched in June, roughly one year after the release of Firefox 3.0. Version 3.6, which is codenamed Namoroka, is tentatively expected to arrive in 2010. Performance and customization improvements are a major part of the roadmap for Namoroka. Mozilla is also exploring some new user interface concepts that could be used to augment the tabbed browsing model.

Although Namoroka is still at a very early stage of development, the 3.6 alpha includes very noticeable performance enhancements. In Firefox 3.5, Mozilla introduced a new high-performance JavaScript engine called TraceMonkey that uses just-in-time compilation and an optimization technique called tracing to deliver faster JavaScript execution. Improvements to this engine have helped to further accelerate JavaScript performance in the 3.6 alpha release.

TraceMonkey developer Andreas Gal, one of the researchers behind tracing optimization, says that JavaScript performance in 3.6 is roughly 15 percent faster than in 3.5. That's already a meaningful improvement, and it's possible that we could see TraceMonkey get even faster as the development cycle progresses. It's still not quite enough to catch up with Google's Chrome Web browser, however, which also got a touch of extra turbo in its latest beta release.

Firefox 3.6 offers several new CSS features. Among these, the most intriguing is support for CSS gradients, which allow Web developers to paint the background of an element with a color gradient with multiple color stops. This feature was originally invented last year by Apple and implemented in WebKit. It is based partly on the gradient features described in the HTML 5 Canvas specification. We have seen it appear in several different WebKit variants, including the rendering engine in Chrome. Mozilla's move to add it to Firefox's Gecko rendering engine marks the first time that it has been used in a renderer other than WebKit.

Mozilla's syntax for CSS gradients, however, is slightly different from that of WebKit. Unlike Safari and Chrome, which specify the type of gradient as the first parameter, Mozilla has elected to move the gradient type into the CSS property name (linear-gradient(...) rather than gradient(linear, ...)), meaning that it has a separate property for each kind of gradient. This arguably simplifies the parsing of the subsequent parameters. The following example is adapted from a simple test that I made for comparing CSS support in WebKit variants:

Mozilla is also working on a lot of major architectural improvements for Firefox 3.6. The earliest of this work has started to land, including a new compositing engine and a rework of how focus is handled. The compositing engine is said to improve scrolling performance. A significantly more ambitious architectural change that is being explored is support for multiprocess browsing. Mozilla has already revealed details about its plans in that area, but it's not clear yet if this approach will be ready in time for Namoroka.

Firefox has an enormous amount of momentum and is moving forward at a very rapid pace. Mozilla recently celebrated the billionth download of its popular browser. Competitors are gaining ground, however, and Firefox is having to match their strengths in order to retain its place at the front of the pack. It's worth noting that the JavaScript performance gains and new CSS features introduced in this release are about attempting to achieve parity with WebKit, rather than raising the bar. This reflects the increasingly healthy competition that is redefining the browser space.