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
|
---
title: Firefox 16 for developers
slug: Mozilla/Firefox/Releases/16
tags:
- Firefox
- Firefox 16
translation_of: Mozilla/Firefox/Releases/16
---
<div>{{FirefoxSidebar}}</div><p>Firefox 16 shipped on October 9, 2012. This article lists key changes that are useful for not only Web developers to know about, but also Firefox and Gecko developers as well as add-on developers.</p>
<h2 id="Web开发">Web开发</h2>
<h3 id="HTML">HTML</h3>
<ul>
<li>The {{HTMLElement("meter")}} element is now supported.</li>
<li>Support for the HTML Microdata API has been added. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=591467">bug 591467</a>)</li>
<li>{{HTMLElement("canvas")}} now supports the CSS <code>currentColor</code> in all case. ({{bug("629882")}})</li>
<li>{{HTMLElement("input")}} now allows filtering based on arbitrary mimetypes in <code>accept</code> ({{bug("565274")}}).</li>
<li>Two new attributes, <code>width</code> and <code>height</code> have been added to the {{HTMLElement("input")}} element (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=683855">bug 683855</a>).</li>
</ul>
<h3 id="CSS">CSS</h3>
<ul>
<li>实现了标准的不带前缀的 <a href="/En/CSS/Using_CSS_transforms" title="En/CSS/Using_CSS_transforms">CSS Transforms</a>. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=745523">bug 745523</a>)</li>
<li>Support for reverse animation direction (keywords <code>reverse</code> and <code>alternate-reverse</code> on the {{cssxref("animation-direction")}} property) has been added. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=655920">bug 655920</a>).</li>
<li>You can now animate the CSS {{cssxref("height")}} and {{cssxref("width")}} properties.</li>
<li>The {{cssxref("animation-duration")}} and {{cssxref("transition-duration")}} CSS properties now reject negative values (and do not handle them as <code>0s</code> anymore) (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=773102" title="https://bugzilla.mozilla.org/show_bug.cgi?id=773102">bug 773102</a>).</li>
<li>Support for the standard, unprefixed version of <a href="https://developer.mozilla.org/en-US/docs/CSS/Using_CSS_transforms" title="CSS/Using_CSS_transforms">CSS Transforms</a> has been landed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=745523">bug 745523</a>). {{cssxref("<length>")}} cannot be used for translation values in <code>matrix()</code> and <code>matrix3d()</code> anymore ({{bug(719054)}}).</li>
<li>Support for the standard, unprefixed version of <a href="https://developer.mozilla.org/en-US/docs/CSS/Using_CSS_gradients" title="CSS/Using_CSS_gradients">CSS Gradients</a> has been landed. Note that the syntax has changed significantly since the prefixed version, so you should read up on this (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=752187">bug 752187</a>).</li>
<li>The {{cssxref("box-sizing", "-moz-box-sizing")}} implementation has been updated to apply to table cells too (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=338554">bug 338554</a>).</li>
<li>Support for the standard, unprefixed version of {{cssxref("calc")}} has been landed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=771678" title="https://bugzilla.mozilla.org/show_bug.cgi?id=771678">bug 771678</a>).</li>
<li>The {{cssxref("<resolution>")}} CSS data type has been extended to support the <code>dppx</code>(<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=741644" title="https://bugzilla.mozilla.org/show_bug.cgi?id=741644">bug 741644</a>).</li>
<li>On screen, for <a href="https://developer.mozilla.org/en-US/docs/CSS/Media_queries" title="CSS/Media_queries">media queries</a>, <code>dppx</code>, <code>dpi</code>, and <code>dpcm</code> are now representing values based on CSS pixels and no more with the physical units (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=771390" title="https://bugzilla.mozilla.org/show_bug.cgi?id=771390">bug 771390</a>).</li>
<li>Three new pseudo-classes <code>:-moz-meter-optimum</code>, <code>:-moz-meter-sub-optimum</code>, and <code>:-moz-meter-sub-sub-optimum</code> have been added for accessing/styling a {{HTMLElement("meter")}} element in a paraticular state (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=660238" title="https://bugzilla.mozilla.org/show_bug.cgi?id=660238">bug 660238</a>).</li>
<li>The {{cssxref("-moz-appearance")}} property gains two new values: <code>meterbar</code> and <code>meterchunk</code>. They represent components inside the {{HTMLElement("meter")}} element (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=659999" title="https://bugzilla.mozilla.org/show_bug.cgi?id=659999">bug 659999</a>).</li>
<li>The {{cssxref("min-width")}} and {{cssxref("min-height")}} now supports the <code>auto</code>keyword for flex items (and resolves to <code>0</code> for other items) ({{bug("763689")}}).</li>
</ul>
<h3 id="APIDOM">API/DOM</h3>
<ul>
<li>在{{ domxref("HTMLInputElement") }} 接口上添加了两个新的 <code>width</code> 和 <code>height</code>属性 . (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=683855">bug 683855</a>)</li>
<li>IndexedDB 属性和方法取消前缀. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=726378">bug 726378</a>)</li>
<li>The <a href="https://developer.mozilla.org/en-US/docs/DOM/window.navigator.battery" title="DOM/window.navigator.battery">Battery API</a> is now unprefixed.</li>
<li>The Vibration API has been unprefixed.</li>
<li>The non-standard <code>Keyboard</code> interface, prefixed as <code>mozKeyboard</code>, now has the <code>Keyboard.setSelectedOption()</code> and <code>Keyboard.setValue()</code> methods, as well as the <code>Keyboard.onfocuschange</code>. <em>This interface, only available for Firefox OS, has been removed in Firefox 31.</em></li>
<li>The <a href="https://developer.mozilla.org/en-US/docs/LiveConnect_Reference/java" title="/en-US/docs/LiveConnect_Reference/java"><code>java</code></a> and <a href="https://developer.mozilla.org/en-US/docs/LiveConnect_Reference/Packages" title="/en-US/docs/LiveConnect_Reference/Packages"><code>Packages</code></a> global objects have been removed. See <a href="https://developer.mozilla.org/en-US/docs/LiveConnect" title="/en-US/docs/LiveConnect">LiveConnect</a>.</li>
<li>The <code>CSSRule.type</code> associated with {{domxref("CSSNamespaceRule")}} has been updated from <code>UNKNOWN_RULE</code> (<code>0</code>) to <code>NAMESPACE_RULE</code> (<code>10</code>) (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=765590" title="https://bugzilla.mozilla.org/show_bug.cgi?id=765590">bug 765590</a>).</li>
<li>WebSMS API: {{domxref("SmsRequest")}} has been superseded by the more general {{domxref("DOMRequest")}}.</li>
<li>The non-standard {{domxref("Element.scrollTopMax")}} and {{domxref("Element.scrollLeftMax")}} read-only properties have been added ({{bug(766937)}}).</li>
<li>The second parameter of {{domxref("Blob.blob", "Blob()")}}, when set to <code>null</code> or <code>undefined</code>, is now being handled as an empty dictionary ({{bug(7691119)}}).</li>
</ul>
<h3 id="JavaScript">JavaScript</h3>
<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" title="JavaScript/Reference/Global_Objects/Number"><code>Number</code></a> objects now offer <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite">isFinite</a>()</code>, <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toInteger">toInteger</a>()</code>, and <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger">isInteger</a>()</code> methods. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=761480">bug 761480</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=761495">bug 761495</a>)</li>
<li>The Harmony <a href="http://wiki.ecmascript.org/doku.php?id=harmony:spread" title="http://wiki.ecmascript.org/doku.php?id=harmony:spread">spread operator</a> is now supported in <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array" title="JavaScript/Reference/Global_Objects/Array"><code>Array</code></a> initializers (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=574130">bug 574130</a>). Note it is not yet supported in calls (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=762363" title="https://bugzilla.mozilla.org/show_bug.cgi?id=762363">bug 762363</a>).</li>
<li>The experimental {{jsxref("TypedArray.prototype.move()")}} method has been added (available in Aurora and Nightly channels only) ({{bug(730873)}}).</li>
</ul>
<h3 id="WebGL">WebGL</h3>
<p><em>No change</em></p>
<h3 id="SVG">SVG</h3>
<p><em>No change</em></p>
<h3 id="MathML">MathML</h3>
<p> </p>
<ul>
<li>The <code>lspace</code> and <code>rspace</code> attributes of {{MathMLElement("mo")}} now correctly default to <code>thickmathspace</code>.</li>
</ul>
<p> </p>
<h3 id="网络">网络</h3>
<p> </p>
<h3 id="Developer_tools">Developer tools</h3>
<p> </p>
<ul>
<li>There's now a handy developer toolbar you can access by going to Tools > Web Developer > Developer Toolbar, or by pressing Ctrl-Shift-V (Cmd-Opt-V on Mac OS X). This toolbar offers a command line interface as well as buttons for quickly accessing useful tools. The graphical command line interface (<a href="https://developer.mozilla.org/en-US/docs/Tools/GCLI" title="Tools/GCLI">GCLI</a>) is easy to expand and additional commands are expected in the future. Type "help" to get a list of supported commands.</li>
<li>The Web Console now displays an error count so you can quickly see how much work you have ahead of you.</li>
<li>The Scratchpad now offers a list of recently opened files.</li>
</ul>
<p> </p>
<p> </p>
<h2 id="Changes_for_Open_Web_App_developers">Changes for Open Web App developers</h2>
<ul>
<li>Initial <a href="https://developer.mozilla.org/en-US/docs/Apps/Getting_Started">Open Web App support</a> has been implemented in the desktop versions of Firefox (that is, on Windows, Mac OS X, and Linux).</li>
</ul>
<h2 id="附加组件开发变更">附加组件开发变更</h2>
<h3 id="修改接口">修改接口</h3>
<p>{{interface("nsIPrivateDOMEvent")}} has been merged into {{interface("nsIDOMEvent")}}. ({{bug("761613")}})</p>
<h4 id="新增接口">新增接口</h4>
<h4 id="废弃接口">废弃接口</h4>
|