Firefox 12 for developers

  • Revision slug: Firefox_12_for_developers
  • Revision title: Firefox 12 for developers
  • Revision id: 304041
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

Firefox 12 was shipped on April 24, 2012. This page summarizes the changes in Firefox 12 that affect developers. This article provides information about the new features and key bugs fixed in this release, as well as links to more detailed documentation for both web developers and add-on developers.

Changes for Web developers

HTML

  • The title attribute now supports newline characters to allow multi-line tooltips.
  • If JavaScript is disabled, the {{HTMLElement("canvas")}} element was being rendered instead of showing the fallback content as per the specification. Now the fallback content is rendered instead.
  • The crossorigin attribute is now supported on {{HTMLElement("video")}}.

CSS

  • Support for the {{cssxref("text-align-last")}} property has been added (prefixed).

JavaScript

  • Support for sharp variables (a Netscape non-standard extension) has been dropped.

DOM

  • {{domxref("DOMParser")}} now supports parsing of HTML document fragments.
  • {{domxref("XMLHttpRequest")}} now supports timeouts using the timeout property and "timeout" event, as well as the ontimeout event handler on the {{domxref("XMLHttpRequestEventTarget")}} interface.
  • {{domxref("XMLHttpRequest")}} can now load from data: URIs.
  • When downloading large amounts of data, {{domxref("XMLHttpRequest")}} progress event handlers are now called periodically with the responseType set to "moz-blob" and the response being a {{domxref("Blob")}} containing all of the data received so far. This lets progress handlers begin processing data without having to wait for it all to arrive.
  • Gecko now supports multi-touch (instead of just single touches at a time) on Android.
  • While editing text using an IME, the {{domeventxref("input")}} event is now sent whenever the contents of the element being edited have been changed; this happens after the {{domeventxref("compositionupdate")}} event has been sent to indicate that the IME's text has been changed. You can use the {{domeventxref("input")}} event handler, therefore, to monitor changes to the actual content of the element.
  • {{domxref("DOMError")}} as defined in the DOM 4 specification has been implemented.
  • The {{domxref("Document.createNodeIterator()")}} method has been updated to match the DOM4 specification. This makes the whatToShow and filter parameters optional and removes the non-standard fourth parameter, entityReferenceExpansion.
  • The {{domxref("Blob")}} interface's slice() method was affected by a bug that prevented it from properly accepting start and end values outside the range of a signed 64-bit integer; this has been fixed.
  • The {{domxref("element.getBoundingClientRect()")}} method now considers effect of CSS transforms when computing the element's bounding rectangle.
  • The crossOrigin property is now supported by {{domxref("HTMLMediaElement")}}.

New WebAPIs

  • Network Information API: Experimental support for {{domxref("window.navigator.connection")}} has been added (prefixed).
  • WebTelephony API: {{domxref("window.navigator.mozTelephony")}} has been implemented and provides support for dialing, answering, and managing phone calls on a device.
  • WebSMS API: {{domxref("window.navigator.mozSms")}} is now available for mobile devices to send SMS text messages.

SVG

  • Firefox now implements the {{domxref("SVGTests")}} DOM API, see {{bug("607854")}}
  • The {{domxref("SVGStringList")}} DOM interface support the non-standard length property see {{bug("711958")}}

MathML

  • To control the directionality of MathML formulas, the dir attribute is now supported on the {{MathMLElement("math")}}, {{MathMLElement("mrow")}}, and {{MathMLElement("mstyle")}} elements as well as on MathML Token Elements. This is particularly important for some Arabic mathematical notations.
  • The alignment attribute align defined in MathML3 has been implemented for {{MathMLElement("munder")}}, {{MathMLElement("mover")}}, and {{MathMLElement("munderover")}}.

Networking

  • Previously, Gecko reported the close code CLOSE_NORMAL when a WebSocket channel was closed due to an unexpected error, or if it was closed due to an error condition that the specification doesn't cover. Now CLOSE_GOING_AWAY is reported instead.

Developer tools

  • The Web Console now caches error messages and log entries added using {{domxref("console.log()")}} if the console isn't currently open, and displays them when the console is opened.
  • You can now reset the zoom level, panning, and rotation in the 3D view by pressing the "r" key.
  • You can now hide nodes in the 3D view by pressing the "x" key after selecting them.
  • The source editor has a several new editing features and keyboard shortcuts; see Using the Source Editor for details

