aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/mozilla/firefox/releases/7/index.html
blob: 3faf9bd9041a98c0a5c63951e5eb72016546fdd7 (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
---
title: Firefox 7 技術文件
slug: Mozilla/Firefox/Releases/7
translation_of: Mozilla/Firefox/Releases/7
---
<div>{{FirefoxSidebar}}</div><p>Firefox 7 shipped on September 27, 2011. This article provides information about the changes that affect developers -- both of web content and of Firefox add-ons.</p>
<h2 id="Changes_for_web_developers">Changes for web developers</h2>
<h3 id="HTML">HTML</h3>
<ul>
 <li>The {{ domxref("HTMLHeadElement") }} <code>profile</code> property has been removed, this property has been deprecated since {{ gecko("2.0") }}.</li>
 <li>The {{ domxref("HTMLImageElement") }} <code>x</code> and <code>y</code> properties have been removed.</li>
 <li>The {{ domxref("HTMLSelectElement") }} <code>add()</code> method <code>before</code> parameter is now optional.</li>
 <li>The {{ HTMLElement("body") }} element's {{ htmlattrxref("background", "body") }} attribute is no longer resolved as a URI; this is in compliance with the current HTML specification.</li>
 <li>The {{ HTMLElement("option") }} element's {{ htmlattrxref("label", "option") }} attribute now reflects the value of the element's text content if the attribute isn't specified.</li>
</ul>
<h4 id="Canvas">Canvas</h4>
<ul>
 <li>As part of the <a class="external" href="http://blog.mozilla.com/joe/2011/04/26/introducing-the-azure-project/">Azure project</a> the Direct2D Azure Backend <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=651858">has been implemented</a> and will significantly improve the performance of the 2D canvas.</li>
 <li>Specifying invalid values when calling <code>setTransform()</code>, <code>bezierCurveTo()</code>, or <code>arcTo()</code> no longer throws an exception; these calls are now correctly silently ignored.</li>
 <li>The <a href="/en/DOM/CanvasRenderingContext2D#isPointInPath()" title="en/DOM/CanvasRenderingContext2D#isPointInPath()"><code>isPointInPath()</code></a> method now correctly considers the transformation matrix when comparing the specified point to the current path.</li>
 <li>Calling <code>strokeRect()</code> with a zero width and height now correctly does nothing.</li>
 <li>Calling <a href="/en/DOM/CanvasRenderingContext2D#drawImage()" title="en/DOM/CanvasRenderingContext2D#drawImage()"><code>drawImage()</code></a> with a zero width or height {{ HTMLElement("canvas") }} now throws <code>INVALID_STATE_ERR</code>.</li>
 <li>Calling <a href="/en/DOM/CanvasRenderingContext2D#drawImage()" title="en/DOM/CanvasRenderingContext2D#drawImage()"><code>drawImage()</code></a> with non-finite coordinates no longer throws an exception.</li>
 <li><code>toDataURL()</code> method now accepts a second argument to control JPEG quality.</li>
 <li>Support for the non-standard <code>globalCompositeOperation</code> operations <code>clear</code> and <code>over</code> has been removed.</li>
 <li><a href="/en/Canvas_tutorial/Applying_styles_and_colors#Shadows" title="en/Canvas_tutorial/Applying_styles_and_colors#Shadows">Shadows</a> are now only drawn for <code>source-over</code> compositing operations.</li>
 <li>You can now configure the fill rule used by canvas by setting the <code>mozFillRule </code><a href="/en/DOM/CanvasRenderingContext2D#Attributes" title="en/DOM/CanvasRenderingContext2D#Attributes">attribute</a> on the context.</li>
 <li>Support for the experimental <code>mozDash</code>, <code>mozDashOffset</code>, <code>mozCurrentTransform</code> and <code>mozCurrentTransformInverse</code> attributes has been added.</li>
 <li>Support for the non-standard methods <code>mozDrawText()</code>, <code>mozMeasureText()</code>, <code>mozPathText()</code> and <code>mozTextAlongPath()</code> has been been removed.</li>
</ul>
<h3 id="CSS">CSS</h3>
<ul>
 <li>{{ cssxref("text-overflow") }} is now supported.</li>
 <li>The {{ cssxref("orient", "-moz-orient") }} property has been fixed so that {{ HTMLElement("progress") }} elements that are vertically oriented have appropriate default dimensions.</li>
</ul>
<h3 id="MathML">MathML</h3>
<ul>
 <li>XLink href has been restored and the MathML3 <code>href</code> attribute is now supported. Developers are encouraged to move to the latter syntax.</li>
 <li>Support for the <code>voffset</code> attribute on {{ MathMLElement("mpadded") }} elements has been added and behavior of <code>lspace</code> attribute has been fixed.</li>
 <li>The top-level {{ MathMLElement("math") }} element now accepts any attributes of the {{ MathMLElement("mstyle") }} element.</li>
 <li>Support for <a class="external" href="http://www.ctan.org/tex-archive/fonts/Asana-Math/">Asana Math</a> fonts has been added.</li>
 <li>The <code>medium</code> line thickness of fraction bars in {{ MathMLElement("mfrac") }} elements has been corrected to match the default thickness.</li>
 <li><a href="/en/MathML/Attributes/Values#Constants_(namedspaces)" title="en/MathML/Attributes/Values#Constants_(namedspaces)">Names for negative spaces</a> are now supported.</li>
</ul>
<h3 id="DOM">DOM</h3>
<ul>
 <li>The {{ domxref("File") }} interface's non-standard methods <code>getAsBinary()</code>, <code>getAsDataURL()</code>, and <code>getAsText()</code> have been removed as well as the non-standard properties <code>fileName</code> and <code>fileSize</code>.</li>
 <li>The {{ domxref("XMLHttpRequest/FormData", "FormData") }} interface no longer reports the filename as an empty string when sending the <code>Content-Disposition</code> HTTP header if the data was set using a {{ domxref("Blob") }}. This fixes errors that were happening with some servers.</li>
 <li>The {{ domxref("element.dir") }} attribute now always returns its result as all lower-case, as required by the HTML specification.</li>
 <li>The {{ domxref("FileReader") }} <code>readAsArrayBuffer()</code> method is now implemented.</li>
 <li>{{ domxref("document.createEntityReference") }} has been removed. It was never properly implemented and is not implemented in most other browsers.</li>
 <li><code>document.normalizeDocument</code> has been removed. Use {{ domxref("Node.normalize") }} instead.</li>
 <li>{{ domxref("DOMTokenList.item") }} now returns <code>undefined</code> if the <code>index</code> is out of bounds, previously it returned <code>null</code>.</li>
 <li><code>Node.getFeature</code> has been removed.</li>
 <li>The <code>HTMLInsElement</code> and <code>HTMLDelElement</code> interfaces have been removed, since the {{ HTMLElement("ins") }} and {{ HTMLElement("del") }} elements actually use the {{ domxref("HTMLModElement") }} interface.</li>
 <li>In a effort to conform to the upcoming <a class="external" href="http://www.w3.org/TR/dom/">DOM4</a> specification where {{ domxref("Attr") }} do not inherit from {{ domxref("Node") }} anymore (it did in DOM Core 1, 2 and 3), many {{ domxref("Node") }} properties and methods on the {{ domxref("Attr") }} interface are <a href="/en/DOM/Attr#Deprecated_properties_and_methods" title="En/DOM/Attr#Deprecated_properties_and_methods">now reporting warnings</a> as we work toward removing them in a later version.</li>
 <li>Added support for the {{ domxref("window.ondeviceorientation") }} and {{ domxref("window.ondevicemotion") }} properties on {{ domxref("window") }} objects.</li>
 <li>{{ domxref("window.resizeTo") }}, {{ domxref("window.resizeBy") }}, {{ domxref("window.moveTo") }} , and {{ domxref("window.moveBy") }} no longer apply to the main window.</li>
</ul>
<h3 id="JavaScript">JavaScript</h3>
<ul>
 <li>The <code><a href="/en/JavaScript/Reference/Global_Objects/Function/arity" title="en/JavaScript/Reference/Global_Objects/Function/arity">Function.arity</a></code> property has been removed; use <code><a href="/en/JavaScript/Reference/Global_Objects/Function/length" title="en/JavaScript/Reference/Global_Objects/Function/length">Function.length</a></code> instead.</li>
</ul>
<h3 id="WebSockets">WebSockets</h3>
<ul>
 <li>The <code>network.websocket.max-connections</code> preference is used to determine the maximum number of WebSocket connections that can be open at a time. The default value is 200.</li>
 <li>The underlying WebSocket protocol version 8 (as specified by <a class="external" href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10" title="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10">IETF draft 10</a>) is used now instead of the version 7 protocol used by Firefox 6.</li>
 <li>The WebSocket API is now available on Firefox Mobile.</li>
</ul>
<h3 id="console_API">console API</h3>
<ul>
 <li>Message logged with <code>console.log</code> while the <a href="/en/Tools/Web_Console" title="Using the Web Console">web console</a> isn't open are still logged, although they aren't displayed when the web console is opened.</li>
</ul>
<div class="changelog">
 <h3 id="Web_timing">Web timing</h3>
 <ul>
  <li>Initial implementation of the <a href="/en/Navigation_timing">Navigation Timing</a> specification which provides data that can be used to measure the performance of a website.</li>
 </ul>
 <h3 id="XML">XML</h3>
 <ul>
  <li>In addition to the previously supported <code>text/xsl</code>, XSLT stylesheets can now use the official internet media (MIME) type <code>application/xslt+xml</code> (in the <a class="external" href="http://www.w3.org/TR/xml-stylesheet/" title="http://www.w3.org/TR/xml-stylesheet/">stylesheet processing instruction</a> or the <a class="external" href="http://tools.ietf.org/html/rfc5988">HTTP Link header field</a>).</li>
 </ul>
</div>
<h2 id="Changes_for_Mozilla_and_add-on_developers">Changes for Mozilla and add-on developers</h2>
<p>These changes affect add-on developers as well as developers working on or with Mozilla code itself. Add-on developers should see <a href="/en/Firefox/Updating_extensions_for_Firefox_7" title="en/Firefox/Updating extensions for Firefox 7">Updating extensions for Firefox 7</a> for additional information.</p>
<div class="note">
 <strong>Note:</strong> Firefox 7 requires that binary components be recompiled, as do all major releases of Firefox. See <a href="/En/Developer_Guide/Interface_Compatibility#Binary_Interfaces" title="En/Developer_Guide/Interface_Compatibility#Binary_Interfaces">Binary Interfaces</a> for details.</div>
<h3 id="JavaScript_code_modules">JavaScript code modules</h3>
<h4 id="FileUtils.jsm">FileUtils.jsm</h4>
<ul>
 <li>New method <code>openFileOutputStream()</code> opens a file output stream, the non-safe variant, for writing.</li>
</ul>
<h4 id="AddonManager.jsm">AddonManager.jsm</h4>
<ul>
 <li>The Add-on Manager has new methods for managing lists of add-ons that changed during applications startup: {{ AMInterface("AddonManager", "addStartupChange") }}, {{ AMInterface("AddonManager", "removeStartupChange") }}, and {{ AMInterface("AddonManager", "getStartupChanges") }}.</li>
</ul>
<h3 id="XUL">XUL</h3>
<ul>
 <li>{{ xulelem("tree") }} elements can now persist the state of disclosure triangles if the nodes referenced by {{ XULAttr("datasources") }} all have unique IDs specified by "id" attributes.</li>
 <li>{{ xulelem("panel") }} elements can now be configured to <a href="/en/XUL/PopupGuide/Panels#Letting_panels_be_dragged_by_grabbing_the_background" title="en/XUL/PopupGuide/Panels#Letting_panels_be_dragged_by_grabbing_the_background">let the user drag them by clicking anywhere on their background</a> by using the new {{ XULAttr("backdrag") }} attribute.</li>
</ul>
<h3 id="XPCOM">XPCOM</h3>
<ul>
 <li>The new <a href="/en/Components.utils.schedulePreciseGC" title="en/Components.utils.schedulePreciseGC"><code>Components.utils.schedulePreciseGC()</code></a> method lets you schedule a thorough garbage collection cycle to occur at some point in the future when no JavaScript code is executing; a callback is executed once collection is complete.</li>
 <li>The <a href="/en/Components.utils.unload" title="Components.utils.unload"><code>Components.utils.unload()</code></a> method lets you unload JavaScript code modules previously loaded by calling <a href="/en/Components.utils.load" title="en/Components.utils.load"><code>Components.utils.load()</code></a>.</li>
</ul>
<h3 id="Memory_reporters">Memory reporters</h3>
<p>Support has been added for multi-reporters; that is, memory reporters that gather data on request and call a callback for each generated result. See {{ interface("nsIMemoryMultiReporter") }} and {{ interface("nsIMemoryMultiReporterCallback") }} for the relevant interfaces, as well as the {{ ifmethod("nsIMemoryReporterManager", "registerMultiReporter") }} and {{ ifmethod("nsIMemoryReporterManager", "unregisterMultiReporter") }} methods.</p>
<h3 id="User_experience_changes">User experience changes</h3>
<ul>
 <li>Extension options can now be <a href="/en/Extensions/Inline_Options" title="en/Extensions/Inline_Options">displayed inside the Add-on Manager</a> for both restartless and traditional extensions.</li>
 <li>The destination of downloads is now remembered on a site-by-site basis. This data can be accessed using <a href="/en/JavaScript_code_modules/DownloadLastDir.jsm" title="en/JavaScript_code_modules/DownloadLastDir.jsm">DownloadLastDir.jsm</a>.</li>
</ul>
<h3 id="Changes_to_the_build_system">Changes to the build system</h3>
<ul>
 <li>The ActiveX embedding API is no longer built and support has been removed from the build system. Supporting interfaces have also been removed; see {{ anch("Removed interfaces") }}.</li>
 <li>You should no longer specify <code>-Zc:wchar_t-</code> when building on Windows. See the <a href="/En/Developer_Guide/Build_Instructions#Build_and_install" title="En/Developer_Guide/Build_Instructions#Build_and_install">updated Build documentation</a> for details.</li>
</ul>
<h3 id="Interface_changes">Interface changes</h3>
<ul>
 <li>{{ interface("nsISocketTransport") }} now offers a new connection flag: <code>DISABLE_IPV6</code>; this causes a socket to only attempt to connect to IPv4 addresses, ignoring any available IPv6 addresses. In addition, {{ interface("nsIDNSService") }} now offers a new resolve flag: <code>RESOLVE_DISABLE_IPV6</code>; this causes domain name resolution to only consider IPv4 hosts, ignoring any available IPv6 addresses. These changes are used to implement the <a class="external" href="http://tools.ietf.org/html/draft-wing-http-new-tech-00">"happy eyeballs" strategy</a> for improving response time when attempting to connect on hosts that support both IPv4 and IPv6 (especially those that have broken IPv6 connectivity).</li>
 <li>{{ interface("inIDOMUtils") }} has two new methods, {{ ifmethod("inIDOMUtils","getChildrenForNode") }} which returns a list of child nodes of a node and {{ ifmethod("inIDOMUtils","getUsedFontFaces") }} which returns a list of font faces used in a range.</li>
 <li>The <code>nsIMarkupDocumentViewer_MOZILLA_2_0_BRANCH</code> interface has been merged into the {{ interface("nsIMarkupDocumentViewer") }} interface.</li>
 <li>The <code>nsIDOMWindow2</code> interface has been merged into the {{ interface("nsIDOMWindow") }} interface.</li>
 <li>The <code>nsIDOMWindow_2_0_BRANCH</code> interface has been merged into the {{ interface("nsIDOMWindowInternal") }} interface.</li>
 <li>{{ interface("nsINavHistoryObserver") }} methods with URI parameters now require a GUID as well.</li>
 <li>The <code>nsISHistory_2_0_BRANCH</code> interface has been merged into the {{ interface("nsISHistory") }} interface.</li>
 <li>{{ interface("nsITelemetry") }} has a new method, {{ ifmethod("nsITelemetry","getHistogramById") }} which returns a histogram by its ID, and a new attribute, <code>canRecord</code> which when set to <code>false</code> disables recording of telemetry statistics. Telemetry statistics are no longer recorded when in Private Browsing Mode. (see {{ bug("661574") }} and {{ bug("661573") }})<br>
  Telemetry histograms defined with {{ ifmethod("nsITelemetry","newHistogram") }} will not be reported in the telemetry ping.</li>
 <li>The {{ interface("nsIMemoryReporter") }} interface has been substantially changed; if you use it, you will need to make some adjustments to your code.</li>
 <li>{{ interface("nsIXMLHttpRequest") }}, headers set by {{ ifmethod("nsIXMLHttpRequest","setRequestHeader") }} are sent with the request when following a redirect. Previously these headers would not be sent.</li>
 <li>{{ interface("nsIDocShell") }} has a new <code>allowWindowControl</code> attribute. If <code>true</code>, the docshell's content is allowed to control the window (that is, to move or resize the window).</li>
 <li>The <code>nsIThreadInternal2</code> interface has been merged into the {{ interface("nsIThreadInternal") }} interface.</li>
</ul>
<h4 id="New_interfaces">New interfaces</h4>
<dl>
 <dt>
  {{ interface("nsIDOMFontFace") }}</dt>
 <dd>
  Describes a single font face.</dd>
 <dt>
  {{ interface("nsIDOMFontFaceList") }}</dt>
 <dd>
  Describes a list of font faces, each represented by {{ interface("nsIDOMFontFace") }}.</dd>
</dl>
<h4 id="Removed_interfaces">Removed interfaces</h4>
<p>The following interfaces were implementation details that are no longer needed:</p>
<ul>
 <li><code>nsIDOM3Attr</code></li>
 <li><code>nsIDOM3Node</code></li>
 <li><code>nsIDOM3TypeInfo</code></li>
 <li><code>nsIDOM3Text</code></li>
 <li><code>nsIDOMDocumentStyle</code></li>
 <li><code>nsIDOMNSDocument</code></li>
 <li><code>nsIDOMNSFeatureFactory</code></li>
 <li>{{ interface("nsIDOMNSHTMLDocument") }}</li>
 <li><code>nsIDOMNSHTMLFormElement</code></li>
 <li><code>nsIDOMNSHTMLHRElement</code></li>
 <li><code>nsIDOMNSHTMLTextAreaElement</code></li>
</ul>
<p>The following interfaces were removed as part of the removal of the ActiveX embedding API:</p>
<ul>
 <li><code>DITestScriptHelper</code></li>
 <li><code>DWebBrowserEvents</code></li>
 <li><code>DWebBrowserEvents2</code></li>
 <li>{{ interface("IDispatch") }}</li>
 <li><code>IMozControlBridge</code></li>
 <li><code>IMozPluginHostCtrl</code></li>
 <li><code>IWebBrowser</code></li>
 <li><code>IWebBrowser2</code></li>
 <li><code>IWebBrowserApp</code></li>
 <li><code>IXMLDocument</code></li>
 <li><code>IXMLElement</code></li>
 <li><code>IXMLElementCollection</code></li>
 <li><code>IXMLError</code></li>
 <li><code>nsIActiveXSecurityPolicy</code></li>
 <li>{{ interface("nsIDispatchSupport") }}</li>
 <li><code>nsIMozAxPlugin</code></li>
 <li><code>nsIScriptEventHandler</code></li>
 <li><code>nsIScriptEventManager</code></li>
</ul>
<h3 id="Other_Changes">Other Changes</h3>
<ul>
 <li>The structure of the library window (<code>places.xul</code>) <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=588027">has been cleaned up</a>. This <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=677417">may break extensions</a> and themes.</li>
 <li>The look of the print preview window <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=663028">has been modernized</a> and theme authors are encouraged to style it using the CSS pseudo-elements {{ cssxref("::-moz-page") }}, {{ cssxref("::-moz-page-sequence") }} and {{ cssxref("::-moz-scrolled-page-sequence") }}.</li>
</ul>
<h2 id="See_also">See also</h2>
<div>
 {{Firefox_for_developers('6')}}</div>