Firefox 19 开发者发布说明
Firefox 19 于 2013 年 2 月 19 日发布。本文档列出了不仅对 Web 开发者,还对 Firefox 和 Gecko 开发者以及插件开发者有用的主要变更。
面向网络开发者的变更
JavaScript
- Map和- Set对象已从具有- size()方法更改为具有- size属性(Firefox bug 807001)
- 现在 Map和Set对象也具有 clear() 方法。(Firefox bug 805003)
CSS
- 对视口相对 <length>单位vh、vw、vmin和vmax的支持已上线(Firefox bug 503720)
- CSS Flexbox 已取消前缀,但仍默认禁用(Firefox bug 801098)。
- -moz-initial值已取消前缀(Firefox bug 806068)。- -moz-initial将保留一段时间作为别名;但是,强烈建议作者切换到- initial。
- CSS text-transform属性现在支持full-width关键字,这使得在文本中更无缝地包含拉丁字符(使用汉字等固定宽度字符)成为可能(Firefox bug 774560)。
- 已实现 CSS page-break-inside(Firefox bug 685012)。
- CSS calc()函数现在可用于<color-stop>(在<gradient>上)。
- 现在支持 CSS @pageat-rule(Firefox bug 115199)。请注意,伪类:first、:right和:left尚未实现。
- :-moz-placeholder伪类已被- ::-moz-placeholder伪元素替换(Firefox bug 737786)。
- 根据规范,!important限定的声明出现在@keyframes中现在会被忽略(Firefox bug 784466)。
DOM/API
- Element.getElementsByTagName、- Element.getElementsByTagNameNS和- Element.getElementsByClassName方法现在返回一个实时的- HTMLCollection(Firefox bug 799464)。
- 已实现 FilemozLastModifiedDate属性。(Firefox bug 793955)
- 当上次修改日期未知时,FilelastModifiedDate 属性会返回当前日期。(Firefox bug 793459)
- 已实现 CanvasRenderingContext2DisPointInStroke方法(Firefox bug 803124)。
- 已实现 HTMLCanvasElementtoBlob方法(Firefox bug 648610)。
- 调用 document.createElement(null)时,null现在将被字符串化,其作用类似于document.createElement("null")。
- Node.isSupported和- document.implementation.hasFeature()方法已被修改为始终返回- true(Firefox bug 801425)。
- TextDecoder和- TextEncoder接口已更新以匹配最新规范(Firefox bug 801487)。
XForms
Firefox 19 已移除 XForms 支持。
面向附加组件和 Mozilla 开发者的变更
注意:Firefox 19 的一个主要变化是 nsresult 现在是强类型的。这将有助于更轻松地检测因不正确处理返回值而导致的错误,但如果现有代码在这一点上存在不正确的假设,可能会导致其中断。
- getBrowserSelection()现在返回文本输入字段中选中的文本。因此,当用户在非密码字段的文本输入字段中选中文本时,- gContextMenu.isTextSelected将为- true。(Firefox bug 565717)
- Dict.jsm:Dict()现在接受 JSON 字符串。添加了Dict.toJSON(),它返回一个 JSON 字符串。(Firefox bug 727967)
接口更改
- nsIImgLoadingContent
- 
addObserver()方法的参数 (aObserver) 已从imgIDecoderObserver更改为imgINotificationObserver。imgINotificationObserver的notify()方法不可脚本化,因此您需要使用imgITools中的createScriptedObserver()。
- nsIChannel
- 
contentLength属性从long更改为int64_t。