A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/4 below:

Firefox 4 for developers - Mozilla

Firefox 4 for developers

Firefox 4, which shipped on March 22, 2011, enhances performance, adds more support for HTML5 and other evolving Web technologies, and further improves security. This article provides information about this release and what features are available for Web developers, add-on developers, and Gecko platform developers alike.

Features for web developers

Gecko now uses the HTML5 parser, which fixes bugs, improves interoperability, and improves performance. It also lets content embed SVG and MathML directly in the HTML markup.

HTML
Web forms

A look at improvements to web forms. Among these changes are added input types in the <input> element, data validation, and more.

HTML5 Sections

Gecko now supports the new HTML5 elements related to sections in a document: <article>, <section>, <nav>, <aside>, <hgroup>, <header> and <footer>.

HTML5 hidden attribute

This attribute, common to all elements, is used to hide content in a webpage that is not currently relevant to the user.

Other HTML5 elements

Gecko now also supports the following new HTML5 elements: <mark>, <figure>, and <figcaption>.

WebSockets

A guide to using the new WebSockets API for real-time communication between a web application and a server. Note that WebSockets as implemented in Firefox 4 is not compatible with the final standard, and should not generally be used.

Canvas improvements

The following changes were made to the CanvasRenderingContext2D interface to bring our <canvas> implementation closer to being in line with the specification:

Miscellaneous HTML changes CSS
CSS transitions

New CSS transitions support is available in Firefox 4.

Computed values in CSS

Support for -moz-calc has been added. This lets you specify <length> values as mathematical expressions.

Selector grouping

Support for :-moz-any to group selectors and factorize combinators.

Background image subrectangle support

The -moz-image-rect() function makes it possible to use subrectangles of images as a background-image.

CSS touch properties

Support for touch properties is added. Details, and real article names, to come later.

Using arbitrary elements as CSS backgrounds

You can use the -moz-element CSS function and the document.mozSetImageElement() DOM function to use arbitrary HTML elements as backgrounds.

Privacy and the :visited selector

Changes have been made to what information can be obtained about the style of visited links using CSS selectors. This may affect some web applications.

New CSS properties Property Description -moz-font-feature-settings Lets you customized advanced features of OpenType fonts. -moz-tab-size Specifies the width in space characters of a tab character (U+0009) when rendering text. resize Lets you control the dimensions in which an element may be resized. New CSS pseudo-classes Pseudo-class Description :-moz-handler-crashed Used to style elements whose plugins have crashed. :-moz-placeholder Applied to placeholder text in form fields. :-moz-submit-invalid Applied to the submit button on forms when one or more of the form's fields doesn't validate. :-moz-window-inactive Applied to elements in inactive windows. :invalid Automatically applied to <input> fields when their contents are invalid. :optional Automatically applied to <input> fields that don't specify the required attribute. :required Automatically applied to <input> fields that specify the required attribute. :valid Automatically applied to <input> fields when their contents validate successfully. New CSS pseudo-selectors Pseudo-selector Description :-moz-focusring Lets you specify the appearance of an element when Gecko believes it should have a focus indication rendered. New CSS functions Function Description :-moz-any Lets you group selectors and factorize combinators. -moz-calc Lets you specify <length> values as mathematical expressions. -moz-element Lets you use an arbitrary element as a background for background-image and background. -moz-image-rect Lets you use a subrectangle of an image as a background-image or background. Renamed CSS properties Old Name New Name Notes -moz-background-size background-size The name -moz-background-size is no longer supported. -moz-border-radius border-radius The old name is supported for a limited time to allow you time to update your sites. Rendering changes have also been made to match the latest version of the specification. -moz-box-shadow box-shadow Miscellaneous CSS changes Graphics and video
WebGL

The developing WebGL standard is now supported by Firefox.

Optimizing graphics performance

Tips and tricks for getting the most out of graphics and video performance in Firefox 4.

Support for WebM video

The new open WebM video format is supported by Gecko 2.0.

SVG animation with SMIL

Support for SMIL animation of SVG is now available.

Using SVG as images and as CSS backgrounds

You can now use SVG with the <img> element, as well as a CSS background-image.

