閲覧文脈 — Browsing contexts


7. Web ページの読み込み

この節は、~Web~browserに最も直接的に適用される特色機能を述べる。 とは言え,~web~browserかどうかにかかわらず、この節に定義される要件は,すべての~UAに適用される — 他が指定されない限り。 ◎ This section describes features that apply most directly to Web browsers. Having said that, except where specified otherwise, the requirements defined in this section do apply to all user agents, whether they are Web browsers or not.

【この訳に固有の表記規約】

この訳の,~algoや定義の記述に利用されている各種記号( ~LET, ~IF, ε, 此れ, ~THROW 等々)の意味や定義の詳細は,~SYMBOL_DEF_REFを~~参照されたし。

7.1. 閲覧文脈

`閲覧文脈@ とは、利用者~向けに`文書$を呈示する環境である。 ◎ A browsing context is an environment in which Document objects are presented to the user.

注記: ~Web~browser内の[ ~tab/~window ]は、概して`閲覧文脈$を包含する — [ `iframe$e / `frameset$e 内の `frame$e ]と同じく。 ◎ A tab or window in a Web browser typically contains a browsing context, as does an iframe or frames in a frameset.

各 `閲覧文脈$は、対応する `WindowProxy$I ~objを持つ。 ◎ A browsing context has a corresponding WindowProxy object.

各 `閲覧文脈$は、`~session履歴$を持つ。 それは、`閲覧文脈$が呈示-[ した/している/することになる ]`文書$たちからなる。 ◎ A browsing context has a session history, which lists the Document objects that the browsing context has presented, is presenting, or will present.\

`閲覧文脈$ %B にて `作動中の文書@ は、 %B の `WindowProxy$I ~objの `Window$sl 内部~slot値に`結付けられている文書$である。 ◎ A browsing context's active document is its WindowProxy object's [[Window]] internal slot value's associated Document.\

`文書$ %文書 が `属する閲覧文脈@ は、次を満たす`閲覧文脈$ %B は[ 在るならば それ / 無いならば ε ]とする ⇒ [ %B は`破棄され$ていない ]~AND[ %B の`~session履歴$を成すある~entryの文書 ~EQ %文書 ] 【同じ文書が複数の~session履歴に含まれることはないので、 %B は一意に定まる。】 ◎ A Document's browsing context is the browsing context whose session history contains the Document, if any such browsing context exists and has not been discarded.

