unload a document

unload a document

仕様書

文書の unload

[24] 文書を unload (unload a document) >>22 するには、

文書
unload する文書
再帰フラグ
boolean再帰呼び出しかどうかを表します。 既定値はです。

... について、次のようにします >>22

  1. 文書unload a document 呼び出し済みフラグをに設定します。 (document.open で使います。)
  2. [25] 文書イベントループtermination nesting level を、 1 インクリメントします。
  3. [46] 文書ignore-opens-during-unload counter を、 1 インクリメントします。
  4. [47] 文書page showingの場合、
    1. [48] 文書page showing を、に設定します。
    2. [49] イベントを発火します。
      インターフェイス
      PageTransitionEvent
      イベント型
      pagehide
      対象
      文書Window
      target override
      文書
      trusted
      bubbles
      取り消し可能
      persisted
      文書salvageable
    3. [50] 文書についてunloading document visibility change steps を実行します。
  5. [36] 文書fired unloadの場合、
    1. [35] イベントを発火します。
      イベント型
      unload
      対象
      文書Window
      target override
      文書
  6. [38] 文書イベントループtermination nesting level を、 1 デクリメントします。
  7. [39] 先の unload イベント発火で何らかのイベントリスナーが実行されていれば、
    1. [52] 文書salvageable を、に設定します。
    2. [53] 文書fired unload を、に設定します。
  8. [51] 文書について unloading document cleanup steps を実行します。
  9. [37] 再帰フラグの場合、
    1. [54] 文書子孫閲覧文脈のリストの各閲覧文脈閲覧文脈について、
      1. [55] 閲覧文脈活性文書について unload a document を実行します。 再帰フラグとします。
      2. [56] 閲覧文脈活性文書salvageableの場合、
        1. [57] 文書salvageable を、に設定します。
    2. [58] 文書salvageableの場合、
      1. [59] 文書捨てます
  10. [60] 文書ignore-opens-during-unload counter を、 1 デクリメントします。

[23] 文書は、 fired unload フラグを持ちます。 初期値はです >>22文書のunloadで参照される他に、 document.open でも値が設定されます。

[26] unload a document の実行中か否かは、文書読み込みを停止の処理に影響します。

[31] ⊿ を指定した履歴の探索は、 unload a document を呼び出すことがあります。

[27] unload a document の実行中は、⊿ を指定した履歴の探索は行われません。

[28] unload a document の実行中は、 navigate は行われません。

[29] navigateunload a document を呼び出すことがあります。 その呼び出し中に navigate が取り消されたとしても、 unload a document の実行は中断されません。

navigate を参照。

[33] 閲覧文脈を閉じると、unload a document が呼び出されることがあります。

[30] document.open は、 unload a document を呼び出すことがあります。

[32] unload a document を呼び出す場合は、それより前に prompt to unload a document が呼び出されています。

[44] WebDriverスクリプト等が実行中の場合、...

onunload 属性 (HTML, XHTML 1)

この章は古いです

[1] HTMLbody 要素と frameset 要素の onunload 属性は、 UAまたはフレームから文書を除去する時に発生する事象に関する内在事象属性です。

[2] 仕様書:

代替

[3] 内在事象属性は表現と構造の分離の原則に反するので、 好ましくないと考える人もいます。また、 DOM 0 に基づく古い設計です。

代わりに、 script 要素などにより関連付けたスクリプト内で DOM 2 以上の事象に関するメソッド等が利用できます。 DOM 水準2 や DOM 水準 3 の HTML 事象モジュールはこの属性に対応する DOM の事象 unload を用意しています。

属性値

[4] この属性の値は %Script です。 SGML 的には CDATA です。スクリプト言語は、 Content-Script-Type によります。

[5] この属性は省略可能です。

他との関係

[6] この属性に対応する DOM の事象は load です。そちらもあわせてごらんください。

[7] 反対の意味の onload 属性もあります。

歴史

visibilityState 属性の値 unloaded (DOM)

