Firefox 46 開發者釋出說明
要測試 Firefox 的最新開發者功能,請安裝 Firefox Developer Edition。Firefox 46 於 2016 年 4 月 26 日釋出。本文件列出了對 Web 開發者、Firefox 和 Gecko 開發者以及附加元件開發者都有用的主要變更。
面向網路開發者的變更
開發者工具
亮點
HTML
- 當遇到無效的
type值時,<ul>不再對映到decimal,而是表現為未指定type值(Firefox bug 241719)。 - 現在,
<input>上的pattern屬性被視為帶有"u"(unicode) 標誌的正則表示式(Firefox bug 1227906)。
CSS
-
我們對 CSS Grids 的實現進行了更新
- 現在,在
repeat()函式中允許使用auto-fill和auto-fit關鍵字(Firefox bug 1118820)。 true值已重新命名為unsafe;這會影響屬性justify-content、align-content、justify-self、align-self、justify-items和align-items(Firefox bug 1230478)。
- 現在,在
-
屬性
text-emphasis、text-emphasis-style、text-emphasis-color和text-emphasis-position現在預設啟用(Firefox bug 1231485)。 -
Gecko 現在接受某些屬性的
-webkit-字首版本;這需要將layout.css.prefixes.webkit切換為true(Firefox bug 1213126)。 -
@font-face的font-display描述符的實驗性支援;這需要將layout.css.font-display.enabled切換為true(Firefox bug 1157064)。 -
添加了對
@media (-webkit-transform-3d)的支援,將其作為 3D 變換支援的媒體查詢,前提是 about:config 偏好設定layout.css.prefixes.webkit設定為true(Firefox bug 1239799)。 -
支援
linear-gradient()省略0deg單位(Firefox bug 1239153)。 -
為了 Web 相容性,添加了
-webkit-filter,該功能受layout.css.prefixes.webkit偏好設定控制,預設為false(Firefox bug 1236506)。 -
[css-align] "unsafe start"(以前是 "true start")應序列化為 "start" 等(Firefox bug 1230398)。
JavaScript
- 已實現 ES2015 RegExp unicode (u) 標誌(Firefox bug 1135377)。
- 已實現 ES2015 塊級函式(Firefox bug 1071646)。
- 已實現 ES2015
TypedArray.prototype.sort()方法(Firefox bug 1121937)。 - 已實現 ES2015
arguments[Symbol.iterator]()(Firefox bug 1067049)。 - 已實現實驗性的ECMAScript Shared Memory API。請參閱
SharedArrayBuffer和Atomics物件。要使用此實驗性 API,請在 about:config 中將javascript.options.shared_memory設定為true。 - 根據 ECMAScript 規範,
let和const變數的重宣告現在會引發SyntaxError而不是TypeError(Firefox bug 1198833)。 - 在嚴格模式下,在原始值上設定屬性現在會引發
TypeError(Firefox bug 603201)。 - 已移除非標準的
WeakMap.prototype.clear()和WeakSet.prototype.clear()方法(Firefox bug 1101817)。 - 非標準的靜態
RegExp.multiline屬性現已棄用(Firefox bug 1220457)。 - 內建訪問器函式名稱現在帶有 "get" 或 "set" 字首(Firefox bug 1180290,Firefox bug 1235656)。
- 已移除 JS1.7/JS1.8(舊版)陣列推導式和生成器推導式(Firefox bug 1220564)。
介面/API/DOM
DOM 和 HTML DOM
- 當 Firefox 在多程序模式 (e10s) 下執行時,已棄用的
Window.showModalDialog()方法不再可用(Firefox bug 1234700)。 - 添加了對
Document.elementsFromPoint()的支援(Firefox bug 1164427)。 - 當
<select>元素的非存在選項被程式設計選擇時,selectedIndex值現在設定為-1,selectedOptions設定為空HTMLCollection,value設定為空字串,而不是像以前那樣錯誤地保持不變(Firefox bug 1203668)。
Canvas
- 實驗性的
OffscreenCanvasAPI 的其餘部分已實現;新功能包括:OffscreenCanvas()建構函式、OffscreenCanvas.toBlob()和OffscreenCanvas.transferToImageBitmap()。要使用此實驗性 API,請在 about:config 中將gfx.offscreencanvas.enabled設定為true(Firefox bug 1172796)。 - 現在支援
ImageBitmap.close()方法(Firefox bug 1172796)。 - 現在實現了一個新的
ImageBitmapRenderingContext渲染上下文。使用"bitmaprenderer"和OffscreenCanvas.getContext()或HTMLCanvasElement.getContext()來獲取此上下文。(Firefox bug 1172796)。
WebGL
- 已實現
WEBGL_compressed_texture_etc擴充套件,允許使用 ETC2 壓縮紋理格式(Firefox bug 917505)。要使用此擴充套件,請在 about:config 中將偏好設定webgl.enable-draft-extensions設定為true。
IndexedDB
無更改。
Service Workers
FetchEvent.request現在不可為空(請參閱 Firefox bug 1238213)。Navigator.serviceWorker現在被標記為 SameObject(請參閱 Firefox bug 1238205)。ExtendableMessageEvent.ports現在被標記為 SameObject(請參閱 Firefox bug 1238225)。
Fetch
Request.mode現在有一個可用的新值navigate,用於支援在文件之間導航時生成的請求(請參閱 Firefox bug 1209081)。
WebRTC
RTCPeerConnection.createOffer()方法現在支援 VP9 影片編解碼器,儘管預設情況下已停用。要啟用它,請在about:config中將偏好設定media.peerconnection.video.vp9_enabled設定為true。啟用後,VP9 是首選編解碼器;以前 VP8 是首選(Firefox bug 1242324)。- 添加了
RTCRtpSender.setParameters()方法,以允許在RTCRtpSender初始建立後更改引數值。
新 API
- 在 SVG 中,
SVGStyleElement介面現在實現了LinkStylemixin(Firefox bug 1239128)。
雜項
-
非同步
FileReader現在可在 Web worker 中使用(Firefox bug 901097)。 -
我們對 Web Animations API 的實驗性實現已更新
- 已實現
AnimationEffectTimingReadOnly字典和AnimationEffectReadOnly.timing(Firefox bug 1214536)。
- 已實現
-
Permissions API 現在預設啟用,適用於所有釋出版本,而不僅僅是之前的 Nightly 版本(Firefox bug 1221106)。
-
WOFF 字型的清理已有所放寬(Firefox bug 1244693)。
MathML
無更改。
SVG
無更改。
音訊/影片
無更改。
HTTP
無更改。
網路
- 已新增對 RFC 7686 的支援:預設情況下,不會嘗試使用 TLD
.onion解析域。這由偏好設定network.dns.blockDotOnion控制。支援 Tor 的附加元件可以更改此偏好設定。(Firefox bug 1228457)
安全
無更改。
面向附加元件和 Mozilla 開發者的變更
介面
無更改。
XUL
無更改。
JavaScript 程式碼模組
無更改。
XPCOM
無更改。
其他
無更改。