Revision Content

{{ draft() }}

{{ ReleaseChannelInfo("8") }}

Changes for web developers

HTML

The {{ domxref("HTMLImageElement") }} crossOrigin property has been added and the {{ htmlattrxref("crossorigin", "img") }} has been added to the {{ HTMLElement("img") }} element. (see {{ bug("664299") }})

The {{ domxref("HTMLSelectElement","","add()") }} method now supports either an item or index of an item that the new item should be inserted before. Previously it only supported an item. (see {{ bug("666200") }})

The HTMLIsIndexElement constructor has been removed. No elements have implemented this interface since before Firefox 4.

The HTML5 "context menu" feature (contextmenu attribute), which lets you add custom element specific items to native context menu, is now supported (the implementation is still experimental awaiting changes in the specification; see {{ bug("617528") }}).

Support for the accesskeylabel attribute has been added to all elements.

The {{ HTMLElement("input") }} and {{ HTMLElement("textarea") }} elements now support the selectionDirection attribute, and their setSelectionRange() methods have been updated to support optionally specifying a direction.

Most elements now get a focus ring drawn around them if they've been made focusable by using the tabindex attribute and the user then focuses the element.

DOM

The {{ domxref("Element.insertAdjacentHTML","insertAdjacentHTML") }} method has been implemented.

{{ domxref("BlobBuilder") }} now has a getFile() method that returns the content of the blob as a file.

The {{ domxref("FileReaderSync") }} interface (part of the FileAPI) has been implemented.

Event handling in nested {{ HTMLElement("label") }}s has been fixed.

You can now use {{ domxref("window.postMessage()") }} to pass {{ domxref("File") }} and {{ domxref("FileList") }} objects between windows.

Support for watchlists has been implemented with the new (non-standard) watch() and unwatch() methods.

CSS

{{ cssxref("resolution") }} now accepts {{ xref_cssnumber() }}, not just {{ xref_cssinteger() }} values as per the specification.

Hyphenation rules have been added for many new languages when using {{ cssxref("hyphens") }}.

Handling of {{ cssxref("background-size") }} has been revised to more closely match the specification.

In the past, {{ cssxref("text-decoration") }} in quirks mode had line thickness and position adjusted on descendant text to match the descendant. Now standards mode and quirks mode rendering are more similar.

Horizontal positioning for elements has been brought more in line with the specification in many cases. Documentation for this is forthcoming, but for now, see {{ bug("682780") }}, comment 23 for details.

XPCOM

Other XPCOM related changes

You can now instantiate DOM {{ domxref("File") }} objects from component code by simply doing new File, instead of having to instantiate an {{ interface("nsIDOMFile") }} directly.

The nsTPtrArray array type has been removed. Its functionality is now all available on nsTArray, which now offers the SafeElementAt() method when instantiated using a pointer type. See the section on SafeElementAt() in the XPCOM array guide for more information.

Workers

It is no longer possible to access XPCOM objects from ChromeWorkers. XPConnect has been disabled in worker contexts as of {{ bug("649537") }}.

XUL

A bug in {{ domxref("document.execCommand()") }} that occurred when calling it on the value of {{ XULProp("contentDocument") }} has been fixed. Since Firefox 3, this resulted in errors instead of working correctly.

Changes to the build system

The following build configuration options have been removed:

--enable-timeline

--disable-storage

--necko-disk-cache

When compiling IDL files to headers, the header file jspubtd.h is automatically included when needed. Manual inclusions of jspubtd.hand/or jsapi.h in IDL files that use jsval or [implicit_jscontext] are no longer necessary.

Chrome registration

The platformversion flag can be used in the chrome.manifest to specify Gecko version compatibility.

Interface changes

The {{ ifmethod("mozIJSSubScriptLoader", "loadSubScript") }} method now loads scripts from the startup cache when possible.

The ownerWindow attribute has been removed from the {{ interface("nsIAccessNode") }} interface.

The {{ interface("nsIDOMStorageWindow") }} interface has been merged into the {{ interface("nsIDOMWindow") }} interface.

All members of the {{ interface("nsIDOMWindowInternal") }} interface have been moved into the {{ interface("nsIDOMWindow") }} interface. The interface itself (with no members) remains available for compatibility until Firefox 9.