注記: 一般に,`~window$から`閲覧文脈に属する$`文書$へは一対一に対応するが、例外が 2 つある: ◎ In general, there is a 1-to-1 mapping from the Window object to the Document object, as long as the Document object has a browsing context. There are two exceptions.\

  • 一つは、`~window$は,同じ`閲覧文脈$内で 2 番目の`文書$を呈示するために再利用されることもあり、その場合,対応関係は一対二になる†。 これは、[ `置換~可能化~flag$ ~SET ~ON ]の下で,`閲覧文脈$が初期 `about_blank$sc `文書$から別の文書へ`~navigate$されるときに生じる。 ◎ First, a Window can be reused for the presentation of a second Document in the same browsing context, such that the mapping is then 1-to-2. This occurs when a browsing context is navigated from the initial about:blank Document to another, with replacement enabled.\
  • もう一つは、 `document.open(type, replace)$m ~methodが利用される結果として,いくつかの`~window$間で同じ`文書$が再利用される††こともある — この場合、対応関係は多対一になる。 ◎ Second, a Document can end up being reused for several Window objects when the document.open(type, replace) method is used, such that the mapping is then many-to-1.

【† この一対二は,異なる時点も含めてのことであり、任意のある時点では,一義的に対応する — そのため、仕様の記述では、文書と~windowは,他の~objとの~~関係を述べるときに同一視されることも多い — 例えば “~windowの閲覧文脈” は、実際には “~windowに結付けられている文書が属する閲覧文脈” の略記である(そう解釈する下で,和訳している)。 】【†† 再利用されると言っても、文書の内容は ~openした資源で一新される。 】

注記: `文書$は必ずしも`閲覧文脈$に属するとは限らない。 特に,~data集析~toolは、およそ閲覧文脈を~instance化することはないであろう。 `createDocument()$m などの ~APIを利用して作成された`文書$は、`閲覧文脈に属する$ことは決してない。 また、 `iframe$e 要素に対し作成された`文書$があって,後にその要素が`文書から除去され$たときは、その文書が`属する閲覧文脈$は`破棄され$,文書が`属する閲覧文脈$は ε になる。 ◎ A Document does not necessarily have a browsing context associated with it. In particular, data mining tools are likely to never instantiate browsing contexts. A Document created using an API such as createDocument() never has a browsing context. And the Document originally created for an iframe element, which has since been removed from the document, has no associated browsing context, since that browsing context was discarded.

`閲覧文脈にて作動中の文書を設定する@ ときは、所与の ( `閲覧文脈$ %B, `文書$ %文書, `~window$ %~window (省略時は ε ) ) に対し,次を走らす: ◎ To set the active document of a browsing context browsingContext to a Document object document, optionally with a Window object window, run these steps:

  1. ~IF[ %~window ~EQ ε ] ⇒ %~window ~SET %文書 に`関連する大域~obj$ ◎ If window is not given, let window be document's relevant global object.

    この標準によれば、 %文書 は, %~window より前に作成され得る — それは理にかなっているとは言い難い。 issue #2688 を見よ。 ◎ Per this standard document can be created before window, which does not make much sense. See issue #2688.

  2. %B の `WindowProxy$I の `Window$sl 内部~slot値 ~SET %window ◎ Set browsingContext's WindowProxy object's [[Window]] internal slot value to window.
  3. %window に`結付けられている文書$ ~SET %文書 ◎ Set window's associated Document to document.
  4. %~window に`関連する設定群~obj$の`実行~準備済み~flag$enV ~SET ~ON ◎ Set window's relevant settings object's execution ready flag.

`閲覧文脈$ %B の `作成元~閲覧文脈@ とは、 %B の作成を担当していたとされる`閲覧文脈$であり,次で定義される: ◎ A browsing context can have a creator browsing context, the browsing context that was responsible for its creation.\

  1. %B の`親~閲覧文脈$ ~NEQ ε ならば、それ。 ◎ If a browsing context has a parent browsing context, then that is its creator browsing context.\
  2. 他の場合, %B を`開いた閲覧文脈$ ~NEQ ε ならば、それ。 ◎ Otherwise, if the browsing context has an opener browsing context, then that is its creator browsing context.\
  3. 他の場合、 ε。 ◎ Otherwise, the browsing context has no creator browsing context.

`閲覧文脈$ %B の`作成元~閲覧文脈$ %作成元 ~NEQ ε ならば、 %B には次のものが結付けられる( %作成元 ~EQ ε の場合、これらは いずれも ε とする)。 以下における %作成元~文書 は %B の作成-時に %作成元 にて`作動中の文書$であった`文書$とする: ◎ If a browsing context context has a creator browsing context creator, it also has the following properties. In what follows, let creator document be creator's active document at the time context is created:

`作成元の生成元@
%作成元~文書 の`生成元$ ◎ creator document's origin
`作成元の~URL@
%作成元~文書 の`~URL$doc ◎ creator document's URL
`作成元の基底~URL@
%作成元~文書 の`基底~URL$doc ◎ creator document's base URL
`作成元の~referrer施策@
%作成元~文書 の`~referrer施策$doc ◎ creator document's referrer policy

`新たな閲覧文脈を作成する@ ときは、所与の ( 真偽値 %noopener (省略時は ~F) ) に対し,次を走らす: ◎ To create a new browsing context, optionally given noopener: • If noopener was not given, let it be false.

  1. %B ~LET 新たな`閲覧文脈$ ◎ Let browsingContext be a new browsing context.
  2. %~realm実行~文脈 ~LET 次のように~custom化する下で,`新たな~JS~realmを作成する$ ⇒# 大域~obj用に 新たな `Window$I ~objを作成する, 大域 `this^jv 束縛には %B の `WindowProxy$I ~objを利用する ◎ Let realm execution context be the result of creating a new JavaScript realm with the following customizations: • For the global object, create a new Window object. • For the global this binding, use browsingContext's WindowProxy object.

  3. %設定群~obj ~LET `~window用に環境~設定群~objを設定しておく$( %~realm実行~文脈 ) ◎ Set up a window environment settings object with realm execution context, and let settingsObject be the result.
  4. %文書 ~LET 次のようにされた新たな`文書$: ◎ Let document be a new Document,\

    • `過去互換~mode$docにおいては ⇒ %文書 の`種別$doc ~SET `html^l ◎ marked as an HTML document in quirks mode,\
    • `内容~型$doc ~SET `text/html^l ◎ whose content type is "text/html", and\
    • 即時に,`読込後~taskは準備済み$になる ◎ which is both ready for post-load tasks and\
    • 即時に,`完全に読込まれ$る ◎ completely loaded immediately.
  5. %文書 が次を満たすことを確保する ⇒ [ %文書 の子~nodeたちは 1 個の `html$e 要素 %html からなる ]~AND[ %html の子~nodeたちは 空の[ `head$e 要素, `body$e 要素 ]からなる ] ◎ Ensure that document has a single child html node, which itself has two empty child nodes: a head element, and a body element.
  6. `閲覧文脈にて作動中の文書を設定する$( %B, %文書 ) ◎ Set the active document of browsingContext to document.
  7. ~IF[ %B の`作成元~閲覧文脈$ ~NEQ ε ] ⇒ %文書 の ⇒# `生成元$ ~SET %B の`作成元の生成元$, `~referrer$doc ~SET `~URLを直列化する$( %B の`作成元の~URL$ ), `~referrer施策$doc ~SET %B の`作成元の~referrer施策$

    ~ELSE ⇒ %文書 の`生成元$ ~SET `不透明な生成元$

    ◎ Set the origin of document: • If browsingContext has a creator browsing context, then the origin of document is the creator origin. • Otherwise, the origin of document is a unique opaque origin. ◎ If browsingContext has a creator browsing context, then set document's referrer to the serialization of creator URL. ◎ If browsingContext has a creator browsing context, then set document's referrer policy to the creator referrer policy.
  8. `文書~用に~sandbox法を実装する$( %文書, %B ) ◎ Implement the sandboxing for document.
  9. `文書の特色機能~施策を初期化する$( %文書 ) `FEATUREPOLICY$r ◎ Execute the Initialize document’s Feature Policy algorithm on document. [FEATUREPOLICY]
  10. %B の`~session履歴$に %文書 を追加する ◎ Add document to browsingContext's session history.
  11. ~IF[ %noopener ~EQ ~F ]~AND[ %B は`~top-level閲覧文脈$である ]~AND[ ( %B の`作成元の生成元$, %文書 の`生成元$ ) は`同一生成元$である ] ⇒ %B の`作成元~閲覧文脈$から[ %B の`作成元の生成元$に属する `sessionStorage$m ~storage区画 ]を[ %B の~session~storage区画の集合 ]に複製する ⇒ これらの区画は、別々の, [ いかなる仕方でも互いに影響しないもの ]と見なされ~MUST。 ◎ If noopener is false, browsingContext is a top-level browsing context, and creator origin is same origin with document's origin, then copy the sessionStorage storage area of the creator origin from the creator browsing context into browsingContext's set of session storage areas. These areas must be considered separate, not affecting each other in any way.
  12. ~RET %B ◎ Return browsingContext.

7.1.1. 入子の閲覧文脈

ある種の要素(例えば `iframe$e 要素)は、更に`閲覧文脈$を~instance化し得る。 そのような要素 %要素 は `閲覧文脈~容器@ と呼ばれる。 【 `iframe^e 以外に該当する要素には、 `embed$e, `object$e と,廃用にされた `frame$e がある(他には?)。】 ◎ Certain elements (for example, iframe elements) can instantiate further browsing contexts. These elements are called browsing context containers.