Mozilla has been working on integrating its own Web developer tools that complement the popular Firebug add-on. You can get more information about these tools as well as see a list of resources external to Firefox that will help you with your Web development. The entire list is located at Web developer tools.

Miscellaneous changes

  • The GEOSTD8 character set, which was never fully supported, is no longer supported at all.

Changes for Mozilla and add-on developers

JavaScript code modules

source-editor.jsm

XUL

  • The definition of the values for the {{XULAttr("chromemargin")}} attribute has changed slightly, to make it easier to make cross-platform XUL code look good on platforms with different default window border widths.

XPCOM

XPConnect

  • The PRUint64 data type was incorrectly essentially identical to PRint64 when used with XPConnect. This has been fixed.

Interface changes

  • The nsIScreen_MOZILLA_2_0_BRANCH interface has been merged into {{interface("nsIScreen")}}. The APIs defined in that interface (for controlling minimum screen brightness) had not previously been documented, but now they are.
  • The {{interface("nsIScriptError2")}} interface has been merged into {{interface("nsIScriptError")}}.
  • {{ifmethod("nsIDownloadManager", "addDownload")}} is now handled asynchronously rather than synchronously.
  • The {{ifmethod("imgIContainerObserver", "frameChanged")}} method now receives as its first parameter an {{interface("imgIRequest")}} object identifying the corresponding request.
  • The {{ifmethod("nsIDOMWindowUtils", "sendTouchEvent")}} method has been added to allow synthesizing touch events.
  • You can now scroll the specified content to the vertical center of the view by specifying SCROLL_CENTER_VERTICALLY as the scroll constant when calling {{ifmethod("nsISelectionController", "scrollSelectionIntoView")}}.
  • The new {{ifattribute("nsIMemoryMultiReporter", "explicitNonHeap")}} attribute has been added; this is a more efficient way to obtain the sum of all of the multi-reporter's measurements that have a path that starts with "explicit" and are of the kind KIND_NONHEAP.
  • The {{ifattribute("nsIDOMWindowUtils", "paintingSuppressed")}} attribute has been added; this boolean value indicates whether or not painting is currently suppressed on the window. This is used on mobile to prevent bouncy rendering that occurs when attempts to draw the page begin before enough content is available to do so smoothly.
  • The nsIDocCharset and nsIDocumentCharsetInfo interfaces have been merged into {{interface("nsIDocShell")}}. As part of this work, the old forcedDetector attribute has been removed; it never did anything.

SpiderMonkey

  • JSThread has been eliminated.
  • JSThreadData has been merged into JSRuntime.

Building

  • When building on Windows, you must have the Windows 7 SDK installed.

Other changes

See also

Revision Source

<p>Firefox 12 was shipped on April 24, 2012. This page summarizes the changes in Firefox 12 that affect developers. This article provides information about the new features and key bugs fixed in this release, as well as links to more detailed documentation for both web developers and add-on developers.</p>
<h2 id="Changes_for_Web_developers">Changes for Web developers</h2>
<h3 id="HTML">HTML</h3>
<ul>
  <li>The <code>title</code> attribute now supports newline characters to allow multi-line tooltips.</li>
  <li>If JavaScript is disabled, the {{HTMLElement("canvas")}} element was being rendered instead of showing the fallback content as per the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html" title="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html">specification</a>. Now the fallback content is rendered instead.</li>
  <li>The <code>crossorigin</code> attribute is now supported on {{HTMLElement("video")}}.</li>
</ul>
<h3 id="CSS">CSS</h3>
<ul>
  <li>Support for the {{cssxref("text-align-last")}} property has been added (prefixed).</li>
</ul>
<h3 id="JavaScript">JavaScript</h3>
<ul>
  <li>Support for <a href="/en-US/docs/JavaScript/Sharp_variables_in_JavaScript" title="Sharp variables in JavaScript">sharp variables</a> (a Netscape non-standard extension) has been dropped.</li>
