生成元, サンドボックス — Origin, Sandboxing

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

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

7.5. 生成元

生成元は ~Webの保安~modelにおける基礎的な通貨である。 ~Web~platformにおける,ある生成元を共有する動作者たちは、互いを信用し,同じ権限を有するものと見做される。 互いの生成元が相違する動作者たちは、潜在的に敵対的にあると見なされ,様々な程度で互いに隔離される。 ◎ Origins are the fundamental currency of the Web's security model. Two actors in the Web platform that share an origin are assumed to trust each other and to have the same authority. Actors with differing origins are considered potentially hostile versus each other, and are isolated from each other to varying degrees.

例えば `bank.example.com^c にて~hostされている X 銀行の ~Web~siteが `charity.example.org^c にて~hostされている Y 事業体の~Web~siteの~DOMを精査しようと試行した場合、 `SecurityError$E 例外が~~投出されることになる。 ◎ For example, if Example Bank's Web site, hosted at bank.example.com, tries to examine the DOM of Example Charity's Web site, hosted at charity.example.org, a "SecurityError" DOMException will be raised.

【 “~~生成元” という訳語は、おそらく, `HTTP$r の用語 “~~生成する( generate )” に由来する(より詳細には、[ ~HTTP要請に対し, 応答を生成する~server ]を識別する情報)。 】


