aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/mozilla/firefox/releases/10/index.html
blob: 1226e5de82187ef2907e6dfa32b7d706d40405b3 (plain)
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
---
title: Firefox 10 技術文件
slug: Mozilla/Firefox/Releases/10
translation_of: Mozilla/Firefox/Releases/10
---
<div>{{FirefoxSidebar}}</div>

<p>Firefox 10 shipped on January 31, 2012. 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>

<p>This documentation is not yet complete. Want to help document Firefox 10? See the <a class="external" href="http://beta.elchi3.de/doctracker/#list=fx&amp;version=10.0" title="http://beta.elchi3.de/doctracker/#list=fx&amp;version=10.0">list of bugs that need to be written about</a> and pitch in!</p>

<div class="note"><strong>Important note: </strong>Firefox 10 is the first release of this browser with two digits. This may lead to problem with some UA-sniffing scripts. Be sure to check them, and those contained in 3rd-party software you embed in your pages, like libraries. For more information about this, look at the <a class="external" href="http://hacks.mozilla.org/2012/01/firefox-goes-2-digit-time-to-check-your-ua-sniffing-scripts/" title="http://hacks.mozilla.org/2012/01/firefox-goes-2-digit-time-to-check-your-ua-sniffing-scripts/">Firefox goes 2-digit article on hack.mozilla.org</a>.</div>

<h2 id="Changes_for_Web_developers">Changes for Web developers</h2>

<h3 id="HTML">HTML</h3>

<ul>
 <li>The new HTML5 {{ HTMLElement("bdi") }} element, bi-directional isolation, allowing isolation of parts of text with a different directionality has been implemented. This is especially useful when displaying text with an unknown directionality, coming from a database for example, in the middle of text with a known, and potentially, different one.</li>
 <li>You may now specify a fragment of "top" for the {{ htmlattrxref("href", "a") }} attribute to create a link to the top of the page. This used to work, then went away for a while, and now it's back, for compatibility with the HTML5 specification. For example: <code>&lt;a href="#top"&gt;Return to top of page&lt;/a&gt;</code>.</li>
</ul>

<h3 id="JavaScript">JavaScript</h3>

<ul>
 <li>The method <code><a href="/en/JavaScript/Reference/Global_Objects/WeakMap" title="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/WeakMap">WeakMap</a>.set()</code> now returns <em><code>undefined</code></em>, instead of itself.</li>
 <li>A bug was introduced in regular expression handling in Firefox 7; this has been fixed. See {{ bug(683838) }} if you want the gory details.</li>
 <li>You can no longer use <a href="/en/E4X" title="E4X">E4X</a> syntax while in <a href="/en/JavaScript/Reference/Functions_and_function_scope/Strict_mode" title="Strict mode">ECMAScript 5 strict mode</a> (that is, after <code>"use strict;"</code>).</li>
</ul>

<h3 id="DOM">DOM</h3>

<h4 id="DOM3_Events">DOM3 Events</h4>

<ul>
 <li>The DOM Event method <a href="/en/DOM/event.stopImmediatePropagation" title="event.stopImmediatePropagation"><code>event.stopImmediatePropagation</code></a> has been implemented.</li>
 <li>The mouse events <code>mouseenter</code> and <code>mouseleave</code> have been implemented.</li>
</ul>

<h4 id="DOM4">DOM4</h4>

<ul>
 <li>The attribute {{ domxref("document.xmlVersion") }} (which was only gettable and not settable) has been removed as it has been deprecated in the DOM4 specification. The article for {{ domxref("document.xmlVersion") }} now suggests a way to detect whether the document is HTML or XML without using that property.</li>
 <li>The attribute {{ domxref("document.xmlStandalone") }} has been removed as it has been deprecated in the DOM4 specification.</li>
 <li>The attribute {{ domxref("document.xmlEncoding") }} has been removed as it has been deprecated in the DOM4 specification.</li>
 <li>The attribute {{ domxref("text.isElementContentWhiteSpace") }} has been removed as it has been deprecated in the DOM4 specification.</li>
 <li>The method {{ domxref("text.replaceWholeText") }} has been removed as it has been deprecated in the DOM4 specification.</li>
 <li>The method {{ domxref("node.isSameNode") }} has been removed as it has been deprecated in the DOM4 specification. Instead of <code><em>node1</em>.isSameNode(<em>node2</em>)</code>, you can simply use the <code>===</code> operator, like this: <code><em>node1 </em>===</code><code><em> node2</em></code>.</li>