`閲覧文脈~容器$ %要素 が `入子にしている閲覧文脈@ は、`閲覧文脈$または ~NULL とする。 ~NULL でない場合、そのような`閲覧文脈$は:

  • `入子の閲覧文脈$である,ともいう。
  • %要素 を `通して入子にされ@ ている,ともいう。
  • %要素 の`~node文書$を %文書 とするとき、 %文書 を`通して入子にされ$ている,ともいう。

【 ある要素が`入子にしている閲覧文脈$が,別の要素のそれと同じになることはない。 】

◎ Each browsing context container has a nested browsing context, which is either a browsing context or null. ◎ If a browsing context is the nested browsing context of a browsing context container, then the browsing context is said to be nested through the browsing context container's node document.

`閲覧文脈$ %子 が別の`閲覧文脈$ %親 の `子~閲覧文脈@ であるとは、次をすべて満たす`閲覧文脈~容器$ %要素 が在ることをいう: ◎ A browsing context child is said to be a child browsing context of another browsing context parent, if all of the following conditions hold:

  • %子 ~EQ %要素 が`入子にしている閲覧文脈$ ◎ child is a nested browsing context of a browsing context container element
  • %要素 は`接続されて$いる ◎ element is connected
  • %親 ~EQ %要素 の`~shadowも含む根$が`属する閲覧文脈$ ◎ element's shadow-including root's browsing context is parent

上の条件に加えて, %要素 は`文書~木~内$にあるならば、 %子 は %親 の`文書~木に属する子~閲覧文脈@ であるという。 ◎ A browsing context child is then a document-tree child browsing context of parent if it is a child browsing context and its browsing context container is not just connected, but also in a document tree.

`閲覧文脈$ %子 がある %親 の`子~閲覧文脈$であるならば、そのような %親 は一意に定まる。 この %親 を指して, %子 の `親~閲覧文脈@ という。 そのような %親 は無いならば、 %子 の`親~閲覧文脈$ ~EQ ε (存在しない)と定義される。 ◎ A browsing context child may have a parent browsing context. This is the unique browsing context that has child as a child browsing context, if any such browsing context exists. Otherwise, the browsing context has no parent browsing context.

`閲覧文脈$ %A, %B が次のいずれかを満たすとき、 %A は %B の `先祖@ であるという:

  • %A は %B の`親~閲覧文脈$である
  • %A は %B の ある`先祖$の`親~閲覧文脈$である
◎ A browsing context A is said to be an ancestor of a browsing context B if there exists a browsing context A' that is a child browsing context of A and that is itself an ancestor of B, or if the browsing context A is the parent browsing context of B.

`入子の閲覧文脈$でない`閲覧文脈$ %B の`親~閲覧文脈$は ε である。 このとき、 %B は,[ %B を`先祖$とするような閲覧文脈 ]すべての `~top-level閲覧文脈@ になる。 ◎ A browsing context that is not a nested browsing context has no parent browsing context, and is the top-level browsing context of all the browsing contexts for which it is an ancestor browsing context.

【 “`~top-level閲覧文脈$である” ことに`子~閲覧文脈$の存在が要求されるわけではない。 ~top-level閲覧文脈 %B 自身の~top-level閲覧文脈も %B である(例えば、`補助~閲覧文脈$)。 】

