Firefox 5 for developers

  • Revision slug: Firefox_5_for_developers
  • Revision title: Firefox 5 for developers
  • Revision id: 57004
  • Created:
  • Creator: custom.firefox.lady
  • Is current revision? No
  • Comment 1 words added, 1 words removed

Revision Content

{{ draft() }}

Firefox 5, based on Gecko 5.0, will ship in mid-2011. This article provides links to information about the changes that affect developers in this release. Nightly builds of what will become Firefox 5 are currently available on the Aurora channel (that is, the mozilla-aurora branch).

Note: Due to the way the development process works, it's possible that features currently listed here may be shifted to future versions of Firefox, so please keep an eye on this page.

Changes for web developers

HTML

  • The {{ HTMLElement("canvas") }} 2D drawing context now supports specifying an ImageData object as the input to the createImageData() method; this creates a new ImageData object initialized with the same dimensions as the specified object, but still with all pixels preset to transparent black. This was documented as implemented already but was not.
  • All HTML elements now have the {{ domxref("element.accessKey", "accessKey") }} attribute, as well as the {{ domxref("element.blur()", "blur()") }}, {{ domxref("element.click()", "click()") }}, and {{ domxref("element.focus()", "focus()") }} methods. These are specified in the {{ domxref("HTMLElement") }} interface.
  • In order to comply with the HTML5 specification, support for the UTF-7 and UTF-32 character sets has been removed.
  • When in quirks mode, empty {{ HTMLElement("map") }}s are no longer skipped over in favor of non-empty ones when matching. See the Gecko notes on the {{ HTMLElement("map") }} element for details.

CSS

CSS animations
Support for CSS animations has been added, using the -moz- prefix for now.

DOM

  • The {{ domxref("selection") }} object's modify() method has been changed so that the "word" selection granularity no longer includes trailing spaces; this makes it more consistent across platforms and matches the behavior of WebKit's implementation.
  • The {{ domxref("window.setTimeout()") }} method now clamps to send no more than one timeout per second in inactive tabs. In addition, it now correctly clamps nested timeouts to 4 ms instead of 10 ms, in accordance with the HTML5 specification.
  • Similarly, the {{ domxref("window.setInterval()") }} method now clamps to no more than one interval per second in inactive tabs.
  • XMLHttpRequest now supports the loadend event for progress listeners. This is sent after any transfer is finished (that is, after the abort, error, or load event). You can use this to handle any tasks that need to be performed regardless of success or failure of a transfer.
  • The {{ domxref("Blob") }} and, by extension, the {{ domxref("File") }} objects' slice() method has been removed and replaced with a new, proposed syntax that makes it more consistent with Array.slice() and String.slice() methods in JavaScript. This method is named mozSlice() for now.
  • The value of {{ domxref("window.navigator.language") }} is now determined by looking at the value of the Accept-Language HTTP header.