In order to improve performance, callback handling for asynchronous Places database updates has been changed. See the new {{ ifmethod("mozIVisitInfoCallback", "handleResult") }} and {{ ifmethod("mozIVisitInfoCallback", "handleError") }} methods, which replace the old single method for both error and success condition handling.

The {{ interface("nsIMemoryReporter") }} KIND_MAPPED attribute has been deprecated in favor of KIND_NONHEAP, new unit types UNITS_COUNT_CUMULATIVE and UNITS_PERCENTAGE have been added.

The {{ interface("nsIMemoryReporterManager") }} interface has a new explicit attribute, which reports the total size of explicit memory allocations.

The {{ interface("nsIMemoryReporterManager") }} interface has a new resident attribute, which reports the amount of physical memory used.

The {{ interface("nsINetworkLinkService") }} interface has a new attribute, linkType. This attribute provides the type of network connection in use. All Operating Systems currently return LINK_TYPE_UNKNOWN. Android support was backed out due to perceived security concerns.

The {{ interface("nsISelection2") }} interface has been merged into the {{ interface("nsISelectionPrivate") }} interface.

The {{ interface("nsISelection3") }} interface has been merged into the {{ interface("nsISelection") }} interface.

The {{ interface("nsISessionStartup") }} attribute state is now a jsval instead of a string, for performance reasons.

The {{ interface("nsIDocShell") }} attribute isActive is now false for minimized windows.

Removed interfaces

The following interfaces were implementation details that are no longer needed:

nsITimelineService

nsIDOMHTMLIsIndexElement

The {{ interface("nsIWorkerFactory") }} interface has been removed as well. Workers can still be created using the Worker and ChromeWorker constructors.

Other changes

When a window is minimized, un-minimized, or switches between full screen and windowed mode, it receives a sizemodechange event.

The new {{ domxref("document.mozSyntheticDocument") }} property on {{ domxref("Document") }} objects lets you determine whether a document is synthetic (that is, something like a standalone image, video, or audio file) rather than a full, standard DOM document. This can be useful, for example, if you want to present different user interface in this situation (such as adding contextual items differently depending on this case).

You can now specify a filter when opening about:config; for example, "about:config?filter=sessionstore" will show only session storage related preferences.

Revision Source

