[30] 閲覧文脈は、 Webブラウザーにおける窓やタブ、フレームに相当する内部オブジェクトです。
[20] 閲覧文脈は、次の状態を持ちます。WindowProxy
Window
window.close
が機能する条件です。http:
→ https:
の URL 書き換えを行うか否か。http:
→ https:
の URL 書き換えを行うか否か。Document
[29] 最上位閲覧文脈は、加えて次の状態を持ちます。sessionStorage
で使われます。
起源ごとに存在します。
[25] 入れ子閲覧文脈は、加えて次の状態を持ちます。load
events modeiframe
sandboxing flag setiframe
要素の属性から得られた sandboxing flag set。
[27] 補助閲覧文脈は、加えて次の状態を持ちます。
[16] 閲覧文脈群には次のようなグループ化の単位があります。
[21] Document
の閲覧文脈は、
セッション履歴に当該 Document
を含むような閲覧文脈であって、
その捨てられたが偽であるもの (あれば)
です >>22。
document.defaultView
に相当します。
[37] 文書の閲覧文脈があることを、「閲覧文脈中にある」 などといいます。 navigate で作られた文書など閲覧文脈中にある文書もあれば、 XHR で作られた文書など閲覧文脈を持たない文書もあります。
[38] 閲覧文脈に現在表示中の文書のことを活性文書といいます。
window.document
に相当します。
[23] セッション履歴、セッション履歴エントリーも参照。
[10] 閲覧文脈には、それに対応する WindowProxy
オブジェクトが1つあります。 >>3
閲覧文脈は、 WindowProxy
への強い参照を持ちます >>40。
[11] それに対して閲覧文脈で提示される Document
オブジェクトには、それぞれ対応する Window
オブジェクトが1つずつあります。>>3
[12] WindowProxy
はその名の通り「串」であり、
すべてをその閲覧文脈の活性文書の Window
オブジェクトに転送します。 >>3
[35] 仕様上 WindowProxy
と閲覧文脈は別のオブジェクトとして規定されていますが、
閲覧文脈は仕様書上にのみ登場する内部オブジェクトで、JavaScript
からはアクセスできませんから、どう実装されるかは
Webブラウザーによります。両者は常に一対一対応していますから、
実質的に同じオブジェクトとみなすこともできます。
[33] Netscape 2 により JavaScript とフレームが導入されました。 現在の閲覧文脈に相当するものはこの時に登場したことになります。
[34] 閲覧文脈という用語が登場しその性質と挙動が初めて明確に規定されたのは、 その10年後の Web Applications 1.0 (現 HTML Standard) でした。
[13] [whatwg] Should events be paused on detached iframes? ( ( 版)) <http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029346.html>
[14] Window Object 1.0 ( ( 版)) <http://www.w3.org/TR/Window/#dfn-browsing-context>
[17] Web Applications 1.0 r8776 Try to fix the logic around opening new tabs because the user said so, even in sandboxed environments ( ( 版)) <https://html5.org/r/8776>
[18] MIX: Drop "JavaScript Global Environment". · 5d32821 · w3c/webappsec ( ( 版)) <https://github.com/w3c/webappsec/commit/5d32821b21f3cb06a651c966f729b3044292a08a>
[19] Web Applications 1.0 r8882 Add hyperlinks for creating browsing contexts. ( ( 版)) <https://html5.org/r/8882>
[24] Clarify the definition of window.frameElement · whatwg/html@a398377 ( 版) <https://github.com/whatwg/html/commit/a398377bbc8483e27c4fc478a097ef72f3057593>
[36] Use new "document's browsing context" concept everywhere · whatwg/html@6fe2ac7 ( 版) <https://github.com/whatwg/html/commit/6fe2ac75f7ab63b98fe1637129f0a8574a542e55>
[41] Remove the concept of creator Document so we don't leak a document · whatwg/html@a996f3b ( 版) <https://github.com/whatwg/html/commit/a996f3b4982f20697f71a23c919567a638519959>
[42] Be more precise about nested and discarded browsing contexts (domenic著, ) <https://github.com/whatwg/html/commit/39118df640ad4a3f03f164fb5ffe0a56316297be>
[43] Set the top-level browser context to use for a session. (#929) (shs96c著, ) <https://github.com/w3c/webdriver/commit/70a3387eaa8021027c5ae543ae9d2c3df167a913>
[44] 540988 - ☂ Speed up discarded tab restoration - chromium - Monorail () <https://bugs.chromium.org/p/chromium/issues/detail?id=540988>
Window
オブジェクトのように見えますが、 厳密には異なります。