[16] Document オブジェクトvisibilityState 属性は、最上位閲覧文脈に含まれている Documentunloadの過程にある時は、 unloaded を返すべきです>>17

[18] unloaded という値には対応しなくても構わない >>17 とされています。
[19] document.hiddenになります。

[34] この値は現在は削除され、 hidden とされています。

メモ

[8] (X)HTML5 Tracking ( 版) http://html5.org/tools/web-apps-tracker?from=4104&to=4105

[9] Surfin’ Safari - Blog Archive » WebKit Page Cache II – The unload Event ( 版) http://webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/

[10] [whatwg] Declarative unload data ( ( 版)) http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035686.html

[11] [whatwg] Declarative unload data ( ( 版)) http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035706.html

[12] Issue 113605 - chromium - Fire event unload, onbeforeunload, pagehide - An open-source browser project to help move the web forward. - Google Project Hosting ( 版) http://code.google.com/p/chromium/issues/detail?id=113605#c2

[13] Web Applications 1.0 r7318 Allow script termination dialogs to close the page too. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7317&to=7318

[14] [whatwg] Declarative unload data ( ( 版)) http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-November/038040.html

[15] [whatwg] events when navigating away before page load? ( ( 版)) http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038344.html

[20] Web Applications 1.0 r8609 align 'load' and 'unload' events since they have similar quirks in practice ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8608&to=8609

[21] Part2 - browsersec - Browser Security Handbook, part 2 - Browser Security Handbook - Google Project Hosting ( 版) https://code.google.com/p/browsersec/wiki/Part2#Page_transition_logic

[40] Remove the storage mutex due to lack of implementation · whatwg/html@1b918cf ( 版) https://github.com/whatwg/html/commit/1b918cf72fcbba011f83b92ab5d1f483fb1cafa3

[41] [] (0) Placeholder for beforeunload/unload; interaction of document.o… ( (Hixie著, )) https://github.com/whatwg/html/commit/c1994a485446ab0fbfb7048df10bb081947f6405

[42] [giow] (2) Make sure to fire the relevant events on the Window object… ( (Hixie著, )) https://github.com/whatwg/html/commit/afdba55e4ae45f4c9d42c00902da1a0df7381aad

[43] Disallow *all* navigations during unload, not just cross-origin (domenic著, ) https://github.com/whatwg/html/commit/2a11eef8f92b0335328890dc2cb1e281d18553eb

[45] Editorial: use a flag to track recursive "unload a document" (gterzian著, ) https://github.com/whatwg/html/commit/d9249d166174f08fe30d843731bfeb58cfb4117c

[61] add recusiveFlag argument to unload by gterzian · Pull Request #3632 · whatwg/html () https://github.com/whatwg/html/pull/3632

[62] Editorial: modernize the style of various document-accepting algorithms (musgravejw著, ) https://github.com/whatwg/html/commit/8bd6fb3972aab1debd2c562b31617e7d3da2377b

[63] Various algorithms should take an explicit document argument · Issue #3638 · whatwg/html () https://github.com/whatwg/html/issues/3638

[64] Editorial: Add Document to argument list explicitly for document algorithms by musgravejw · Pull Request #3639 · whatwg/html () https://github.com/whatwg/html/pull/3639

[65] document.open() simplifications, part 1 (TimothyGu著, ) https://github.com/whatwg/html/commit/6f769b8089a843066aa19f5991405bf4c84458b3

[66] document.open() simplifications, part 1 (TimothyGu著, ) https://github.com/whatwg/html/commit/6f769b8089a843066aa19f5991405bf4c84458b3

[67] document.open() simplifications: realm creation, unloading, tasks removal by TimothyGu · Pull Request #3918 · whatwg/html () https://github.com/whatwg/html/pull/3918

[68] document.open() simplifications: realm creation, unloading, tasks removal by TimothyGu · Pull Request #3918 · whatwg/html () https://github.com/whatwg/html/pull/3918

[69] Disallow window.open() during unload by TimothyGu · Pull Request #3960 · whatwg/html () https://github.com/whatwg/html/pull/3960