Media buffered attribute support

The buffered attribute on <video> and <audio> elements is now supported, letting you determine which ranges of a media file have been buffered. The TimeRanges DOM interface has been implemented to support this.

Media preload attribute

The preload attribute from the HTML5 specification has been implemented, replacing the previously-implemented (and no longer supported) autobuffer attribute. This affects the <video> and <audio> elements, as well as the nsIDOMHTMLMediaElement interface.

SVG text positioning improvements

You can now specify lists for the values of the x, y, dx, and dy properties on SVG <text> and <tspan> elements. This lets you control the positioning of each character in a string individually.

DOM
JavaScript typed arrays

Support has been added for JavaScript typed arrays; this allows you to manipulate buffers containing raw data using native data types. Several APIs make use of this, including the File API, WebGL, and WebSockets.

Obtaining boundary rectangles for ranges

The Range object now has range.getClientRects() and range.getBoundingClientRect() methods.

Capturing mouse events on arbitrary elements

Support for the Internet Explorer-originated setCapture() and releaseCapture() APIs has been added. See Firefox bug 503943.

Manipulating the browser history

The existing document history object, available through the window.history object, now supports the new HTML5 pushState() and replaceState() methods.

Animations using MozBeforePaint

A new event has been added which, in concert with the window.mozRequestAnimationFrame() method and window.mozAnimationStartTime property, provides a way to create animations that are synchronized with one another.

Touch and multi-touch events

Support has been added for touch and multi-touch events.

HTML elements' DOM interfaces have changed

Several HTML elements have had their DOM interfaces changed to the ones required by the HTML5 specification, as shown below.

Interface in Firefox 3.6 Interface in Firefox 4 HTML Element HTMLSpanElement HTMLElement <abbr>, <acronym>, <address>, <b>, <bdo>, <big>, <blink>, <center>, <cite>, <code>, <dd>, <dfn>, <dt>, <em>, <i>, <kbd>, <listing>, <nobr>, <plaintext>, <s>, <samp>, <small>, <strike>, <strong>, <sub>, <sup>, <tt>, <u>, <var>, <xmp> HTMLDivElement HTMLElement <noembed>, <noframes>, <noscript> HTMLWBRElement HTMLElement <wbr> Miscellaneous DOM changes Security
Content Security Policy (CSP)

Content Security Policy (CSP) is a Mozilla proposal designed to help web designers and server administrators specify how content on their websites interacts. The goal is to help detect and mitigate attacks including cross-site scripting and data injection attacks.

HTTP Strict Transport Security

HTTP Strict Transport Security is a security feature that lets a website tell browsers that it should only be communicated with using HTTPS, instead of using HTTP.

The X-FRAME-OPTIONS HTTP response header introduced in Internet Explorer 8 is now supported by Firefox. This allows sites to indicate whether or not their pages can be used in frames, and if so, whether or not to restrict that to the same origin.

User Agent string changes

As a means to reduce the amount of data and entropy sent out in HTTP requests (see Firefox bug 572650), the crypto strength and language tokens have been removed from the user agent string.

JavaScript

For an overview of the changes implemented in JavaScript 1.8.5, see New in JavaScript 1.8.5. JavaScript in Firefox 4 will have additional adherence to the ECMAScript 5 standard.

Developer tools
Using the Web Console

The Web Console tool is a useful debugging aid for web developers and extension developers alike.

Note: The Error Console is disabled by default starting in Gecko 2.0. You can re-enable it by changing the devtools.errorconsole.enabled preference to true and restarting the browser.

Changes for Mozilla and add-on developers

For helpful tips on updating existing extensions for Firefox 4, see Updating extensions for Firefox 4. There are several key changes that break compatibility with existing add-ons, so be sure to read that article.

If you're a theme developer, you should read Theme changes in Firefox 4 to understand some critical changes you'll need to be aware of.

JavaScript code modules
Services.jsm

The Services.jsm code module provides getters that make it easy to obtain references to commonly-used services, such as the preferences service or the window mediator, among others.

JS-ctypes API

The JS-ctypes API makes it possible to call C-compatible foreign library functions without using XPCOM.

