Firefox 9 release notes for developers
Firefox 9 was released for Windows on December 20, 2011. Mac and Linux version 9.0.1, which fixed a crashing bug discovered at the last minute, were released on December 21, 2011.
Changes for web developers
>HTML
- The
valueattribute of<li>now can be negative. Previously negative values were converted to 0. - You can now specify the start and stop time of media in the URI of the media when using
<audio>and<video>elements. <input>and<textarea>elements now respect the value of thelangattribute when invoking the spell checker.- Firefox on Android now lets users snap photos with their phone's camera without leaving the browser when the
<input>element is used withtype="file"andaccept="image/*". - Windows Vista style PNG ICO images are now supported.
- Drawing images that use the
crossoriginattribute to request CORS access no longer incorrectly taint the canvas when CORS is granted. - The value of the
rowspanattribute may now be as large as 65,534, up from 8190.
CSS
- The
font-stretchproperty is now supported. - The
columnsproperty is now supported, with the-mozprefix. This is a shorthand for the following properties:column-widthandcolumn-count. - When a stylesheet included using the
<link>element has been fully loaded and parsed (but not yet applied to the document), aloadevent is now fired. Also, if an error occurs processing a style sheet, anerrorevent is fired. - You can now specify overflow settings for both the left and right edges of content using a new two-value syntax for
text-overflow.
JavaScript
No change.
DOM
- Using fullscreen mode
-
The new fullscreen API provides a way to present content using the entire screen, with no browser interface. This is great for video and games. This API is currently experimental and prefixed.
- The
Node.contains()method is now implemented; this lets you determine if a given node is a descendant of another node. - The
Node.parentElementattribute has been implemented; this returns the parentElementof a DOM node, ornullif the parent isn't an element. - DOM Level 3 composition events are now supported.
- The
Document.scriptsattribute has been implemented; this returns anHTMLCollectionof all the<script>elements on the document. - The
Document.queryCommandSupported()method has been implemented. - The set of events that can be listened for on
<body>elements has been revised to match the latest draft of the HTML5 specification. The list of events in the DOM events guide reflects which events can be listened for on<body>. - The
readystatechangeevent is now fired only on theDocument, as intended. - Event handlers are now implemented as standard IDL interfaces. For most cases, this won't affect content, but there are exceptions.
- A new response type,
"moz-json", has been added toXMLHttpRequest, lettingXMLHttpRequestautomatically parse JSON strings for you; when you request this type, a returned JSON string is parsed, so that the value of theresponseproperty is the resulting JavaScript object. XMLHttpRequest"progress" events are now reliably sent for every chunk of data received; in the past it was possible for the last chunk of data received to not fire a "progress" event. Now you can track progress by following only "progress" events, instead of also having to monitor "load" events to detect the receipt of the last chunk of data.- In the past, calling
addEventListener()with anulllistener would throw an exception. Now it returns without error and with no effect. - The new
navigator.doNotTrackproperty lets your content easily determine whether or not the user has enabled their do-no-track preference; if this value is "yes", you should not track the user. RangeandSelectionobjects now behave according to their specifications whensplitText()andnormalize()are called.- The value of
Node.ownerDocumentfor doctype nodes is now the document on whichcreateDocumentType()was called to create the node, instead ofnull. window.navigator.taintEnabledhas been removed; it has not been supported in many years.
Workers
- Workers implemented in blob URLs were broken in Firefox 8, and work again starting in Firefox 9.
WebGL
- The WebGL context
drawingBufferWidthanddrawingBufferHeightattributes are now supported.
MathML
- The non-standard
restylevalue for theactiontypeattribute on<maction>elements has been removed. - While still unsupported, using the
mlabeledtrelement no longer breaks rendering completely. See Firefox bug 689641 for progress on actual support of this element.
Networking
- You can now send the contents of JavaScript typed arrays (that is, the contents of an
ArrayBufferobject) using XMLHttpRequest. - WebSocket connections now permit non-characters in otherwise valid UTF-8 data frames to be received, instead of failing.
- The HTTP
Acceptheader for XSLT requests has been changed to*/*for simplicity. Since fetching XSLT has always fallen back to*/*anyway, it made sense to simplify the initial request. - Attempts by a server to use the
301 Moved Permanentlyor307 Temporary Redirectresponse codes to redirect the user to ajavascript:URI now result in a "bad connection" error instead of actually redirecting. This prevents certain types of cross-site scripting attacks. - Content served with an empty
Content-Dispositionwere previously treated as if theContent-Dispositionwere "attachment"; this didn't always work as expected. These are now handled as if theContent-Dispositionwere "inline". - The default maximum size of an item in the disk cache has been increased to 50 MB; previously, only items up to 5 MB were cached.
Developer tools
- The web console now supports basic string substitutions in its logging methods.
- You can now create visually nested blocks of output in the web console, to help make it easier to read.
Changes for Mozilla and add-on developers
See Updating add-ons for Firefox 9 for an overview of the changes you may need to make to get your add-ons working in Firefox 9.
XUL
- The
<xul:tab>element now has apendingattribute, whose value istrue, when the tab is in the process of being restored by the session store service. This can be used for styling the tab in themes. The attribute isn't present on tabs that aren't pending. - The
<xul:tab>element now has anunreadattribute, whose value istrue, when the tab has changed since the last time it was the active tab or if it hasn't been selected since the current session began. The attribute isn't present on tabs that are not unread. - You can now use a
<xul:panel>as a drag image for DOM drag and drop operations. This lets you use the standard drag & drop API for drag and drop of XUL content. - The
<xul:notificationbox>element'sappendNotification) method now lets you specify a callback that gets called for interesting events related to the notification box. Currently, the only event is "removed", which tells you the box has been removed from its window.
JavaScript code module changes
FileUtils.jsmnow has aFileconstructor that returns annsIFileobject representing a file specified by its pathname.
Service changes
- The content preference service now handles private mode browsing (see Firefox bug 679784).
NSPR
- NSPR now has an "append" module, which lets you append new data to the end of an existing log.
Interface changes
Removed interfaces
nsIGlobalHistory3has been removed during streamlining of the Places and DocShell code.
Miscellaneous interface changes
- The
nsISoundinterface has a new constant,EVENT_EDITOR_MAX_LEN. The allows for playing the system sound for when more characters than the maximum allowed are typed into a text field. Currently, this is only used on Windows. - The
nsIScriptError2interface has newtimeStampandinnerWindowIDproperties; in addition, theinitWithWindowID()method now takes an inner window ID instead of an outer window ID. - The
nsIBidiKeyboard.haveBidiKeyboardsattribute has been added; this lets you determine if the system has at least one keyboard installed for each direction: left-to-right and right-to-left. - The new
nsIEditor.isSelectionEditableattribute lets you determine if the current selection anchor is editable. This helps to support cases where only parts of the document are editable, by letting you see if the current selection is in an editable section. - The
nsIBrowserHistory.registerOpenPage()andnsIBrowserHistory.unregisterOpenPage()methods have been removed as part of a performance overhaul in the Places system. You can use the corresponding methods inmozIPlacesAutoCompleteinstead. - The
nsIDOMWindowUtils.wrapDOMFile()method has been added; this returns a DOMFileobject for a givennsIFile. - The
nsIChromeFrameMessageManager.removeDelayedFrameScript()method was added to support removing delayed load scripts. Bootstrapped add-ons should use this, at shutdown, to remove any scripts it loaded usingnsIChromeFrameMessageManager.loadFrameScript()with the delayed load flag set. This is exposed to add-ons asbrowser.messageManager.removeDelayedFrameScript(). - The
nsIAppStartupinterface has a newinterruptedattribute, which lets you know if the startup process was interrupted at any point by an interactive prompt. This can be helpful, for example, when timing startups during performance evaluation, to be able to drop numbers from sessions that were interrupted. - The
nsIEditorSpellCheckinterface has been revised to support per-site selection of spell checker dictionaries.
IDL parser
The IDL parser no longer includes support for the never fully-implemented notion of unique pointers.
Build system changes
- The
--enable-application=standaloneoption for building standalone XPConnect has been removed; it hasn't worked since 2007 anyway. - Support for building Necko and Transformiix XSLT standalone has been removed; you can no longer use
--enable-application=networkor--enable-application=content/xslt. - The build system now looks for
.mozconfigat$topsrcdir/.mozconfigor$topsrcdir/mozconfig, and nowhere else, unless you override the.mozconfigpath using theMOZCONFIGenvironment variable. - The
xpidlutility has been replaced in the SDK withpyxpidl.
Other changes
- The spell checker no longer has an arbitrary 130-character word-length limit on the length of words it will attempt to spell check. This limit was previously in place to prevent crashes that were occurring in the spell checker, but the underlying bugs have since been fixed.
- You can now register components to add features to the
window.navigatorobject by using the "JavaScript-navigator-property" category.