</ul>

<h4 id="Page_Visibility_API">Page Visibility API</h4>

<ul>
 <li>The <a href="/en/DOM/Using_the_Page_Visibility_API" title="Using the Page Visibility API">Page Visibility API</a> has been implemented (prefixed): <code>document.mozHidden</code>, <code>document.mozVisibilityState</code> are available and the event <code>mozvisibilitychanged</code> is sent when the state is modified.</li>
</ul>

<h4 id="Full_Screen_API">Full Screen API</h4>

<ul>
 <li>Support for {{ domxref("document.mozFullScreenEnabled") }} has been added.</li>
 <li>The new {{ cssxref(":-moz-full-screen-ancestor") }} property has been added. This lets you match against elements that are ancestors of an element in full screen mode.</li>
</ul>

<h4 id="Battery_API">Battery API</h4>

<ul>
 <li>Experimental support for {{ domxref("window.navigator.mozBattery") }} has been added (can be enabled setting the preference <code>dom.battery.enabled</code> to <code>true</code> and will be enabled by default starting with Firefox 11).</li>
</ul>

<h4 id="Canvas">Canvas</h4>

<ul>
 <li>The <a href="/en/DOM/CanvasRenderingContext2D#createPattern%28%29" title="en/DOM/CanvasRenderingContext2D#createPattern%28%29"><code>createPattern()</code></a> method now throws an exception if a zero-sized source canvas is specified.</li>
 <li>If you use a non-finite value for any of the numeric parameters to <a href="/en/DOM/CanvasRenderingContext2D#putImageData%28%29" title="en/DOM/CanvasRenderingContext2D#putImageData%28%29"><code>putImageData()</code></a>, the call is now silently ignored instead of throwing an exception, in keeping with the specification.</li>
</ul>

<h4 id="WebGL">WebGL</h4>

<ul>
 <li>Firefox 10 now supports the <a class="external" href="http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/" title="http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/"><code>OES_standard_derivatives</code></a> extension.</li>
 <li><a href="/en/WebGL#WebGL_debugging_and_testing" title="en/WebGL#WebGL_debugging_and_testing">New preferences have been added</a> to help test WebGL code for compatibility with minimally-capable devices on your full development platform.</li>
</ul>

<h4 id="Web_Workers">Web Workers</h4>

<ul>
 <li>The attribute <code>XMLHttpRequest.responseType</code> and <code>XMLHttpRequest.response</code> are now available from inside <a href="/en/DOM/Worker/Functions_available_to_workers#section_2" title="https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers#section_2">Workers</a>.</li>
 <li>The <a href="/en/DOM/Worker#Worker()" title="En/DOM/Worker#Worker()"><code>Worker()</code></a> constructor now accepts <a href="/en/data_URIs" title="data URIs">data URIs</a>.</li>
</ul>

<h4 id="IndexedDB">IndexedDB</h4>

<p>Great progress has been made to update IndexedDB to the latest draft specification. This effort will continue in Firefox 11.</p>

