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 HTMLHeadElementprofileproperty has been removed, this property has been deprecated since Gecko 2.0.
- The HTMLImageElementxandyproperties have been removed.
- The HTMLSelectElementadd()methodbeforeparameter is now optional.
- The <body>element'sbackgroundattribute is no longer resolved as a URI; this is in compliance with the current HTML specification.
- The <option>element'slabelattribute 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 been removed.
CSS
- text-overflowis now supported.
- The -moz-orientproperty 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 Fileinterface's non-standard methodsgetAsBinary(),getAsDataURL(), andgetAsText()have been removed as well as the non-standard propertiesfileNameandfileSize(bug 661876).
- The FormDatainterface no longer reports the filename as an empty string when sending theContent-DispositionHTTP header if the data was set using aBlob. This fixes errors that were happening with some servers.
- The element.dirattribute now always returns its result as all lower-case, as required by the HTML specification.
- The FileReaderreadAsArrayBuffer()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.normalizeinstead.
- DOMTokenList.itemnow returns- undefinedif the- indexis out of bounds, previously it returned- null.
- Node.getFeaturehas been removed.
- The HTMLInsElementandHTMLDelElementinterfaces have been removed, since the<ins>and<del>elements actually use theHTMLModElementinterface.
- In a effort to conform to the upcoming DOM4 specification where Attrdo not inherit fromNodeanymore (it did in DOM Core 1, 2 and 3), manyNodeproperties and methods on theAttrinterface are now reporting warnings as we work toward removing them in a later version.
- Added support for the window.ondeviceorientationandwindow.ondevicemotionproperties onwindowobjects.
- window.resizeTo,- window.resizeBy,- window.moveTo, and- window.moveByno 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 are 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.
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 applications startup: AddonManager.addStarupChange(),AddonManager.removeStartupChange(), andAddonManager.getStartupChanges().
XUL
- treeelements can now persist the state of disclosure triangles if the nodes referenced by- datasourcesall have unique IDs specified by "id" attributes.
- panelelements can now be configured to let the user drag them by clicking anywhere on their background by using the new- backdragattribute.
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. See the updated Build documentation for details.
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 and- inIDOMUtils.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 to- falsedisables recording of telemetry statistics. Telemetry statistics are no longer recorded when in Private Browsing Mode. (see bug 661574 and bug 661573)
 Telemetry histograms defined with- nsITelemetry.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 by- nsIXMLHttpRequest.setRequestHeader()are sent with the request when following a redirect. Previously these headers would not be sent.
- nsIDocShellhas a new- allowWindowControlattribute. If- true, 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:
- nsIDOM3Attr
- nsIDOM3Node
- nsIDOM3TypeInfo
- nsIDOM3Text
- nsIDOMDocumentStyle
- nsIDOMNSDocument
- nsIDOMNSFeatureFactory
- nsIDOMNSHTMLDocument
- nsIDOMNSHTMLFormElement
- nsIDOMNSHTMLHRElement
- nsIDOMNSHTMLTextAreaElement
The following interfaces were removed as part of the removal of the ActiveX embedding API:
- DITestScriptHelper
- DWebBrowserEvents
- DWebBrowserEvents2
- IDispatch
- IMozControlBridge
- IMozPluginHostCtrl
- IWebBrowser
- IWebBrowser2
- IWebBrowserApp
- IXMLDocument
- IXMLElement
- IXMLElementCollection
- IXMLError
- nsIActiveXSecurityPolicy
- nsIDispatchSupport
- nsIMozAxPlugin
- nsIScriptEventHandler
- nsIScriptEventManager
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.