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。