<ul>
 <li>The <a href="/en/IndexedDB/IDBIndex#count" title="en/IndexedDB/IDBIndex#count"><code>IDBIndex.count()</code></a> and <a href="/en/IndexedDB/IDBObjectStore#count" title="en/IndexedDB/IDBObjectStore#count"><code>IDBObjectStore.count()</code></a> methods have been added.</li>
 <li>The <a href="/en/IndexedDB/IDBCursor#advance" title="en/IndexedDB/IDBCursor#advance"><code>IDBCursor.advance()</code></a> method has been added.</li>
 <li>When encountering an unknown optional parameter in <a href="/en/IndexedDB/IDBObjectStore#createIndex" title="https://developer.mozilla.org/en/IndexedDB/IDBObjectStore#createIndex"><code>IDBObjectStore.createIndex()</code></a> or <a href="/en/IndexedDB/IDBDatabase#createObjectStore" title="en/IndexedDB/IDBDatabase#createObjectStore"><code>IDBDatabase.createObjectStore()</code></a>, Gecko will not fire an exception anymore, but simply ignore it.</li>
 <li>When <a href="/en/IndexedDB/IDBTransaction#abort%28%29" title="https://developer.mozilla.org/en/IndexedDB/IDBTransaction#abort%28%29"><code>IDBTransaction.abort()</code></a> is called, all pending <a href="/en/IndexedDB/IDBRequest" title="IDBRequest"><code>IDBRequest</code></a> have their <code>errorCode</code> set to <code>ABORT_ERROR</code>.</li>
 <li>The methods <a href="/en/IndexedDB/IDBObjectStore#delete()" title="en/IndexedDB/IDBObjectStore#delete()"><code>IDBObjectStore.delete()</code></a> and <a href="/en/IndexedDB/IDBCursor#delete()" title="en/IndexedDB/IDBCursor#delete()"><code>IDBCursor.delete()</code></a> now set the <code>result</code> attribute of the returned <a href="/en/IndexedDB/IDBRequest" title="en/IndexedDB/IDBRequest"><code>IDBRequest</code></a> to <code>undefined</code>.</li>
 <li>The method <a href="/en/IndexedDB/IDBDatabase#setVersion()" title="en/IndexedDB/IDBDatabase#setVersion()"><code>IDBDatabase.setVersion()</code></a> has been removed as it was removed from the latest spec. The version of the database is given through the <a href="/en/IndexedDB/IDBFactory#open" title="en/IndexedDB/IDBFactory#open"><code>IDBFactory.open()</code></a> method which has been updated and the <code>onupgradeneeded </code>callback allows the schema of the database to be upgraded. The version itself has been changed from a <code>DOMString</code> to an <code>unsigned long long</code>. The <a href="/en/IndexedDB/IDBVersionChangeRequest" title="en/IndexedDB/IDBVersionChangeRequest"><code>IDBVersionChangeRequest</code></a> interface has been removed and replaced by the new <a href="/en/IndexedDB/IDBOpenDBRequest" title="en/IndexedDB/IDBOpenDBRequest"><code>IDBOpenDBRequest</code></a> interface.</li>
 <li>The method <a href="/en/IndexedDB/IDBFactory#deleteDatabase%28%29" title="en/IndexedDB/IDBFactory#deleteDatabase%28%29"><code>IDBFactory.deleteDatabase()</code></a> method has been added.</li>
</ul>

<h4 id="Other">Other</h4>

<ul>
 <li>When the proper MIME type is passed, <code>image/svg+xml</code>, <a href="/en/DOM/DOMParser#Parsing_a_SVG_document" title="https://developer.mozilla.org/en/DOM/DOMParser#Parsing_a_SVG_document">the <code>DOMParser</code> now creates a <code>SVGDocument</code></a> when given a string with SVG.</li>
 <li>In the past, when {{ domxref("element.setAttribute()") }} parsed integers, it would report an error if the integer included any non-numeric characters (for example "42foo"). Now it correctly truncates this as the number 42, in accordance with the specification.</li>
 <li>The ESC key no longer incorrectly results in the {{ domxref("window.oninput") }} handler incorrectly getting called.</li>
 <li>The {{ domxref("NameList") }} interface is no longer implemented; it previously had an implementation with no way to actually get access to one.</li>
 <li>The {{ domxref("document.createProcessingInstruction()") }} method now works on HTML documents as well as XML documents. {{ domxref("ProcessingInstruction") }} nodes are still only supported on XML documents, but since nodes can be moved among documents, it's helpful to be able to create them on HTML documents as well.</li>
 <li>The {{ domxref("XMLHttpRequest") }} <code>responseType</code> "<code>moz-json</code>" <a href="/en/Firefox_9_for_developers#DOM" title="en/Firefox_9_for_developers#DOM">introduced in Firefox 9</a> has been updated to the latest draft of the specification and has been unprefixed. See {{ bug("707142#c13") }}</li>
</ul>

<h3 id="CSS">CSS</h3>

