Mozilla has announced the availability of the third Firefox 4 beta. The release brings several improvements, including JavaScript optimizations and support for multitouch interaction on Windows.

Mozilla's developers have created new APIs that will make it possible for individual websites to handle and respond to multitouch input. Developers will be able to bind JavaScript functions to a set of "MozTouch" events that are triggered when touchscreen interaction occurs. There is also a special CSS media query that can be used to apply custom styles on devices that have touch support enabled.

The APIs are specific to Mozilla's browser and are currently only implemented on the Windows platform. In a recent blog entry, Firefox developer Felipe Gomes says that Mozilla hopes to bring the new APIs to W3C so that they can start to discuss the possibility of standardization. At the Mozilla Hacks blog, you can see some nice demo videos that show the multitouch feature in action, including one in which pinch-zooming is used to transform an HTML video element.

Another major change in this beta is an update to how Mozilla implements tagged integers in its JavaScript engine. In the old system, each JavaScript value was stored in a 32-bit space, with the last three bits used to specify the type. For strings and objects, the type data was accompanied by a pointer to where the actual value was in memory, but for numbers the actual value would be included alongside the type data if it could fit within the remainder of the 32-bit space.

The new system uses Fat Values, which are 64 bits wide. It typically uses the first half of the space to store the tag and the second half to store the value or pointer to the value. For floating point numbers and bigger integers, it can use the full 64 bits. This change means that floating point numbers can be retrieved faster during JavaScript execution, leading to better performance on mathematically intensive code. Mozilla's Rob Sayre has a detailed explanation.

Users who want to test the beta can download it from the Mozilla website. For more details, you can refer to the release notes.