`閲覧文脈$に対する,非 ε の`親~閲覧文脈$による推移閉包 【親を順々に辿って得られる先祖たち】 は、`先祖~閲覧文脈$の~listを成す。 ◎ The transitive closure of parent browsing contexts for a browsing context that is a nested browsing context gives the list of ancestor browsing contexts.

`文書$ %文書 の `子孫~閲覧文脈~list@ は、次の~algoが返す~listで与えられる: ◎ The list of the descendant browsing contexts of a Document d is the (ordered) list returned by the following algorithm:

  1. %~list ~LET 新たな`~list$ ◎ Let list be an empty list.
  2. ~Assert: %文書 が`属する閲覧文脈$ ~NEQ ε 【この段はこの訳による補完】
  3. %文書 `木~内にある$ ~EACH( `閲覧文脈~容器$ %C ) に対し,`木~順序$で: ◎ For each child browsing context of d that is nested through an element that is in the Document d, in the tree order of the elements nesting those browsing contexts, run these substeps:

    1. %子~閲覧文脈 ~LET %C が`入子にしている閲覧文脈$ ◎ ↑
    2. ~IF[ %子~閲覧文脈 は %文書 が`属する閲覧文脈$の`子~閲覧文脈$でない ] ⇒ ~CONTINUE ◎ ↑
    3. %~list に %子~閲覧文脈 を`付加する$ ◎ Append that child browsing context to the list list.
    4. %子~閲覧文脈 にて`作動中の文書$の`子孫~閲覧文脈~list$を成す ~EACH( %子孫 ) に対し ⇒ %~list に %子孫 を`付加する$ ◎ Append the list of the descendant browsing contexts of the active document of that child browsing context to the list list.
  4. ~RET %~list ◎ Return the constructed list.

`作動中の文書$は、それが`属する閲覧文脈$ %B が次のいずれかを満たすならば, `全部的に作動中@ であるとされる: ◎ A Document is said to be fully active when it has a browsing context and it is the active document of that browsing context, and\

  • %B は`~top-level閲覧文脈$である ◎ either its browsing context is a top-level browsing context, or\
  • [ %B の`親~閲覧文脈$ %P ~NEQ ε ]~AND[ %B は %P において`全部的に作動中$である文書を`通して入子にされ$ている ] ◎ it has a parent browsing context and the Document through which it is nested is itself fully active.

`子~閲覧文脈$ %B は,要素に結付けられるので、常にその`親~閲覧文脈$に属する特定の`文書$ %文書 に束ねられる。 ~UAは、 %文書 が`全部的に作動中$でない下では、利用者による %B とのやりとりを許容しては~MUST_NOT。 ◎ Because they are associated with an element, child browsing contexts are always tied to a specific Document in their parent browsing context. User agents must not allow the user to interact with child browsing contexts of elements that are in Documents that are not themselves fully active.

`入子の閲覧文脈$は、 `~load~event遅延~中~mode@ 下に置かれ得る。 この~modeは、`~navigate$に際して新たな`文書$が作成される前に,その`閲覧文脈~容器$向けの`~load~eventを遅延する$ために利用される。 ◎ A browsing context that is a nested browsing context can be put into a delaying load events mode. This is used when it is navigated, to delay the load event of its browsing context container before the new Document is created.

`閲覧文脈$ %B の `文書~族@ は、[ %B の`~session履歴$内にある`文書$ ]すべてと, [ それらの各`文書$の`文書~族$ ]すべての和集合からなる。 `文書$ %文書 の`文書~族$は、[ %文書 を`通して入子にされ$ている各 `閲覧文脈$の`文書~族$ ]すべての和集合からなる。 ◎ The document family of a browsing context consists of the union of all the Document objects in that browsing context's session history and the document families of all those Document objects. The document family of a Document object consists of the union of all the document families of the browsing contexts that are nested through the Document object.

`閲覧文脈~容器$ %C の `内容~文書@ は、次の~algoの結果で与えられる: ◎ The content document of a browsing context container container is the result of the following algorithm:

  1. %B ~LET %C が`入子にしている閲覧文脈$ ◎ ↓
  2. ~IF[ %B ~EQ ~NULL ] ⇒ ~RET ~NULL ◎ If container's nested browsing context is null, then return null. ◎ Let context be container's nested browsing context.
  3. %文書 ~LET %B にて`作動中の文書$ ◎ Let document be context's active document.
  4. ~IF[ ( %文書 の`生成元$, `現在の設定群~obj$により指定される`生成元$enV ) は`同じ生成元~domain$でない ] ⇒ ~RET ~NULL ◎ If document's origin and the origin specified by the current settings object are not same origin-domain, then return null.
  5. ~RET %文書 ◎ Return document.

7.1.2. 補助~閲覧文脈

新たな閲覧文脈を、要素を`通して入子にされ$ることなく,ある`~top-level閲覧文脈$に関係するように作成することも可能である。 そのような閲覧文脈は、 `補助~閲覧文脈@ と呼ばれる。 補助~閲覧文脈は、常に`~top-level閲覧文脈$である。 ◎ It is possible to create new browsing contexts that are related to a top-level browsing context without being nested through an element. Such browsing contexts are called auxiliary browsing contexts. Auxiliary browsing contexts are always top-level browsing contexts.

`補助~閲覧文脈$ %B を作成させた`閲覧文脈$を指して、 %B を `開いた閲覧文脈@ という — そのようなものが無ければ、開いた閲覧文脈は ε とする。 ◎ An auxiliary browsing context has an opener browsing context, which is the browsing context from which the auxiliary browsing context was created.

【 おそらく, “補助~閲覧文脈である” と “開いた閲覧文脈 ~NEQ ε” は、論理的に等価になると思われる。 】

7.1.3. 保安

