Revision 56967 of Firefox 5 for developers

  • Revision slug: Firefox_5_for_developers
  • Revision title: Firefox 5 for developers
  • Revision id: 56967
  • Created:
  • Creator: Crash
  • Is current revision? No
  • Comment adding "See Also"; 26 words added

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.

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.

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 a minimum of 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.

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).

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.

Changes for Mozilla and add-on developers

Changes to JavaScript code modules

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).

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.</p>
<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>
</ul>
<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 a minimum of 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>
</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>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>
</ul>
<h2>Changes for Mozilla and add-on developers</h2>
<h3>Changes to JavaScript code modules</h3>
<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>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