JavaScript

  • Regular expressions are no longer callable as if they were functions; this change has been made in concert with the WebKit team to ensure compatibility (see {{ WebkitBug("28285") }}. This feature had existed for a long time but was never documented (at least, not here on MDC).

SVG

  • The {{ SVGAttr("class") }} SVG attribute can now be animated.
  • The following SVG-related DOM interfaces representing lists of objects are now indexable and can be accessed like arrays; in addition, they have a length property indicating the number of items in the lists: {{ domxref("SVGLengthList") }}, {{ domxref("SVGNumberList") }}, {{ domxref("SVGPathSegList") }}, and {{ domxref("SVGPointList") }}.

HTTP

  • Firefox no longer sends the "Keep-Alive" HTTP header; we weren't formatting it correctly, and it was redundant since we were also sending the {{ httpheader("Connection") }} or {{ httpheader("Proxy-Connection") }} header with the value "keep-alive" anyway.
  • The HTTP transaction model has been updated to be more intelligent about reusing connections in the persistent connection pool; instead of treating the pool as a {{ interwiki("wikipedia", "FIFO") }} queue, Necko now attempts to sort the pool with connections with the largest {{ interwiki("wikipedia", "congestion window") }} (CWND) first. This can reduce the round-trip time (RTT) of HTTP transactions by avoiding the need to grow connections' windows in many cases.
  • Firefox now handles the Content-Disposition HTTP response header more effectively if both the filename and filename* parameters are provided; it looks through all provided names, using the filename* parameter if one is available, even if a filename parameter is included first. Previously, the first matching parameter would be used, thereby preventing a more appropriate name from being used. See {{ bug("588781") }}.

MathML

  • The top-level {{ MathMLElement("math") }} element now accepts any attributes of the {{ MathMLElement("mstyle") }} element.
  • Support for embellished operators

Developer tools

  • The Web Console's Console object now has a debug() method, which is an alias for its log() method; this improves compatibility with certain existing sites.

Changes for Mozilla and add-on developers

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

Changes to JavaScript code modules

New JavaScript code modules

  • The Dict.jsm code module was added; it provides an API for dictionaries of key/value pairs.

NetUtil.jsm

  • The asyncFetch() method now supports specifying the input source as an {{ interface("nsIInputStream") }}.

Interface changes

  • The {{ interface("nsIHttpChannelInternal") }} interface has new attributes providing access to information about the channels' endpoints' addresses and ports. This information is provided primarily for debugging purposes.
  • The {{ HTMLElement("canvas") }} element's {{ htmlattrxref("width", "canvas") }} and {{ htmlattrxref("height", "canvas") }} attributes are now reflected in IDL as unsigned integers instead of signed (see HTMLCanvasElement).
  • The {{ ifmethod("mozIJSSubScriptLoader", "loadSubScript") }} method now has an optional argument allowing you to specify the character set of the script; if one is not provided, ASCII is assumed (as was always assumed previously).

Debugging aids

  • The new DebugOnly<T> helper makes it possible to declare variables only for DEBUG builds.

JavaScript API (SpiderMonkey)

Build system changes

  • You can now build Firefox without a mozconfig file; the --enable-application setting now defaults to "browser". After pulling or downloading the code, you can simply configure && make (or make -f client.mk) to build Firefox.

See also

Revision Source

<p>{{ draft() }}</p>
<p>Firefox 5, based on Gecko 5.0, will ship in mid-2011. This article provides links to information about the changes that affect developers in this release. Nightly builds of what will become Firefox 5 are <a class=" external" href="http://www.mozilla.com/en-US/firefox/channel/" title="http://www.mozilla.com/en-US/firefox/channel/">currently available</a> on the Aurora channel (that is, the <a href="/En/Developer_Guide/Source_Code/Mercurial#mozilla-aurora_(second-stage_development_tree)" title="en/Mozilla Source Code (Mercurial)#mozilla-aurora (second-stage development tree)">mozilla-aurora</a> branch).</p>
<div class="note"><strong>Note:</strong> Due to the way the development process works, it's possible that features currently listed here may be shifted to future versions of Firefox, so please keep an eye on this page.</div>
<h2>Changes for web developers</h2>
<h3>HTML</h3>
<ul> <li>The {{ HTMLElement("canvas") }} 2D drawing context now supports specifying an <code>ImageData</code> object as the input to the <code>createImageData()</code> method; this <a href="/En/HTML/Canvas/Pixel_manipulation_with_canvas#Creating_an_ImageData_object" title="En/HTML/Canvas/Pixel manipulation with canvas#Creating an ImageData object">creates a new <code>ImageData</code> object</a> initialized with the same dimensions as the specified object, but still with all pixels preset to transparent black. This was documented as implemented already but was not.</li> <li>All HTML elements now have the {{ domxref("element.accessKey", "accessKey") }} attribute, as well as the {{ domxref("element.blur()", "blur()") }}, {{ domxref("element.click()", "click()") }}, and {{ domxref("element.focus()", "focus()") }} methods. These are specified in the {{ domxref("HTMLElement") }} interface.</li> <li>In order to comply with the HTML5 specification, support for the UTF-7 and UTF-32 <a href="/en/Character_Sets_Supported_by_Gecko" title="en/Character Sets Supported by Gecko">character sets</a> has been removed.</li> <li>When in quirks mode, empty {{ HTMLElement("map") }}s are no longer skipped over in favor of non-empty ones when matching. See the <a href="/en/HTML/Element/map#Gecko_notes" title="en/HTML/Element/map#Gecko notes">Gecko notes</a> on the {{ HTMLElement("map") }} element for details.</li>
</ul>
<h3>CSS</h3>
<dl> <dt><a href="/en/CSS/CSS_animations" title="en/CSS/CSS animations">CSS animations</a></dt> <dd>Support for CSS animations has been added, using the <code>-moz</code>- prefix for now.</dd>
</dl>
<h3>DOM</h3>
<ul> <li>The {{ domxref("selection") }} object's <a href="/en/DOM/Selection/modify" title="en/DOM/Selection/modify"><code>modify()</code></a> method has been changed so that the "word" selection granularity no longer includes trailing spaces; this makes it more consistent across platforms and matches the behavior of WebKit's implementation.</li> <li>The {{ domxref("window.setTimeout()") }} method now clamps to send no more than one timeout per second in inactive tabs. In addition, it now correctly clamps nested timeouts to 4 ms instead of 10 ms, in accordance with the HTML5 specification.</li> <li>Similarly, the {{ domxref("window.setInterval()") }} method now clamps to no more than one interval per second in inactive tabs.<code><br> </code></li> <li><a href="/en/XMLHttpRequest" title="en/XMLHttpRequest"><code>XMLHttpRequest</code></a> now <a href="/En/XMLHttpRequest/Using_XMLHttpRequest#Detecting_any_load_end_condition" title="en/XMLHttpRequest/Using XMLHttpRequest#Detecting any load end condition">supports the <code>loadend</code> event</a> for progress listeners. This is sent after any transfer is finished (that is, after the <code>abort</code>, <code>error</code>, or <code>load</code> event). You can use this to handle any tasks that need to be performed regardless of success or failure of a transfer.</li> <li>The {{ domxref("Blob") }} and, by extension, the {{ domxref("File") }} objects' <code>slice()</code> method has been removed and replaced with a new, proposed syntax that makes it more consistent with <a href="/en/JavaScript/Reference/Global_Objects/Array/slice" title="en/JavaScript/Reference/Global Objects/Array/slice"><code>Array.slice()</code></a> and <a href="/en/JavaScript/Reference/Global_Objects/String/slice" title="en/JavaScript/Reference/Global Objects/String/slice"><code>String.slice()</code></a> methods in JavaScript. This method is named <a href="/en/DOM/Blob#mozSlice()" title="en/DOM/Blob#mozSlice()"><code>mozSlice()</code></a> for now.</li> <li>The value of {{ domxref("window.navigator.language") }} is now determined by looking at the value of the <code>Accept-Language</code> <a href="/en/HTTP/Headers" title="en/HTTP/Headers">HTTP header</a>.</li>
</ul>
<h3>JavaScript</h3>
<ul> <li>Regular expressions are no longer callable as if they were functions; this change has been made in concert with the WebKit team to ensure compatibility (see {{ WebkitBug("28285") }}. This feature had existed for a long time but was never documented (at least, not here on MDC).</li>
</ul>
<h3>SVG</h3>
<ul> <li>The {{ SVGAttr("class") }} SVG attribute can now be animated.</li> <li>The following SVG-related DOM interfaces representing lists of objects are now indexable and can be accessed like arrays; in addition, they have a <code>length</code> property indicating the number of items in the lists: {{ domxref("SVGLengthList") }}, {{ domxref("SVGNumberList") }}, {{ domxref("SVGPathSegList") }}, and {{ domxref("SVGPointList") }}.</li>
</ul>
<h3>HTTP</h3>
<ul> <li>Firefox no longer sends the "Keep-Alive" HTTP header; we weren't formatting it correctly, and it was redundant since we were also sending the {{ httpheader("Connection") }} or {{ httpheader("Proxy-Connection") }} header with the value "keep-alive" anyway.</li> <li>The HTTP transaction model has been updated to be more intelligent about reusing connections in the persistent connection pool; instead of treating the pool as a {{ interwiki("wikipedia", "FIFO") }} queue, Necko now attempts to sort the pool with connections with the largest {{ interwiki("wikipedia", "congestion window") }} (CWND) first. This can reduce the round-trip time (RTT) of HTTP transactions by avoiding the need to grow connections' windows in many cases.</li> <li>Firefox now handles the Content-Disposition HTTP response header more effectively if both the <code>filename</code> and <code>filename*</code> parameters are provided; it looks through all provided names, using the <code>filename*</code> parameter if one is available, even if a <code>filename</code> parameter is included first. Previously, the first matching parameter would be used, thereby preventing a more appropriate name from being used. See {{ bug("588781") }}.</li>
</ul>
<h3>MathML</h3>
<ul> <li>The top-level {{ MathMLElement("math") }} element now accepts any attributes of the {{ MathMLElement("mstyle") }} element.</li> <li>Support for <a class=" external" href="http://www.w3.org/TR/MathML3/chapter3.html#id.3.2.5.7.3" title="http://www.w3.org/TR/MathML3/chapter3.html#id.3.2.5.7.3">embellished operators</a></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">Web Console's <code>Console</code> object</a> now has a <code>debug()</code> method, which is an alias for its <code>log()</code> method; this improves compatibility with certain existing sites.</li>
</ul>
<h2>Changes for Mozilla and add-on developers</h2>
<div class="note"><strong>Note:</strong> Firefox 5 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>Changes to JavaScript code modules</h3>
<h4>New JavaScript code modules</h4>
<ul> <li>The <a href="/en/JavaScript_code_modules/Dict.jsm" title="en/JavaScript code modules/Dict.jsm"><code>Dict.jsm</code></a> code module was added; it provides an API for dictionaries of key/value pairs.</li>
</ul>
<h4>NetUtil.jsm</h4>
<ul> <li>The <a href="/en/JavaScript_code_modules/NetUtil.jsm#asyncFetch()" title="en/JavaScript code modules/NetUtil.jsm#asyncFetch()"><code>asyncFetch()</code></a> method now supports specifying the input source as an {{ interface("nsIInputStream") }}.</li>
</ul>
<h3>Interface changes</h3>
<ul> <li>The {{ interface("nsIHttpChannelInternal") }} interface has new attributes providing access to information about the channels' endpoints' addresses and ports. This information is provided primarily for debugging purposes.</li> <li>The {{ HTMLElement("canvas") }} element's {{ htmlattrxref("width", "canvas") }} and {{ htmlattrxref("height", "canvas") }} attributes are now reflected in IDL as unsigned integers instead of signed (see <a href="/en/DOM/HTMLCanvasElement" title="en/DOM/HTMLCanvasElement"><code>HTMLCanvasElement</code></a>).</li> <li>The {{ ifmethod("mozIJSSubScriptLoader", "loadSubScript") }} method now has an optional argument allowing you to specify the character set of the script; if one is not provided, ASCII is assumed (as was always assumed previously).</li>
</ul>
<h3>Debugging aids</h3>
<ul> <li>The new <a href="/En/Namespace/Mozilla/DebugOnly%3CT%3E" title="En/Namespace/Mozilla/DebugOnly&lt;T>"><code>DebugOnly&lt;T&gt;</code></a> helper makes it possible to declare variables only for <code>DEBUG</code> builds.</li>
</ul>
<h3>JavaScript API (SpiderMonkey)</h3>
<ul> <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DoubleToInt32" title="en/SpiderMonkey/JSAPI Reference/JS DoubleToInt32"><code>JS_DoubleToInt32()</code></a> and <a href="/en/SpiderMonkey/JSAPI_Reference/JS_DoubleToInt32" title="en/SpiderMonkey/JSAPI Reference/JS DoubleToInt32"><code>JS_DoubleToUint32()</code></a> have been added, for converting <code><a href="/en/SpiderMonkey/JSAPI_Reference/jsdouble" title="en/jsdouble">jsdouble</a></code> values into C integers and unsigned integers.</li>
</ul>
<h3>Build system changes</h3>
<ul> <li>You can now build<span id="1302802424260S" style="display: none;"> </span> Firefox without a <code>mozconfig</code> file; the <a href="/en/Configuring_Build_Options#Choose_an_application" title="en/Configuring Build Options#Choose an application"><code>--enable-application</code> setting</a> now defaults to "browser". After pulling or downloading the code, you can simply <code>configure &amp;&amp; make</code> (or <code>make -f client.mk</code>) to build Firefox.</li>
</ul>
<h3>See also</h3>
<ul> <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 class="internal" href="/En/Firefox_3.5_for_developers" title="En/Firefox 3.5 for developers">Firefox 3.5 for developers</a></li> <li><a class="internal" href="/en/Firefox_3_for_developers" title="en/Firefox 3 for developers">Firefox 3 for developers</a></li> <li><a class="internal" href="/en/Firefox_2_for_developers" title="en/Firefox 2 for developers">Firefox 2 for developers</a></li> <li><a class="internal" href="/en/Firefox_1.5_for_developers" title="en/Firefox 1.5 for developers">Firefox 1.5 for developers</a></li>
</ul>
Revert to this revision