Firefox 9 for developers
Firefox 9 は Windows 向けに 2011 年 12 月 20 日にリリースされました。その直後に見つかったクラッシュバグを修正した Mac 版および Linux 版のバージョン 9.0.1 は、2011 年 12 月 21 日にリリースされました。
Web 開発者向けの変更点一覧
HTML
<li>要素のvalue属性が負の値を取れるようになりました。これは HTML5 仕様に基づくもので、HTML5 以前は 0 に変換されていました。<audio>と<video>要素を用いるときのメディアの URI において、メディアの開始時間と終了時間を指定 できるようになりました。<input>要素と<textarea>要素が、スペルチェッカーの実行においてlang属性の値を加味 (en-US)するようになりました。- Android 版 Firefox において、
type="file"とaccept="image/*" を指定している<input>要素のときに、ユーザがブラウザからアプリを切り替えることなく電話のカメラを用いて写真を撮れるようになりました。 - Windows Vista スタイル PNG ICO イメージがサポートされるようになりました。
- CORS が許可されているときに、CORS アクセスを要求するために
crossorigin属性 を用いた画像を描いても、不正に Canvas を制限状態にしないようになりました。 rowspan属性に指定できる値の最大値が 8190 から 65,534 になりました。
CSS
font-stretchプロパティがサポートされました。columnsプロパティが -moz (en-US) 接頭辞付きでサポートされました。このプロパティはcolumn-widthとcolumn-countをまとめて記述する短縮形プロパティです。<link>要素を用いて取り込まれたスタイルシートが完全にロードされてパースされたとき (しかしまだドキュメントに適用されていない状態)、loadイベント (en-US) が発生するようになりました。また、スタイルシートの処理においてエラーが起きた場合、errorイベントが発生します。text-overflow向けの 2 つの値を指定できる新しい構文を用いて、左端と右端の両方のオーバフロー設定を指定できるようになりました。
DOM
- フルスクリーンモードの利用
-
新しい full-screen API は、ブラウザインターフェースを表示せずに、画面全体を用いてコンテンツを表示する方法を提供します。これはビデオおよびゲームにとって素晴らしいものです。この API は現在実験的かつプレフィックス付きです。
Node.contains()メソッドがサポートされました。このメソッドによって、あるノードが別のノードの子孫であるかを調べられます。Node.parentElement属性が実装されました。このメソッドは DOM ノードの親Element、または、親が要素ではない場合はnullを返します。- DOM Level 3 Composition イベント がサポートされました。
Document.scripts属性が実装されました。このメソッドはドキュメントのすべての<script>要素のHTMLCollectionを返します。Document.queryCommandSupported()メソッドが実装されました。- 標準 IDL インターフェースとして Event ハンドラが実装されました。多くのケースで、これはコンテンツに影響を及ぼさないはずですが、例外が存在します。 (en-US)
- 新しいレスポンスタイプ、 "moz-json" が XMLHttpRequest に追加されました。 そのタイプを用いると、 XMLHttpRequest に自動的に JSON 文字列をパースさせられます。つまり、このタイプをリクエストしたときはパースされた JSON 文字列が返るので、
responseプロパティの値がパース結果の JavaScript オブジェクトになります。 - XMLHttpRequest の progress イベント が受け取ったデータの各チャンクに対して確実に送信されるようになりました。つまり、以前のバージョンでは受け取ったデータの最後のチャンクが progeress イベントを発生させない可能性がありました。データの最後のチャンクを受け取ったかを判定するために load イベントも監視する必要はもう無くなり、progress イベントだけで進捗を追えるようになります。
- 過去に、
nullのリスナーを指定したaddEventListener()の呼び出しは例外を投げていましたが、エラーを出すことなく、何の影響も及ぼさずに処理を戻すようになりました。 - 新しい
navigator.doNotTrackプロパティを用いることで、コンテンツ中で簡単にユーザが do-no-track 設定を有効にしているかを判定できます。この値が "yes" ならば、ユーザを追跡するべきではありません。 splitText()やnormalize()が呼び出されたとき、RangeオブジェクトやSelectionオブジェクトがとる挙動が仕様通りになりました。- doctype ノードに対しての
Node.ownerDocumentの値が、nullではなく、ノードを作成するために呼ばれたcreateDocumentType()(en-US) 上のドキュメントになるようになりました。 window.navigator.taintEnabledが削除されました。このプロパティは長年サポートされていませんでした。
Workers
- Firefox 8 では、blob URL で実装された Workers が壊れていましたが、Firefox 9 から再び動作するようになりました。
MathML
<maction>(en-US) 要素のactiontype属性における非推奨な値restyleが削除されました。- まだ要素自体はサポートされていませんが、
<mlabeledtr>要素を用いても、描画を完全に壊さないようになりました。この要素の実際のサポートの進捗は バグ 689641 を参照してください。
Networking
- You can now send the contents of JavaScript typed arrays (that is, the contents of an
ArrayBufferobject) using XMLHttpRequest. - WebSocket connections now permit non-characters in otherwise valid UTF-8 data frames to be received, instead of failing.
- The HTTP
Acceptheader for XSLT requests has been changed to simply "*/*" for simplicity. Since fetching XSLT has always fallen back to "*/*" anyway, it made sense to simplify the initial request. - Attempts by a server to use the
301 Moved Permanentlyor307 Temporary Redirectresponse codes to redirect the user to ajavascript:URI now result in a "bad connection" error instead of actually redirecting. This prevents certain types of cross-site scripting attacks. - Content served with an empty
Content-Dispositionwere previously treated as if theContent-Dispositionwere "attachment"; this didn't always work as expected. These are now handled as if theContent-Dispositionwere "inline". - The default maximum size of an item in the disk cache has been increased to 50 MB; previously, only items up to 5 MB were cached.
Developer tools
- The web console now supports basic string substitutions in its logging methods.
- You can now create visually nested blocks of output in the web console, to help make it easier to read.
Mozilla 開発者とアドオン開発者向けの変更点
See Updating add-ons for Firefox 9 for an overview of the changes you may need to make to get your add-ons working in Firefox 9.
XUL
- The
tabelement now has apendingattribute, whose value istrue, when the tab is in the process of being restored by the session store service. This can be used for styling the tab in themes. The attribute isn't present on tabs that aren't pending. - The
tabelement now has anunreadattribute, whose value istrue, when the tab has changed since the last time it was the active tab or if it hasn't been selected since the current session began. The attribute isn't present on tabs that are not unread. - You can now use a
panelas a drag image for DOM drag and drop operations. This lets you use the standard drag & drop API for drag and drop of XUL content. - The
notificationboxelement'sappendNotificationmethod now lets you specify a callback that gets called for interesting events related to the notification box. Currently, the only event is "removed", which tells you the box has been removed from its window.
JavaScript code module changes
FileUtils.jsmnow has aFileconstructor that returns annsIFileobject representing a file specified by its pathname.
Service changes
- サイト別設定サービスが プライベートブラウジングモードを考慮するようになりました (バグ 679784 参照)。
Interface changes
Removed interfaces
nsIGlobalHistory3has been removed during streamlining of the Places and DocShell code.
Miscellaneous interface changes
nsISoundインタフェースに新しい定数EVENT_EDITOR_MAX_LENが導入され、テキスト欄に入力された文字数が制限を超えた場合にシステム効果音を鳴らせるようになりました。今のところ、これは Windows のみで使用されています。nsIScriptError2インタフェースに新しいプロパティtimeStampとinnerWindowIDが追加されました。また、initWithWindowID()メソッドが、外部ウィンドウ ID の代わりに内部ウィンドウ ID を受け取るようになりました。nsIBidiKeyboardインタフェースにhaveBidiKeyboards属性が追加されました。これは、OS に少なくともひとつ各方向 (LTR もしくは RTL) のキーボードがインストールされているかどうかを判別できるものです。.- The new
nsIEditor.isSelectionEditableattribute lets you determine if the current selection anchor is editable. This helps to support cases where only parts of the document are editable, by letting you see if the current selection is in an editable section. - The
nsIBrowserHistory.registerOpenPage()andnsIBrowserHistory.unregisterOpenPage()methods have been removed as part of a performance overhaul in the Places system. You can use the corresponding methods inmozIPlacesAutoCompleteinstead. - The
nsIDOMWindowUtils.wrapDOMFile()method has been added; this returns a DOMFileobject for a givennsIFile. - The
nsIChromeFrameMessageManager.removeDelayedFrameScript()method was added to support removing delayed load scripts. Bootstrapped add-ons should use this, at shutdown, to remove any scripts it loaded usingnsIChromeFrameMessageManager.loadFrameScript()with the delayed load flag set. This is exposed to add-ons asbrowser.messageManager.removeDelayedFrameScript(). - The
nsIAppStartupinterface has a newinterruptedattribute, which lets you know if the startup process was interrupted at any point by an interactive prompt. This can be helpful, for example, when timing startups during performance evaluation, to be able to drop numbers from sessions that were interrupted. - The
nsIEditorSpellCheckinterface has been revised to support per-site selection of spell checker dictionaries.
IDL パーサ
IDL パーサから、これまで完全に実装されたことのなかったユニークポインタの概念が削除されました。
Build system changes
- The
--enable-application=standaloneoption for building standalone XPConnect has been removed; it hasn't worked since 2007 anyway. - The build system now looks for
.mozconfigat$topsrcdir/.mozconfigor$topsrcdir/mozconfig, and nowhere else, unless you override the.mozconfigpath using theMOZCONFIGenvironment variable. - The xpidl utility has been replaced in the SDK with pyxpidl.
Other changes
- The spell checker no longer has an arbitrary 130-character word-length limit on the length of words it will attempt to spell check. This limit was previously in place to prevent crashes that were occurring in the spell checker, but the underlying bugs have since been fixed.
- You can now register components to add features to the
window.navigatorobject by using the "JavaScript-navigator-property" category. See Adding APIs to the navigator object for details and examples.