Firefox 10 release notes for developers
Firefox 10 shipped on January 31, 2012. This article provides information about the new features and key bugs fixed in this release, as well as links to more detailed documentation for both web developers and add-on developers.
Note: Firefox 10 is the first release of this browser with two digits. This may lead to problem with some UA-sniffing scripts. Be sure to check them, and those contained in 3rd-party software you embed in your pages, like libraries. For more information about this, look at the Firefox goes 2-digit article on hack.mozilla.org.
Changes for Web developers
>HTML
- The new HTML5
<bdi>element, bi-directional isolation, allowing isolation of parts of text with a different directionality has been implemented. This is especially useful when displaying text with an unknown directionality, coming from a database for example, in the middle of text with a known, and potentially, different one. - You may now specify a fragment of "top" for the
hrefattribute to create a link to the top of the page. This used to work, then went away for a while, and now it's back, for compatibility with the HTML5 specification. For example:<a href="#top">Return to top of page</a>.
JavaScript
- The method
WeakMap.set()now returnsundefined, instead of itself. - A bug was introduced in regular expression handling in Firefox 7; this has been fixed. See Firefox bug 683838 if you want the gory details.
- You can no longer use the deprecated ECMAScript for XML (E4X) syntax while in ECMAScript 5 strict mode (that is, after
"use strict;").
DOM
DOM3 Events
- The DOM Event method
event.stopImmediatePropagationhas been implemented. - The mouse events
mouseenterandmouseleavehave been implemented.
DOM4
- The attribute
document.xmlVersion(which was only gettable and not settable) has been removed as it has been deprecated in the DOM4 specification. The article fordocument.xmlVersionnow suggests a way to detect whether the document is HTML or XML without using that property. - The attribute
document.xmlStandalonehas been removed as it has been deprecated in the DOM4 specification. - The attribute
document.xmlEncodinghas been removed as it has been deprecated in the DOM4 specification. - The attribute
text.isElementContentWhiteSpacehas been removed as it has been deprecated in the DOM4 specification. - The method
text.replaceWholeTexthas been removed as it has been deprecated in the DOM4 specification. - The method
node.isSameNodehas been removed as it has been deprecated in the DOM4 specification. Instead ofnode1.isSameNode(node2), you can use the===operator, like this:node1 === node2.
Page Visibility API
- The Page Visibility API has been implemented (prefixed):
document.mozHidden,document.mozVisibilityStateare available and the eventmozvisibilitychangedis sent when the state is modified.
Full Screen API
- Support for
document.fullscreenEnabledhas been added. - The new
:-moz-full-screen-ancestorproperty has been added. This lets you match against elements that are ancestors of an element in full screen mode.
Battery API
- Experimental support for
navigator.mozBatteryhas been added (can be enabled setting the preferencedom.battery.enabledtotrueand will be enabled by default starting with Firefox 11).
Canvas
- The
createPattern()method now throws an exception if a zero-sized source canvas is specified. - If you use a non-finite value for any of the numeric parameters to
putImageData(), the call is now silently ignored instead of throwing an exception, in keeping with the specification.
WebGL
- Firefox 10 now supports the
OES_standard_derivativesextension. - New preferences have been added to help test WebGL code for compatibility with minimally-capable devices on your full development platform.
Web Workers
- The attribute
XMLHttpRequest.responseTypeandXMLHttpRequest.responseare now available from inside Workers. - The
Worker()constructor now accepts data URLs.
IndexedDB
Great progress has been made to update IndexedDB to the latest draft specification. This effort will continue in Firefox 11.
- The
IDBIndex.count()andIDBObjectStore.count()methods have been added. - The
IDBCursor.advance()method has been added. - When encountering an unknown optional parameter in
IDBObjectStore.createIndex()orIDBDatabase.createObjectStore(), Gecko will not fire an exception anymore, but ignore it. - When
IDBTransaction.abort()is called, all pendingIDBRequesthave theirerrorCodeset toABORT_ERROR. - The methods
IDBObjectStore.delete()andIDBCursor.delete()now set theresultattribute of the returnedIDBRequesttoundefined. - The method
IDBDatabase.setVersion()has been removed as it was removed from the latest spec. The version of the database is given through theIDBFactory.open()method which has been updated and theonupgradeneededcallback allows the schema of the database to be upgraded. The version itself has been changed from aDOMStringto anunsigned long long. TheIDBVersionChangeRequestinterface has been removed and replaced by the newIDBOpenDBRequestinterface. - When opening a database with
IDBFactory.open(), if theversionparameter is not provided and the database does not exist, then it will be created with a version of1. - The method
IDBFactory.deleteDatabase()method has been added. - Methods that search via an
IDBKeyRange(such asIDBObjectStore.openCursorandIDBIndex.getKey) can accept either a single key or key range.
Other
- When the proper MIME type is passed,
image/svg+xml, theDOMParsernow creates aSVGDocumentwhen given a string with SVG. - In the past, when
element.setAttribute()parsed integers, it would report an error if the integer included any non-numeric characters (for example "42foo"). Now it correctly truncates this as the number 42, in accordance with the specification. - The ESC key no longer incorrectly results in the
onkeydownhandler incorrectly getting called. - The
NameListinterface is no longer implemented; it previously had an implementation with no way to actually get access to one. - The
document.createProcessingInstruction()method now works on HTML documents as well as XML documents.ProcessingInstructionnodes are still only supported on XML documents, but since nodes can be moved among documents, it's helpful to be able to create them on HTML documents as well. - The
XMLHttpRequestresponseType"moz-json"introduced in Firefox 9 has been updated to the latest draft of the specification and has been unprefixed. See note in Firefox bug 707142.
CSS
- CSS 3D Transforms are now supported. This includes support for the
transform-style,perspective,perspective-originandbackface-visibilityproperties, as well as for 3D transform functions in thetransformand<transform-function>properties. See Using CSS transforms for details. - Two new values for the CSS property
unicode-bidihave been added:-moz-isolationand-moz-plaintext. The-moz-isolationvalue isolates, from a directionality point of view, the element from its environment, letting it have a different directionality. An element withunicode-bidi:-moz-isolationbehaves like a<bdi>element. The-moz-plaintextindicates the browser to use the Unicode browser heuristic to determine directionality and not the CSSdirectionproperty. - The CSS
linear-gradient()andrepeating-linear-gradient()properties have been updated to support the newtosyntax and the magic corner algorithm. This allows to give a precise color on the corner of a gradient-filled box. - The
text-overflowproperty's handling of cases in which the box overflows on both sides while thetext-overflowproperty is set to overflow on only one has been corrected. - Handling of the
positionproperty on elements inside positioned<table>elements has been fixed. This change will affect layout of pages; however, we now comply with the CSS specification and with other browsers, so this should be easy to fix. - Margin collapsing around
<table>elements has been fixed to match the CSS specification. Previously, table elements' margins would not be collapsed along with other adjacent elements, leading to incorrect layout. This change will affect layout of pages; however, we now comply with the CSS specification and with other browsers, so this should be easy to fix.
SVG
- The
<mask>element has been updated to support both sRGB and linearRGB, and now defaults to sRGB, in compliance with the latest revision of the SVG 1.1 specification.
Networking
- The HTTP
Accept-Charsetheader is no longer sent in HTTP requests. In its absence, servers should respond by sending UTF-8.
Developer tools
- The
consoleobject has two new methods,console.time()andconsole.timeEnd(), which can be used to set timers on a page. - The new Page Inspector has been added, providing an excellent way to examine and manipulate the HTML and CSS behind your content.
Changes for Mozilla and add-on developers
For an overview of likely issues that may arise when updating your add-ons to support Firefox 10, see Updating add-ons for Firefox 10.
Note:
The old PRBool data type has been retired! Anywhere in the documentation that refers to it now uses the standard C++ bool type instead. Documentation will be updated in the future, but for now, just keep this in mind.
Manifests
- Support for
<em:strictCompatibility>has been added to the install manifest. It allows add-ons authors to opt in to checking the maximum version of their extension. If set totruethe add-on will be disabled if the application version is greater than<em:maxVersion>. Firefox 10 defaults to add-ons being compatible, regardless of their specified maximum version. This flag overrides that preference. You should set this if your add-on does things that are likely to be broken by Firefox updates, but not if your add-on has a binary component, since such add-ons always get strictly checked (remember that binary components must always be recompiled for each major Firefox release). - If you wish to revert to the old behavior — that is, to strict compatibility checking for all add-ons, regardless of the value of the
strictCompatibilityflag in their manifests, you can set theextensions.strictCompatibilitypreference totrue.
XUL
- Bootstrapped add-ons using a
chrome.manifestfile now have the manifest file registered automatically. See the section Adding user interface with a chrome.manifest for details.
XPConnect
- Several new properties and methods have been added to
Components.utils, granting access to assorted debugging-related information.
Interface changes
- The
mozISpellCheckingEngineandnsIEditorSpellCheckinterfaces have been updated to allow restartless add-ons to add dictionaries to the spell checker. - The
nsIBrowserHistory.lastPageVisitedattribute has been removed. - The
nsIDocumentViewerinterface has been merged intonsIContentViewer. - The
nsIURIFixupinterface has a new flag,FIXUP_FLAG_USE_UTF8, which lets you tell it to use UTF-8 instead of the platform character set, when doing conversions.
Plug-in changes
- The new variable
NPNVdocumentOriginhas been added; this returns the document origin, and is more secure thanwindow.location.
Build system changes
- The
--disable-rdfbuild option, which actually made it impossible to successfully build, has been removed. Work is ongoing on being able to actually remove RDF support entirely, but at present XUL still requires it to function. See Firefox bug 559505 for progress on removing the last vestiges of RDF being required. - The
--disable-smilbuild option has been removed.