所与の`閲覧文脈$ %A, %B に対し, %A が %B に `近しい@ ( “ %A is familiar with %B ” )とは、次のいずれかが満たされることを意味する: ◎ A browsing context A is familiar with a second browsing context B if one of the following conditions is true:

  • ( %A にて`作動中の文書$の`生成元$, %B にて`作動中の文書$の`生成元$ ) は`同一生成元$である ◎ Either the origin of the active document of A is the same as the origin of the active document of B, or
  • %A の`~top-level閲覧文脈$ ~EQ %B ◎ The browsing context A is a nested browsing context with a top-level browsing context, and its top-level browsing context is B, or
  • [ %B は`補助~閲覧文脈$である ]~AND[ %A は %B を`開いた閲覧文脈$に`近しい$ ] ◎ The browsing context B is an auxiliary browsing context and A is familiar with B's opener browsing context, or
  • %B のある`先祖~閲覧文脈$ %X が存在して ⇒ %A にて`作動中の文書$の`生成元$, %X にて`作動中の文書$の`生成元$ ) は`同一生成元$である ◎ The browsing context B is not a top-level browsing context, but there exists an ancestor browsing context of B whose active document has the same origin as the active document of A (possibly in fact being A itself).

【 最初と最後の条件から、特に,[ %A ~EQ %B, または %A は %B の`先祖~閲覧文脈$である ]ならば、 %A は %B に`近しい$ことになる。 】


所与の`閲覧文脈$ %A, %B に対し、次の手続きが ~T を返すならば, %A は %B を `~navigateすることは許容されて@ いるとされる: ◎ A browsing context A is allowed to navigate a second browsing context B if the following algorithm returns true:

  1. ~IF[ %A ~EQ %B ] ⇒ ~RET ~T ◎ ↓
  2. %S ~LET[ %A にて`作動中の文書$ ]の`作動中の~sandbox法~flag集合$ ◎ ↓
  3. ~RET[ 次のいずれかが満たされるならば ~F / ~ELSE_ ~T ]:

    • [ %B は`~top-level閲覧文脈$ではない ]~AND[ %A は %B の`先祖~閲覧文脈$でない ]~AND[ `~navi$sbox ~IN %S ] ◎ If A is not the same browsing context as B, and A is not one of the ancestor browsing contexts of B, and B is not a top-level browsing context, and A's active document's active sandboxing flag set has its sandboxed navigation browsing context flag set, then return false.
    • [ %B は %A の`~top-level閲覧文脈$である ]~AND[ 次のいずれかが満たされる ]: ◎ Otherwise, if B is a top-level browsing context, and is one of the ancestor browsing contexts of A, then:

      • [ この~algoは`利用者による作動化から誘発されて$いる ]~AND[ `利用者~作動化~top-level~navi$sbox ~IN %S ] ◎ If this algorithm is triggered by user activation and A's active document's active sandboxing flag set has its sandboxed top-level navigation with user activation browsing context flag set, then return false.
      • [ この~algoは`利用者による作動化から誘発されて$いない ]~AND[ `非~利用者~作動化~top-level~navi$sbox ~IN %S ] ◎ Otherwise, if this algorithm is not triggered by user activation and A's active document's active sandboxing flag set has its sandboxed top-level navigation without user activation browsing context flag set, then return false.
    • [ %B は`~top-level閲覧文脈$である ]~AND[ %B は %A の`先祖~閲覧文脈$でない ]~AND[ `~navi$sbox ~NIN %S ]~AND[ %A は %B の`許可-済み~navigator$でない ] ◎ Otherwise, if B is a top-level browsing context, and is neither A nor one of the ancestor browsing contexts of A, and A's Document's active sandboxing flag set has its sandboxed navigation browsing context flag set, and A is not the one permitted sandboxed navigator of B, then return false. ◎ Return true.

【 最初の 2 つの段は、 3 番目の段を簡潔に記すための,訳者による追加。 】【 論理的には、 %A が %B を~navigateする機会が生じ得ないような場合( “互いに無縁な” 閲覧文脈など)も ~F を返すべきだが、不要なので省略されていると見られる。 】


要素 %E の `閲覧文脈~視野~生成元@ は、次を走らせた結果で与えられる:

  1. %文書 ~LET %E の`~node文書$
  2. %B ~LET %文書 が`属する閲覧文脈$
  3. ~IF[ %B ~EQ ε ] ⇒ ~RET ε
  4. %生成元 ~LET %文書 の`生成元$
  5. %B の ~EACH ( `先祖~閲覧文脈$ %A ) に対し ⇒ ~IF[ ( %A にて`作動中の文書$の`生成元$, %生成元 ) は`同一生成元$でない ] ⇒ ~RET ε
  6. ~RET %生成元
◎ An element has a browsing context scope origin if its Document's browsing context is a top-level browsing context or if all of its Document's ancestor browsing contexts all have active documents whose origin are the same origin as the element's node document's origin. If an element has a browsing context scope origin, then its value is the origin of the element's node document.

7.1.4. 閲覧文脈の~group分け

所与の`閲覧文脈$ %A に対し,次のいずれかを満たす`閲覧文脈$ %B は、 %A から `直接到達可能@ とされる: ◎ Each browsing context is defined as having a list of one or more directly reachable browsing contexts. These are:

  • %B ~EQ %A ◎ The browsing context itself.
  • %B の`親~閲覧文脈$ ~EQ %A ◎ All the browsing context's child browsing contexts.
  • %B ~EQ %A の`親~閲覧文脈$ ◎ The browsing context's parent browsing context.
  • %B を`開いた閲覧文脈$ ~EQ %A ◎ All the browsing contexts that have the browsing context as their opener browsing context.
  • %B ~EQ %A を`開いた閲覧文脈$ ◎ The browsing context's opener browsing context.

【 この関係は、反射律と対称律を満たす(そのことが明白になるよう,ここでは 原文を等価な形に言い換えている)。 】

`直接到達可能$な関係による推移閉包は、 `互いに関係する閲覧文脈~群@ を形成する。 ◎ The transitive closure of all the browsing contexts that are directly reachable browsing contexts forms a unit of related browsing contexts.

【 すなわち、推移律も満たすように — したがって,同値律を満たすように — “直接到達可能” を拡張した関係に基づく,同値類。 】

各 `互いに関係する閲覧文脈~群$は,更に、各~groupが次を満たすような,最も少数の~groupに分けられる ⇒ ~groupのどの~memberも,その`作動中の文書$の`生成元$は,[ `document.domain$m 属性に対する適切な操作 ]を通して,~groupの他の~memberにて`作動中の文書$のそれと`同じ生成元~domain$にできる一方で、他の~groupの~memberとは同じにできない。 ◎ Each unit of related browsing contexts is then further divided into the smallest number of groups such that every member of each group has an active document with an origin that, through appropriate manipulation of the document.domain attribute, could be made to be same origin-domain with other members of the group, but could not be made the same as members of any other group.\

