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
|
---
title: Firefox 15 for developers
slug: Mozilla/Firefox/Releases/15
tags:
- Firefox
- Firefox 15
- Gecko 15
translation_of: Mozilla/Firefox/Releases/15
---
<div>{{FirefoxSidebar}}</div><p>Firefox 15 shipped on August 28, 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="Changes_for_Web_developers">Changes for Web developers</h2>
<h3 id="HTML">HTML</h3>
<ul>
<li>The <code>size</code> attribute of the {{ HTMLElement("font") }} element is now handled according the HTML5 spec. It means that all integer greater than 10 or smaller than -10 are now considered equivalent to 10, respectively -10.</li>
<li>Support for <code>font-weight</code> and <code>point-size</code> attributes on the <code><font></code> element has been removed; these were non-standard and Gecko was the only engine supporting them.</li>
<li>The <a class="external" href="http://www.opus-codec.org/">Opus codec</a> is now supported for audio in Ogg containers for the HTML {{ HTMLElement("audio") }} and {{ HTMLElement("video") }} elements.</li>
<li>The {{ HTMLElement("source") }} element now supports the <code>media</code> attribute.</li>
<li>The {{ HTMLElement("audio") }} and {{ HTMLElement("video") }} elements now support the played attribute, which provides a {{ domxref("TimeRanges") }} object listing the time ranges of the media that have been played back so far.</li>
</ul>
<h3 id="CSS">CSS</h3>
<ul>
<li>The {{ cssxref("font-feature-settings") }} property has been updated to the latest syntax: <code>font-feature-settings: "lnum" 1;</code></li>
<li>The CSS {{ cssxref("text-transform") }} property has been extended to correctly handle Unicode ligature characters (like <code>?</code>).</li>
<li>The CSS {{ cssxref("word-break") }} property has been implemented.</li>
<li>The {{ cssxref("border-image") }} property has been updated to match the latest Specification and properties have been unprefixed. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=713643">bug 713643</a>)</li>
<li>The <code>skew()</code> {{cssxref("transform")}} function dropped in Firefox 14 has been restored due to existing site compatibility. Authors are however, advised to use <code>skewX()</code> and <code>skewY(</code>) functions instead.</li>
<li>The value <code>plaintext</code> of CSS {{cssxref("unicode-bidi")}} property now applies to inline elements too. ({{bug("746987")}}).</li>
</ul>
<h3 id="DOM">DOM</h3>
<ul>
<li>The DOM Events Level 3 methods <a href="/zh-cn/DOM/KeyboardEvent#getModifierState%28%29" title="https://developer.mozilla.org/zh-cn/DOM/KeyboardEvent#getModifierState%28%29"><code>KeyboardEvent.getModifierState()</code></a> and <a href="/zh-cn/DOM/MouseEvent#getModifierState%28%29" title="https://developer.mozilla.org/zh-cn/DOM/MouseEvent#getModifierState%28%29"><code>MouseEvent.getModifierState()</code></a>, which let you query the state of modifier keys, like <code>Ctrl</code> or <code>Shift</code>, have been implemented (bugs <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=630811">630811</a> and <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=731878">731878</a>). But the behavior conforms to the latest D3E draft. So, some modifier key names are different from IE ({{ bug("769190") }}).</li>
<li>On mouse events, support for querying the state of the mouse buttons using the <a href="/zh-cn/DOM/MouseEvent" title="zh-cn/DOM/MouseEvent"><code>MouseEvent.buttons</code></a> attribute, has been implemented.</li>
<li>On keyboard events, support for querying the key location (standard, left or right of modifier key, in the Numpad) using the <a href="/zh-cn/DOM/KeyboardEvent#Attributes_location" title="https://developer.mozilla.org/zh-cn/DOM/KeyboardEvent#Attributes_location">KeyboardEvent.location</a> attribute, has been implemented ({{ bug("166240") }}).</li>
<li>KeyboardEvent.keycode result has been computed from better rules which were almost same on Windows/Linux/Mac. And now they are available on some keyboard layouts which are not ASCII capable layouts on Linux and Mac, such as Arabic, Cyrillic, Thai and so on. See <a href="/zh-cn/DOM/KeyboardEvent#Virtual_key_codes" title="zh-cn/DOM/KeyboardEvent#Virtual_key_codes">the document for virtual key codes</a>.</li>
<li>The <a href="/zh-cn/DOM/range.detach" title="https://developer.mozilla.org/zh-cn/DOM/range.detach"><code>range.detach()</code></a> method has been transformed in a no-op and will probably be removed in the future.</li>
<li>The method <code>HTMLVideoElement.mozHasAudio()</code> has been implemented. It indicates if there is an audio track associated to a given video element. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=480376">bug </a><a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=480376">480376</a>)</li>
<li>The <code>Performance</code> API has a new method, <code>now()</code>, supporting high resolution timers of type<code> DOMHighResTimeStamp</code>. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=539095">bug 539095</a>).</li>
<li>The <code>Window.java</code> and <code>Window.packages</code> attributes has been removed. These were never documented, and hopefully you're not using them!</li>
<li>The <a href="/zh-cn/API/WebSMS" title="zh-cn/API/WebSMS">WebSMS API</a> has been updated and now supports a <code>read </code>attribute indicating whether an SMS text message is read or unread.</li>
<li>The <a class="link-https" href="https://wiki.mozilla.org/WebAPI/FileHandleAPI">FileHandle API</a> has been implemented.</li>
<li>The <a href="/zh-cn/DOM/Blob" title="zh-cn/DOM/Blob"><code>Blob</code></a> constructor now takes <code>ArrayBufferView</code> as a member of <code><var>blobParts</var></code> parameter in addition to <code>ArrayBuffer</code>. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=752402">bug 752402</a>)</li>
<li>The {{domxref("DeviceLightEvent")}} specified in the <a href="http://www.w3.org/TR/ambient-light/">Ambient Light Events Working Draft</a> has been implemented.</li>
<li>The {{domxref("DeviceProximityEvent")}} and {{domxref("UserProximityEvent")}} <a href="http://www.w3.org/TR/proximity/">Proximity Events</a> have been implemented.</li>
<li>The {{domxref("File")}} <code>lastModifiedDate</code> property has been implemented. ({{bug("673586")}})</li>
</ul>
<h3 id="JavaScript">JavaScript</h3>
<ul>
<li>Support for the <a href="/zh-cn/JavaScript_typed_arrays/DataView" title="/zh-cn/JavaScript_typed_arrays/DataView"><code>DataView</code></a> interface from the Typed Arrays specification has been added. This provides low-level access to the data contained in an <a href="/zh-cn/JavaScript_typed_arrays/ArrayBuffer" title="zh-cn/JavaScript_typed_arrays/ArrayBuffer"><code>ArrayBuffer</code></a>.</li>
<li>Support for new ECMAScript 2015 built-ins: <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/isNaN" title="JavaScript/Reference/Global_Objects/isNaN"><code>Number.isNaN()</code></a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toInteger"><code>Number.toInteger()</code></a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger"><code>Number.isInteger()</code></a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite"><code>Number.isFinite()</code></a> has been added. (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=749818">bug 749818</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=749818">bug 761495</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=749818">bug 761480</a>).</li>
<li>添加了对<code>ES6中的<a href="/zh-CN/docs/Web/JavaScript/Reference/Functions/Default_parameters">默认参数</a></code>的支持. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=757676">bug 757676</a>)</li>
<li>添加了对<code>ES6中的<a href="/zh-CN/docs/Web/JavaScript/Reference/Functions/Rest_parameters">剩余参数</a></code>的支持.(<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=574132">bug 574132</a>)</li>
</ul>
<h3 id="WebGL">WebGL</h3>
<ul>
<li>Support for the <a href="/zh-cn/WebGL/Using_Extensions#WEBGL_compressed_texture_s3tc" title="zh-cn/WebGL/Using_Extensions#WEBGL_compressed_texture_s3tc"><code>WEBGL_compressed_texture_s3tc</code></a> extension has been added. Compressed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures.</li>
</ul>
<h3 id="MathML">MathML</h3>
<ul>
<li>Mathematical operators can now use downloadable fonts specified with {{ cssxref("@font-face") }}. This makes the <a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/mathml-fonts/">MathML-fonts add-on</a> work with stretchy operators too.</li>
<li>The <code>selection</code> attribute of the {{ MathMLElement("maction") }} is now only taken into account with the <code>toggle</code> actiontype.</li>
<li><a class="external" href="http://www.w3.org/TR/MathML3/chapter3.html#id.3.3.4.2.1"><span id="summary_alias_container"><span id="short_desc_nonedit_display">Deprecated namedspace binding</span></span></a> has been removed ({{ bug("673759") }}).</li>
<li>Supported syntax for <a href="/zh-cn/MathML/Attributes/Values" title="Values">Length</a> and {{ MathMLElement("mpadded") }} values have been made closer to the one specified in MathML3 spec.</li>
</ul>
<h3 id="SVG">SVG</h3>
<ul>
<li>Added support for the {{SVGElement("view")}} element ({{bug("512525")}}).</li>
</ul>
<h3 id="Network">Network</h3>
<ul>
<li>Support for the SPDY v3 protocol has landed. It is disabled by default and can be enabled by setting the preference <code>network.http.spdy.enabled.v3</code> to true. (<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=737470">bug 737470</a>)</li>
</ul>
<h2 id="附加组件开发变更">附加组件开发变更</h2>
<h3 id="接口变更">接口变更</h3>
<dl>
<dt>{{ interface("nsIDOMWindowUtils") }}</dt>
<dd><code>aModifiers</code> of <code>sendMouseEvent()</code>, <code>sendTouchEvent()</code>, <code>sendMouseEventToWindow()</code>, <code>sendMouseScrollEvent()</code> and <code>sendKeyEvent()</code> supports all modifier keys which are supported by <a href="/zh-cn/DOM/KeyboardEvent#getModifierState%28%29" title="https://developer.mozilla.org/zh-cn/DOM/KeyboardEvent#getModifierState%28%29"><code>KeyboardEvent.getModifierState()</code></a>. Use <code>MODIFIER_*</code> values. And now the 5th parameter of <code>sendKeyEvent()</code> is changed from <code>boolean</code> to <code>unsigned long</code>. For backward compatibility, if caller passes <code>true</code> or <code>false</code> to it, the behavior isn't changed. This change allows callers to specify the key's location.</dd>
<dt>{{ interface("nsIBrowserHistory") }}</dt>
<dd>The <code>hidePage()</code> method was never implemented, and has been removed entirely in this release. The <code>addPageWithDetails()</code> method has also been removed as part of the ongoing work to make all <a href="/zh-cn/Places" title="zh-cn/Places">Places</a> APIs asynchronous; use {{ ifmethod("mozIAsyncHistory", "updatePlaces") }} instead. Also, the <code>count</code> attribute was removed; it had not returned an actual count in some time (instead, it was simply indicating whether or not any entries existed). You can use {{ ifattribute("nsINavHistoryService", "hasHistoryEntries") }} instead.</dd>
<dt>{{interface("inIDOMUtils")}}</dt>
<dd>The {{ifmethod("inlDOMUtils", "parseStyleSheet")}} method has been added and allows the (re-)parsing of Cascading Style Sheets.</dd>
<dt>{{interface("nsIINIParserWriter")}}</dt>
<dd>The {{ifmethod("nsIINIParserWriter", "writeFile")}} method now accepts a <code>flags</code>property. This currently offers only one option: you can now tell it to write the file in UTF-16 format instead of UTF-8, for better compatibility with Windows and certain installers.</dd>
</dl>
<h4 id="新增接口">新增接口</h4>
<dl>
<dt>{{ interface("nsISpeculativeConnect") }}</dt>
<dd>Provides a way to hint to the networking layer that you are likely to ask to open a connection to a given URI sometime in the near future. This lets the network layer begin the sometimes high-latency process of opening a new network connection ahead of time.</dd>
</dl>
<h4 id="移除接口">移除接口</h4>
<p>The following interfaces have been removed.</p>
<ul>
<li>{{ interface("nsIGlobalHistory") }}</li>
</ul>
<h2 id="相关链接">相关链接</h2>
<p>{{Firefox_for_developers('14')}}</p>
|