</ul>
<h3 id="DOM">DOM</h3>
<ul>
  <li>{{domxref("DOMParser")}} now supports parsing of HTML document fragments.</li>
  <li>{{domxref("XMLHttpRequest")}} now supports timeouts using the <code>timeout</code> property and "timeout" event, as well as the <code>ontimeout</code> event handler on the {{domxref("XMLHttpRequestEventTarget")}} interface.</li>
  <li>{{domxref("XMLHttpRequest")}} can now load from <a href="/en-US/docs/data_URIs" title="data URIs"><code>data:</code> URIs</a>.</li>
  <li>When downloading large amounts of data, {{domxref("XMLHttpRequest")}} progress event handlers are now called periodically with the <code>responseType</code> set to "moz-blob" and the response being a {{domxref("Blob")}} containing all of the data received so far. This lets progress handlers begin processing data without having to wait for it all to arrive.</li>
  <li>Gecko now supports <a href="/en-US/docs/DOM/Touch_events" title="en-US/docs/DOM/Touch_events">multi-touch</a> (instead of just single touches at a time) on Android.</li>
  <li>While editing text using an IME, the {{domeventxref("input")}} event is now sent whenever the contents of the element being edited have been changed; this happens after the {{domeventxref("compositionupdate")}} event has been sent to indicate that the IME's text has been changed. You can use the {{domeventxref("input")}} event handler, therefore, to monitor changes to the actual content of the element.</li>
  <li>{{domxref("DOMError")}} as defined in the DOM 4 specification has been implemented.</li>
  <li>The {{domxref("Document.createNodeIterator()")}} method has been updated to match the DOM4 specification. This makes the <code>whatToShow</code> and <code>filter</code> parameters optional and removes the non-standard fourth parameter, <code>entityReferenceExpansion</code>.</li>
  <li>The {{domxref("Blob")}} interface's <code>slice()</code> method was affected by a bug that prevented it from properly accepting <code>start</code> and <code>end</code> values outside the range of a signed 64-bit integer; this has been fixed.</li>
  <li>The {{domxref("element.getBoundingClientRect()")}} method now considers effect of <a href="/en-US/docs/CSS/Using_CSS_transforms" title="Using CSS transforms">CSS transforms</a> when computing the element's bounding rectangle.</li>
  <li>The <code>crossOrigin</code> property is now supported by {{domxref("HTMLMediaElement")}}.</li>
</ul>
<h4 id="New_WebAPIs">New WebAPIs</h4>
<ul>
  <li>Network Information API: Experimental support for {{domxref("window.navigator.connection")}} has been added (prefixed).</li>
  <li>WebTelephony API: {{domxref("window.navigator.mozTelephony")}} has been implemented and provides support for dialing, answering, and managing phone calls on a device.</li>
  <li>WebSMS API: {{domxref("window.navigator.mozSms")}} is now available for mobile devices to send SMS text messages.</li>
</ul>
<h3 id="SVG">SVG</h3>
<ul>
  <li>Firefox now implements the {{domxref("SVGTests")}} DOM API, see {{bug("607854")}}</li>
  <li>The {{domxref("SVGStringList")}} DOM interface support the non-standard <code>length</code> property see {{bug("711958")}}</li>
</ul>
<h3 id="MathML">MathML</h3>
<ul>
  <li>To control the directionality of MathML formulas, the <code>dir</code> attribute is now supported on the {{MathMLElement("math")}}, {{MathMLElement("mrow")}}, and {{MathMLElement("mstyle")}} elements as well as on <a href="/Special:Tags?tag=MathML:Token+Elements" title="Special:Tags?tag=MathML:Token+Elements">MathML Token Elements</a>. This is particularly important for some <a class="external" href="http://www.w3.org/TR/arabic-math/" title="http://www.w3.org/TR/arabic-math/">Arabic mathematical notations</a>.</li>
  <li>The alignment attribute <code>align</code> defined in MathML3 has been implemented for {{MathMLElement("munder")}}, {{MathMLElement("mover")}}, and {{MathMLElement("munderover")}}.</li>
</ul>
<h3 id="Networking">Networking</h3>
<ul>
  <li>Previously, Gecko reported the close code <code>CLOSE_NORMAL</code> when a WebSocket channel was closed due to an unexpected error, or if it was closed due to an error condition that the specification doesn't cover. Now <code>CLOSE_GOING_AWAY</code> is reported instead.</li>