そのような各~groupを `互いに関係するかつ生成元も類似する閲覧文脈~群@ という。 ◎ Each such group is a unit of related similar-origin browsing contexts.

【 この定義が~well-definedになるためには, “適切な操作〜” が 対称律を満たす(可逆になる)必要があるが、それを確かめるためには,この仕様~全体を精査する必要がある。 おそらく、[ 2 つの~memberが同じ~groupに属するのは、両者 に対し ある適切な操作を施した結果が`同じ生成元~domain$になるとき ]と解釈されるべきに思われる(そう解釈すれば精査する必要もなくなる)。 】

注記: 各 `互いに関係するかつ生成元も類似する閲覧文脈~群$ が持ち得る`~event-loop$は高々一つまでである(一方で、複数の`互いに関係するかつ生成元も類似する閲覧文脈~群$は,同じ`~event-loop$を共有し得る)。 ◎ There is also at most one event loop per unit of related similar-origin browsing contexts (though several units of related similar-origin browsing contexts can have a shared event loop).

7.1.5. 閲覧文脈~名

各 `閲覧文脈$は、 `閲覧文脈~名@ を持つ。 他が言明されない限り,空~文字列とする(名前がないことを表す)。 ◎ Browsing contexts can have a browsing context name. Unless stated otherwise, it is the empty string.

`妥当な閲覧文脈~名@ とは、[ 空でない ]~AND[ 最初の文字 ~NEQ `005F^U `_^smb ]を満たす文字列である。 (最初の文字 ~EQ `005F^U `_^smb なる文字列は、次に述べる特別な~keyword用に予約される。) ◎ A valid browsing context name is any string with at least one character that does not start with a U+005F LOW LINE character. (Names starting with an underscore are reserved for special keywords.)

`妥当な閲覧文脈~名または~keyword@ とは、次のいずれかを満たす文字列である:

  • `妥当な閲覧文脈~名$である
  • 次のいずれかに`~ASCII大小無視$で合致する ⇒ `_blank^l, `_self^l, `_parent^l, `_top^l
◎ A valid browsing context name or keyword is any string that is either a valid browsing context name or that is an ASCII case-insensitive match for one of: _blank, _self, _parent, or _top.

頁の “~link等” ( ~link, ~script, ~form提出 等々)が指定する,`妥当な閲覧文脈~名または~keyword$ 値 — 以下,単に %名前 と記す — は、頁が~sandbox化されているか否かに応じて、下の規範的でない “表 A” の 2 列目以降に要約されるような,それぞれに異なる意味を持つ: ◎ These values have different meanings based on whether the page is sandboxed or not, as summarized in the following (non-normative) table.\

  • 表の 1 列目には、 %名前, および追加の条件が示される。
  • 表の 2 〜 4 列目 — ~~見出し[ “普通”, “無”, “有” ]の列 — は、表の 1 列目の条件の下で,どの`閲覧文脈$が~navigateされるかを与える:

    • “普通” の列は、次項の “無”, “有” いずれにも該当しないときの効果を与える。
    • [ “無” / “有” ]の列は、当の “~link等” が `iframe$e 内にあって, その `iframe^e は `sandbox$a 属性を有していて, その値に `allow-top-navigation$v ~keywordが[ 無いとき / 有るとき ]の効果を与える。

【 原文による表は、説明が省略され過ぎているので、この訳ではかなり加筆している。 】

加えて、 “表 A” に利用される~~記号の意味を次の表に示す:

記号 意味
`現-^i %名前 を指定している “~link等” が所属している`文書$が`属する閲覧文脈$を指す。
`親^i `現-^i の`親~閲覧文脈$を指す。
`top^i `現-^i の`~top-level閲覧文脈$を指す。
`新-^i 新たな`~top-level閲覧文脈$(`補助~閲覧文脈$の場合もある)が作成されることを意味する。 これは、種々の[ 利用者による選好/~UAによる施策 ]の対象0になる。
`なし^i 何も起きない(~navigateされる閲覧文脈はない)ことを意味する。
`新-?^i ( “無” / “有” の場合のみ) `iframe^e の `sandbox$a 属性に `allow-popups$v ~keywordも指定されているならば `新-^i と同じ。 他の場合は `なし^i と同じ(ただし,利用者が~sandbox法を上書きした(していた)場合は、 `新-^i になり得る)。
◎ In this table, "current" means the browsing context that the link or script is in, "parent" means the parent browsing context of the one the link or script is in, "top" means the top-level browsing context of the one the link or script is in, "new" means a new top-level browsing context or auxiliary browsing context is to be created, subject to various user preferences and user agent policies, "none" means that nothing will happen, and "maybe new" means the same as "new" if the "allow-popups" keyword is also specified on the sandbox attribute (or if the user overrode the sandboxing), and the same as "none" otherwise.
表 A
%名前, および追加の条件 普通
%名前 は指定されていない ◎ none specified, for links and form submissions `現-^i `現-^i `現-^i
空~文字列 `現-^i `現-^i `現-^i
以下、~keywordによる %名前 の場合
`_blank^l `新-^i `新-?^i `新-?^i
`_self^l `現-^i `現-^i `現-^i
`_parent^l ~AND[ `親^i ~EQ ε ] ◎ _parent if there isn't a parent `現-^i `現-^i `現-^i
`_parent^l ~AND[ `親^i ~EQ `top^i ] ◎ _parent if parent is also top `親^i ( ~EQ `top^i )◎ parent/top `なし^i `親^i◎ parent/top
`_parent^l ~AND[ `親^i ~NIN { ε, `top^i } ] ◎ _parent if there is one and it's not top `親^i `なし^i `なし^i
`_top^l ~AND[ `top^i ~EQ `現-^i ] ◎ _top if top is current `現-^i ( ~EQ `top^i ) `現-^i `現-^i
`_top^l ~AND[ `top^i ~NEQ `現-^i ] ◎ _top if top is not current `top^i `なし^i `top^i
以下、非~keywordによる %名前 の場合 — 記号 %B は、 %名前 を`名前$とする`閲覧文脈$を表すとする。
%B は存在しない ◎ name that doesn't exist `新-^i `新-?^i `新-?^i
%B は `現-^i の子孫である ◎ name that exists and is a descendant %B◎ Ipecified descendant %B◎ specified descendant %B◎ specified descendant
%B ~EQ `現-^i ◎ name that exists and is current %B ( ~EQ `現-^i ) %B %B
[ %B は `現-^i の先祖である ]~AND[ %B ~EQ `top^i ] ◎ name that exists and is an ancestor that is top %B ( ~EQ `top^i )◎ specified ancestor `なし^i %B◎ specified ancestor/top
[ %B は `現-^i の先祖である ]~AND[ %B ~NEQ `top^i ] ◎ name that exists and is an ancestor that is not top %B◎ specified ancestor `なし^i `なし^i
[ %B は上のどれにも該当しない ]~AND[ %B の`~top-level閲覧文脈$ ~EQ `top^i ] ◎ other name that exists with common top %B◎ specified `なし^i `なし^i
以下、 %B は上のどれにも該当しない場合
[ %B は `現-^i に`近しい$ ]~AND[ `現-^i は %B の`許可-済み~navigator$である ] ◎ name that exists with different top, if familiar and one permitted sandboxed navigator %B◎ specified %B◎ specified %B◎ specified
[ %B は `現-^i に`近しい$ ]~AND[ `現-^i は %B の`許可-済み~navigator$でない ] ◎ name that exists with different top, if familiar but not one permitted sandboxed navigator %B◎ specified `なし^i `なし^i
[ %B は `現-^i に`近しい$ ]でない ◎ name that exists with different top, not familiar `新-^i `新-?^i `新-?^i

~sandbox化された閲覧文脈に対する制約のほとんどは、他の~algo — 例えば `~navi$~algo — により適用される。 `閲覧文脈を選ぶ規則$ではなく。 ◎ Most of the restrictions on sandboxed browsing contexts are applied by other algorithms, e.g. the navigation algorithm, not the rules for choosing a browsing context given below.


`閲覧文脈を選ぶ規則@ は、所与の ( `閲覧文脈~名$ %名前, `閲覧文脈$ %現, 真偽値 %noopener ) に対し,次に従う: ◎ The rules for choosing a browsing context, given a browsing context name name, a browsing context current, and a boolean noopener are as follows:

  1. %小文字~化~名 ~LET `~ASCII小文字~化する$( %名前 ) ◎ ↓
  2. %結果 ~SET %小文字~化~名 に応じて,次で与えられる閲覧文脈または ~NULL: ◎ Let chosen be null. ◎ Let new be false.

    空~文字列
    `_self^l
    %現 ◎ If name is the empty string or an ASCII case-insensitive match for "_self", then set chosen to current.
    `_parent^l
    %現 の`親~閲覧文脈$ ~NEQ ε ならば それ / ~ELSE_ %現 ◎ If name is an ASCII case-insensitive match for "_parent", then set chosen to current's parent browsing context, if any, and current otherwise.
    `_top^l
    %現 の`~top-level閲覧文脈$ ~NEQ ε ならば それ / ~ELSE_ %現 ◎ If name is an ASCII case-insensitive match for "_top", then set chosen to current's top-level browsing context, if any, and current otherwise.
    `_blank^l
    ~NULL
    その他

    ~IF[ 次のいずれも満たすような閲覧文脈 %B は存在する ]…

    • %B の`名前$ ~EQ %名前
    • %現 は %B に`近しい$
    • ~UAは, %現, %B が互いに到達してもよいほどに十分~関係すると決定した

    …ならば ⇒ そのような閲覧文脈のうちのいずれか ⇒ 該当する %B が複数ある場合、~UAは,そのうち一つを[ 何らかの,一貫した, 任意の方式 ]で選定するべきである — 例えば[ 最も近過去に開いたもの / 最も近過去に~focusされたもの / より近く関係するもの ]など。

    ~ELSE ⇒ ~NULL

    ◎ If name is not an ASCII case-insensitive match for "_blank" and there exists a browsing context whose name is the same as name, and current is familiar with that browsing context, and the user agent determines that the two browsing contexts are related enough that it is ok if they reach each other, then set chosen to that browsing context. If there are multiple matching browsing contexts, the user agent should set chosen to one in some arbitrary consistent manner, such as the most recently opened, most recently focused, or more closely related.
    これは、 issue #1440 にて,もっと精確に定められることになる。 ◎ This will be made more precise in issue #1440.
  3. ~IF[ %結果 ~NEQ ~NULL ] ⇒ ~RET ( %結果, ~F ) ◎ ↑
  4. ~Assert: 新たな閲覧文脈が要請されている — 何が起こるかは、~UAの環境設定と能に依存する ◎ Otherwise, a new browsing context is being requested, and what happens depends on the user agent's configuration and abilities — it is determined by the rules given for the first applicable option from the following list:
  5. %新 ~LET ~F ◎ ↑↑
  6. %~flag集合 ~LET[ %現 にて`作動中の文書$ ]の`作動中の~sandbox法~flag集合$ ◎ ↓
  7. ~ELIF[ `補助~navi$sbox ~IN %~flag集合 ]: ◎ If current's active document's active sandboxing flag set has the sandboxed auxiliary navigation browsing context flag set.

    1. ~UAの任意選択で、利用者に,次の選択肢を提供する: ◎ The user agent may offer the user one of:

      • 新たな~top-level閲覧文脈 ⇒# %結果 ~SET `新たな閲覧文脈を作成する$( %noopener ), %新 ~SET ~T ◎ Set chosen to a new top-level browsing context given noopener, and set new to true.
      • 既存のものを再利用する ⇒ %結果 ~SET 既存の`~top-level閲覧文脈$ ◎ Set chosen to an existing top-level browsing context.
      • 辞退する

      この事例が生じた場合、~linkを開こうと試行している文書は,作者が明示的に~sandbox化していることを意味する。 ◎ If this case occurs, it means that an author has explicitly sandboxed the document that is trying to open a link.

    注記: 利用者が辞退した場合/~UAが上の選択肢を提供しなかった場合、[ %結果, %新 ]はそのままにされる。 ◎ If the user declines or the user agent doesn't offer the above, the variables remain unchanged.

  8. ~ELIF[ ~UAは新たな閲覧文脈を作成するように環境設定されている ]: ◎ If the user agent has been configured such that in this instance it will create a new browsing context:

    1. %結果 ~SET `新たな閲覧文脈を作成する$( %noopener ) ◎ Set chosen to a new auxiliary browsing context given noopener\
    2. %結果 は`補助~閲覧文脈$になるとする ⇒ %結果 を`開いた閲覧文脈$ ~SET %現 ◎ with the opener browsing context being current, and\
    3. %新 ~SET ~T ◎ set new to true.
    4. ~IF[ %小文字~化~名 ~NEQ `_blank^l ] ⇒ %結果 の`名前$ ~SET %名前 ◎ If name is not an ASCII case-insensitive match for "_blank", then chosen's name must be set to name.

    注記: 新たに作成された`閲覧文脈$が即時に`~navigate$される場合、その~naviは,[ `置換~可能化~flag$ ~SET ~ON ]の下で行われることになる。 ◎ If the newly created browsing context is immediately navigated, then the navigation will be done with replacement enabled.

  9. ~ELIF[ ~UAは %現 を再利用するように環境設定されている ] ⇒ %結果 ~SET %現 ◎ If the user agent has been configured such that in this instance it will reuse current • Set chosen to current.
  10. ~ELSE( ~UAは閲覧文脈を見出さないように環境設定されている) ⇒ 何もしない ◎ If the user agent has been configured such that in this instance it will not find a browsing context • Do nothing.

    注記: ~UAには、[ ~UAが常に %現 を再利用するように環境設定する仕方 ]を,利用者に供することが奨励される。 ◎ User agents are encouraged to provide a way for users to configure the user agent to always reuse current.

  11. ~IF[ %新 ~EQ ~T ]: ◎ If new is true, then:

    1. ~IF[ `~navi$sbox ~IN %~flag集合 ] ⇒ %結果 の`許可-済み~navigator$ ~SET %現 ◎ Let flagSet be current's active document's active sandboxing flag set. ◎ If flagSet's sandboxed navigation browsing context flag is set, then current must be set as chosen's one permitted sandboxed navigator.
    2. ~IF[ `~sandboxは補助~閲覧文脈に伝播する~flag$ ~IN %~flag集合 ] ⇒ %結果 の`~popup~sandbox法~flag集合$に %~flag集合 内のすべての~flagを追加する ◎ If flagSet's sandbox propagates to auxiliary browsing contexts flag is set, then all the flags that are set in flagSet must be set in chosen's popup sandboxing flag set.
  12. ~RET ( %結果, %新 ) ◎ Return chosen and new.

7.2. `Window^I, `WindowProxy^I, `Location^I ~obj用の保安~基盤

【 この節の内容は、 別ページ にて。 】