First look: Firefox 4 Beta 1 shines on HTML5

Sure, Firefox 4's new Chrome-like UI is nice, but the real story is under the hood

While it's impossible to sum up the thousands of enhancements and bug fixes both big and small, the Firefox 4 beta version brings the browser that much closer to taking over everything on the desktop. There are fewer reasons for anyone to interact with an extra plug-in or the operating system. Remember when people cared about whether a machine was Windows or Mac or a Commodore 64? Remember when software needed to be written in native code? Those days are fading away quickly as the browser is more able than ever before to deliver most of the content we might want.

You've no doubt heard about or even seen Firefox 4's new Chrome-like interface. More important are the many new features generally lumped together under the catchall standard HTML5, a specification that's still a draft but has become more of a rallying cry for AJAX, JavaScript, endless tags, and life beyond plug-ins.

[ Also on InfoWorld: HTML5 will spawn richer, more sophisticated websites while also easing development. Read about the nine ways HTML5's impact will be felt in "How HTML5 will change the Web." Learn how to take advantage of HTML5 in "What to expect from HTML5." ]

Many of the enticing new features open up new opportunities for AJAX and JavaScript programmers to add more razzle-dazzle and catch up with Adobe Flash, Adobe AIR, Microsoft Silverlight, and other plug-ins. The CSS transitions, still "partially supported" in Firefox 4 Beta 1, give programmers the chance to set up one model for changing the CSS parameters without writing a separate JavaScript function to do it. The browser just fades and tweaks the CSS parameters over time.

There are plenty of other little parts of HTML5 that have been slowly arriving in previous versions of Firefox but are now being more fully integerated. MathML and SVG data are now a bit easier to mix right in with old-fashioned text. The Canvas and optional WebGL layers can create custom images at the browser without waiting for a server to deliver a GIF. A handful of new tags like <header> and <figure> offer a more document-centric approach, so the browser can present information more like the data on the printed page. The <figure> tag can be matched with a <figcaption> tag and the browser will keep the two together and try to put the results near the <mark> tag.

These are just some of the options that programmers can use to add more zip to static text. Firefox 4 also adds an implementation of the Websockets API, a tool for enabling the browser and the server to pass data back and forth as needed, making it unnecessary for the browser to keep asking the server if there's anything new to report. If there's a need to store some of this data locally, the JavaScript programmer now gets access to indexed databases. They're not exactly flat files, but they're useful if you want to store and index name/value pairs data.

Converting this information to the HTML tags is becoming more fluid. The Mozilla release notes, for instance, brag that Firefox 4's parser is 20 percent faster at interpreting the innerHTML calls generated by dynamic JavaScript. The frames are supposedly going to be evaluated in a lazy manner so that the page resembles its final form a bit sooner. And now plug-ins are running in separate threads, offering so-called Crash Protection against glitches.

Some of this is clearly paying off. Firefox 4 Beta 1 scored 3,573 on the Peacekeeper benchmark, much better than 2,470, the score produced by Firefox 3.6.4 on the same machine. These values, though, still lag behind the competition. Other browsers, including Chrome, Opera, and Safari, score between 5,000 and 7,000. There is a similar gap in the JavaScript-centric SunSpider benchmarks: 970ms for Firefox 4 Beta 1 versus 750ms for Chrome.

1 2 Page 1
Page 1 of 2