1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
---
title: Firefox 12 for developers
slug: Mozilla/Firefox/Releases/12
tags:
- Firefox
- Firefox 12
- Gecko 12
- Web Developement
translation_of: Mozilla/Firefox/Releases/12
---
<div>{{FirefoxSidebar}}</div>
<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>
<li>{{jsxref("ArrayBuffer.prototype.slice()")}} has been implemented.</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 <code>input</code> event is now sent whenever the contents of the element being edited have been changed; this happens after the <code>compositionupdate</code> event has been sent to indicate that the IME's text has been changed. You can use the <code>input</code> 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>
<li>Screen brightness API: {{domxref("window.screen.mozEnabled")}} and {{domxref("window.screen.mozBrightness")}} have been added to control the device's screen.</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/" 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>
<div>{{Firefox_for_developers('11')}}</div>
|