<p>{{ draft() }}</p>
<p>{{ ReleaseChannelInfo("8") }}</p>
<h2>Changes for web developers</h2>
<h3>HTML</h3>
<ul> <li>The {{ domxref("HTMLImageElement") }} <code>crossOrigin</code> property has been added and the {{ htmlattrxref("crossorigin", "img") }} has been added to the {{ HTMLElement("img") }} element. (see {{ bug("664299") }})</li> <li>The {{ domxref("HTMLSelectElement","","add()") }} method now supports either an item or index of an item that the new item should be inserted before. Previously it only supported an item. (see {{ bug("666200") }})</li> <li>The <code>HTMLIsIndexElement</code> constructor has been removed. No elements have implemented this interface since before Firefox 4.</li> <li>The HTML5 "context menu" feature (<code>contextmenu</code> attribute), which lets you add custom element specific items to native context menu, is now supported (the implementation is still experimental awaiting changes in the specification; see {{ bug("617528") }}).</li> <li>Support for the <a href="/en/HTML/Global_attributes#attr-accesskeylabel" title="https://developer.mozilla.org/en/HTML/Global_attributes#attr-accesskeylabel"><code>accesskeylabel</code></a> attribute has been added to all elements.</li> <li>The {{ HTMLElement("input") }} and {{ HTMLElement("textarea") }} elements now support the <code>selectionDirection</code> attribute, and their <code>setSelectionRange()</code> methods have been updated to support optionally specifying a direction.</li> <li>Most elements now get a focus ring drawn around them if they've been made focusable by using the <code>tabindex</code> attribute and the user then focuses the element.</li>
</ul>
<h3>DOM</h3>
<ul> <li>The {{ domxref("Element.insertAdjacentHTML","insertAdjacentHTML") }} method has been implemented.</li> <li>{{ domxref("BlobBuilder") }} now has a <code>getFile()</code> method that returns the content of the blob as a file.</li> <li>The {{ domxref("FileReaderSync") }} interface (part of the FileAPI) has been implemented.</li> <li>Event handling in nested {{ HTMLElement("label") }}s has been fixed.</li> <li>You can now use {{ domxref("window.postMessage()") }} to pass {{ domxref("File") }} and {{ domxref("FileList") }} objects between windows.</li> <li>When editing {{ domxref("element.contenteditable") }} areas, exiting a heading by pressing return, or exiting list editing mode by pressing return twice, now returns to paragraph entry mode (that is, paragraphs inside {{ HTMLElement("p") }} blocks) instead of separating lines by {{ HTMLElement("br") }} elements.</li> <li>Fixed a bug that prevents justification from taking effect properly when applied to the first line in a {{ domxref("element.contenteditable") }} area.</li> <li>Fixed a bug that caused pressing delete or backspace at the beginning of a {{ domxref("element.contenteditable") }} area to affect the previous <code>contenteditable</code> block if one is present.</li> <li>{{ domxref("document.getSelection()") }} now returns the same <code>Selection</code> object as {{ domxref("window.getSelection()") }}, instead of <em>stringifying</em> it.</li> <li>The HTML5 <code>selectionDirection</code> property makes it possible to define the direction of the selection in an editable text.</li> <li>{{ domxref("HTMLMediaElement") }} now have a <code>seekable</code> property that return a {{ domxref("TimeRanges") }} object.</li> <li>The {{domxref("HTMLMediaElement")}<code>.preload</code> attribute now correctly reflects as an <em>enumerated value</em>.</li> <li><a href="/en/HTML/CORS_settings_attributes" title="en/HTML/CORS_settings_attributes"><code>crossOrigin</code> property</a> defaults to "Anonymous" when an invalid value is used.</li> <li>{{ domxref("window.navigator.cookieEnabled") }} now returns correct information when the default cookie setting is overridden on a per-site basis.</li>
</ul>
<h3>JavaScript</h3>
<ul> <li><code><a href="/en/JavaScript/Reference/Global_Objects/RegExp/exec" title="en/JavaScript/Reference/Global Objects/RegExp/exec">RegExp.exec()</a></code> and <code><a href="/en/JavaScript/Reference/Global_Objects/RegExp/test" title="en/JavaScript/Reference/Global Objects/RegExp/test">RegExp.test()</a></code> called with no arguments now match against the string "undefined".</li> <li><code><a href="/en/JavaScript/Reference/Global_Objects/String/search" title="en/JavaScript/Reference/Global Objects/String/search">String.search()</a></code> and <code><a href="/en/JavaScript/Reference/Global_Objects/String/match" title="en/JavaScript/Reference/Global Objects/String/match">String.match()</a></code> called with no arguments or <code>undefined</code> now match against the empty string and thus match every string.</li> <li>Support for watchlists has been implemented with the new (non-standard) <a href="/en/JavaScript/Reference/Global_Objects/Object/watch" title="en/JavaScript/Reference/Global_Objects/Object/watch"><code>watch()</code></a> and <a href="/en/JavaScript/Reference/Global_Objects/Object/unwatch" title="en/JavaScript/Reference/Global_Objects/Object/unwatch"><code>unwatch()</code></a> methods.</li>
</ul>
<h3>CSS</h3>
<ul> <li>{{ cssxref("resolution") }} now accepts {{ xref_cssnumber() }}, not just {{ xref_cssinteger() }} values as per the specification.</li> <li>Hyphenation rules have been added for many new languages when using {{ cssxref("hyphens") }}.</li> <li>Handling of {{ cssxref("background-size") }} has been revised to more closely match the specification.</li> <li>In the past, {{ cssxref("text-decoration") }} in quirks mode had line thickness and position adjusted on descendant text to match the descendant. Now standards mode and quirks mode rendering are more similar.</li> <li>Horizontal positioning for elements has been brought more in line with the specification in many cases. Documentation for this is forthcoming, but for now, see {{ bug("682780") }}, comment 23 for details.</li> <li><a href="/en/CSS/Scaling_of_SVG_backgrounds" title="en/CSS/Scaling_of_SVG_backgrounds">SVG images are now scaled properly</a> when used as background images.</li>
</ul><h3>Network</h3>
<ul> <li>Double quotes are no longer accepted as a delimiter for {{ RFC("2231") }} or {{ RFC("5987") }} encoding, as per those RFCs.</li> <li>MIME header field parser (<code>Content-Disposition</code>) now requires "=" in parameters.</li> <li>Scripts are no longer downloaded when JavaScript is disabled.</li> <li>SSL 2.0 is no longer supported.</li>
</ul>
<h3>WebSockets</h3>
<ul> <li>The <a href="/en/WebSockets/WebSockets_reference/WebSocket" title="WebSocket"><code>WebSocket</code></a> object's <a href="/en/WebSockets/WebSockets_reference/WebSocket#send()" title="en/WebSockets/WebSockets reference/WebSocket#send()"><code>send()</code></a> method no longer incorrectly returns a Boolean value.</li> <li>The <a href="/en/WebSockets/WebSockets_reference/WebSocket" title="WebSocket"><code>WebSocket</code></a> object's <a href="/en/WebSockets/WebSockets_reference/WebSocket#close()" title="en/WebSockets/WebSockets_reference/WebSocket#close()"><code>close()</code></a> method now matches the current draft of the standard, and close events now properly use the <a href="/en/WebSockets/WebSockets_reference/CloseEvent" title="CloseEvent"><code>CloseEvent</code></a> interface.</li> <li>The <a href="/en/WebSockets/WebSockets_reference/WebSocket" title="WebSocket"><code>WebSocket</code></a> object's <code>extensions</code> attribute is now supported.</li> <li>The WebSocket constructor now supports an array of protocols as well as a single protocol string.</li> <li>Mixed content is not allowed with WebSockets; that is, you can no longer open a connection to a non-secure WebSocket server from secure content.</li> <li>Connection errors with WebSockets now trigger the <code>onerror</code> handler.</li> <li><a href="/en/WebSockets" title="en/WebSockets">WebSocket</a> API has been updated to the latest draft of the specification (see {{ bug("674890") }}, {{ bug("674527") }}, and {{ bug("674716") }}).</li> <li>The deflate-stream extension to WebSockets has been disabled; it has been deprecated, and was breaking compatibility with some sites.</li>
</ul>
<h3>WebGL</h3>
<ul> <li><a href="/en/WebGL/Cross-Domain_Textures" title="en/WebGL/Cross-Domain Textures">Cross-domain textures</a> can now be allowed with CORS approval.</li> <li>Cross-process rendering with Direct2D/Direct3D 10.</li>
</ul>
<h3>MathML</h3>
<ul> <li>Support for the <code>displaystyle</code> attribute on the top-level {{ MathMLElement("math") }} element has been added.</li> <li>The interpretation of negative row numbers for the <code>align</code> attribute on {{ MathMLElement("mtable") }} has been corrected.</li>
</ul>
<h3>Developer tools</h3>
<ul> <li>The <a href="/en/Using_the_Web_Console#The_console_object" title="en/Using_the_Web_Console#The_console_object"><code>console</code></a> object has a new <code>dir()</code> method, which displays an interactive list of the properties on a specified object.</li>
</ul>
<h2>Changes for Mozilla and add-on developers</h2>
<p>See <a href="/en/Firefox/Updating_add-ons_for_Firefox_8" title="en/Firefox/Updating_add-ons_for_Firefox_8">Updating add-ons for Firefox 8</a> for a guide to changes you're likely to have to make to make your add-ons compatible with Firefox 8.</p>
<div class="note"><strong>Note:</strong> Firefox 8 requires that binary components be recompiled, as do all major releases of Firefox. See <a href="/En/Developer_Guide/Interface_Compatibility#Binary_Interfaces" title="En/Developer_Guide/Interface_Compatibility#Binary_Interfaces">Binary Interfaces</a> for details.</div>
<h3>XPCOM</h3>
<dl> <dt><a href="/en/Components.utils" title="en/Components.utils"><code>Components.utils</code></a></dt> <dd>The new methods <a href="/en/Components.utils.createObjectIn" title="en/Components.utils.createObjectIn"><code>Components.utils.createObjectIn()</code></a> and <a href="/en/Components.utils.makeObjectPropsNormal" title="en/Components.utils.makeObjectPropsNormal"><code>Components.utils.makeObjectPropsNormal()</code></a> have been created to make it easier to create objects in specific compartments.</dd>
</dl>
<h4>Other XPCOM related changes</h4>
<ul> <li>You can now instantiate DOM {{ domxref("File") }} objects from component code by simply doing new File, instead of having to instantiate an {{ interface("nsIDOMFile") }} directly.</li> <li>The <code>nsTPtrArray</code> array type has been removed. Its functionality is now all available on <code>nsTArray</code>, which now offers the <code>SafeElementAt()</code> method when instantiated using a pointer type. See the section on <a href="/en/XPCOM_array_guide#Bounds-safe_access_to_elements" title="en/XPCOM_array_guide#Bounds-safe_access_to_elements"><code>SafeElementAt()</code></a> in the <a href="/en/XPCOM_array_guide" title="XPCOM array guide">XPCOM array guide</a> for more information.</li>
</ul>
<h3>Workers</h3>
<p>It is no longer possible to access XPCOM objects from ChromeWorkers. XPConnect has been disabled in worker contexts as of {{ bug("649537") }}.</p>
<h3>XUL</h3>
<ul> <li>A bug in {{ domxref("document.execCommand()") }} that occurred when calling it on the value of {{ XULProp("contentDocument") }} has been fixed. Since Firefox 3, this resulted in errors instead of working correctly.</li> <li><a href="/en/Extensions/Bootstrapped_extensions" title="Bootstrapped extensions">Bootstrapped add-ons</a> can now load chrome using a <a href="/en/Chrome_Registration" title="en/chrome.manifest"><code>chrome.manifest</code></a> file. See the section <a href="/en/Extensions/Bootstrapped_extensions#Adding_user_interface_with_a_chrome.manifest" title="en/Extensions/Bootstrapped_extensions#Adding_user_interface_with_a_chrome.manifest">Adding user interface with a chrome.manifest</a> for details.</li>
</ul>
<h3>JavaScript code modules</h3>
<h4>ISO8601DateUtils.jsm</h4>
<ul> <li>This code module has been removed. The <code><a href="/en/JavaScript/Reference/Global_Objects/Date/parse" title="en/JavaScript/Reference/Global_Objects/Date/parse">Date.parse()</a></code> method now supports reading ISO 8601 dates, and the new <code><a href="/en/JavaScript/Reference/Global_Objects/Date/toISOString" title="toISOString">Date.toISOString()</a></code> function allows to output ISO date/time. These should be used instead. Note that they <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=693077" title="https://bugzilla.mozilla.org/show_bug.cgi?id=693077">do not accept timezones yet</a>.</li>
</ul>
<h3>Changes to the build system</h3>
<ul> <li>The following build configuration options have been removed: <ul> <li><code>--enable-timeline</code></li> <li><code>--disable-storage</code></li> <li><code>--necko-disk-cache</code></li> </ul> </li> <li>When compiling IDL files to headers, the header file <code>jspubtd.h</code> is automatically included when needed. Manual inclusions of <code>jspubtd.h</code>and/or <code>jsapi.h</code> in IDL files that use jsval or [implicit_jscontext] are no longer necessary.</li>
</ul>
<h3>Chrome registration</h3>
<ul> <li>The <a href="/en/Chrome_Registration#platformversion" title="en/Chrome_Registration#platformversion"><code>platformversion</code></a> flag can be used in the chrome.manifest to specify Gecko version compatibility.</li>
</ul>
<h3>Interface changes</h3>
<ul> <li>The {{ ifmethod("mozIJSSubScriptLoader", "loadSubScript") }} method now loads scripts from the startup cache when possible.</li> <li>The <code>ownerWindow</code> attribute has been removed from the {{ interface("nsIAccessNode") }} interface.</li> <li>The {{ interface("nsIDOMStorageWindow") }} interface has been merged into the {{ interface("nsIDOMWindow") }} interface.</li> <li>All members of the {{ interface("nsIDOMWindowInternal") }} interface have been moved into the {{ interface("nsIDOMWindow") }} interface. The interface itself (with no members) remains available for compatibility until Firefox 9.</li> <li>In order to improve performance, callback handling for asynchronous Places database updates has been changed. See the new {{ ifmethod("mozIVisitInfoCallback", "handleResult") }} and {{ ifmethod("mozIVisitInfoCallback", "handleError") }} methods, which replace the old single method for both error and success condition handling.</li> <li>The {{ interface("nsIMemoryReporter") }} <code>KIND_MAPPED</code> attribute has been deprecated in favor of <code>KIND_NONHEAP</code>, new unit types <code>UNITS_COUNT_CUMULATIVE</code> and <code>UNITS_PERCENTAGE</code> have been added.</li> <li>The {{ interface("nsIMemoryReporterManager") }} interface has a new <code>explicit</code> attribute, which reports the total size of explicit memory allocations.</li> <li>The {{ interface("nsIMemoryReporterManager") }} interface has a new <code>resident</code> attribute, which reports the amount of physical memory used.</li> <li>The {{ interface("nsINetworkLinkService") }} interface has a new attribute, <code>linkType</code>. This attribute provides the type of network connection in use. All Operating Systems currently return <code>LINK_TYPE_UNKNOWN</code>. Android support was backed out due to perceived security concerns.</li> <li>The {{ interface("nsISelection2") }} interface has been merged into the {{ interface("nsISelectionPrivate") }} interface.</li> <li>The {{ interface("nsISelection3") }} interface has been merged into the {{ interface("nsISelection") }} interface.</li> <li>The {{ interface("nsISessionStartup") }} attribute state is now a <a href="/En/SpiderMonkey/JSAPI_Reference/Jsval" title="en/jsval"><code>jsval</code></a> instead of a string, for performance reasons.</li> <li>The {{ interface("nsIDocShell") }} attribute <code>isActive</code> is now <code>false</code> for minimized windows.</li>
</ul>
<h4>Removed interfaces</h4>
<p>The following interfaces were implementation details that are no longer needed:</p>
<ul> <li><code>nsITimelineService</code></li> <li><code>nsIDOMHTMLIsIndexElement</code></li>
</ul>
<p>The {{ interface("nsIWorkerFactory") }} interface has been removed as well. Workers can still be created using the <code>Worker</code> and <code>ChromeWorker</code> constructors.</p>
<h3>Other changes</h3>
<ul> <li>When a window is minimized, un-minimized, or switches between full screen and windowed mode, it receives a <code>sizemodechange</code> event.</li> <li>You can now <a href="/en/Installing_extensions#Preventing_automatic_install_from_specific_locations" title="en/Installing_extensions#Preventing_automatic_install_from_specific_locations">use the <code>extensions.autoDisableScopes</code> preference</a> to disable automatic installation of add-ons from specific add-on install locations.</li> <li>The new {{ domxref("document.mozSyntheticDocument") }} property on {{ domxref("Document") }} objects lets you determine whether a document is synthetic (that is, something like a standalone image, video, or audio file) rather than a full, standard DOM document. This can be useful, for example, if you want to present different user interface in this situation (such as adding contextual items differently depending on this case).</li> <li>You can now specify a filter when opening <code>about:config</code>; for example, "about:config?filter=sessionstore" will show only session storage related preferences.</li>
</ul><h2>See also</h2>
<ul> <li><a href="/en/Firefox_7_for_developers" title="en/Firefox_7_for_developers">Firefox 7 for developers</a></li> <li><a href="/en/Firefox_6_for_developers" title="en/Firefox_6_for_developers">Firefox 6 for developers</a></li> <li><a href="/en/Firefox_5_for_developers" title="en/Firefox_5_for_developers">Firefox 5 for developers </a></li> <li><a href="/en/Firefox_4_for_developers" title="en/Firefox_4_for_developers">Firefox 4 for developers </a></li> <li><a href="/en/Firefox_3.6_for_developers" title="en/Firefox_3.6_for_developers">Firefox 3.6 for developers </a></li> <li><a href="/En/Firefox_3.5_for_developers" title="En/Firefox_3.5_for_developers">Firefox 3.5 for developers</a></li> <li><a href="/en/Firefox_3_for_developers" title="en/Firefox_3_for_developers">Firefox 3 for developers</a></li> <li><a href="/en/Firefox_2_for_developers" title="en/Firefox_2_for_developers">Firefox 2 for developers</a></li> <li><a href="/en/Firefox_1.5_for_developers" title="en/Firefox_1.5_for_developers">Firefox 1.5 for developers</a></li>
</ul>
<p>{{ languages( { "ja": "ja/Firefox_8_for_developers" } ) }}</p>