这篇文章需要文法复核。如何帮忙。
这篇翻译不完整。请帮忙从英语翻译这篇文章。
Firefox 49,基于 Gecko 49, 将会在 September 2016 正式发布。本文记录了开发者们应该注意的,该版本的 Firefox 的各种变化。
对于Web开发者的改变
开发者工具
- 控制台记录的JavaScript错误信息 现在提供了一个 [Learn more] 链接 为了额外的调试帮助(bug 1179876).
- CSS 自动完成: 显示更多的建议在自动完成弹窗 (bug 1260419).
- 动画查看器现在 暴露出动画的性能信息 在开发工具中 (bug 1254408).
- The 查看器的上下文菜单 被重组的更清楚并且更加容易的使用 (bug 1211613).
- 查看器现在支持
#RRGGBBAA
和#RGBA
语法对于颜色的值 (bug 1271191). - 开发工具不在显示自关闭标签 (比如
<br>
和<img>
好像它们在HTML页面拥有关闭标签; 这个行文在XHTML页面上没有改变 (bug 820926). - 可用性的提高!
- 工具可以做更好的工作去确保键盘聚焦的地方更加明显 (bug 1242851).
- Accessibility labels have been added to unlabeled controls (bug 1242715).
- 增加合适的语义化的树状图和键盘导航到查看器的标记视图 (bug 1242694).
- 网络监视器 现在显示一个原因列, 该列提供导致每一个详细的网络请求的踪迹 (bug 1134073).
- 在 about:debugging 附加组件页面, Reload 按钮现在只能在临时的附加组件开启. 这将禁用在其他的所有附加组件 (bug 1273184).
- 在 about:debugging Workers 页面, 如果 service workers are incompatible 在现在的浏览器上配置一个温馨的提示将会显示在 Service Workers 部分 (bug 1266415).
- about:debugging 现在有一个 新的标签页 可用, 这个标签页提供一个完整的列表包含所有的在FireFox实例中打开的所有的调试标签 (bug 1266128).
- Disable Cache 选项 在 工具箱高级设置 已经被重命名成 Disable HTTP Cache, 来使它更加的清晰得标明这个选项影响 HTTP cache, 而不是 Service Workers/the Cache API (bug(1253018)).
- 存储查看器现在允许 IndexedDB 数据库可以被删除 通过它们的上下文菜单 (bug 1205123), 并且将显示一个温馨的提示如果 indexedDB因为一些原因没有被删除 (比如它们仍然有活动的链接) (bug 1268460).
HTML
- 增加支持
<details>
和<summary>
元素 (bug 1226455). pattern
属性对于<input>
元素现在使用'u'
参数在潜在的 JavaScriptRegExp
(bug 1227906).- 为了匹配规范的变化,
<track>
的属性值kind
现在已经无效,现在用 "metadata" 代替 "subtitles" (bug 1269712). <iframe>
元素的sandbox
属性现在已经支持'allow-popups-to-escape-sandbox'
和 'allow-modals'
值(bug 1190641).- 支持 microdata 属性并且已经移除了 Microdata API (bug 909633).
referrerpolicy
属性在<a>
元素现在已经支持'no-referrer-when-downgrade
' 和'origin-when-cross-origin'
(bug 1178337).<label>
的属于某一个Form的属性form
现在已经被移除. 但是TheHTMLLabelElement.form
属性依旧存在, 但是现在返回的form是与label的控制权相关联的, 如果有控制(或者是与控制权相关联的form) (bug 1268852).
CSS
- 增加
background-position-x
和background-position-y
, 这允许去分别的指定水平和垂直偏移量来去绘画一个背景图片; 这两个属性是background-position
的组件 (bug 550426). - 在
background-repeat
增加支持round
和space
关键字 (bug 548372). - On
background-clip
, the keywordtext
is now activated by default (bug 1264905). - 增加支持去指定颜色的时候使用alpha通道,使用 4-或者是8-位的 CSS十六进制值 (#RRGGBBAA 或者是 #RGBA) (bug 567283).
- 伪类选择器
:dir()
已经去除了浏览器前缀 (bug 859301). - 在我们的实验实现 (还没有在默认的情况下被激活) CSS属性
clip-path
, 我们现在可以在<basic-shape>
中间插入值 (bug 1110460). - 增加
q
长度单位 (bug 1274526). - 属性值
text-align-last
已经去除里浏览器前缀 (bug 1039541). - 增加支持
overflow-wrap
, 来替换replacingword-wrap
,但是现在被替换的依旧可用来作为一个可以替换的名字 (bug 955857). - 我们的实验 CSS Grids 实现已经被增强:
- 实现
<percentage>
支持对于grid-gap
,grid-row-gap
, andgrid-column-gap
属性 (bug 1266268). - 实现网格布局支持对于
align
,justify-self
:baseline
和last-baseline
(也称 "baseline self-alignment") (bug 1221525). - 实现网格子项目基线内容对齐 (bug 1256429).
- 实现
- 我们的实验 CSS Masks 实现已经被增强:
mask-origin
属性现在使用border-box
代替 ofpadding-box
作为初始值, 为了匹配规范 (bug 1258286).mask-repeat
属性现在支持space
和round
值 (bug 1258626).- Fixed an issue preventing the
mask-position
attribute from being animated (bug 1273804).
- 偏好控制
text-emphasis
已经被移除. 所以支持该属性可以不再被禁用 (bug 1229609).
JavaScript
- ES2015 (ES6)
getPrototypeOf()
和setPrototypeOf()
Proxy
traps属性已经被实现 (bug 888969). - ES2015 (ES6)
RegExp.prototype[@@match]()
,RegExp.prototype[@@replace]()
,RegExp.prototype[@@search]()
, andRegExp.prototype[@@split]()
方法, 和RegExp[@@species]
getter方法已经被实现 (bug 887016). - 不被赞成的, 非标准的标记参数
String.prototype.
match
/search
/replace
已经被移除 (bug 1108382). Date.parse()
方法在解析2位数年份的行为已经被改变为了更好地和 Google Chrome browser 更好地协作 (bug 1265136).
Interfaces/APIs/DOM
DOM & HTML DOM
- 方法
DOMTokenList.supports()
已经被增加 (bug 1257849). DOMTokenList.replace()
方法已经被增加 (bug 1224186).- 第一位的
'?'
字符现在已经被忽视当作为参数在URLSearchParams()
构造器 (bug 1268361). - The value returned by
URL.origin
,HTMLAnchorElement.origin
, andHTMLAreaElement.origin
for URL using theblob:
scheme is no longer incorrectlynull
but is instead the origin of the URL formed by removing the leadingblob:
(bug 1270451). - 在预渲染模式,
Document.visibilityState
属性现在返回'prerender'
(bug 1069772). Window.isSecureContext
属性已经被实现 (bug 1162772).- DOM4
ChildNode.before()
,ChildNode.after()
,ChildNode.replaceWith()
,ParentNode.append()
andParentNode.prepend()
方法已经被实现 (bug 911477). TouchList.identifiedTouch()
方法已经被移除 (bug 1188539).- 在默认的情况下,
scrollbars
Window
特性是开启的当调用Window.open()
. 在过去, 这种情况下被强烈推荐开启但却不是默认开启的 (bug 1257887). - 增加实验性并且非标准的
HTMLMediaElement.seekToNextFrame()
方法, 它允许你which allows seeking frame-by-frame through video content (bug 1235301). While you're encouraged to experiment with this method to help us understand how useful it is, do not use it in production code! - The
HTMLLabelElement.form
property now returns the form with which the label's control is associated, if there is a control (and if that control is associated with a form). Previously, labels were directly associated with forms using this property (bug 1268852). - Support for the third parameter of
EventTarget.addEventListener()
, either aBoolean
or anEventListenerOptions
has been added (bug 1266164 and bug 1266066). - The audio volume related values for
KeyboardEvent.key
have been renamed."VolumeDown"
is now"AudioVolumeDown"
,"VolumeUp"
is now"AudioVolumeUp"
, and"VolumeMute"
is now"AudioVolumeMute".
This brings Firefox into alignment with the latest draft of the UI Events specification (bug 1272578). See "Code values" in KeyboardEvent.code for a full list of available key codes. - The keys previously referred to as
"MozHomeScreen"
,"MozCameraFocusAdjust"
, and"MozPhoneCall"
now have official names in the UI Events specification:"GoHome"
,"CameraFocus"
, and"Call"
. Firefox 49 has been updated to use the new names (bug 1272599). See "Code values" in KeyboardEvent.code for a full list of available key codes. - The key values
"Separator"
and"MediaSkip"
have been removed, as they were deprecated and unused (bug 1232919). - Key values and the corresponding key codes
"Hyper"
and"Super"
have been added to represent these legacy modifier keys (bug 1232919). - 两个键值为了多媒体数字小键盘已经被增加:
"Key11"
and"Key12"
(bug 1232919). - 下面的心键值被增加为了音频控制按键:
"AudioBassBoostToggle"
,"AudioTrebleDown"
, and"AudioTrebleUp"
(bug 123919). - 键值被增加为了麦克风控制按键:
"
MicrophoneToggle"
,"
MicrophoneVolumeDown"
,"
MicrophoneVolumeUp"
, and"
MicrophoneVolumeMute"
(bug 123919). - 新的键值被增加为了支持语音识别设备: "
SpeechCorrectionList"
and"
SpeechInputToggle"
(bug 1232919). - 新的键值已经被增加去支持手机上的特别的按键:
"
AppSwitch"
,"
Call"
,"
CameraFocus"
,"
EndCall"
,"
GoBack"
,"
GoHome"
,"
HeadsetHook"
,"
LastNumberRedial"
,"
Notification"
,"
MannerMode"
, and"
VoiceDial"
(bug 1232919). - 这些新的应用程序键值已经被增加:
"
LaunchContacts"
and"
LaunchPhone"
(bug 1232919). - 新的键值被增加去支持电视设备:
"
TV3DMode"
,"
TVAntennaCable"
,"
TVAudioDescription"
,"
TVAudioDescriptionMixDown"
,"
TVAudioDescriptionMixUp"
,"
TVContentsMenu"
,"
TVDataService"
,"
TVInput"
,"
TVInputComponent1"
,"
TVInputComponent2"
,"
TVInputComposite1"
,"
TVInputComposite2"
,"
TVInputHDMI1"
,"
TVInputHDMI2"
,"
TVInputHDMI3"
,"
TVInputHDMI4"
,"
TVInputVGA1"
,"
TVMediaContext"
,"
TVNetwork"
,"
TVNumberEntry"
,"
TVRadioService"
,"
TVSatellite"
,"
TVSatelliteBS"
,"
TVSatelliteCS"
,"
TVSatelliteToggle"
,"
TVTerrestrialAnalog"
,"
TVTerrestrialDigital"
,"
TVTimer"
, and"
DVR"
(bug 1232919). - 键值
"
MediaSelect"
已经被替换成标准的"
LaunchMediaPlayer"
键值 (bug 1272592). - Additional media player key values have been added as well. These are
"
MediaAudioTrack"
,"
MediaSkipBackward"
,"
MediaSkipForward"
,"
MediaStepBackward"
,"
MediaStepForward"
,"
MediaTopMenu"
,"
NavigateIn"
,"
NavigateNext"
,"
NavigateOut"
, and"
NavigatePrevious"
(bug 1232919).
Canvas
CanvasRenderingContext2D.filter
属性, 它提供支持去增加滤镜在canvas中, 现在是默认被激活的并且不再需要去偏好选项中去开启 (bug 1173545).
WebGL
EXT_color_buffer_float
WebGL 2 扩展已经被实现 (bug 1129332).webglcontextcreationerror
事件, 它会被发送当 WebGL context 尝试创建但是失败的时候, 已经被实现 (bug 1271478). 使用这个来帮助理解什么导致了错误, 可以用来调试代码和生产中的错误处理.
IndexedDB
- 现在你可以重命名 IndexedDB 索引; the
IDBIndex.name
属性不再是只读的 (bug 1118028). - 现在你可以重命名
IDBObjectStore
s;IDBObjectStore.name
属性不再是只读的 (bug 1118028).
Service Workers and related
- The Fetch API's
Response
object now implements theredirected
property, which indicates whether or not the response is for a request which was redirected. Please review the security related notes in the documentation before using this property (bug 1243792). - In the Permissions API, Firefox no longer supports the 'push'
PermissionDescriptor
dictionary type (referred to in the spec asPushPermissionDescriptor
); this is because Firefox relies on a quota system for controlling theuserVisibleOnly
status instead, and was throwing an error when it encountered aPushPermissionDescriptor
instance (bug 1266821). With this dictionary removed, Firefox now simply ignores it.
Media Streams
- In the past, it was possible for a call to
MediaDevices.getUserMedia()
which requests both audio and video to succeed in cases where the user has only one of the two types of hardware available. This has been fixed (bug 802326). - In prior versions of Firefox, it was possible for a call to
MediaDevices.getUserMedia()
which requests both audio and video to succeed even though the user denied access to one but not both of the matching devices. This has been fixed (bug 802326). This involves minor user interface changes as well, to remove the options to choose "No audio" or "No video" when the user is prompted for permissions. - The
MediaStream.getTrackById()
method has been implemented (bug 1208390).
WebRTC
- The
RTCPeerConnection.addTrack()
method has been updated to allow tracks which are not components of the specified streams to be added to the connection. Instead, the streams are used to group tracks on the receiving end of the connection (bug 1271669).
New APIs
PerformanceObserver
API 现在在默认是被激活的在 Nightly. 这在其他版本的Firefox 49 在默认下是无效的 (bug 1271487).
Others
XMLHttpRequest.getResponseHeader()
和XMLHttpRequest.getAllResponseHeaders()
返回空头部在偏好选项中network.http.keep_empty_response_headers_as_empty_string
被设置成true
(bug 669259).- Firefox OS-only Data Store API 已经被移除 (bug 1261009).
- The Fullscreen API event handlers
Document.onfullscreenchange
andDocument.onfullscreenerror
have been removed fromElement
as they were never fired there; the prefixed versions of these event handlers have been kept there for compatibility purposes, however (bug 1270386). Note that this is not yet activated by default, but is behind thefull-screen-api.unprefix.enabled
preference (bug 1268749). - The obsolete
Document.mozFullScreen
property has been unprefixed toDocument.fullscreen
bug 1269157}. Note that this is not yet activated by default by behind thefull-screen-api.unprefix.enabled
preference (bug 1268749). - The read-only properties
Document.fullscreenElement
andDocument.fullscreenEnabled
no longer throw an exception if an attempt is made to change their values; instead, the new value is silently ignored and the setter function is a no-op (bug 1269798). - Any kind of data can now be retrieved from the clipboard using
DataTransfer.getData()
: previously, only data of certain MIME types were supported bug 860857. - Our implementation of the Frame Timing API, consisting of the two interfaces
PerformanceCompositeTiming
andPerformanceRenderTiming
, has been removed as the spec has been completely rewritten (bug 1271846). - To match the spec, the
VTTCue.positionAlign
property now returns aPositionAlign
enum instead of anAlign
enum (bug 1276129). - The speech synthesis part of Web Speech API is now activated by default (bug 1268633).
- The Performance Timeline API is now available by default in Nightly (though not in Aurora, Beta or Release).
- The
install
event, and theWindow.oninstall
event handler, are now supported for Web Manifests (bug 1265279). - When using the
AudioContext.createPeriodicWave()
method of the Web Audio API, you can now specify whether the resulting periodic wave should be normalized by including a dictionary object as the third parameter, which includes a single parameter —{disableNormalization: true}
(bug 1265405). - In the WebVTT API,
VTTCue.positionAlign
now correctly returns aPositionAlignSetting
enum as per spec; previously it returned anAlignSetting
enum (bug 1276129). - The Speech Synthesis part of the Web Speech API is now enabled by default across all desktop browsers (bug 1268633).
- The
Animation()
constructor of the Web Animations API now accepts a null timeline (bug 1096776).
MathML
No change.
SVG
- 移除支持不被赞成的
<altGlyph>
,<altGlyphDef>
和<altGlyphItem>
元素 (bug 1260032).
Audio/Video
没有改变.
HTTP
Cache-Control: immutable
指令现在已经被实现 (bug 1267474). 另见这篇文章 blog post 得到更多信息.
Networking
- The Proxy Auto-Configuration (PAC) implementation has been updated. Now
weekdayRange
,dateRange
, andtimeRange
support "reversed ranges", for example,weekdayRange("SAT", "MON")
will evaluatetrue
if the current day is Saturday, Sunday, or Monday (bug 1251332).
Security
- The
Window.isSecureContext
property, indicating whether a context is capable of using features that require secure contexts, has been implemented (bug 1162772).
Compatibility
为了增强兼容性对于现在已经存在的内容, Firefox 现在接受一些 webkit 前缀 properties and attributes.
- 接下来的 properties 现在依旧工作在前缀 -webkit下:
-webkit-align-items
-webkit-align-content
-webkit-align-self
-webkit-animation
-webkit-animation-delay
-webkit-animation-direction
-webkit-animation-duration
-webkit-animation-fill-mode
-webkit-animation-iteration-count
-webkit-animation-name
-webkit-animation-play-state
-webkit-animation-timing-function
-webkit-backface-visibility
-webkit-background-clip
-webkit-background-origin
-webkit-background-size
-webkit-border-bottom-left-radius
-webkit-border-bottom-right-radius
-webkit-border-image
-webkit-border-top-left-radius
-webkit-border-top-right-radius
-webkit-border-radius
-webkit-box-shadow
-webkit-filter
-webkit-flex
-webkit-flex-basis
-webkit-flex-direction
-webkit-flex-flow
-webkit-flex-grow
-webkit-flex-shrink
-webkit-flex-wrap
-webkit-justify-content
-webkit-order
-webkit-perspective
-webkit-perspective-origin
-webkit-text-size-adjust
-webkit-transform
-webkit-transform-origin
-webkit-transform-style
-webkit-transition
-webkit-transition-delay
-webkit-transition-duration
-webkit-transition-property
-webkit-transition-timing-function
-webkit-user-select
- 接下来的 properties 映射到(根据猜测,这里应该是没有前缀的属性,但是很奇怪这里的prefixed没有un) the equivalent prefixed property
- 对于
<image>
值:- 接下来的功能映射到它们的没有前缀的事物:
-webkit-linear-gradient()
,-webkit-radial-gradient()
,-webkit-repeating-linear-gradient()
, and-webkit-repeating-radial-gradient()
. - The outdated
-webkit-gradient
is supported (and translated to a regular gradient)
- 接下来的功能映射到它们的没有前缀的事物:
- 接下来的
display
值被转换:-webkit-box
to-moz-box
-webkit-flex
toflex
-webkit-inline-box
toinline-flex
-webkit-inline-flex
to-moz-inline-flex
- 接下来的属性被支持 (并且不会映射到任何没有前缀的事物and don't map to any unprefixed equivalent):
WebKitCSSMatrix
接口是DOMMatrix
的别名- 接下来的媒体查询功能已经被实现:
-webkit-min-device-pixel-ratio
as an alias ofmin-resolution
with the same value (indppx)
, though this feature is disabled by default (behind about:config preflayout.css.prefixes.device-pixel-ratio-webkit
)-webkit-max-device-pixel-ratio
as an alias ofmax-resolution
of the same value (indppx
); this feature is also disabled by default, behind the same about:config pref.-webkit-transform-3d
always matching, indicating 3d transform support.
改变对于 add-on and Mozilla developers
WebExtensions
- Support for the
history
has been added. This provides access to the browser history, with methods available for searching the history, getting information about previously-visited pages, and adding and removing history entries. - Added the
tabs.removeCSS()
method to the tabs API. This method lets you remove CSS which was previously injected by callingtabs.insertCSS()
.
Interfaces
- In
EventTarget.addEventListener()
, the valuemozSystemGroup
, active only in code running in XBL or in Firefox's chrome, is aBoolean
which indicates if the listener is added to the system group. (bug 1274520)
Other
没有改变.
See also
Older versions
- Firefox 50 for developers
- Firefox 49 for developers
- Firefox 48 for developers
- Firefox 47 for developers
- Firefox 46 for developers
- Firefox 45 for developers
- Firefox 44 for developers
- Firefox 43 for developers
- Firefox 42 for developers
- Firefox 41 for developers
- Firefox 40 for developers
- Firefox 39 for developers
- Firefox 38 for developers
- Firefox 37 for developers
- Firefox 36 for developers
- Firefox 35 for developers
- Firefox 34 for developers
- Firefox 33 for developers
- Firefox 32 for developers
- Firefox 31 for developers
- Firefox 30 for developers
- Firefox 29 for developers
- Firefox 28 for developers
- Firefox 27 for developers
- Firefox 26 for developers
- Firefox 25 for developers
- Firefox 24 for developers
- Firefox 23 for developers
- Firefox 22 for developers
- Firefox 21 for developers
- Firefox 20 for developers