Add-ons Manager

The new Add-ons Manager provides information about installed add-ons, support for managing them, and provides ways to install and remove add-ons.

The new popup notifications module makes it easy to present attractive, non-modal notifications to the user. You can see how to use this API in Using popup notifications.

Loading code modules from chrome: URLs

You can now load JavaScript code modules using chrome: URLs, even inside JAR files.

DownloadLastDir.jsm

The DownloadLastDir.jsm code module provides the gDownloadLastDir global variable, which contains a string you can use to learn the path of the directory into which the last download occurred. This module handles issues related to private browsing for you.

Measuring performance using the PerfMeasurement.jsm code module

The PerfMeasurement.jsm code module provides an API to measure CPU-level performance data in JavaScript code.

Miscellaneous changes to code modules DOM changes
ChromeWorker

A new type of worker for privileged code; this lets you use things like js-ctypes from workers in extensions and application code.

Touch events

Support for (non-standard) touch events has been added; these let you track multiple fingers moving on a touch screen at the same time.

Other DOM changes XUL Changes to the tabbrowser element

Several changes were made to the <xul:tabbrowser> element that impact extensions that interact with tabs. In addition to supporting app tabs, these changes also change the tab bar into a standard toolbar, which lets the user drag toolbar buttons into it.

Remote XUL support removed

Remote XUL is no longer supported; this affects XUL documents being served through HTTP; also, you can no longer load XUL documents using file:// URLs unless you create the preference dom.allow_XUL_XBL_for_file and set it to true. There is, however, a whitelist feature that can be used to allow specific domains to load remote XUL.

Miscellaneous XUL changes UI changes affecting developers
The add-on bar

The status bar has been removed in favor of the new add-on bar. You'll need to update your extension to use this if you've been adding UI to the status bar in the past.

Hiding browser chrome

You can now hide the browser's chrome when it's desirable to do so; for example, about:addons does this.

Storage Miscellaneous storage API changes XPCOM

In addition to the specific changes referenced below, it's important to note that there are no longer any frozen interfaces. All interfaces are now unfrozen, regardless of what the documentation may say. We'll update the documentation over time.

XPCOM changes in Gecko 2.0

Details about changes to XPCOM that impact compatibility in Firefox 4.

Components.utils.getGlobalForObject()

This new method returns the global object with which an object is associated; this replaces a common use case of the now-removed __parent__.

Places Interface changes Memory management
Infallible memory allocation

Mozilla now provides infallible memory allocators that are guaranteed not to return null. You should read this article to learn how they work and how to explicitly request fallible versus infallible memory allocation.

Other changes Other changes
Only the root chrome.manifest file is loaded

Only the root chrome.manifest file is loaded now; if you need secondary manifest files to be loaded, you can use the manifest command in your root chrome.manifest to load them.

Gopher support removed

The Gopher protocol is no longer supported natively. Continued support is available via the OverbiteFF extension.

Content process event handling

In order to support out-of-process plugins and other multiple-process features, a new API has been introduced to support sending messages across processes.

Bootstrapped extensions

You can now create extensions that can be installed, uninstalled, and upgraded (or downgraded) without requiring a browser restart.

Default plugin removed

The default plugin has been removed. The application plugins folder has also been removed by default, however support for installing plugins via this folder still exists. See Firefox bug 533891.

Extension Manager replaced by Addon Manager

nsIExtensionManager has been replaced by AddonManager.

Child HWNDs no longer used

Firefox no longer creates child HWNDs for its internal use on Windows. If you've written an extension that uses native code to manipulate these HWNDs, your extension will not work on Firefox 4. You'll need to either stop using HWNDs or wrap your code that relies on HWNDs in an NPAPI plugin. That's a lot of work, so if you can avoid using HWNDs directly, you should.

Gesture changes

The three finger up and down swipe gestures on trackpads have been changed to, by default, open and close Firefox Panorama view (neé TabCandy). To change these back to the previous scroll-to-top and scroll-to-bottom commands, open about:config and set browser.gesture.swipe.down to cmd_scrollBottom and browser.gesture.swipe.up to cmd_scrollTop.

See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3