<ul>
 <li>CSS 3D Transforms are now supported. This includes support for the {{ cssxref("transform-style") }}, {{ cssxref("perspective") }}, {{ cssxref("perspective-origin") }} and {{ cssxref("backface-visibility") }} properties, as well as for 3D transform functions in the {{ cssxref("transform") }} and {{ cssxref("transform-function") }} properties. See <a href="/En/CSS/Using_CSS_transforms#3D_specific_CSS_properties" title="En/CSS/Using_CSS_transforms#3D_specific_CSS_properties">Using CSS transforms</a> for details.</li>
 <li>Two new values for the CSS property {{ cssxref("unicode-bidi") }} have been added: <code>-moz-isolation</code> and <code>-moz-plaintext</code>. The <code>-moz-isolation</code> value isolates, from a directionality point of view, the element from its environment, letting it have a different directionality. An element with <code>unicode-bidi:-moz-isolation</code> behaves like a {{ HTMLElement("bdi") }} element. The <code>-moz-plaintext</code> indicates the browser to use the Unicode browser heuristic to determine directionality and not the CSS {{ cssxref("direction") }} property.</li>
 <li>The CSS {{ cssxref("linear-gradient") }} and {{ cssxref("repeating-linear-gradient") }} properties have been updated to support the new <code>to</code> syntax and the <em>magic corner</em> algorithm. This allows to give a precise color on the corner of a gradient-filled box.</li>
 <li>The {{ cssxref("text-overflow") }} property's handling of cases in which the box overflows on both sides while the <code>text-overflow</code> property is set to overflow on only one <a href="/en/CSS/text-overflow#Gecko_notes" title="en/CSS/text-overflow#Gecko_notes">has been corrected</a>.</li>
 <li>Handling of the {{ cssxref("position") }} property on elements inside positioned {{ HTMLElement("table") }} elements <a href="/en/CSS/position#Gecko_notes" title="en/CSS/position#Gecko_notes">has been fixed</a>. <strong>This change will affect layout of pages; however, we now comply with the CSS specification and with other browsers, so this should be easy to fix.</strong></li>
 <li>Margin collapsing around {{ HTMLElement("table") }} elements has been fixed to match the CSS specification. Previously, table elements' margins would not be collapsed along with other adjacent elements, leading to incorrect layout. <strong>This change will affect layout of pages; however, we now comply with the CSS specification and with other browsers, so this should be easy to fix.</strong></li>
</ul>

<h3 id="SVG">SVG</h3>

<ul>
 <li>The {{ SVGElement("mask") }} element has been updated to support both sRGB and linearRGB, and now defaults to sRGB, in compliance with the latest revision of the SVG 1.1 specification.</li>
</ul>

<h3 id="Networking">Networking</h3>

<ul>
 <li>The HTTP <code>Accept-Charset</code> header is no longer sent in HTTP requests. In its absence, servers should respond by sending UTF-8.</li>
</ul>

<h3 id="Developer_tools">Developer tools</h3>

<ul>
 <li>The {{ domxref("console") }} object has two new methods,  {{ domxref("console.time()") }} and {{ domxref("console.timeEnd()") }}, which can be used to set timers on a page.</li>
 <li>The new <a href="/en/Tools/Page_Inspector" title="Page Inspector">Page Inspector</a> has been added, providing an excellent way to examine and manipulate the HTML and CSS behind your content.</li>
</ul>

<h2 id="Changes_for_Mozilla_and_add-on_developers">Changes for Mozilla and add-on developers</h2>

<p>For an overview of likely issues that may arise when updating your add-ons to support Firefox 10, see <a href="/en/Firefox/Updating_add-ons_for_Firefox_10" title="en/Firefox/Updating_add-ons_for_Firefox_10">Updating add-ons for Firefox 10</a>.</p>

<div class="note"><strong>Note:</strong> The old <a href="/en/PRBool" title="PRBool"><code>PRBool</code></a> data type has been retired! Anywhere in the documentation that refers to it now uses the standard C++ <code>bool</code> type instead. Documentation will be updated in the future, but for now, just keep this in mind.</div>

<h3 id="Manifests">Manifests</h3>

<ul>
 <li>Support for <a href="/en/Install_Manifests#strictCompatibility" title="en/Install_Manifests#strictCompatibility"><code>&lt;em:strictCompatibility&gt;</code></a> has been added to the install manifest. It allows add-ons authors to opt in to checking the maximum version of their extension. If set to <code>true</code> the add-on will be disabled if the application version is greater than <code>&lt;em:maxVersion&gt;</code>. Firefox 10 defaults to add-ons being compatible, regardless of their specified maximum version. This flag overrides that preference. You should set this if your add-on does things that are likely to be broken by Firefox updates, <strong>but not</strong> if your add-on has a binary component, since such add-ons always get strictly checked (remember that binary components must always be recompiled for each major Firefox release).</li>
 <li>If you wish to revert to the old behavior -- that is, to strict compatibility checking for all add-ons, regardless of the value of the <code>strictCompatibility</code> flag in their manifests, you can set the <code>extensions.strictCompatibility</code> preference to <code>true</code>.</li>