`生成元@ ( origin )は、次のいずれかとして与えられる: ◎ An origin is one of the following:

`不透明な生成元@
直列化して再度~作成し直せないような,内部的な値であって(`生成元を直列化する$ときは `null^l に直列化される)、有意義な演算は,同等性を試験することに限られる。 ◎ An internal value, with no serialization it can be recreated from (it is serialized as "null" per serialization of an origin), for which the only meaningful operation is testing for equality.
`成分組~生成元@

次のものからなる(括弧内はとり得る値): ◎ A tuple consists of:

  • `~scheme@o( `~scheme$url ) ◎ A scheme (a scheme).
  • `~host@o ( `~host$url ) ◎ A host (a host).
  • `~port@o ( `~port$url ) ◎ A port (a port).
  • `~domain@o ( ~NULL または `~domain$url )。 他が言明されない限り, ~NULL とする。 ◎ A domain (null or a domain). Null unless stated otherwise.

注記: `生成元$は共有され得る — 例えば、複数の`文書$間で。 加えて、`生成元$は,一般に変異しない。 `成分組~生成元$の`~domain$oのみ,それも `document.domain$m ~APIを通してのみ,変更され得る。 ◎ Origins can be shared, e.g., among multiple Document objects. Furthermore, origins are generally immutable. Only the domain of a tuple origin can be changed, and only through the document.domain API.

`生成元$ %生成元 の `実効~domain@ は、次に従って計算される: ◎ The effective domain of an origin origin is computed as follows:

  1. ~IF[ %生成元 は`不透明な生成元$である ] ⇒ ~RET ~NULL ◎ If origin is an opaque origin, then return null.
  2. ~IF[ %生成元 の`~domain$o ~NEQ ~NULL ] ⇒ ~RET %生成元 の`~domain$o ◎ If origin's domain is non-null, then return origin's domain.
  3. ~RET %生成元 の`~host$o ◎ Return origin's host.

仕様が定義する様々な~objは,`生成元$を有するように定義される。 これらの`生成元$は、次のうち,最初に該当する項目に従って決定される: ◎ Various specification objects are defined to have an origin. These origins are determined as follows:

`文書$ %文書 に対しては: ◎ For Document objects
`生成元$sbox ~IN %文書 の`作動中の~sandbox法~flag集合$の場合: ◎ If the Document's active sandboxing flag set has its sandboxed origin browsing context flag set
%文書 は `data_$sc ~URLから生成されたものである場合: ◎ If the Document was generated from a data: URL
%文書 の作成-時にあてがわれた,一意かつ`不透明な生成元$。 ◎ A unique opaque origin assigned when the Document is created.
%文書 の`~URL$docの`~scheme$urlは`~network~scheme$である場合: ◎ If the Document's URL's scheme is a network scheme
%文書 の作成-時にあてがわれた, %文書 の`~URL$docの`生成元$urlの複製 ◎ A copy of the Document's URL's origin assigned when the Document is created.
注記: `document.open(type, replace)$m ~methodは、 %文書 の`~URL$docを `about_blank$sc に変更し得る。 したがって、`生成元$は作成-時にあてがわれる。 ◎ The document.open(type, replace) method can change the Document's URL to "about:blank". Therefore the origin is assigned when the Document is created.
%文書 は初期 "`about_blank$sc" 文書である場合: ◎ If the Document is the initial "about:blank" document
%文書 が`属する閲覧文脈$の 作成-時にあてがわれたもの。 ◎ The one it was assigned when its browsing context was created.
%文書 は 初期でない "`about_blank$sc" 文書である場合: ◎ If the Document is a non-initial "about:blank" document

`~script$が孕まれるかどうかに応じて:

孕まれる場合:
`~navigate$~algoが呼出された時点での`現任の設定群~obj$の`生成元$enV
孕まれない場合:
当の`~URL$への`~navi$を起動させた要素の`~node文書$の`生成元$
◎ The origin of the incumbent settings object when the navigate algorithm was invoked, or, if no script was involved, the origin of the node document of the element that initiated the navigation to that URL.
%文書 は `javascript_$sc ~URLの処理の一部として作成されたものである場合: ◎ If the Document was created as part of the processing for javascript: URLs
~navigateされている`閲覧文脈$の[ `~navigate$~algoが呼出された時点で`作動中の文書$ ]の`生成元$ ◎ The origin of the active document of the browsing context being navigated when the navigate algorithm was invoked.
%文書 は `~iframe-srcdoc文書$である場合: ◎ If the Document is an iframe srcdoc document
[[[ %文書 が`属する閲覧文脈$ ]の`閲覧文脈~容器$ ]の`~node文書$ ]の`生成元$ ◎ The origin of the Document's browsing context's browsing context container's node document.
%文書 は 何らかの他の方式で得られたものである場合: ◎ If the Document was obtained in some other manner (e.g. a Document created using the createDocument() API, etc)
WHATWG `DOM$r 標準に定義される既定の挙動が適用される。 ◎ The default behavior as defined in the WHATWG DOM standard applies. [DOM].
注記: `生成元$は %文書 の作成-時にあてがわれた,一意かつ`不透明な生成元$になる。 ◎ The origin is a unique opaque origin assigned when the Document is created.
例えば、 `createDocument()$m ~API, 等々を利用して作成された`文書$。 ◎ ↑
`img$e 要素による画像に対しては: ◎ For images of img elements

その`画像~data$に応じて:

`~CORS非同一生成元$である場合: ◎ If the image data is CORS-cross-origin ◎
一意かつ`不透明な生成元$ — これは、画像の作成-時にあてがわれる。 ◎ A unique opaque origin assigned when the image is created.
`~CORS同一生成元$である場合: ◎ If the image data is CORS-same-origin
要素の`~node文書$の`生成元$ ◎ The img element's node document's origin.
`~media要素$( `audio$e / `video$e )に対しては: ◎ For audio and video elements

その`~media~data$に応じて:

`~CORS非同一生成元$である場合: ◎ If the media data is CORS-cross-origin
一意かつ`不透明な生成元$ — これは、~media~dataの~fetch時にあてがわれる。 ◎ A unique opaque origin assigned when the media data is fetched.
`~CORS同一生成元$である場合: ◎ If the media data is CORS-same-origin
要素の`~node文書$の`生成元$ ◎ The media element's node document's origin.

他の仕様は、特定0の[ `文書$ / 画像 / `~media要素$ ]の`生成元$を指定して上の定義を上書きし得る。 ◎ Other specifications can override the above definitions by themselves specifying the origin of a particular Document object, image, or media element.


`生成元を直列化する@ ときは、所与の ( `生成元$ %生成元 ) に対し,次を適用して得られる文字列を返す: ◎ The serialization of an origin is the string obtained by applying the following algorithm to the given origin origin:

  1. ~IF[ %生成元 は`不透明な生成元$である ] ⇒ ~RET `null^l ◎ If origin is an opaque origin, then return "null".
  2. %結果 ~LET 次を順に連結した結果 ⇒# %生成元 の`~scheme$o, `://^l, `~hostを直列化する$( %生成元 の`~host$o ) ◎ Otherwise, let result be origin's scheme. ◎ Append "://" to result. ◎ Append origin's host, serialized, to result.
  3. ~IF[ %生成元 の`~port$o ~EQ ~NULL ] ⇒ ~RET %結果 ◎ ↓
  4. ~RET 次を順に連結した結果 ⇒# %結果, `003A^U `:^smb, `整数を直列化する$( %生成元 の`~port$o ) ◎ If origin's port is non-null, append a U+003A COLON character (:), and origin's port, serialized, to result. ◎ Return result.

`成分組~生成元$ ( `https^l, `xn--maraa-rta.example^l, ~NULL, ~NULL ) の`直列化$oは、 `https://xn--maraa-rta.example^l になる。 ◎ The serialization of ("https", "xn--maraa-rta.example", null, null) is "https://xn--maraa-rta.example".

注記: `生成元の~Unicode直列化^i も利用されていたが、それが広く採用されたことは,決してない。 ◎ There used to also be a Unicode serialization of an origin. However, it was never widely adopted.


次のいずれかを満たすような 2 つの`生成元$ %A, %B は、 `同一生成元@ とされる: ◎ Two origins, A and B, are said to be same origin if the following algorithm returns true:

次のいずれかを満たすような 2 つの`生成元$ %A, %B は、 `同じ生成元~domain@ とされる: ◎ Two origins, A and B, are said to be same origin-domain if the following algorithm returns true:

%A %B `同一生成元$? `同じ生成元~domain$?
(`https^l, `example.org^l, ~NULL, ~NULL) (`https^l, `example.org^l, ~NULL, ~NULL)
(`https^l, `example.org^l, 314, ~NULL) (`https^l, `example.org^l, 420, ~NULL)
(`https^l, `example.org^l, 314, `example.org^l) (`https^l, `example.org^l, 420, `example.org^l)
(`https^l, `example.org^l, ~NULL, ~NULL) (`https^l, `example.org^l, ~NULL, `example.org^l)
(`https^l, `example.org^l, ~NULL, `example.org^l) (`http^l, `example.org^l, ~NULL, `example.org^l)

7.5.1. 同一生成元 制約の緩め方

%document . `domain$m [ = %domain ]
保安~検査~用に利用される現在の~domainを返す。 ◎ Returns the current domain used for security checks.
下位domainを除去するような値に設定して,`生成元$の`~domain$oを変更できる — そうすることにより, 同じ~domainにおける他の下位domain上の頁と互いに~accessできるようになる(それらも,同じことをしたならば)。 (ただし,~sandbox化された `iframe$e においては設定できない。) ◎ Can be set to a value that removes subdomains, to change the origin's domain to allow pages on other subdomains of the same domain (if they do the same thing) to access each other. (Can't be set in sandboxed iframes.)

文字列 %~host~suffix文字列 は`~host$x %元~host に対し `登録-可能な~domain~suffixまたは同等@ であるかどうか決定するときは、次を走らす: ◎ To determine if a string hostSuffixString is a registrable domain suffix of or is equal to a host originalHost, run these steps:

  1. ~IF[ %~host~suffix文字列 ~EQ 空~文字列 ] ⇒ ~RET ~F ◎ If hostSuffixString is the empty string, then return false.
  2. %~host ~LET `~host構文解析器$( %~host~suffix文字列 ) ◎ Let host be the result of parsing hostSuffixString.
  3. ~IF[ %~host ~EQ `失敗^i ] ⇒ ~RET ~F ◎ If host is failure, then return false.
  4. ~IF[ ( %~host, %元~host ) は`~hostとして同等$でない ]: ◎ If host does not equal originalHost, then:

    1. ~IF[ %~host , %元~host のいずれかは`~domain$urlでない ] ⇒ ~RET ~F ◎ If host or originalHost is not a domain, then return false.

      注記: すなわち、 `~IPv4~address$ / `~IPv6~address$ による`~host$xは除外する。 ◎ This excludes hosts that are an IPv4 address or an IPv6 address.

    2. ~IF[[ %~host に `002E^U `.^smb を接頭した結果 ]は %元~host の尾部に合致しない ] ⇒ ~RET ~F ◎ If host, prefixed by a U+002E FULL STOP (.), does not exactly match the end of originalHost, then return false.
    3. ~IF[ ( %~host, %~host の`公共接尾辞$ ) は`~hostとして同等$である `URL$r ] ⇒ ~RET ~F ◎ If host equals host's public suffix, then return false. [URL]
  5. ~RET ~T ◎ Return true.

`Document$I 上の `domain@m 属性は、次で定義される:

  • 取得子は、次を走らせ~MUST: ◎ The domain attribute's getter must run these steps:

    1. %実効~domain ~LET 此れの`生成元$の`実効~domain$ ◎ Let effectiveDomain be this Document object's origin's effective domain.
    2. ~IF[ %実効~domain ~EQ ~NULL ] ⇒ ~RET 空~文字列 ◎ If effectiveDomain is null, then return the empty string.
    3. ~RET `~hostを直列化する$( %実効~domain ) ◎ Return effectiveDomain, serialized.
  • 設定子は、次を走らせ~MUST: ◎ The domain attribute's setter must run these steps:

    1. ~IF[ 此れが`属する閲覧文脈$ ~EQ ε ] ⇒ ~THROW `SecurityError$E ◎ If this Document object has no browsing context, then throw a "SecurityError" DOMException.
    2. ~IF[ `~document-domain$sbox ~IN 此れの`作動中の~sandbox法~flag集合$ ] ⇒ ~THROW `SecurityError$E ◎ If this Document object's active sandboxing flag set has its sandboxed document.domain browsing context flag set, then throw a "SecurityError" DOMException.
    3. %実効~domain ~LET 此れの`生成元$の`実効~domain$ ◎ Let effectiveDomain be this Document object's origin's effective domain.
    4. ~IF[ %実効~domain ~EQ ~NULL ] ⇒ ~THROW `SecurityError$E ◎ If effectiveDomain is null, then throw a "SecurityError" DOMException.
    5. ~IF[ 所与の値は %実効~domain に対し`登録-可能な~domain~suffixまたは同等$でない ] ⇒ ~THROW `SecurityError$E ◎ If the given value is not a registrable domain suffix of and is not equal to effectiveDomain, then throw a "SecurityError" DOMException.
    6. 此れの`生成元$の`~domain$o ~SET `~host構文解析器$( 所与の値 ) ◎ Set this Document object's origin's domain to the result of parsing the given value.