</ul>
<h3 id="Developer_tools">Developer tools</h3>
<ul>
  <li>The <a href="/en-US/docs/Tools/Web_Console" title="Web Console">Web Console</a> now caches error messages and log entries added using {{domxref("console.log()")}} if the console isn't currently open, and displays them when the console is opened.</li>
  <li>You can now reset the zoom level, panning, and rotation in the <a href="/en-US/docs/Tools/Page_Inspector/3D_view" title="3D view">3D view</a> by pressing the "r" key.</li>
  <li>You can now hide nodes in the <a href="/en-US/docs/Tools/Page_Inspector/3D_view" title="3D view">3D view</a> by pressing the "x" key after selecting them.</li>
  <li>The <a href="/en-US/docs/Tools/Using_the_Source_Editor" title="en-US/docs/Tools/Using_the_Source_Editor">source editor</a> has a several new editing features and keyboard shortcuts; see <a href="/en-US/docs/Tools/Using_the_Source_Editor" title="Using the Source Editor">Using the Source Editor</a> for details</li>
</ul>
<p>Mozilla has been working on integrating its own Web developer tools that complement the popular <a class="external" href="http://getfirebug.com/" target="external" title="Firebug Firefox add-on">Firebug</a> add-on. You can get more information about these tools as well as see a list of resources external to Firefox that will help you with your Web development. The entire list is located at <a href="/en-US/docs/Tools" title="Web Developer Tools">Web developer tools</a>.</p>
<h3 id="Miscellaneous_changes">Miscellaneous changes</h3>
<ul>
  <li>The GEOSTD8 character set, which was never fully supported, is no longer supported at all.</li>
</ul>
<h2 id="Changes_for_Mozilla_and_add-on_developers">Changes for Mozilla and add-on developers</h2>
<h3 id="JavaScript_code_modules">JavaScript code modules</h3>
<h4 id="source-editor.jsm">source-editor.jsm</h4>
<ul>
  <li>The <a href="/en-US/docs/JavaScript_code_modules/source-editor.jsm#resetUndo%28%29" title="en-US/docs/JavaScript_code_modules/source-editor.jsm#resetUndo%28%29"><code>resetUndo()</code></a> method was added; this lets you clear the undo stack.</li>
  <li>The source editor now offers methods for providing search capability: <a href="/en-US/docs/JavaScript_code_modules/source-editor.jsm#find()" title="en-US/docs/JavaScript_code_modules/source-editor.jsm#find()"><code>find()</code></a>, <a href="/en-US/docs/JavaScript_code_modules/source-editor.jsm#findNext()" title="en-US/docs/JavaScript_code_modules/source-editor.jsm#findNext()"><code>findNext()</code></a>, and <a href="/en-US/docs/JavaScript_code_modules/source-editor.jsm#findPrevious()" title="en-US/docs/JavaScript_code_modules/source-editor.jsm#findPrevious()"><code>findPrevious()</code></a>.</li>
</ul>
<h3 id="XUL">XUL</h3>
<ul>
  <li>The definition of the values for the {{XULAttr("chromemargin")}} attribute has changed slightly, to make it easier to make cross-platform XUL code look good on platforms with different default window border widths.</li>
</ul>
<h3 id="XPCOM">XPCOM</h3>
<ul>
  <li><a href="/en-US/docs/nsISupports_proxies" title="nsISupports proxies"><code>nsISupports</code> proxies</a> are no longer supported. You should be using runnables instead; see <a href="/en-US/docs/XPCOM/Making_cross-thread_calls_using_runnables" title="en-US/docs/XPCOM/Making cross-thread calls using runnables">Making cross-thread calls using runnables</a>.</li>
  <li>Firefox 11 changed the behavior of <a href="/en-US/docs/Components.utils.getWeakReference" title="Components.utils.getWeakReference"><code>Components.utils.getWeakReference()</code></a> to throw an exception when the object reference is null; the previous behavior of silently failing has been restored.</li>
</ul>
<h3 id="XPConnect">XPConnect</h3>
<ul>
  <li>The <a href="/en-US/docs/PRUint64" title="PRUint64"><code>PRUint64</code></a> data type was incorrectly essentially identical to <a href="/en-US/docs/PRInt64" title="PRInt64"><code>PRint64</code></a> when used with XPConnect. This has been fixed.</li>
