Firefox 7 release notes for developers
Firefox 7 shipped on September 27, 2011. This article provides information about the changes that affect developers — both of web content and of Firefox add-ons.
Firefox 7 shipped on September 27, 2011. This article provides information about the changes that affect developers — both of web content and of Firefox add-ons.
Changes for web developers
HTML
- The HTMLHeadElement
profileproperty has been removed, this property has been deprecated since Gecko 2.0. - The HTMLImageElement
xandyproperties have been removed. - The HTMLSelectElement
add()methodbeforeparameter is now optional. - The body element's
backgroundattribute is no longer resolved as a URI; this is in compliance with the current HTML specification. - The option element's
labelattribute now reflects the value of the element's text content if the attribute isn't specified.
Canvas
- As part of the Azure project the Direct2D Azure Backend has been implemented and will significantly improve the performance of the 2D canvas.
- Specifying invalid values when calling
setTransform(),bezierCurveTo(), orarcTo()no longer throws an exception; these calls are now correctly silently ignored. - The
isPointInPath()method now correctly considers the transformation matrix when comparing the specified point to the current path. - Calling
strokeRect()with a zero width and height now correctly does nothing. - Calling
drawImage()with a zero width or height canvas now throwsINVALID_STATE_ERR. - Calling
drawImage()with non-finite coordinates no longer throws an exception. toDataURL()method now accepts a second argument to control JPEG quality.- Support for the non-standard
globalCompositeOperationoperationsclearandoverhas been removed. - Shadows are now only drawn for
source-overcompositing operations. - You can now configure the fill rule used by canvas by setting the
mozFillRuleattribute on the context. - Support for the experimental
mozDash,mozDashOffset,mozCurrentTransformandmozCurrentTransformInverseattributes has been added. - Support for the non-standard methods
mozDrawText(),mozMeasureText(),mozPathText()andmozTextAlongPath()has been removed.
CSS
- text-overflow is now supported.
- The -moz-orient property has been fixed so that progress elements that are vertically oriented have appropriate default dimensions.
MathML
- XLink href has been restored and the MathML3
hrefattribute is now supported. Developers are encouraged to move to the latter syntax. - Support for the
voffsetattribute on mpadded elements has been added and behavior oflspaceattribute has been fixed. - The top-level math element now accepts any attributes of the mstyle element.
- Support for Asana Math fonts has been added.
- The
mediumline thickness of fraction bars in mfrac elements has been corrected to match the default thickness. - Names for negative spaces are now supported.
DOM
- The File interface's non-standard methods
getAsBinary(),getAsDataURL(), andgetAsText()have been removed as well as the non-standard propertiesfileNameandfileSize(Firefox bug 661876). - The FormData interface no longer reports the filename as an empty string when sending the
Content-DispositionHTTP header if the data was set using a Blob. This fixes errors that were happening with some servers. - The HTMLelement.dir property now always returns its result as all lower-case, as required by the HTML specification.
- The FileReader
readAsArrayBuffer()method is now implemented. Document.createEntityReferencehas been removed. It was never properly implemented and is not implemented in most other browsers.document.normalizeDocumenthas been removed. Use Node.normalize instead.- DOMTokenList.item now returns
undefinedif theindexis out of bounds, previously it returnednull. Node.getFeaturehas been removed.- The
HTMLInsElementandHTMLDelElementinterfaces have been removed, since the ins and del elements actually use the HTMLModElement interface. - In an effort to conform to the upcoming DOM4 specification where Attr do not inherit from Node anymore (it did in DOM Core 1, 2 and 3), many Node properties and methods on the Attr interface are now reporting warnings as we work toward removing them in a later version.
- Added support for the ondeviceorientation and ondevicemotion properties on window objects.
- window.resizeTo, window.resizeBy, window.moveTo, and window.moveBy no longer apply to the main window.
JavaScript
- The
Function.arityproperty has been removed; useFunction.lengthinstead.
WebSockets
- The
network.websocket.max-connectionspreference is used to determine the maximum number of WebSocket connections that can be open at a time. The default value is 200. - The underlying WebSocket protocol version 8 (as specified by IETF draft 10) is used now instead of the version 7 protocol used by Firefox 6.
- The WebSocket API is now available on Firefox Mobile.
console API
- Message logged with
console.logwhile the web console isn't open is still logged, although they aren't displayed when the web console is opened.
Web timing
- Initial implementation of the Navigation Timing specification which provides data that can be used to measure the performance of a website.
XML
- In addition to the previously supported
text/xsl, XSLT stylesheets can now use the official internet media (MIME) typeapplication/xslt+xml(in the stylesheet processing instruction or the HTTP Link header field).
Changes for Mozilla and add-on developers
These changes affect add-on developers as well as developers working on or with Mozilla code itself. Add-on developers should see Updating extensions for Firefox 7 for additional information.
[!NOTE] Firefox 7 requires that binary components be recompiled, as do all major releases of Firefox.
JavaScript code modules
FileUtils.jsm
- New method
openFileOutputStream()opens a file output stream, the non-safe variant, for writing.
AddonManager.jsm
- The Add-on Manager has new methods for managing lists of add-ons that changed during application startup:
AddonManager.addStartupChange(),AddonManager.removeStartupChange(), andAddonManager.getStartupChanges().
XUL
<tree>elements can now persist the state of disclosure triangles if the nodes referenced bydatasourcesall have unique IDs specified by "id" attributes.<panel>elements can now be configured to let the user drag them by clicking anywhere on their background by using the newbackdragattribute.
XPCOM
- The new
Components.utils.schedulePreciseGC()method lets you schedule a thorough garbage collection cycle to occur at some point in the future when no JavaScript code is executing; a callback is executed once collection is complete. - The
Components.utils.unload()method lets you unload JavaScript code modules previously loaded by callingComponents.utils.load().
Memory reporters
Support has been added for multi-reporters; that is, memory reporters that gather data on request and call a callback for each generated result. See nsIMemoryMultiReporter and nsIMemoryMultiReporterCallback for the relevant interfaces, as well as the nsIMemoryReporterManager.registerMultiReporter() and nsIMemoryReporterManager.unregisterMultiReporter() methods.
User experience changes
- Extension options can now be displayed inside the Add-on Manager for both restartless and traditional extensions.
- The destination of downloads is now remembered on a site-by-site basis. This data can be accessed using
DownloadLastDir.jsm.
Changes to the build system
- The ActiveX embedding API is no longer built and support has been removed from the build system. Supporting interfaces have also been removed; see Removed interfaces.
- You should no longer specify
-Zc:wchar_t-when building on Windows.
Interface changes
nsISocketTransportnow offers a new connection flag:DISABLE_IPV6; this causes a socket to only attempt to connect to IPv4 addresses, ignoring any available IPv6 addresses. In addition,nsIDNSServicenow offers a new resolve flag:RESOLVE_DISABLE_IPV6; this causes domain name resolution to only consider IPv4 hosts, ignoring any available IPv6 addresses. These changes are used to implement the "happy eyeballs" strategy for improving response time when attempting to connect on hosts that support both IPv4 and IPv6 (especially those that have broken IPv6 connectivity).inIDOMUtilshas two new methods,inIDOMUtils.getChildrenForNode()which returns a list of child nodes of a node andinIDOMUtils.getUsedFontFaces()which returns a list of font faces used in a range.- The
nsIMarkupDocumentViewer_MOZILLA_2_0_BRANCHinterface has been merged into thensIMarkupDocumentViewerinterface. - The
nsIDOMWindow2interface has been merged into thensIDOMWindowinterface. - The
nsIDOMWindow_2_0_BRANCHinterface has been merged into thensIDOMWindowInternalinterface. nsINavHistoryObservermethods with URI parameters now require a GUID as well.- The
nsISHistory_2_0_BRANCHinterface has been merged into thensISHistoryinterface. nsITelemetryhas a new method,nsITelemetry.getHistogramById()which returns a histogram by its ID, and a new attribute,canRecordwhich when set tofalsedisables recording of telemetry statistics. Telemetry statistics are no longer recorded when in Private Browsing Mode. (see Firefox bug 661574 and Firefox bug 661573) Telemetry histograms defined withnsITelemetry.newHistogram()will not be reported in the telemetry ping.- The
nsIMemoryReporterinterface has been substantially changed; if you use it, you will need to make some adjustments to your code. nsIXMLHttpRequest, headers set bynsIXMLHttpRequest.setRequestHeader()are sent with the request when following a redirect. Previously these headers would not be sent.nsIDocShellhas a newallowWindowControlattribute. Iftrue, the docshell's content is allowed to control the window (that is, to move or resize the window).- The
nsIThreadInternal2interface has been merged into thensIThreadInternalinterface.
New interfaces
nsIDOMFontFace- : Describes a single font face.
nsIDOMFontFaceList- : Describes a list of font faces, each represented by
nsIDOMFontFace.
Removed interfaces
The following interfaces were implementation details that are no longer needed:
nsIDOM3AttrnsIDOM3NodensIDOM3TypeInfonsIDOM3TextnsIDOMDocumentStylensIDOMNSDocumentnsIDOMNSFeatureFactorynsIDOMNSHTMLDocumentnsIDOMNSHTMLFormElementnsIDOMNSHTMLHRElementnsIDOMNSHTMLTextAreaElement
The following interfaces were removed as part of the removal of the ActiveX embedding API:
DITestScriptHelperDWebBrowserEventsDWebBrowserEvents2IDispatchIMozControlBridgeIMozPluginHostCtrlIWebBrowserIWebBrowser2IWebBrowserAppIXMLDocumentIXMLElementIXMLElementCollectionIXMLErrornsIActiveXSecurityPolicynsIDispatchSupportnsIMozAxPluginnsIScriptEventHandlernsIScriptEventManager
Other Changes
- The structure of the library window (
places.xul) has been cleaned up. This may break extensions and themes. - The look of the print preview window has been modernized and theme authors are encouraged to style it using the CSS pseudo-elements
::-moz-page,::-moz-page-sequenceand::-moz-scrolled-page-sequence.