注記: `domain$m 属性は、同じ~domain上の異なる~host上の頁どうしが互いの DOM に~accessすることを可能化するために利用される。 ◎ The document.domain attribute is used to enable pages on different hosts of a domain to access each other's DOMs.

他者と~hostを共有しているときは、`document.domain$m 属性を利用しないこと。 信用できない第三者主体が、[ 同じ~IP~address上の~portだけ異なる~HTTP~server ]を~hostできる場合、通常は 同じ~host上の互いに異なる~siteを保護する,同一生成元による保護は、失敗することになる — `document.domain$m 属性が利用されて以降は、生成元の比較-時に,その~portは無視されるので。 ◎ Do not use the document.domain attribute when using shared hosting. If an untrusted third party is able to host an HTTP server at the same IP address but on a different port, then the same-origin protection that normally protects two different sites on the same host will fail, as the ports are ignored when comparing origins after the document.domain attribute has been used.

7.6. ~sandbox法

`~sandbox法~flag集合@ は、以下に挙げる各種~flagのうち,いくつかからなる集合である。 この集合は、それが含む各種~flagを通して,信用できない資源が持ち得る能を制約するために利用される: ◎ A sandboxing flag set is a set of zero or more of the following flags, which are used to restrict the abilities that potentially untrusted resources have:

【 “~sandbox” — “(こどもの)砂場” ( “監獄” を和らげた語(一般に,より制約も緩い))。 】【 以下に現れる各種 “`X^sbox” は、 “[ X について,閲覧文脈を~sandbox化する( X の機能を抑止する) ]ことを指示する~flag” と解釈する — そのように解釈し易いよう、この訳では,関数的に記している。 】【 以下に現れる “内容” とは、[ これらの~flagが適用される閲覧文脈 ]内の内容を指す。 】

`~navi@sbox ◎ The sandboxed navigation browsing context flag

この~flagは、~sandbox化されている当の閲覧文脈を %B とするとき, 次に挙げるもの以外の`閲覧文脈$ %C に対しては, %B の内容が %C を ~navigateするのを防止する

  • %B 自身
  • %B が更に内側に入子にしている閲覧文脈 【再帰的に?】
  • %B が開いた`補助~閲覧文脈$(これは、`補助~navi$sboxにより保護される)†
  • %B の`~top-level閲覧文脈$(これは、 `利用者~作動化~top-level~navi$sbox, `非~利用者~作動化~top-level~navi$sbox により保護される)
◎ This flag prevents content from navigating browsing contexts other than the sandboxed browsing context itself (or browsing contexts further nested inside it), auxiliary browsing contexts (which are protected by the sandboxed auxiliary navigation browsing context flag defined next), and the top-level browsing context (which is protected by the sandboxed top-level navigation without user activation browsing context flag and sandboxed top-level navigation with user activation browsing context flag defined below).
† ここに述べた制約にもかかわらず、[ `補助~navi$sbox ~NIN `~sandbox法~flag集合$ ]の下では、ある種の事例においては,新たな`~top-level閲覧文脈$として %~popup ††を開くことが許容される。 そのような %~popup の作成-時には、それを作成した`閲覧文脈$が, %~popup の `許可-済み~navigator@††† として設定される — それは、( ~naviに関して~sandbox化されていても)実際には %~popup に対する~navigateが許可される。 (他の場合、 %~popup に対する~navigateは,`~navi$sboxにより防止される。) ◎ If the sandboxed auxiliary navigation browsing context flag is not set, then in certain cases the restrictions nonetheless allow popups (new top-level browsing contexts) to be opened. These browsing contexts always have one permitted sandboxed navigator, set when the browsing context is created, which allows the browsing context that created them to actually navigate them. (Otherwise, the sandboxed navigation browsing context flag would prevent them from being navigated even if they were opened.)
【†† すなわち、`補助~閲覧文脈$。 】【††† “one permitted sandboxed navigator” — この “one” は、[ %~popup に対し`許可-済み~navigator$とされるものは、きっかり 1 個ある ]ことを表していると見受けられる。 】
`補助~navi@sbox ◎ The sandboxed auxiliary navigation browsing context flag
この~flagは、内容が 新たな補助~閲覧文脈を作成するのを防止する — 例えば[ `target$a 属性 / `window.open()$m ~method ]を利用して。 ◎ This flag prevents content from creating new auxiliary browsing contexts, e.g. using the target attribute or the window.open() method.
`非~利用者~作動化~top-level~navi@sbox
`利用者~作動化~top-level~navi@sbox
両~flagとも、内容が その~top-level閲覧文脈を[ ~navigateするのを防止する閉じるのを防止する ]。 これらは順に、`利用者による作動化から誘発されて$[ いない, いる ]~algoからのみ,諮問される。 ◎ The sandboxed top-level navigation without user activation browsing context flag ◎ This flag prevents content from navigating their top-level browsing context and prevents content from closing their top-level browsing context. It is consulted only from algorithms that are not triggered by user activation.
両~flagとも、影響するのは`~top-level閲覧文脈$に限られる — [ この~flag ~NIN `~sandbox法~flag集合$ ]の下では、内容は,その`~top-level閲覧文脈$を~navigateできる(~flagは`利用者による作動化から誘発されて$いるかどうかに応じて適切な方とする)。 が、他の`閲覧文脈$は,依然として他の~flag — `~navi$sboxや, (場合によっては)`補助~navi$sbox — により保護される。 ◎ When the sandboxed top-level navigation without user activation browsing context flag is not set, content can navigate its top-level browsing context, but other browsing contexts are still protected by the sandboxed navigation browsing context flag and possibly the sandboxed auxiliary navigation browsing context flag. ◎ The sandboxed top-level navigation with user activation browsing context flag ◎ This flag prevents content from navigating their top-level browsing context and prevents content from closing their top-level browsing context. It is consulted only from algorithms that are triggered by user activation. ◎ As with the sandboxed top-level navigation without user activation browsing context flag, this flag only affects the top-level browsing context; if it is not set, other browsing contexts might still be protected by other flags.
`~plugin@sbox ◎ The sandboxed plugins browsing context flag
この~flagは、内容が[ `embed^e 要素を利用して`object^e 要素を利用して / `入子の閲覧文脈$ に対する~naviを通して ]~pluginを~instance化するのを防止する — それらの`~plugin$を`保安化-$できない限り。 ◎ This flag prevents content from instantiating plugins, whether using the embed element, the object element, or through navigation of a nested browsing context, unless those plugins can be secured.
`生成元@sbox ◎ The sandboxed origin browsing context flag
この~flagは、 内容を一意な生成元~内に強制する — したがって,内容が同じ`生成元$からの他の内容へ~accessするのを防止する。 ◎ This flag forces content into a unique origin, thus preventing it from accessing other content from the same origin.
この~flagはまた、~scriptが `document.cookie^m ~IDL属性を 読取る/書込むのを防止する ことに加え, `localStorage$m への~accessも阻止する。 ◎ This flag also prevents script from reading from or writing to the document.cookie IDL attribute, and blocks access to localStorage.
`~form@sbox ◎ The sandboxed forms browsing context flag
この~flagは、 ~form提出を阻止する 。 ◎ This flag blocks form submission.
`~pointer~lock@sbox ◎ The sandboxed pointer lock browsing context flag
この~flagは、 Pointer Lock ~APIを不能化する。 `POINTERLOCK$r ◎ This flag disables the Pointer Lock API. [POINTERLOCK]
`~script@sbox ◎ The sandboxed scripts browsing context flag
この~flagは、 ~script実行を阻止する。 ◎ This flag blocks script execution.
`自動~特色機能@sbox ◎ The sandboxed automatic features browsing context flag

この~flagは、次に挙げるような自動的に誘発される特色機能を阻止する:

◎ This flag blocks features that trigger automatically, such as automatically playing a video or automatically focusing a form control.
`~sandbox化( ~storage域~URL )~flag@ ◎ The sandboxed storage area URLs flag
この~flagは、[ ~storage域を利用するような ~URL~scheme† ]が,生成元の~dataに~accessするのを防止する。 ◎ This flag prevents URL schemes that use storage areas from being able to access the origin's data.
【† 例えば `filesystem_^sc ~scheme?( 参考 ) 】
`~document-domain@sbox ◎ The sandboxed document.domain browsing context flag
この~flagは、 `document.domain$m 設定子の利用を防止する。 ◎ This flag prevents content from using the document.domain setter.
`~sandboxは補助~閲覧文脈に伝播する~flag@ ◎ The sandbox propagates to auxiliary browsing contexts flag
この~flagは、[ 内容にて`作動中の~sandbox法~flag集合$ ]を[ 内容が作成する`補助~閲覧文脈$ ]に継承させることにより,内容が ~sandboxから逃れるのを防止する。 ◎ This flag prevents content from escaping the sandbox by ensuring that any auxiliary browsing context it creates inherits the content's active sandboxing flag set.
`~sandbox化( ~modal )~flag@ ◎ The sandboxed modals flag

この~flagは、[ 内容が,次のいずれかの特色機能を利用して~modal~dialogを生産する ]のを防止する: ◎ This flag prevents content from using any of the following features to produce modal dialogs:

  • `window.alert()$m
  • `window.confirm()$m
  • `window.print()$m
  • `window.prompt()$m
  • `beforeunload$et ~event
`方位~lock@sbox ◎ The sandboxed orientation lock browsing context flag
この~flagは、~screen方位を~lockする能を不能化する。 `SCREENORIENTATION$r ◎ This flag disables the ability to lock the screen orientation. [SCREENORIENTATION]
`呈示@sbox ◎ The sandboxed presentation browsing context flag
この~flagは、 Presentation API を不能化する。 `PRESENTATION$r ◎ This flag disables the Presentation API. [PRESENTATION]

`~sandbox法~指令を構文解析する@ 手続きは、所与の ( 文字列 %入力, `~sandbox法~flag集合$ %出力 ) に対し,次を走らせ~MUST: ◎ When the user agent is to parse a sandboxing directive, given a string input, a sandboxing flag set output, it must run the following steps:

  1. %~tokenたち ~LET `~ASCII空白で分割する$( %入力 ) ◎ Split input on ASCII whitespace, to obtain tokens.
  2. %出力 を空にする ◎ Let output be empty.
  3. 以下に挙げる各種~flagを,対応する記述の条件が満たされるならば %出力 に追加する: ◎ Add the following flags to output:

    • `~navi$sbox ⇒ 無条件 ◎ The sandboxed navigation browsing context flag.
    • `補助~navi$sbox ⇒ `allow-popups@v ~NIN %~tokenたち ◎ The sandboxed auxiliary navigation browsing context flag, unless tokens contains the allow-popups keyword.
    • `非~利用者~作動化~top-level~navi$sbox ⇒ `allow-top-navigation@v ~NIN %~tokenたち ◎ The sandboxed top-level navigation without user activation browsing context flag, unless tokens contains the allow-top-navigation keyword.
    • `利用者~作動化~top-level~navi$sbox ⇒ [ `allow-top-navigation-by-user-activation@v ~NIN %~tokenたち ]~AND[ `allow-top-navigation$v ~NIN %~tokenたち ] ◎ The sandboxed top-level navigation with user activation browsing context flag, unless tokens contains either the allow-top-navigation-by-user-activation keyword or the allow-top-navigation keyword.

      注記: したがって、[ `allow-top-navigation$v ~IN %~tokenたち ]の場合、 `allow-top-navigation-by-user-activation$v の効果はなくなる。 この理由から、両~keywordとも指定するのは,文書~適合性の~errorになる。 ◎ This means that if the allow-top-navigation is present, the allow-top-navigation-by-user-activation keyword will have no effect. For this reason, specifying both is a document conformance error.

    • `~plugin$sbox ⇒ 無条件 ◎ The sandboxed plugins browsing context flag.
    • `生成元$sbox ⇒ `allow-same-origin@v ~NIN %~tokenたち ◎ The sandboxed origin browsing context flag, unless the tokens contains the allow-same-origin keyword.

      注記: `allow-same-origin$v ~keywordは、次の 2 つの事例に意図されている: ◎ The allow-same-origin keyword is intended for two cases.

      • 一つは、同じ~siteからの内容を,次のように~sandbox化するための利用:

        • 内容による~scriptingは不能化する。
        • 内容が成す~DOMへの~accessは許容する。
        ◎ First, it can be used to allow content from the same site to be sandboxed to disable scripting, while still allowing access to the DOM of the sandboxed content.
      • もう一つは、第三者主体~siteからの内容を埋込むときに,その内容を次のように~sandbox化するための利用:

        • その~siteが ~popup~windowを開く, 等々は防止する。
        • [ 埋込まれた頁が、~dataを格納するための~database~API, 等を利用して,その出自の~siteと通信する ]ことは防止しない。
        ◎ Second, it can be used to embed content from a third-party site, sandboxed to prevent that site from opening pop-up windows, etc, without preventing the embedded page from communicating back to its originating site, using the database APIs to store data, etc.
    • `~form$sbox ⇒ `allow-forms@v ~NIN %~tokenたち ◎ The sandboxed forms browsing context flag, unless tokens contains the allow-forms keyword.
    • `~pointer~lock$sbox ⇒ `allow-pointer-lock@v ~NIN %~tokenたち ◎ The sandboxed pointer lock browsing context flag, unless tokens contains the allow-pointer-lock keyword.
    • `~script$sbox ⇒ `allow-scripts@v ~NIN %~tokenたち ◎ The sandboxed scripts browsing context flag, unless tokens contains the allow-scripts keyword.
    • `自動~特色機能$sbox ⇒ `allow-scripts$v ~NIN %~tokenたち ◎ The sandboxed automatic features browsing context flag, unless tokens contains the allow-scripts keyword (defined above).

      注記: この~flagは、`~script$sboxと同じ~keywordで緩められる — この~flagにより許容されなくなる宣言的~特色機能は、~scriptが可能化されている下では自明に可能0になるので。 ◎ This flag is relaxed by the same keyword as scripts, because when scripts are enabled these features are trivially possible anyway, and it would be unfortunate to force authors to use script to do them when sandboxed rather than allowing them to use the declarative features.

    • `~sandbox化( ~storage域~URL )~flag$ ⇒ 無条件 ◎ The sandboxed storage area URLs flag.
    • `~document-domain$sbox ⇒ 無条件 ◎ The sandboxed document.domain browsing context flag.
    • `~sandboxは補助~閲覧文脈に伝播する~flag$ ⇒ `allow-popups-to-escape-sandbox@v ~NIN %~tokenたち ◎ The sandbox propagates to auxiliary browsing contexts flag, unless tokens contains the allow-popups-to-escape-sandbox keyword.
    • `~sandbox化( ~modal )~flag$ ⇒ `allow-modals@v ~NIN %~tokenたち ◎ The sandboxed modals flag, unless tokens contains the allow-modals keyword.
    • `方位~lock$sbox ⇒ `allow-orientation-lock@v ~NIN %~tokenたち ◎ The sandboxed orientation lock browsing context flag, unless tokens contains the allow-orientation-lock keyword.
    • `呈示$sbox ⇒ `allow-presentation@v ~NIN %~tokenたち ◎ The sandboxed presentation browsing context flag, unless tokens contains the allow-presentation keyword.

`~sandbox法~flag集合$には、次に挙げる種類のものがある:


`文書~用に~sandbox法を実装する@ ときは、所与の ( `文書$ %文書, `閲覧文脈$ %B ) に対し、次を走らす: ◎ To implement the sandboxing for a Document object document,\

【 引数 %B はこの訳による追加であり, %文書 が`属する閲覧文脈$と同じになるが、この手続きが呼出される時点では まだ そうなるように設定されていない場合もあるので,必要になる。 】

  1. 以下において,ある~flag集合 %M で “拡充する” と記された所では、次を行うとする ⇒ %文書 の`作動中の~sandbox法~flag集合$に %M を成す すべての~flagを追加する (集合なので、重複するものは除く) ◎ populate document's active sandboxing flag set with the union of the flags that are present in the following sandboxing flag sets:
  2. ~IF[ %B は`~top-level閲覧文脈$である ] ⇒ %B の`~popup~sandbox法~flag集合$で拡充する ◎ If document's browsing context is a top-level browsing context, then: the flags set on the browsing context's popup sandboxing flag set.
  3. ~IF[ %B は`入子の閲覧文脈$である ] ⇒# %B の`~iframe~sandbox法~flag集合$で拡充する; %B の`親~閲覧文脈$にて`作動中の文書$の`作動中の~sandbox法~flag集合$で拡充する ◎ If document's browsing context is a nested browsing context, then: the flags set on the browsing context's iframe sandboxing flag set. ◎ If document's browsing context is a nested browsing context, then: the flags set on the browsing context's parent browsing context's active document's active sandboxing flag set.
  4. %文書 の資源があれば その`強制~sandbox法~flag集合$で拡充する ◎ The flags set on document's resource's forced sandboxing flag set, if it has one.