</ul>
<h3 id="Interface_changes">Interface changes</h3>
<ul>
  <li>The <code>nsIScreen_MOZILLA_2_0_BRANCH</code> interface has been merged into {{interface("nsIScreen")}}. The APIs defined in that interface (for controlling minimum screen brightness) had not previously been documented, but now they are.</li>
  <li>The {{interface("nsIScriptError2")}} interface has been merged into {{interface("nsIScriptError")}}.</li>
  <li>{{ifmethod("nsIDownloadManager", "addDownload")}} is now handled asynchronously rather than synchronously.</li>
  <li>The {{ifmethod("imgIContainerObserver", "frameChanged")}} method now receives as its first parameter an {{interface("imgIRequest")}} object identifying the corresponding request.</li>
  <li>The {{ifmethod("nsIDOMWindowUtils", "sendTouchEvent")}} method has been added to allow synthesizing touch events.</li>
  <li>You can now scroll the specified content to the vertical center of the view by specifying <code>SCROLL_CENTER_VERTICALLY</code> as the scroll constant when calling {{ifmethod("nsISelectionController", "scrollSelectionIntoView")}}.</li>
  <li>The new {{ifattribute("nsIMemoryMultiReporter", "explicitNonHeap")}} attribute has been added; this is a more efficient way to obtain the sum of all of the multi-reporter's measurements that have a path that starts with "explicit" <strong>and</strong> are of the kind <code>KIND_NONHEAP</code>.</li>
  <li>The {{ifattribute("nsIDOMWindowUtils", "paintingSuppressed")}} attribute has been added; this boolean value indicates whether or not painting is currently suppressed on the window. This is used on mobile to prevent bouncy rendering that occurs when attempts to draw the page begin before enough content is available to do so smoothly.</li>
  <li>The <code>nsIDocCharset</code> and <code>nsIDocumentCharsetInfo</code> interfaces have been merged into {{interface("nsIDocShell")}}. As part of this work, the old <code>forcedDetector</code> attribute has been removed; it never did anything.</li>
</ul>
<h3 id="SpiderMonkey">SpiderMonkey</h3>
<ul>
  <li><code>JSThread</code> has been eliminated.</li>
  <li><code>JSThreadData</code> has been merged into <code>JSRuntime</code>.</li>
</ul>
<h3 id="Building">Building</h3>
<ul>
  <li>When building on Windows, you must have the Windows 7 SDK installed.</li>
</ul>
<h3 id="Other_changes">Other changes</h3>
<ul>
  <li>The editor component (known as <a href="/en-US/docs/Midas" title="Midas">Midas</a>) now <a href="/en-US/docs/Using_the_Editor_from_XUL#Editor_event_handling" title="en-US/docs/Using_the_Editor_from_XUL#Editor_event_handling">only accepts events</a> from privileged code.</li>
</ul>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/Firefox_11_for_developers" title="Firefox 11 for developers">Firefox 11 for developers</a></li>
  <li><a href="/en-US/docs/Firefox_10_for_developers" title="en-US/docs/Firefox 10 for developers">Firefox 10 for developers</a></li>
  <li><a href="/en-US/docs/Firefox_9_for_developers" title="en-US/docs/Firefox 9 for developers">Firefox 9 for developers</a></li>
  <li><a href="/en-US/docs/Firefox_8_for_developers" title="en-US/docs/Firefox 8 for developers">Firefox 8 for developers</a></li>
  <li><a href="/en-US/docs/Firefox_7_for_developers" title="en-US/docs/Firefox 7 for developers">Firefox 7 for developers</a></li>
  <li><a href="/en-US/docs/Firefox_6_for_developers" title="en-US/docs/Firefox 6 for developers">Firefox 6 for developers</a></li>
  <li><a href="/en-US/docs/Firefox_5_for_developers" title="en-US/docs/Firefox 5 for developers">Firefox 5 for developers </a></li>
  <li><a href="/en-US/docs/Firefox_4_for_developers" title="en-US/docs/Firefox 4 for developers">Firefox 4 for developers </a></li>
  <li><a href="/en-US/docs/Firefox_3.6_for_developers" title="en-US/docs/Firefox 3.6 for developers">Firefox 3.6 for developers </a></li>
  <li><a href="/en-US/docs/Firefox_3.5_for_developers" title="en-US/docs/Firefox 3.5 for developers">Firefox 3.5 for developers</a></li>
  <li><a href="/en-US/docs/Firefox_3_for_developers" title="en-US/docs/Firefox 3 for developers">Firefox 3 for developers</a></li>
  <li><a href="/en-US/docs/Firefox_2_for_developers" title="en-US/docs/Firefox 2 for developers">Firefox 2 for developers</a></li>
  <li><a href="/en-US/docs/Firefox_1.5_for_developers" title="en-US/docs/Firefox 1.5 for developers">Firefox 1.5 for developers</a></li>
</ul>
Revert to this revision