Firefox 6 技術文件
Firefox 6, based on Gecko 6.0, was released on August 16, 2011. This article provides links to information about the changes that affect developers in this release.
- The HTML5 <progress> (en-US) element, which lets you create a progress bar, is now supported.
- The parsing of the HTML5 <track> (en-US) element, which specifies text tracks for media elements, is now supported. This element should appear in the DOM now, though its behavior is still not implemented.
- The <iframe> (en-US) element is now clipped correctly by its container when the container's corners have been rounded using the border-radius (en-US) property.
<form>elements' text element is used to create interactive controls for web-based forms in order to accept data from the user.">
<input>fields no longer support the XUL
maxwidthproperty; this was never intentional, and is in violation of the HTML specification. You should instead use the
sizeattribute to set the maximum width of input fields.
- The 元素 可以被使用於對腳本程式(JaveScript) 繪圖 .舉例來說, 它能用來畫圖,組合照片,甚至作動畫. 你也許(應該) 在<canvas>區段內提供替代方案的內容 .這內容將能被一些不支援<canvas>以及無法使用 Javescript 功能的瀏覽器所渲染 .">
<canvas>元素上以 "2d" 為參數呼叫 getContext() 方法：'>
strokeStyleused to ignore garbage included after a valid color definition; now this is correctly treated as an error. For example, "red blue" as a color used to be treated as "red", when it should have been ignored.
- The width and height of 元素 可以被使用於對腳本程式(JaveScript) 繪圖 .舉例來說, 它能用來畫圖,組合照片,甚至作動畫. 你也許(應該) 在<canvas>區段內提供替代方案的內容 .這內容將能被一些不支援<canvas>以及無法使用 Javescript 功能的瀏覽器所渲染 .">
<canvas>elements can now properly be set to 0px; previously, these were getting arbitrarily set to 300px when you tried to do that.
- Support for the HTML custom data attributes (data-*) has been added. The DOM
element.datasetproperty allows to access them.
- When a <textarea> (en-US) element receives focus, the text insertion point is now placed, by default, at the beginning of the text rather than at the end. This makes Firefox's behavior consistent with other browsers.
- -moz-text-decoration-color (en-US)
This new property lets you set the color used by text decorations, such as underlines, overlines, and strikethroughs.
- -moz-text-decoration-line (en-US)
This new property lets you set the kind of text decorations added to an element.
- -moz-text-decoration-style (en-US)
This new property lets you set the style of text decorations, such as underlines, overlines, and strikethroughs. Styles include single-strokes, double strokes, wavy lines, dotted lines, and so forth.
- -moz-hyphens (en-US)
This new property lets you control how hyphenation of words during line wrapping is handled.
- -moz-orient (en-US)
A new (currently Mozilla-specific) property which lets you control the vertical or horizontal orientation of certain elements (particularly <progress> (en-US)).
- ::-moz-progress-bar (en-US)
A Mozilla-specific pseudo-element that lets you style the area of an <progress> (en-US) element representing the completed portion of a task.
- The @-moz-document (en-US) property has a new
regexp()function, which lets you match the document's URL to a regular expression.
azimuthCSS property is no longer supported, as we have removed what little code we had for the
auralmedia group. It was never significantly implemented, so it made more sense to remove the crufty implementation for the time being rather than try to patch it up.
- In the past, the :hover (en-US) pseudoclass was not applied to class selectors when in quirks mode; for example,
.someclass:hoverdid not work. This quirk has been removed.
- The :indeterminate (en-US) pseudo-class can be applied to <progress> (en-US) elements. This is non-standard, but we hope it will be adopted by other browsers, because it will be useful.
-moz-win-exclude-glassvalue has been added to the -moz-appearance (en-US) CSS property in order to exclude opaque regions in Aero Glass glaze effects on Windows systems.
- bug 658949 changed how the hash (#) symbol is treated in data URIs which may break CSS stylesheets which contain such a symbol if it is not escaped.
- Using media queries from code
- Touch events
- : Firefox 6 adds support for W3C standard touch events; these make it easy to interpret one or more touches at a time on touch-sensitive surfaces such as touch screens and trackpads.
- Server-sent events
- : Server-sent events make it possible for a web application to ask a server to send events just like any locally-created DOM event.
navigator.securityPolicy, which has returned an empty string for a long time, has been removed outright.
- BlobBuilder (en-US) is now implemented, although for now it's prefixed (so you need to use
- The document.height (en-US) and 元素的寬度有多少像素。">
document.widthhave been removed. bug 585877
notationsproperties, which were never implemented and always returned
null, have been removed, since they've been removed from the specification anyway.
DOMConfigurationinterface and the
document.domConfigproperty that used it have both been removed; they were never supported and have since been removed from the DOM specification.
hashchangeevent now correctly includes the
abort()method now throws an exception when used if no file read is in progress.
window.historyAPI now uses the structured clone algorithm to serialize the objects you pass to the
replaceState()methods; this lets you use more complex objects (including those that contain cyclic graphs of references).
- You can now detect when printing has been initiated and has completed by listening for the new
document.strictErrorCheckingproperty has been removed, since it was never implemented and was removed from the DOM specification.
- The standard
event.defaultPreventedproperty is now supported; you should use this instead of the non-standard
getPreventDefault()method to detect whether or not
event.preventDefault()was called on the event.
- The window.top (en-US) property is now properly read only.
- DOM views, which we never documented, have been removed. This was a bit of implementation detail that was unnecessarily complicating things, so we got rid of it. If you notice this change, you're probably doing something wrong.
useCaptureparameter is now optional, as it is in WebKit (and as per the latest version of the specification).
mozResponseArrayBufferproperty of the
XMLHttpRequestobject has been replaced with the
element.datasetproperty has been added to the
HTMLElementinterface allowing access to the
data-*global attributes of an element.
CustomEventinterface has been implemented. (see bug 427537)
- For security reasons,
- In the past, it was possible to use the
newoperator on several built-in functions (eval, parseInt, Date.parse...) that should not have allowed it, according to the specification. This behavior is no longer supported. Using the
newoperator in this way was never officially supported and was not widely done, so it's unlikely that this change affects you.
- ECMAScript Harmony WeakMaps have been added as a prototype implementation.
- The implementation of "><mstyle> (en-US) has been corrected.
- A state change event is now correctly sent when the value of
- An attribute change event is now correctly sent when
- : WebSockets was updated to protocol version 07 for Firefox 6. In addition, the global
WebSocketobject has been renamed to
MozWebSocketto prevent it from incorrectly being used to detect the availability of unprefixed WebSockets.
- : WebSockets was updated to protocol version 07 for Firefox 6. In addition, the global
- Parsing of the
Content-Dispositionheader has been fixed to properly interpret backslash-escaped ASCII characters as just that character itself. Previously it was incorrectly replacing that character with an underscore ("_").
- The value of the path field on
Set-Cookieheaders is now interpreted correctly when quotes are used; previously, they were being treated as part of the path string instead of as delimiters. This change may affect compatibility with some web sites, so authors should check their code.
Upgraderequest header is now supported; you can request an upgrade of an HTTP channel to another protocol by calling
- Support for microsummaries has been removed; these were never widely used, were not very discoverable, and continuing to support them was making improvements to the Places (bookmark and history) architecture difficult.
- WebGL now supports the
console.trace()method has been added to the ConsoleAPI (see bug 585956).
openSafeFileOutputStream()method now opens files with the
DEFER_OPENbehavior flag instead of attempting to open them immediately.
- The new
- Using the DOM File API in chrome code
Although you've always been able to use the DOM File API from chrome code, the
Fileconstructor now supports specifying a local pathname string when used from chrome. In addition, you can also specify the file to access using the DOM File API using an
nsINavHistoryQueryOptionsnow supports sorting in frecency order using the new
nsIFilePickerhas a new
nsIFilePicker.addToRecentDocsattribute, which lets you indicate that the selected file should be added to the user's "recent documents" list if there is one. This attribute has no effect when in private browsing mode.
nsINavBookmarkObservermethods with item ID parameters now require a GUID as well.
nsIPrefBranch.clearUserPref()no longer throws an exception if the specified preference doesn't exist or has no user-set value. Instead, it simply does nothing.
nsIMemoryReporterinterface now provides support for indicating the kind of memory being described (mapped, heap, or other).
stateDataattribute now returns a
nsIURIhas a new
nsIURI.refattribute, which returns the reference portion (the part after the "#") of the URI. It also has new methods
nsIURI.cloneIgnoringRef()which clones the
nsIURIwithout the ref member and
nsIURI.equalsExceptRef()which compares to another
nsIURIignoring the ref member.
A new service that lets you access the favicon service asynchronously.
The callback interface for handling HTTP upgrade requests via the
A container for objects that have been serialized using the structured clone algorithm.
See bug 576006.
See bug 640003.
See bug 640003.
The following interfaces were implementation details that are no longer needed:
nsIDOMDocumentEvent(see bug 655517)
nsIDOMDocumentTraversal(see bug 655514)
nsIDOMDocumentRange(see bug 655513)
IWeaveCrypto(see bug 651596)
nsIDOM3DocumentEvent(see bug 481863)
nsIPlugin(see bug 637253)
nsIPluginInstance(see bug 637253)
nsIHTMLEditRules(see bug 633750)
nsIXSLTProcessorObsolete(see bug 649534)
- Using preferences from application code
A new static API is available for easily accessing preferences; this is only available to application code and can't be used by add-ons.