Firefox 8 for developers

  • Revision slug: Firefox_8_for_developers
  • Revision title: Firefox 8 for developers
  • Revision id: 60255
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment 47 words removed

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") }}).
  • 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.

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.
  • Event handling in nested {{ HTMLElement("label") }}s has been fixed.
  • 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.
  • Fixed a bug that prevents justification from taking effect properly when applied to the first line in a {{ domxref("element.contenteditable") }} area.
  • Fixed a bug that caused pressing delete or backspace at the beginning of a {{ domxref("element.contenteditable") }} area to affect the previous contenteditable block if one is present.
  • {{ domxref("document.getSelection()") }} now returns the same Selection object as {{ domxref("window.getSelection()") }}, instead of stringifying it.
  • The HTML5 selectionDirection property makes it possible to define the direction of the selection in an editable text.
  • {{ domxref("HTMLMediaElement") }} now have a seekable property that return a {{ domxref("TimeRanges") }} object.
  • crossOrigin property defaults to "Anonymous" when an invalid value is used.
  • window.navigator.taintEnabled has been removed; it has not been supported in many years.
  • {{ domxref("window.navigator.cookieEnabled") }} now returns correct information when the default cookie setting is overridden on a per-site basis.

JavaScript

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("hyphen") }}.

Network

  • Double quotes are no longer accepted as a delimiter for {{ RFC("2231") }} or {{ RFC("5987") }} encoding, as per those RFCs.
  • MIME header field parser (Content-Disposition) now requires "=" in parameters.
  • Scripts are no longer downloaded when JavaScript is disabled.
  • SSL 2.0 is no longer supported.

WebSockets

  • The WebSocket object's send() method no longer incorrectly returns a Boolean value.
  • The WebSocket object's close() method now matches the current draft of the standard, and close events now properly use the CloseEvent interface.
  • The WebSocket object's extensions attribute is now supported.
  • The WebSocket constructor now supports an array of protocols as well as a single protocol string.
  • 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.
  • Connection errors with WebSockets now trigger the onerror handler.
  • WebSocket API has been updated to the latest draft of the specification (see {{ bug("674890") }}, {{ bug("674527") }}, and {{ bug("674716") }}).
  • The deflate-stream extension to WebSockets has been disabled; it has been deprecated, and was breaking compatibility with some sites.

WebGL

  • Cross-domain textures can now be allowed with CORS approval.
  • Cross-process rendering with Direct2D/Direct3D 10.

MathML

  • Support for the displaystyle attribute on the top-level {{ MathMLElement("math") }} element has been added.
  • The interpretation of negative row numbers for the align attribute on {{ MathMLElement("mtable") }} has been corrected.

Developer tools

  • The console object has a new dir() method, which displays an interactive list of the properties on a specified object.

Changes for Mozilla and add-on developers

See Updating add-ons for Firefox 8 for a guide to changes you're likely to have to make to make your add-ons compatible with Firefox 8.

Note: Firefox 8 requires that binary components be recompiled, as do all major releases of Firefox. See Binary Interfaces for details.

XPCOM

Components.utils
The new methods Components.utils.createObjectIn() and Components.utils.makeObjectPropsNormal() have been created to make it easier to create objects in specific compartments.

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.

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.

JavaScript code modules

ISO8601DateUtils.jsm

Changes to the build system

  • The following build configuration options have been removed:
    • --enable-timeline
    • --disable-storage
    • --necko-disk-cache

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("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

Other changes

  • When a window is minimized, un-minimized, or switches between full screen and windowed mode, it receives a sizemodechange event.
  • You can now use the extensions.autoDisableScopes preference to disable automatic installation of add-ons from specific add-on install locations.
  • 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.

See also

{{ languages( { "ja": "ja/Firefox_8_for_developers" } ) }}

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>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>
</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>Event handling in nested {{ HTMLElement("label") }}s has been fixed.</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><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><code>window.navigator.taintEnabled</code> has been removed; it has not been supported in many years.</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>
</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("hyphen") }}.</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>
</ul><h3>XUL</h3>
<p>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.</p><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>--<span id="summary_alias_container"><span id="short_desc_nonedit_display">necko-disk-cache</span></span></code></li> </ul> </li>
</ul>
<h3>Chrome registration</h3>
<ul> <li>The <code><a href="/en/Chrome_Registration#platformversion" title="en/Chrome_Registration#platformversion">platformversion</a></code> 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("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>
<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>
Revert to this revision