</ul>

<h3 id="XUL">XUL</h3>

<ul>
 <li>Bootstrapped add-ons using a <a href="/en/Chrome_Registration" title="en/chrome.manifest">chrome.manifest</a> file now have the manifest file registered automatically. See the section <a href="/en/Extensions/Bootstrapped_extensions#Adding_user_interface_with_a_chrome.manifest" title="en/Extensions/Bootstrapped_extensions#Adding_user_interface_with_a_chrome.manifest">Adding user interface with a chrome.manifest</a> for details.</li>
</ul>

<h3 id="XPConnect">XPConnect</h3>

<ul>
 <li>Several new properties and methods have been added to <a href="/en/Components.utils" title="Components.utils"><code>Components.utils</code></a>, granting access to assorted debugging-related information.</li>
</ul>

<h3 id="Interface_changes">Interface changes</h3>

<ul>
 <li>The {{ interface("mozISpellCheckingEngine") }} and {{ interface("nsIEditorSpellCheck") }} interfaces have been updated to allow restartless add-ons to add dictionaries to the spell checker. <strong>XXX need to <a href="/En/Using_an_External_Spell-checker" title="en/Using_an_External_Spell-checker">update docs</a> on how to actually do this.</strong></li>
 <li>The {{ ifattribute("nsIBrowserHistory", "lastPageVisited") }} attribute has been removed.</li>
 <li>The <code>nsIDocumentViewer</code> interface has been merged into {{ interface("nsIContentViewer") }}.</li>
 <li>The {{ interface("nsIURIFixup") }} interface has a new flag, <code>FIXUP_FLAG_USE_UTF8</code>, which lets you tell it to use UTF-8 instead of the platform character set, when doing conversions.</li>
</ul>

<h3 id="Plug-in_changes">Plug-in changes</h3>

<ul>
 <li>The <a href="/en/Gecko_Plugin_API_Reference/Plug-in_Development_Overview#Working_with_URLs" title="en/Gecko_Plugin_API_Reference/Plug-in_Development_Overview#Working_with_URLs">new variable <code>NPNVdocumentOrigin</code></a> has been added; this returns the document origin, and is more secure than {{ domxref("window.location") }}.</li>
</ul>

<h3 id="Build_system_changes">Build system changes</h3>

<ul>
 <li>The <code>--disable-rdf</code> build option, which actually made it impossible to successfully build, has been removed. Work is ongoing on being able to actually remove RDF support entirely, but at present XUL still requires it to function. See {{ bug(559505) }} for progress on removing the last vestiges of RDF being required.</li>
 <li>The <code>--disable-smil</code> build option has been removed.</li>
</ul>

<h3 id="See_also">See also</h3>

<ul>
 <li><a href="/en/Firefox_9_for_developers" title="en/Firefox 9 for developers">Firefox 9 for developers</a></li>
 <li><a href="/en/Firefox_8_for_developers" title="en/Firefox 8 for developers">Firefox 8 for developers</a></li>
 <li><a href="/en/Firefox_7_for_developers" title="en/Firefox 7 for developers">Firefox 7 for developers</a></li>
 <li><a href="/en/Firefox_6_for_developers" title="en/Firefox 6 for developers">Firefox 6 for developers</a></li>
 <li><a href="/en/Firefox_5_for_developers" title="en/Firefox 5 for developers">Firefox 5 for developers </a></li>
 <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 href="/En/Firefox_3.5_for_developers" title="en/Firefox 3.5 for developers">Firefox 3.5 for developers</a></li>
 <li><a href="/en/Firefox_3_for_developers" title="en/Firefox 3 for developers">Firefox 3 for developers</a></li>
 <li><a href="/en/Firefox_2_for_developers" title="en/Firefox 2 for developers">Firefox 2 for developers</a></li>
 <li><a href="/en/Firefox_1.5_for_developers" title="en/Firefox 1.5 for developers">Firefox 1.5 for developers</a></li>
</ul>

<p>{{ languages( { "ja": "ja/Firefox_10_for_developers" } ) }}</p>