Firefox 4 beta gets hard on Windows
Drops 60s psychedelia API
Mozilla has released a fifth Firefox 4 beta, offering graphics hardware acceleration on Windows and a new API that lets site developers code pages that visually display audio data inside the browser.
"The latest update to Firefox 4 Beta brings super fast graphics and incredible new audio capabilities to the Web," reads a blog post from Firefox development head Mike Beltzner.
The new beta also includes HTTP Strict Transport Security (HSTS), which lets websites demand that Firefox always use a secure connection when visiting. "Firefox 4 Beta now remembers what sites use the HSTS protocol and will only connect to those sites using SSL (Secure Sockets Layer) in the future, helping to prevent 'man in the middle' attacks," Beltzner says.
If you're running Windows Vista or Windows 7 and your graphics card is DirectX 10–compatible, Mozilla's beta will automatically accelerate graphics via Microsoft's Direct2D rendering system. Previously, the beta — and the Firefox 4 alpha — offered such hardware acceleration as an option, but it's now turned on by default.
In a separate post, Mozilla man Bas Schouten said that although there's nothing analogous to Direct2D from other OSes, Mozilla is also "working hard on alternative approaches to use hardware acceleration on other platforms."
Clearly, this is the ideal tool for those looking to build an homage to late-60s psychedelia:
Last year, Mozilla began work on a project called ForceTLS that would allow sites to force a secure connection. "The main idea was simple, yet powerful: allow sites a way to say 'in the future, ALWAYS load me via HTTPS,'" said security maven Sid Stamm. The idea has now been added to the Firefox beta using the HTTP Strict Transport Security (HSTS) protocol.
"If Firefox knows your host is an HSTS one, it will automatically establish a secure connection to your server without even trying an insecure one," Stamm says in a new post. "This way, if I am surfing the 'net in my favorite cafe and a hacker is playing MITM [man in the middle] with paypal.com (intercepting http requests for paypal.com and then forwarding them on to the real site), either I'll thwart the attacker by getting an encrypted connection to paypal.com immediately, or the attack will be detected by HSTS and the connection won't work at all."
Stamm adds that work on the project is not completely finished. The team also aims to include an interface that lets you remove the HSTS default for a server on your own.
Of course there are things analogous to Direct2D in other operating systems. Every platform has a native drawing API. Firefox uses whatever is most suitable and available. In the case of Windows, that would be DirectX or GDI. On OS X it might be QuickDraw or Quartz. On Linux it might be OpenGL or X11.
Firefox uses Cairo to abstract all these differences so the bulk of the code just calls a Cairo API.and the command is translated into the relevant backend instructions. Cairo can also be used to print to PDF / Postscript which makes it useful for printing too.
Microsoft certainly do change DirectX from time to time but they do so in an incremental fashion. They add new interfaces to support new functionality, not change the existing ones. Therefore, there is no reason to think that Firefox will suddenly break from using it, any more than some random game that happens to use DirectX 9 when version 10 or 11 turn up.
Firefox uses OpenGL for hardware acceleration on other platforms
Although there is nothing exactly similar to Direct2D on non-Windows platforms does not mean other platforms won't see hardware accelerated browsing.
Firefox uses OpenGL on OS X and Linux to use the GPU for rendering of everything from basic HTML to SVG animation and HTML5 video.
Joe Drew, Mozilla: Hardware accelerating Firefox
"I don't know Linux but I'm going to ask a deep question about it anyway" - that's a rather odd thing to do, to my mind, but I'll bite..
The distributions all share the same kernel and drivers (that's the "Linux" bit), although they often tweak it a little and they all contain different versions.
The graphics part is almost always provided by the Xorg X server - this is written by the Xorg folk, some of which may be employed by companies such as RedHat, but it's really a separate project to the distributions themselves.
The biggest issue on Linux is that graphics hardware development is so rapid and the chips so complex that writing a driver for them without access to the specs (which are almost always never available) is very very hard.
Even if you have the specs, you don't always get the list of things which don't work as they were specified.
So, you have very many slightly different and very complicated devices which are expensive to buy (it's hard writing code for something you haven't got) and no guide to writing a driver.
Then people complain that driver support is crap on Linux.
So, the manufacturers tend to write a Linux driver (for Xorg, normally, maybe with a bit in the kernel too), which by and large is closed source, buggy, contains security holes and is bloated. However, the drivers usually work OK and give pretty quick performance so lots of people use them anyway.
By the time the open source drivers get to the point that they're featureful and fast, the hardware's moved on and the cycle begins anew.