【この訳に固有の表記規約】
この訳の,~algoの記述に利用されている各種記号(ε, 此れ, ~LET, ~IF, ~RET, 等々)の意味や定義の詳細は、~SYMBOL_DEF_REFを~~参照されたし。
一部の箇所では、既存の用語を利用して記述を簡約している。
1. 序論
~web~platformは、絶えず発展し続ける一連の[ 特色機能や~API ]を供して,より[ 多彩な機能性, 開発者にとって使い勝手の良さ, 改善された処理能 ]を提供する。 しかしながら、開発者が,~browserに備わるこれらの[ 特色機能や~API ]のうち一部の挙動を 自身の~appの中で選択的に[ 可能化- / 不能化- / 改変- ]する能は、これまで無かった: ◎ The web-platform provides an ever-expanding set of features and APIs, offering richer functionality, better developer ergonomics, and improved performance. However, a missing piece is the ability for the developer to selectively enable, disable, or modify the behavior of some of these browser features and APIs within their application:
- 開発者は、~browserに備わる ある種の[ 特色機能や~API ]への~accessを 選択的に不能化-したいと求めることもある — ~securityや処理能のための予防策として,[ 自前の, あるいは第三者主体の ]内容が,自身の~appの中で実行されるのを防止して、[ 求まれない/期待されない ]挙動を導入しないように,自身の~appを “監禁する” ために。 ◎ The developer may want to selectively disable access to certain browser features and APIs to "lock down" their application, as a security or performance precaution, to prevent own and third-party content executing within their application from introducing unwanted or unexpected behaviors within their application.
- 開発者は、[ 既定では不能化され得るような,~browserに備わる ある種の[ 特色機能や~API ]]への~accessを,選択的に可能化-したいと求めることもある — 例:一部の特色機能は、[ 埋込まれた文脈においては,明示的に可能化されない限り 既定で不能化されたり、他の施策~要件の対象になる ]こともある。 ◎ The developer may want to selectively enable access to certain browser features and APIs which may be disabled by default - e.g. some features may be disabled by default in embedded context unless explicitly enabled; some features may be subject to other policy requirements.
-
開発者は、[ ある種の[ 特色機能や~API ]の利用 — または その欠如 — について,自身の~app[ の~client/を埋込む側 ]に約束する ]ことを言明する施策を利用したいと求めることもある。 例えば:
- ~browserにおいて ある種の “`fast path^en”† 最適化を可能化するため。 【†よくある事例~用の “優先路”(短期滞在者用の入出国手続きのような)】
- 埋込む側 — 例:様々な~social-network, 検索engine, 等々 — が設定した一部の要件に対する適合性についての約束を言明するため。
この仕様は、上の利用~事例に取組む特色機能~施策の仕組みを定義する。 ◎ This specification defines a feature policy mechanism that addresses the above use cases.
2. 例
~SecureCorp社は、自身の~appの中では[ ~Vibration/~Geolocation ]~APIの利用を不能化したいと求めているとする。 次のような特色機能~施策を定義する~HTTP応答~headerを送達すれば、それを行える: ◎ SecureCorp Inc. wants to disable use of Vibration and Geolocation APIs within their application. It can do so by delivering the following HTTP response header to define a feature policy:
`Feature-Policy$h: vibrate 'none'; geolocation 'none'
生成元~list用の~keyword `'none'^l を指定することにより、指定された特色機能は — どの閲覧文脈においても,その生成元に関わらず — 不能化されることになる。 ◎ By specifying the "'none'"keyword for the origin list, the specified features will be disabled for all browsing contexts, regardless of their origin.
~SecureCorp社は、[ 自前の生成元/ 生成元 `https://example.com^l ]用を除くどの閲覧文脈の中でも~Geolocation~APIの利用を不能化したいと求めているとする。 次のような特色機能~施策を定義する~HTTP応答~headerを送達すれば、それを行える: ◎ SecureCorp Inc. wants to disable use of Geolocation API within all browsing contexts except for its own origin and those whose origin is "https://example.com". It can do so by delivering the following HTTP response header to define a feature policy:
`Feature-Policy$h: geolocation 'self' https://example.com
`許容list$は、 1 個~以上の生成元からなる~listである — その各~生成元には、次のいずれかを与えれる ⇒# 任意選択で ~keyword `'self'^l を伴う,~appの生成元 / 任意の第三者主体~生成元 ◎ The allowlist is a list of one or more origins, which can include the application’s origin, optionally with the keyword "'self'", and any third-party origin.
~SecureCorp社は、 `https://example.com^l にて ある~appを~hostしていて,自前の生成元~上では[ ~camera/~microphone ]入力を不能化したいが,自身が埋込む特定の~host( `https://other.com^l )用には可能化したいと求めているとする。 次のような特色機能~施策を定義する~HTTP応答~headerを送達すれば、それを行える: ◎ SecureCorp Inc. is hosting an application on "https://example.com" and wants to disable camera and microphone input on its own origin but enable it for a specific embedee ("https://other.com"). It can do so by delivering the following HTTP response header to define a feature policy:
`Feature-Policy$h: camera https://other.com; microphone https://other.com
一部の特色機能は、埋込まれた文脈~内では既定で不能化される。 施策は、そのような特色機能を,指定された生成元~用に選択的に可能化することを,~appに許容する。 ◎ Some features are disabled by default in embedded contexts. The policy allows the application to selectively enable such features for specified origins.
~FastCorp社は、特定の `iframe^e 用を除く,すべての非同一生成元の子~frame用には,地理情報( `geolocation^en )を不能化したいと求めているとする。 次のような特色機能~施策を定義する~HTTP応答~header: ◎ FastCorp Inc. wants to disable geolocation for all cross-origin child frames, except for a specific iframe. It can do so by delivering the following HTTP response header to define a feature policy:
`Feature-Policy$h: geolocation 'self'
を送達した上で, `iframe^e 要素に `allow^a 属性を含めることで,それを行える: ◎ and including an "allow" attribute on the iframe element:
<iframe src="https://other.com/map" allow="geolocation"></iframe>
各種 `iframe^e 用の属性は、一定の~frame内に限り,選択的に特色機能を可能化できる — 他では,同じ生成元からの文書を包含する場合でも可能化しないように。 ◎ Iframe attributes can selectively enable features in certain frames, and not in others, even if those contain documents from the same origin.
4. ~framework
4.1. 施策により制御される特色機能
`施策により制御される特色機能@ は、`特色機能~施策$を~~参照することにより,文書において[ 可能化-/不能化- ]できる[ ~APIや挙動 ]である。 ◎ A policy-controlled feature is an API or behaviour which can be enabled or disabled in a document by referring to it in a feature policy.
注記: 簡潔にするため,この文書においては、施策により制御される特色機能は “特色機能” と略称されることが多い。 他が指示されない限り,用語 “特色機能” は`施策により制御される特色機能$を指す。 そのような特色機能を定義する他の仕様は、多義性を避けるため,長い方の用語を利用するべきである。 ◎ For brevity, policy-controlled features will often be referred to in this document simply as "Features". Unless otherwise indicated, the term "feature" refers to policy-controlled features. Other specifications, defining such features, should use the longer term to avoid any ambiguity.
この仕様は、現時点では,文書~内に定義される特色機能しか対処していない。 これについて,~Workerや~Worklet内の[ 特色機能/特色機能~施策 ]の可能性も含みにする言い回しを見つけるべきである。 ◎ This spec currently only deals with features defined in Documents. We should figure out how to word this to include the possibility of features and feature policies in Workers and Worklets as well.
`施策により制御される特色機能$は、[ `施策~指令$内で利用される,文字列による~token ]により識別される。 ◎ Policy-controlled features are identified by tokens, which are character strings used in policy directives.
各 `特色機能$には、`既定の許容list$がある — それは、次の 2 つを定義する ⇒# その特色機能は `~top-level閲覧文脈$に`属する文書$内で可用かどうか/ その特色機能への~accessは `入子の閲覧文脈$にはどう継承されるか ◎ Each policy-controlled feature has a default allowlist, which defines whether that feature is available in documents in top-level browsing contexts, and how access to that feature is inherited in nested browsing contexts.
`特色機能$のうち,~UAが施策を通して制御することを許容するものは、 `~support済み特色機能@ と呼ばれる。 ~UAには、あらゆる`特色機能$を~supportすることは要求されない。 ◎ A user agent has a set of supported features, which is the set of features which it allows to be controlled through policies. User agents are not required to support every feature.
注記: `施策により制御される特色機能$自体は、この~frameworkの一部を成すものではない。 現時点で定義されている規範的でない特色機能の~listは、この仕様とは別に, 姉妹~文書 にて保守されている。 ◎ The policy-controlled features themselves are not themselves part of this framework. A non-normative list of currently-defined features is maintained as a companion document alongside this specification.
4.2. 施策
`特色機能~施策@ は、次の~itemからなる`構造体$である ⇒# `継承した施策$, `宣言-済み施策$ ◎ A feature policy is a struct with the following items: • An inherited policy. • A declared policy.
`空の特色機能~施策@ は、次のようにされた`特色機能~施策$である:
- どの`~support済み特色機能$ %特色機能 に対しても ⇒ `継承した施策$[ %特色機能 ] ~EQ `可能化される^i
- `宣言-済み施策$は空~map
4.3. 継承した施策
`継承した施策@ は、各 `特色機能$を[ ある施策 ~IN { `可能化される^i, `不能化される^i } ]に対応付ける`有順序~map$である。 ◎ An inherited policy is an ordered map from features to either "Enabled" or "Disabled".
`特色機能~用に継承される施策@ は、所与の %特色機能 に対し,`継承した施策$[ %特色機能 ] で与えられる。 `特色機能~施策$が初期化された後には、それが`継承した施策$は,各`~support済み特色機能$用に何らかの値を包含することになる。 ◎ The inherited policy for a feature feature is the value in the inherited policy whose key is feature. After a feature policy has been initialized, its inherited policy will contain a value for each supported feature.
注記: ~frame木を成す各 文書は、一連の施策を継承する — [ ~top-level文書は 各`特色機能$用に定義される既定~のものから / 他の文書は その親~frameから ]。 この継承した施策は、次を決定する ⇒# 各~特色機能の初期~状態( `可能化される^i / `不能化される^i ) / 文書~内の`宣言-済み施策$により制御できるかどうか。 ◎ Each document in a frame tree inherits a set of policies from its parent frame, or in the case of the top-level document, from the defined defaults for each policy-controlled feature. This inherited policy determines the initial state ("Enabled" or "Disabled") of each feature, and whether it can be controlled by a declared policy in the document.
`~top-level閲覧文脈$に`属する文書$に継承される施策は、各~特色機能~用に定義される既定の施策に基づく。 ◎ In a Document in a top-level browsing context, the inherited policy is based on defined defaults for each feature.
`入子の閲覧文脈$に`属する文書$に継承される施策は、[ 親~文書の`特色機能~施策$doc, および`入子の閲覧文脈$の`容器~施策$ ]に基づく。 ◎ In a Document in a nested browsing context, the inherited policy is based on the parent document’s feature policy, as well as the nested browsing context's container policy.
4.4. 宣言-済み施策
`宣言-済み施策@ は、各 `特色機能$を ある`許容list$に対応付ける`有順序~map$である。 ◎ A declared policy is an ordered map from features to allowlists.
4.5. ~header施策
`~header施策@ は、文書に伴う~HTTP~headerを介して送達された`施策~指令$からなる~listである。 これは、文書の`特色機能~施策$の`宣言-済み施策$を形成する。 ◎ A header policy is a list of policy directives delivered via an HTTP header with a document. This forms the document’s feature policy’s declared policy.
4.6. 容器~施策
各`入子の閲覧文脈$は、`~header施策$に加えて, `容器~施策@ を持つ。 それは、`施策~指令$であり,空にもなり得る。 `容器~施策$は、`閲覧文脈~容器$上の属性により設定できる。 ◎ In addition to the header policy, each nested browsing context has a container policy, which is a policy directive, which may be empty. The container policy can set by attributes on the browsing context container.
`入子の閲覧文脈$用の`容器~施策$は、その文脈の中に読込まれる文書に`継承される施策$に波及する(`特色機能~用に継承される施策を定義する$を見よ)。 ◎ The container policy for a nested browsing context influences the inherited policy of any document loaded into that context. (See §10.9 Define an inherited policy for feature)
注記: 現時点では,`容器~施策$は直には設定できないが、 `iframe^e 要素の `allowfullscreen^a, `allowpaymentrequest^a, `allowusermedia^a, `allow^a 属性により,間接的に設定される。 この仕様の将来の改訂は、全部的な`容器~施策$を明示的に宣言する仕組みを導入し得る。 ◎ Currently, the container policy cannot be set directly, but is indirectly set by iframe "allowfullscreen", "allowpaymentrequest", "allowusermedia", and "allow" attributes. Future revisions to this spec may introduce a mechanism to explicitly declare the full container policy.
4.7. 施策~指令
`施策~指令@ は、各 `特色機能$を ある`許容list$に対応付ける`有順序~map$である。 ◎ A policy directive is an ordered map, mapping policy-controlled features to corresponding allowlists of origins.
`施策~指令$は、[ ~HTTP~header/~HTML属性 ]内では,`~ASCII直列化$pdとして表現される。 ◎ A policy directive is represented in HTTP headers and HTML attributes as its ASCII serialization.
4.8. 許容list
特色機能~施策 `許容list@ は、概念的には,いくつかの`生成元$からなる集合である。 `許容list$は、次のいずれかをとり得る: ◎ A feature policy allowlist is conceptually a set of origins. An allowlist may be either:
- あらゆる生成元を表現する,特別な値 "`*@P" 。 この仕様における `全~生成元@i は、この値を表す別名として利用される。 【 この別名は、表記的/意味的に明快にするために,この訳に導入している。】 ◎ The special value *, which represents every origin, or
- `生成元$たちが成す`有順序~集合$ ◎ An ordered set of origins
注記: [ ~headerや属性 ]内の文字列による許容listの~text表現には、~keyword[ `'self'^l, `'src'^l, `'none'^l ]も現れ得る 【属性の場合は、一重引用符は不要】 。 これらの各~keywordは,常に構文解析の間に文脈~内で解釈され、それぞれが指す生成元のみが,許容list~内に格納される。 ~keyword自身は、許容listの一部を成すことはない。 ◎ The keywords 'self', 'src', and 'none' can appear in the text representation of allowlists in headers and attribute strings. These keywords are always interpreted in context during parsing, and only the origins which they refer to are stored in the allowlist. The keywords themselves are not part of the allowlist.
`許容listは生成元に合致する@ かどうか決定するときは、所与の ( `許容list$ %許容list, 生成元 %生成元 ) に対し,次の手続きを走らす: ◎ To determine whether an allowlist matches an origin origin, run these steps:
- ~IF[ %許容list ~EQ `全~生成元$i ] ⇒ ~RET ~T ◎ If the allowlist is the special value *, then return true.
- %許容list 内の ~EACH( %~item ) に対し ⇒ ~IF[ ( %~item, %生成元 ) は`同じ生成元~domain$である ] ⇒ ~RET ~T ◎ Otherwise, for each item in the allowlist: • If item is same origin-domain with origin, then return true.
- ~RET ~F ◎ return false.
4.9. 既定の許容list
各 `特色機能$には、 `既定の許容list@ がある。 `既定の許容list$は、次を決定する ⇒# `~top-level閲覧文脈$内に宣言された施策は無い下で,所与の特色機能は文書において許容されるかどうか / 特色機能への~accessは自動的に`入子の閲覧文脈$に`属する文書$に移譲されるかどうか ◎ Every policy-controlled feature has a default allowlist. The default allowlist determines whether the feature is allowed in a document with no declared policy in a top-level browsing context, and also whether access to the feature is automatically delegated to documents in nested browsing contexts.
`特色機能$用の`既定の許容list$は、次のいずれかの値をとる: ◎ The default allowlist for a feature is one of these values:
- `全~生成元$i
- 特色機能は、既定では,`~top-level閲覧文脈$に`属する文書$において許容されることに加え、許容されるときは, `入子の閲覧文脈$に`属する文書$においても既定で許容される。 ◎ The feature is allowed in documents in top-level browsing contexts by default, and when allowed, is allowed by default to documents in nested browsing contexts.
- `'self'^l
- 特色機能は、既定では,`~top-level閲覧文脈$に`属する文書$において許容されることに加え、許容されるときは: `入子の閲覧文脈$に`属する文書$のうち,同じ生成元~domainのものにおいては既定で許容されるが、非同一生成元の文書においては,既定では許容されない。 ◎ The feature is allowed in documents in top-level browsing contexts by default, and when allowed, is allowed by default to same-origin domain documents in nested browsing contexts, but is disallowed by default in cross-origin documents in nested browsing contexts.
- `'none'^l
- 特色機能は、既定では,`~top-level閲覧文脈$に`属する文書$において許容されないことに加え、`入子の閲覧文脈$に`属する文書$においても,既定では許容されない。 ◎ The feature is disallowed in documents in top-level browsing contexts by default, and is also disallowed by default to documents in nested browsing contexts.
5. 特色機能~施策の直列化
5.1. ~ASCII直列化
`施策~指令$は[ ~HTTP~header/~HTML属性 ]内では、~ASCII~textとして表現される。 ◎ Policy Directives are represented in HTTP headers and in HTML attributes as ASCII text.
`serialized-feature-policy@P = `serialized-policy-directive$P *(";" `serialized-policy-directive$P) `serialized-policy-directive@P = `feature-identifier$P RWS `allow-list$P `feature-identifier@P = 1*( ALPHA / DIGIT / "-") `allow-list@P = `allow-list-value$P *(RWS `allow-list-value$P) `allow-list-value@P = `serialized-origin$P / "*" / "'self'" / "'src'" / "'none'"
`serialized-origin@P は、`生成元の直列化$である。 しかしながら,符号位置[ `0027^U (') / `0021^U (*) / `002C^U (,) / `003B^U (;) ]は、直列化~内に現れては~MUST_NOT — それらが要求される場合には、[ `%27^l / `%2A^l / `%2C^l / `%3B^l ]として~percent-符号化され~MUST。 ◎ serialized-origin is the serialization of an origin. However, the code points U+0027 ('), U+0021 (*), U+002C (,) and U+003B (;) MUST NOT appear in the serialization. If they are required, they must be percent-encoded as "%27", "%2A", "%2C" or "%3B", respectively.
注記: 文字列 `'self'^l は、許容list内の生成元として利用されても~MAY。 この仕方で利用されたときは、当の特色機能~施策を包含する文書の生成元を指すことになる。 ◎ The string "'self'" may be used as an origin in an allowlist. When it is used in this way, it will refer to the origin of the document which contains the feature policy.
6. 送達
6.1. `Feature-Policy^h ~HTTP~header
[ ~clientにより施行されるべきである`特色機能~施策$ ]を( ~serverから~clientへ )通信するときには、~HTTP応答~内に `Feature-Policy@h ~headerを利用できる。 ◎ The `Feature-Policy` HTTP header field can be used in the response (server to client) to communicate the feature policy that should be enforced by the client.
この~headerの値は、 1 個~以上の[ `施策~指令$の`~ASCII直列化$pd ]からなる。 ◎ The header’s value is the §5.1 ASCII serialization of one or more policy directives:.
FeaturePolicy = `serialized-feature-policy$P *("," `serialized-feature-policy$P)
`Feature-Policy$h ~headerを受信した~UAは、 ~HTMLとの統合 に従って, 応答~施策を処理して `施行-$し~MUST。 ◎ When the user agent receives a `Feature-Policy` header field, it MUST process and enforce the serialized policy as described in §8.1 Integration with HTML.
6.2. `iframe^e 要素の `allow^a 属性
`iframe$e 要素の `allow$aF 属性は、`直列形の特色機能~施策$を包含する。 ◎ iframe elements have an "allow" attribute, which contains an ASCII-serialized policy directive.
この属性~内に挙げられた名前の特色機能~用の`許容list$は、空になることもある。 その事例では、当の許容list用の既定の値は `'src'^l とする — この値は、 `iframe^e 要素の `src$aF 属性に与えられた~URLの`生成元$urlを表現する。 ◎ The allowlist for the features named in the attribute may be empty; in that case, the default value for the allowlist is 'src', which represents the origin of the URL in the iframe’s src attribute.
空でないときは、 `allow^aF 属性により,それを有する `iframe^e 要素が`入子にしている閲覧文脈$が構築されるときに,その`容器~施策$に[ 認識される各`特色機能$用の`許容list$ ]が追加されることになる。 ◎ When not empty, the "allow" attribute will result in adding an allowlist for each recognized feature to the nested browsing context's container policy, when it is constructed.
6.3. 旧来の特色機能を~supportする追加の属性
この仕様により制御される一部の`特色機能$に対しては、それ用の既存の属性が `iframe^e 要素~上に定義されている。 この仕様は、これらの属性を `iframe^e 要素~用に宣言された施策として動作するように定義し直す。 ◎ Some features controlled by Feature Policy have existing iframe attributes defined. This specification redefines these attributes to act as declared policies for the iframe element.
6.3.1. `allowfullscreen^a
`iframe^e 要素~上の `allowfullscreen$aF 属性は、 `requestFullscreen()$m への~accessを制御する。 ◎ The "allowfullscreen" iframe attribute controls access to requestFullscreen().
`iframe^e 要素が `allow$aF 属性を有していて,その値は ~token `fullscreen^l を包含する場合、 `allowfullscreen$aF 属性は効果を及ぼしては~MUST_NOT。 ◎ If the iframe element has an "allow" attribute whose value contains the token "fullscreen", then the "allowfullscreen" attribute must have no effect.
他の場合, `iframe^e 要素が `allowfullscreen$aF 属性を有するならば、要素が`入子にしている閲覧文脈$が構築されるときに,その`容器~施策$に `fullscreen^l 特色機能~用の`許容list$として `全~生成元$i が追加されることになる。 ◎ Otherwise, the presence of an "allowfullscreen" attribute on an iframe will result in adding an allowlist of * for the "fullscreen" feature to the nested browsing context's container policy, when it is constructed.
注記: これは、 `<iframe allow="fullscreen">^c の挙動から異なるが、既存の `allowfullscreen^a の利用と互換性を得るためにある。 `allow="fullscreen"^c, `allowfullscreen^c の両者とも `iframe^e 要素~上に在する場合、より制約的な方の許容listを成す `allow="fullscreen"^c が利用されることになる。 ◎ This is different from the behaviour of <iframe allow="fullscreen">, and is for compatibility with existing uses of allowfullscreen. If allow="fullscreen" and allowfullscreen are both present on an iframe element, then the more restrictive allowlist of allow="fullscreen" will be used.
6.3.2. `allowpaymentrequest^a
`iframe^e 要素~上の `allowpaymentrequest$aF 属性は `PaymentRequest$I への~accessを制御する。 ◎ The "allowpaymentrequest" iframe attribute controls access to paymentrequest.
`iframe^e 要素は `allow$aF 属性を有していて,その値は `payment^l を包含する場合、 `allowpaymentrequest$aF 属性は効果を及ぼしては~MUST_NOT。 ◎ If the iframe element has an "allow" attribute whose value contains the token "payment", then the "allowpaymentrequest" attribute must have no effect.
他の場合, `iframe^e 要素が `allowpaymentrequest$aF 属性を有するならば、要素が`入子にしている閲覧文脈$が構築されるときに,その`容器~施策$に `payment^l 特色機能~用の`許容list$として `全~生成元$i が追加されることになる。 ◎ Otherwise, the presence of an "allowpaymentrequest" attribute on an iframe will result in adding an allowlist of * for the "payment" feature to the nested browsing context's container policy, when it is constructed.
注記: これは、 `<iframe allow="payment">^c の挙動と異なるが、既存の `allowpaymentrequest^a の利用と互換性を得るためにある。 `allow="payment"^c, `allowpaymentrequest^a の両者とも `iframe^e 要素~上に在する場合、より制約的な方の許容listを成す `allow="payment"^c が利用されることになる。 ◎ This is different from the behaviour of <iframe allow="payment">, and is for compatibility with existing uses of allowpaymentrequest. If allow="payment" and allowpaymentrequest are both present on an iframe element, then the more restrictive allowlist of allow="payment" will be used.
6.3.3. `allowusermedia^a
`iframe^e 要素~上の `allowusermedia$aF 属性は、 `getUserMedia()$m への~accessを制御する。 ◎ The "allowusermedia" iframe attribute controls access to getUserMedia().
`iframe^e 要素が `allow$aF 属性を有していて,その値は~token `payment^l を包含する場合、 `allowusermedia$aF 属性は効果を及ぼしては~MUST_NOT。 ◎ If the iframe element has an "allow" attribute whose value contains the token "payment", then the "allowusermedia" attribute must have no effect.
他の場合, `iframe^e 要素が `allowusermedia$aF 属性を有するならば、要素が`入子にしている閲覧文脈$が構築されるときに,その`容器~施策$に[ `camera^l, `microphone^l ]各~特色機能~用の`許容list$として `全~生成元$i が追加されることになる。 ◎ Otherwise, the presence of an "allowusermedia" attribute on an iframe will result in adding an allowlist of * for each of the "camera" and "microphone" features to the nested browsing context's container policy, when it is constructed.
注記: これは `<iframe allow="camera; microphone">^c の挙動と異なるが、既存の `allowusermedia^a の利用と互換性を得るためにある。 `allow="camera; microphone"^c, `allowusermedia^a の両者とも `iframe^e 要素~上に在る場合、より制約的な方の許容listを成す `allow="camera; microphone"^c が利用されることになる。 同様に,[ `allow="camera"^c, `allow="microphone"^c ]の片方だけが在する場合、その特色機能~用には より制約的な方の許容listが利用されることになる一方で、 他方には より制約的でない方の許容listを成す `全~生成元$i を利用することになる。 ◎ This is different from the behaviour of <iframe allow="camera; microphone">, and is for compatibility with existing uses of allowusermedia. If allow="camera; microphone" and allowusermedia are both present on an iframe element, then the more restrictive allowlist of allow="camera; microphone" will be used. Similarly, if only one of allow="camera" or allow="microphone" is present, then the more restrictive allowlist will be used for that feature, while the other will use the less restrictive *.
7. ~scriptからの施策の自己検分
この節にて述べる自己検分~APIは、開発の早期段階にあり,完成する前に — 場合によっては有意に — 変更されるものと見込まれる。 ~web開発者には、この~APIを利用して実験して ~feedbackを供することが 奨励されるが、変更されたり,完全に除去されることを意識しておくように。 ◎ The introspection API described in this section is early in development, and is likely to change — possibly significantly — before it is finalized. Web developers are encouraged to experiment with using the API, and provide feedback, but should be aware that it may change or be removed completely.
7.1. 概観
文書~内で効果を発揮している現在の施策は、~scriptから観測できる。 これは、[ ある特色機能が可能化されているかどうか判らない限り,何か — 具体例として, どの~UIを表示するかなど — を決定する ]のがアリでない事例で,裁定を下すときに利用できる。 (特色機能には、観測-可能な失敗~modeが無いものや,特色機能~検出に際し求まれない副作用を伴うものもあるかもしれない。) ◎ The current policy which is in effect in a document can be observed by scripts. This can be used to make decisions, for instance, about what user interface to display, in cases it is not possible to determine otherwise whether a feature is enabled or not. (Some features may not have any observable failure mode, or may have unwanted side effects to feature detection.)
文書, `iframe^e の両者とも, `Policy$I ~objを供する — それを利用すれば、自身に適用される特色機能~施策を検分できる。 ◎ Documents and iframes both provide a Policy object which can be used to inspect the feature policies which apply to them.
注記: “`policy^en” という名は、意図的に広い~~意味にされている: `Policy$I ~objは、この仕様~専用ではなく,~CSPなどの他の種類の施策~用にも拡張-可能になるものと意図されている。 将来に この~objに追加される~methodは、それが指す施策の種類を指示するよう,適切に命名されるべきである。 ◎ The name policy is intentionally broad: the Policy object is intended to be extendable to other kinds of policies, such as Content Security Policy, rather than being exclusively dedicated to Feature Policy. Future methods added to the object should be named appropriately, to indicate the kinds of policies they refer to.
7.1.1. 文書~施策
現在~有効な施策を検索取得するときは、 `document.policy()$m を利用する。 これは、次に利用できる `Policy$I ~objを返す: ◎ To retreive the currently effective policy, use document.policy(). This returns a policy object, which can be used to:
- 現在の文書に対し,所与の特色機能~用の状態(許容されるか/否認されるか)を照会する ◎ query the state (allowed or denied) in the current document for a given feature,
- 現在の文書にて許容される特色機能すべてからなる~listを取得する ◎ get a list of all allowed features in the current document, or
- 現在の文書における,所与の特色機能~用の許容listを取得する。 ◎ get the allowlist for a given feature in the current document.
<!doctype html> <script> let %policy = document.policy; /* この文書が~WebUSBを利用できるならば、次の結果は ~T になる。 ◎ This will be true if this document can use WebUSB */ let %can_use_usb = %policy.allowsFeature('usb'); /* `https://example.com^s にある新たな~frameには,~WebVRの利用は許容されるならば、次の結果は ~T になる。 ◎ True if a new frame at https://example.com will be allowed to use WebVR */ if (%policy.allowsFeature('vr', 'https://example.com')) { /* `https://example.com^s にある~frameを作成する~UIを示す ◎ Show UI to create frame at https://example.com */ } else { /* 代替~UIを示す ◎ Show an alternative UI */ } /* `payment^l (支払い)要請が許容される生成元たちの~listを取得する。 結果は、すべての生成元に許容される場合は `全~生成元$i のみからなる~list( `['\*']^c )になり,他の場合は 明示的な生成元の~listになる。 ◎ Get the list of origins which are allowed to request payment. The result will be a list of explicit origins, or the single element ['\*'] if all origins are allowed. */ let %allowed_payment_origins = %policy.getAllowlistForFeature('payment'); </script>
7.1.2. ~frame 施策
`iframe^e 要素~上の施策を,それを包含する文書から検分することもアリである。 この事例における施策~objは、その~frame用の`観測-可能な施策$を表現する — それは、現在の文書と `iframe^e 要素の属性のみに依存し,[ ~frame内で,ある特色機能が実際に現在~許容されているかどうか ]を露呈することはない。 ~frame内の文書は、~HTTP~headerを介して自前の施策を適用していることもあれば,初期の所在から新たな生成元へ~navigateされることもある。 そのような事例で 入子の閲覧文脈~内で有効な施策が露呈されれば、非同一生成元~文書の挙動について情報を漏洩することになり得る。 ◎ It is also possible to inspect the policy on an iframe element, from the document which contains it. The policy object in this case represents the observable policy for the frame, which depends only on the current document and the attributes of the iframe element. It does not reveal whether a feature is actually currently allowed in the frame, as the document in the frame may have applied its own policy via an HTTP header, or may have navigated away from its initial location to a new origin. Revealing the effective policy in the nested browsing context in that case could leak information about the behaviour of a cross-origin document.
<!doctype html> <iframe id="frame" allow="fullscreen; vr"></iframe> <script> let %iframe_element = document.getElementById("frame"); let %iframe_policy = %iframe_element.policy; /* ~frame化された文書にて~WebVRの利用は許容されるならば、次の結果は ~T になる。 ◎ True if the framed document will be allowed to use WebVR */ if (%iframe_policy.allowsFeature('vr')) { /* ~VR制御を表示する ◎ display vr controls */ } </script>
`iframe^e 要素~上で`観測-可能な施策$は、~frameの中に読込まれた実際の内容には依存しない(非同一生成元への情報~漏洩を避けるため) — また、要素が文書~木~内にあるかどうかにも依存しない。 ◎ The observable policy on an iframe element is independent of any actual content loaded into the frame (to avoid cross-origin information leakage,) or even whether it is in a document tree.
<!doctype html> <!-- 次の~frameの `src^a 属性に与えた文書が読込まれるときは、その~frameには,~fullscreenを利用することは許容されるべきでない。 ◎ this frame should not be allowed to use fullscreen when the document in its src attribute is loaded in it --> <iframe id="frame" allow="fullscreen https://example.com" src="https://example.net/" ></iframe> <script> let %iframe_element = document.getElementById("frame"); let %iframe_policy = %iframe_element.policy; /* 次の結果は、~F になる — 施策により、 `src^a 属性~内に挙げられた~URLには,~fullscreenの利用-は許容されないので。 ◎ This will be false, as the URL listed in the src attribute is not allowed by policy to use fullscreen. */ let %is_fullscreen_allowed_in_frame = iframe_policy.allowsFeature('fullscreen'); let %new_frame = document.createElement('iframe'); %new_frame.allow = 'syncxhr'; /* 次の結果は、 ~T になる。 すなわち、この `iframe^e には `syncxhr^l 【同期的 `XMLHttpRequest$I 】の利用-は許容される — `src^a 属性に挙げられた~URLが何であれ,属性がまだ設定されてなくとも。 ◎ This will be true, as the iframe is allowed to use syncxhr at whatever URL is mentioned in its src attribute, even though that attribute is not yet set. */ let %is_syncxhr_allowed = %new_frame.policy.allowsFeature('syncxhr'); </script>
7.2. 施策~obj
[`NoInterfaceObject$] interface `Policy@I { boolean `allowsFeature$m(DOMString %feature, optional DOMString %origin); sequence<DOMString> `allowedFeatures$m(); sequence<DOMString> `getAllowlistForFeature$m(DOMString %feature); }; partial interface `Document$I { [`SameObject$] readonly attribute `Policy$I `~policyD$m; }; partial interface `HTMLIFrameElement$I { [`SameObject$] readonly attribute `Policy$I `~policyF$m; };
各 `Policy$I ~obj %P には、 `Node$I ~objが結付けられる — それは, %P に `結付けられている~node@ と称され、 %P の作成-時に設定される。 ◎ A Policy object has an associated node, which is a Node. The associated node is set when the Policy object is created.
各 `Policy$I ~obj %P の `既定の生成元@ は、 %P に`結付けられている~node$ %N に応じて,次で与えられる`生成元$になる ⇒# `Document$I であるならば %N の`生成元$ / `Element$I であるならば %N に`宣言された生成元$ ◎ A Policy object has a default origin, which is an origin, whose value depends on the state of the Policy object’s associated node: • If the Policy object’s associated node is a Document, then its default origin is the Document's origin. • If the Policy object’s associated node is an Element, then its default origin is the Element's declared origin.
各 `Document$I ~obj %D には、 %D の `施策~obj@doc と称される,次を満たす `Policy$I ~obj %P がただ一つ在る ⇒ %P に`結付けられている~node$ ~EQ %D ◎ Each Document has a policy object, which is a Policy instance whose associated node is that Document.
`Document$I 上の `~policyD@m ~IDL属性の取得子は、此れの`施策~obj$docを返さ~MUST ◎ A Document's policy IDL attribute, on getting, must return the Document's policy object.
各 `iframe$e 要素 %E には、 %E の `施策~obj@doc と称される,次を満たす `Policy$I ~obj %P がただ一つ在る ⇒ %P に`結付けられている~node$ ~EQ %E ◎ Each iframe element has a policy object, which is a Policy instance whose associated node is that element.
`iframe$e %E 上の `~policyF@m ~IDL属性の取得子は、此れの`施策~obj$iFを返さ~MUST。 ◎ An iframe's policy IDL attribute, on getting, must return the iframe's policy object.
- `allowsFeature(feature, origin)@m
-
被呼出時には、次を走らせ~MUST: ◎ The allowsFeature(feature, origin) method must run the following steps:
- ~IF[ %origin は与えられていない ] ⇒ %origin ~SET 此れの`既定の生成元$ ◎ If origin is omitted, set origin to this Policy object’s default origin.
- %施策 ~LET 此れに`結付けられている~node$用の`観測-可能な施策$ ◎ Let policy be the observable policy for this Policy object’s associated node.
- ~IF[ %施策 により, %特色機能 は %origin 用に許容される【具体的な~algoは指定されていない】 ] ⇒ ~RET ~T ◎ If feature is allowed by policy for origin, return true.
- ~RET ~F ◎ Otherwise, return false.
- `allowedFeatures()@m
-
被呼出時には、次を走らせ~MUST: ◎ The allowedFeatures() method must run the following steps:
- %結果 ~SET 空~list ◎ Set result to an empty list
- %生成元 ~LET 此れの`既定の生成元$ ◎ Let origin be this Policy object’s default origin.
- %施策 ~LET 此れに`結付けられている~node$用に`観測-可能な施策$ ◎ Let policy be the observable policy for this Policy object’s associated node.
- ~EACH( `~support済み特色機能$ %特色機能 ) に対し ⇒ ~IF[ %施策 により, %特色機能 は %生成元 用に許容される ] ⇒ %結果 に %特色機能 を付加する ◎ For each supported feature feature: • If feature is allowed by policy for origin, append feature to result.
- ~RET %結果 ◎ return result
- `getAllowlistForFeature(feature)@m
-
被呼出時には、次を走らせ~MUST: ◎ The getAllowlistForFeature(feature) method must run the following steps:
- %結果 ~SET 空~list ◎ Set result to an empty list
- %生成元 ~LET 此れの`既定の生成元$ ◎ Let origin be this Policy object’s default origin.
- %施策 ~LET 此れに`結付けられている~node$用の`観測-可能な施策$ ◎ Let policy be the observable policy for this Policy object’s associated node.
- ~IF[ %施策 により, %特色機能 は %生成元 用には許容されない ] ⇒ ~RET %結果 ◎ If feature is not allowed in policy for origin, return result
- %許容list ~LET %施策 の宣言-済み施策[ %特色機能 ] ◎ Let allowlist be policy’s declared policy[feature]
- ~IF[ %許容list ~EQ `全~生成元$i ] ⇒ %結果 に`全~生成元$iを付加する ◎ If allowlist is the special value *, append "*" to result
- ~ELSE ⇒ %許容list 内の ~EACH( %生成元 ) に対し ⇒ %結果 に次の結果を付加する ⇒ `生成元を直列化する$( %生成元 ) ◎ Otherwise, for each origin in allowlist: • Append the serialization of origin to result
- ~RET %結果 ◎ Return result.
~node %N 用の `観測-可能な施策@ は、現在の閲覧文脈から可視である`特色機能~施策$のうち,[ %N により表現される,閲覧文脈~内の施策についての情報 ]を包含するものである。 ◎ The observable policy for any Node is a feature policy, which contains the information about the policy in the browsing context represented by that Node which is visible from the current browsing context.
所与の %文書 用の`観測-可能な施策$を取得するときは、 %文書 の`特色機能~施策$docを返す。 ◎ To get the observable policy for a Document document, return document’s feature policy.
所与の要素 %~node 用に`観測-可能な施策$を取得するときは、次を走らす: ◎ To get the observable policy for an Element node, run the following steps:
- %継承した施策 ~LET 新たな有順序~map ◎ Let inherited policy be a new ordered map.
- %宣言-済み施策 ~LET 新たな有順序~map ◎ Let declared policy be a new ordered map.
- ~EACH( `~support済み特色機能$ %特色機能 ) に対し ⇒ %継承した施策[ %特色機能 ] ~SET `容器~内の特色機能~用に継承される施策を定義する$( %特色機能, %~node ) ◎ For each supported feature feature: • Let isInherited be the result of running §10.10 Define an inherited policy for feature in container on feature and node. • Set inherited policy[feature] to isInherited.
- ~RET 次のようにされた新たな`特色機能~施策$ ⇒# `継承した施策$ ~SET %継承した施策, `宣言-済み施策$ ~SET %宣言-済み施策 ◎ Return a new feature policy with inherited policy inherited policy and declared policy declared policy.
`Element$I %~node 用に `宣言された生成元@ を取得するときは、次を走らす: ◎ To get the declared origin for an Element node, run the following steps:
- %文書 ~LET %~node の`~node文書$ ◎ ↓
-
~IF[ %~node は `src^a 属性を有する ]: ◎ If node has a src attribute:
- %~url ~LET %~node の `src^a 属性の値を %文書 に`相対的に構文解析-$した結果 ◎ Let url be the result of parsing node’s src attribute, relative to node’s node document.
- ~IF[ %~url ~NEQ 失敗 ] ⇒ ~RET %~url の生成元 ◎ If url is not failure, return url’s origin.
- ~RET %文書 の生成元 ◎ Return node’s node document’s origin.
8. 統合
この文書は、一連の~algoを定義する — 他の仕様は、この仕様が定義する制約を実装するために,それらを利用することになる。 統合については,明確さを得るためここで要旨するが†、それらの外部~仕様が規範的であり,詳細はそれらを参照すること。 ◎ This document defines a set of algorithms which other specifications will use in order to implement the restrictions which Feature Policy defines. The integrations are outlined here for clarity, but those external documents are the normative references which ought to be consulted for detailed information.
8.1. ~HTMLとの統合
【† この訳では、原文をさらに簡約して,該当する変更点とその参照先を挙げるにとどめる(原文の “引用” による記述は、~HTML仕様の更新に伴い,次第に乖離していくと予想されるので)。 】
- `文書$用の`特色機能~施策$は、各 `文書$の`特色機能~施策$doc(初期~時は空)を設定することにより, `施行-@ されることになる。 【具体的には、次項に挙げる~algo, および`特色機能~施策~属性を処理する$ことを通して。】 ◎ Document objects have a Feature Policy, which is initially empty. ◎ ↓
- 次に挙げる~algoは改変された ⇒# `新たな閲覧文脈を作成する$/ `文書を初期化する$/ 特色機能の`利用は許容される$かどうかを決定する ◎ Replace the existing step 12 of "Create a new browsing context" with with the following step: • Execute the Initialize document’s Feature Policy algorithm on the Document object. ◎ Replace the existing step 8 of "Initialising a new Document object" with the following step: • Execute the Initialize document’s Feature Policy from response algorithm on the Document object and the response used to generate the document. ◎ A feature policy is enforced for a Document by setting it as the Document's Feature Policy. ◎ The "allowed to use" algorithm is replaced with the following: • 以下略
- `iframe$e 要素に `allow$aF 属性が追加された。 ◎ The allow attribute is added to the IDL for the iframe element, with the description: • 以下略
- `allowfullscreen$aF, `allowpaymentrequest$aF, `allowusermedia$aF 属性の挙動は変更された。 ◎ The description of the behavior of the allowfullscreen, allowpaymentrequest and allowusermedia attributes is changed to refer to this specification: • 以下略
- もはや参照されなくなった “`set the allow* flags^en” ~algoは除去された。 ◎ The set the allow* flags algorithm is removed, as it is no longer referenced.
9. 報告-法
`特色機能~施策~違反~報告@ は、[ `文書$内のある挙動が,特色機能~施策に`違反-$している ]ことを指示する。 その施策の `違反@ がいつ生じるか[ 定義する/決定する ]のは、個々の特色機能~施策に委ねられる。 ◎ Feature policy violation reports indicate that some behavior of the Document has violated a feature policy. It is up to each individual feature policy to define/determine when a violation of that policy has occurred.
`特色機能~施策~違反~報告$の`報告~種別$は、 `feature-policy-violation^l とする。 ◎ Feature policy violation reports have the report type "feature-policy-violation".
`特色機能~施策~違反~報告$は、`報告用~観測器から可視$になるとする。 ◎ Feature policy violation reports are visible to ReportingObservers.
interface `FeaturePolicyViolationReportBody@I : `ReportBody$I { readonly attribute DOMString `featureId$m; readonly attribute DOMString `message$m; readonly attribute DOMString? `sourceFile$m; readonly attribute long? `lineNumber$m; readonly attribute long? `columnNumber$m; readonly attribute DOMString `disposition$m; };
`特色機能~施策~違反~報告$の`本体$rPは、~JSにおいては,次の~fieldを包含する `FeaturePolicyViolationReportBody$I により表現される: ◎ A feature policy violation report’s body, represented in JavaScript by FeaturePolicyViolationReportBody, contains the following fields:
- `featureId@m
- 施策に`違反-$した`特色機能$を識別する文字列。 この文字列は、関係する報告を~group化する/数えるときに利用できる。 ◎ featureId: The string identifying the policy-controlled feature whose policy has been violated. This string can be used for grouping and counting related reports.
- `message@m
- 詳細を伴う,人が読める文字列 — 開発者~consoleに表示されるものに概して合致するような。 この~messageは、所与の `featureId$m に一意になることは保証されない(例:~APIがどう利用されたかについて追加の文脈を包含することもある)。 ◎ message: A human-readable string with details typically matching what would be displayed on the developer console. The message is not guaranteed to be unique for a given featureId (e.g. it may contain additional context on how the API was used).
- `sourceFile@m
- 既知ならば,`違反$が生じた~file — 他の場合は ~NULL 。 ◎ sourceFile: If known, the file where the violation occured, or null otherwise.
- `lineNumber@m
- 既知ならば, `sourceFile$m において`違反$が生じた箇所の行番号 — 他の場合は ~NULL 。 ◎ lineNumber: If known, the line number in sourceFile where the violation occured, or null otherwise.
- `columnNumber@m
- 既知ならば, `sourceFile$m において`違反$が生じた箇所の列番号 — 他の場合は ~NULL 。 ◎ columnNumber: If known, the column number in sourceFile where the violation occured, or null otherwise.
- `disposition@m
- `違反-$された特色機能~施策は、この事例にて施行されたかどうかを指示する文字列。 施策は施行されたなら `enforce^l に設定される。 `違反$は この報告を生成させるだけであったなら `report^l に設定される(~UAは、違反に呼応してそれ以上の動作はとらなかった)。 ◎ disposition: A string indicating whether the violated feature policy was enforced in this case. disposition will be set to "enforce" if the policy was enforced, or "report" if the violation resulted only in this report being generated (with no further action taken by the user agent in response to the violation).
- 注記: 現時点では、報告のみ行う~modeを可能化する仕組みは無いので、これは,常に `enforce^l に設定されることになる。 ◎ Note: There is currently no mechanism in place for enabling report-only mode, so disposition will always be set to "enforce".
10. 各種~algo
10.1. 応答~施策を処理する
この~algoは、所与の ( `応答$ %応答, `生成元$ %生成元 ) に対し,`宣言-済み施策$を返す: ◎ Given a response (response) and an origin (origin), this algorithm returns a declared feature policy.
- ~IF[ %応答 の`~header~list$rs内に `Feature-Policy^h を`名前に持つ~header$は無い ] ⇒ ~RET ◎ Abort these steps if the response’s header list does not contain a header whose name is "Feature-Policy".
- %~header値 ~LET %応答 の`~header~list$rs内の `Feature-Policy^h に対する`結合-済みの値$hd ◎ Let header be the concatenation of the values of all header fields in response’s header list whose name is "Feature-Policy", separated by U+002C (,) (according to [RFC7230, 3.2.2]).
- %特色機能~施策 ~LET `値と生成元から~headerを構文解析する$( %~header値, %生成元 ) ◎ Let feature policy be the result of executing §10.2 Parse header from value and origin on header and origin.
- ~RET %特色機能~施策 ◎ Return feature policy.
10.2. %値 と %生成元 から~headerを構文解析する
この~algoは、所与の ( 文字列 %値, `生成元$ %生成元 ) に対し,`宣言-済み施策$を返す: ◎ Given a string (value) and an origin (origin) this algorithm will return a declared feature policy.
- %施策 ~LET 新たな`有順序~map$ ◎ Let policy be an empty ordered map.
-
`~commaで分割する$( %値 ) の結果を成す ~EACH( %要素 ) に対し: ◎ For each element returned by splitting value on commas:
- %指令 ~LET `値と生成元から施策~指令を構文解析する$( %要素, %生成元 ) ◎ Let directive be the result of executing §10.3 Parse policy directive from value and origin on element and origin
- `指令を宣言-済み施策に併合する$( %指令, %施策 ) ◎ Run §10.4 Merge directive with declared policy on directive and policy.
- ~RET %施策 ◎ Return policy.
10.3. %値 と %生成元 から施策~指令を構文解析する
この~algoは、所与の ( 文字列 %値, `生成元$ %生成元 ) に対し,`施策~指令$を返す: ◎ Given a string (value) and an origin (origin) this algorithm will return a policy directive.
- %指令 ~LET 新たな`有順序~map$ ◎ Let directive be an empty ordered map.
-
`区切子で厳密に分割する$( %値, `003B^U (;) ) の結果を成す ~EACH( %直列形の宣言 ) に対し: ◎ For each serialized-declaration returned by strictly splitting value on the delimiter U+003B (;):
- %~token~list ~LET `~ASCII空白で分割する$( %直列形の宣言 ) ◎ Let tokens be the result of splitting serialized-declaration on ASCII whitespace.
- ~IF[ %~token~list は空である ] ⇒ ~CONTINUE ◎ If tokens is an empty list, then continue.
- %特色機能~名 ~LET %~token~list[0] ◎ Let feature-name be the first element of tokens.
- %特色機能 ~LET %特色機能~名 により識別される`~support済み特色機能$が[ 在るならば それ / 無いならば ε ] ◎ If feature-name does not identify any recognized policy-controlled feature, then continue.
- ~IF[ %特色機能 ~EQ ε ] ⇒ ~CONTINUE ◎ Let feature be the policy-controlled feature identified by feature-name.
- %~target~list ~LET %~token~list から最初の~itemを除去して得られる~list ◎ Let targetlist be the remaining elements, if any, of tokens.
- %許容list ~LET `全~生成元$i ◎ ↓
-
~IF[ `全~生成元$i ~NIN %~target~list ] ◎ Let allowlist be a new allowlist. ◎ If any element of targetlist is the string "*", set allowlist to the special value *. ◎ Otherwise:
- %許容list ~SET 新たな`有順序~集合$ ◎ Set allowlist to an new ordered set.
-
%~target~list 内の ~EACH( %~target ) に対し: ◎ For each element in targetlist:
- ~IF[ %~target は 文字列 `'self'^l に`~ASCII大小無視$で合致しない ] ⇒ %~target ~SET %生成元 ◎ If element is an ASCII case-insensitive match for the string "'self'", let result be origin.
-
~ELSE:
- %~target ~LET `~URL構文解析する$( %~target ) ◎ Otherwise, let result be the result of executing the URL parser on element.
- ~IF[ %~target ~EQ `失敗^i ] ⇒ ~CONTINUE ◎ If result is not failure:
- %~target ~SET %~target の`生成元$url ◎ Let target be the origin of result.
- ~IF[ %~target は`不透明な生成元$でない ] ⇒ %許容list に %~target を付加する ◎ If target is not an opaque origin, append target to allowlist.
- %指令[ %特色機能 ] ~SET %許容list ◎ Set directive[feature] to allowlist.
- ~RET %指令 ◎ Return directive
10.4. 指令を宣言-済み施策に併合する
この~algoは、所与の ( 施策~指令 %指令, `宣言-済み施策$ %施策 ) に対し,新たな指令を織り込むように %施策 を改変する: ◎ Given a policy directive (directive) and a declared policy (policy), this algorithm will modify policy to account for the new directive.
-
%指令 を成す ~EACH( %特色機能 → %許容list ) に対し: ◎ For each feature → allowlist of directive:
- ~IF[ %施策[ %特色機能 ] ~EQ ε ] ⇒ %施策[ %特色機能 ] ~SET %許容list ◎ If policy does not contain an allowlist for feature, then set policy[feature] to allowlist.
10.5. 特色機能~施策~属性を処理する
この~algoは、所与の ( 要素 %要素 ) に対し,`容器~施策$を返す(空にもなり得る): ◎ Given an element (element), this algorithm returns a container policy, which may be empty.
- %施策 ~LET 新たな`施策~指令$ ◎ Let policy be a new policy directive.
- %容器~施策 ~LET `allow^a 属性を構文解析する( %要素 の `allow$aF 属性の値, %要素 の`~node文書$の生成元, %要素 に`宣言された生成元$ ) ◎ Let container policy be the result of running Parse allow attribute on the value of element’s allow attribute, with container origin set to the origin of element’s node document, and target origin set to element’s declared origin.
- ~IF[ %要素 は `iframe$e 要素でない ] ⇒ ~RET %容器~施策 【 `allow^a 属性が定義されているのは `iframe^e しかないので、この記述はおかしい。】 ◎ If element is an iframe element:
- ~IF[ %要素 は `allowfullscreen$aF 属性を有する ]~AND[ %容器~施策[ `fullscreen^ft ] ~EQ ε ] ⇒ %容器~施策[ `fullscreen^ft ] ~SET `全~生成元$i ◎ If element’s allowfullscreen attribute is specified, and container policy does not contain an allowlist for fullscreen, • Construct a new declaration for fullscreen, whose allowlist is the special value *. • Add declaration to container policy.
- ~IF[ %要素 は `allowpaymentrequest$aF 属性を有する ]~AND[ %容器~施策[ `payment^ft ] ~EQ ε ] ⇒# %容器~施策[ `payment^ft ] ~SET `全~生成元$i ◎ If element’s allowpaymentrequest attribute is specified, and container policy does not contain an allowlist for payment, • Construct a new declaration for payment, whose allowlist is the special value *. • Add declaration to container policy.
-
~IF[ %要素 は `allowusermedia$aF 属性を有する 【原文の `allowusermediarequest^a は誤記であろう】 ] ⇒ ◎ If element’s allowusermediarequest attribute is specified:
- ~IF[ %容器~施策[ `camera^ft ] ~EQ ε ] ⇒ %施策[ `camera^ft ]† ~SET `全~生成元$i ◎ If container policy does not contain an allowlist for camera, • Construct a new declaration for camera, whose allowlist is the special value *. • Add declaration to policy.
- ~IF[ %施策[ `microphone^ft ]† ~EQ ε ] ⇒ %容器~施策[ `microphone^ft ] ~SET `全~生成元$i ◎ If policy does not contain an allowlist for microphone, • Construct a new declaration for microphone, allowlist is the special value *. • Add declaration to container policy.
- ~RET %容器~施策 ◎ Return container policy.
10.6. `allow^a 属性を構文解析する
この~algoは、所与の ( 文字列 %値, 生成元 %容器~生成元, 生成元 %~target生成元 ) に対し,`施策~指令$を返す: ◎ Given a string (value), and two origins (container origin and target origin), this algorithm returns a policy directive.
- %指令 ~LET 新たな`有順序~map$ ◎ Let directive be an empty ordered map.
-
`区切子で厳密に分割する$( %値, `003B^U (;) ) の結果を成す ~EACH( %直列形の宣言 ) に対し: ◎ For each serialized-declaration returned by strictly splitting value on the delimiter U+003B (;):
- %~token~list ~LET `~ASCII空白で分割する$( %直列形の宣言 ) ◎ Let tokens be the result of splitting serialized-declaration on ASCII whitespace.
- ~IF[ %~token~list は空である ] ⇒ ~CONTINUE ◎ If tokens is an empty list, then continue.
- %特色機能~名 ~LET %~token~list[0] ◎ Let feature-name be the first element of tokens.
- %特色機能 ~LET %特色機能~名 により識別される`~support済み特色機能$が[ 在るならば それ / 無いならば ε ] ◎ If feature-name does not identify any recognized policy-controlled feature, then continue.
- ~IF[ %特色機能 ~EQ ε ] ⇒ ~CONTINUE ◎ Let feature be the policy-controlled feature identified by feature-name.
- %~target~list ~LET %~token~list から最初の~itemを除去して得られる~list ◎ Let targetlist be the remaining elements, if any, of tokens.
- %許容list ~LET 新たな`許容list$ ◎ Let allowlist be a new allowlist.
- ~IF[ `全~生成元$i ~IN %~target~list ] ⇒ %許容list ~SET `全~生成元$i ◎ If any element of targetlist is the string "*", set allowlist to the special value *.
-
~ELSE: ◎ Otherwise:
- %許容list ~SET 新たな `有順序~集合$ ◎ Set allowlist to an new ordered set.
- ~IF[ %~target~list は空である ] ⇒ %許容list に %~target生成元 を付加する ◎ If targetlist is empty, append target origin to allowlist.
-
%~target~list を成す ~EACH( %~target ) に対し: ◎ For each element in targetlist:
- ~IF[ %~target は`~ASCII大小無視$で `'self'^l に合致する ] ⇒ %~target ~SET %容器~生成元 ◎ If element is an ASCII case-insensitive match for "'self'", let result be container origin.
- ~ELIF[ %~target は`~ASCII大小無視$で `'src'^l に合致する ] ⇒ %~target ~SET %~target生成元 ◎ If element is an ASCII case-insensitive match for "'src'", let result be target origin.
-
~ELSE:
- %~target ~LET `~URL構文解析する$( %~target ) ◎ Otherwise, let result be the result of executing the URL parser on element.
- ~IF[ %~target ~EQ `失敗^i ] ⇒ ~CONTINUE ◎ If result is not failure:
- %~target ~SET %~target の`生成元$url ◎ Let target be the origin of result.
- ~IF[ %~target は`不透明な生成元$でない ] ⇒ %許容list に %~target を付加する ◎ If target is not an opaque origin, append target to allowlist.
- %指令[ %特色機能 ] ~SET %許容list ◎ Set directive[feature] to allowlist.
- ~RET %指令 ◎ Return directive
10.7. %文書 の特色機能~施策を初期化する
この~algoは、所与の ( `文書$ %文書 ) に対し, %文書 の`特色機能~施策$docを初期化する: ◎ Given a Document object (document), this algorithm initialises document’s Feature Policy
- %継承した施策 ~LET 新たな`有順序~map$ ◎ Let inherited policy be a new ordered map.
- %宣言-済み施策 ~LET 新たな`有順序~map$ ◎ Let declared policy be a new ordered map.
- ~EACH( `~support済み特色機能$ %特色機能 ) に対し ⇒ %継承した施策[ %特色機能 ] ~SET ~LET `特色機能~用に継承される施策を定義する$( %特色機能, %文書 が`属する閲覧文脈$ ) ◎ For each feature supported, • Let isInherited be the result of running §10.9 Define an inherited policy for feature on feature and document’s browsing context. • Set inherited policy[feature] to isInherited.
- %施策 ~LET 次のようにされた新たな`特色機能~施策$ ⇒# `継承した施策$ ~SET %継承した施策, `宣言-済み施策$ ~SET %宣言-済み施策 ◎ Let policy be a new feature policy, with inherited policy inherited policy and declared policy declared policy.
- %文書 の`特色機能~施策$doc ~SET %施策 (すなわち、 %施策 を`施行する$) ◎ Enforce the policy policy on document.
10.8. %応答 からの特色機能~施策で %文書 のそれを初期化する
この~algoは、所与の ( `応答$ %応答, `文書$ %文書 ) に対し, %文書 の`特色機能~施策$を拡充する: ◎ Given a response (response) and a Document (document), this algorithm populates document’s Feature Policy
- %文書 の`特色機能~施策を初期化する$ ◎ Initialize document’s Feature Policy
- %継承した施策 ~LET %文書 の特色機能~施策が`継承した施策$ ◎ Let inherited policy be document’s Feature Policy’s inherited policy.
- %宣言-済み施策 ~LET 新たな`有順序~map$ ◎ Let declared policy be a new ordered map.
- %施策~指令 ~LET `応答~施策を処理する$( %応答, %文書 の生成元 ) ◎ Let d be the result of running Process response policy on response and document’s origin.
- %施策~指令 を成す ~EACH( %特色機能 → %許容list ) に対し ⇒ ~IF[ %継承した施策[ %特色機能 ] ~EQ ~T ] ⇒ %宣言-済み施策[ %特色機能 ] ~SET %許容list ◎ For each feature → allowlist of d: • If inherited policy[feature] is true, then set declared policy[feature] to allowlist.
- %施策 ~LET 次のようにされた新たな`特色機能~施策$ ⇒# `継承した施策$ ~SET %継承した施策, `宣言-済み施策$ ~SET %宣言-済み施策 ◎ Let policy be a new feature policy, with inherited policy inherited policy and declared policy declared policy.
- %文書 上で施策 %施策 を`施行する$ ◎ Enforce the policy policy on document.
10.9. %特色機能 用に継承される施策を定義する
この~algoは、所与の ( `特色機能$ %特色機能, `閲覧文脈$ %文脈 ) に対し, %文脈 が %特色機能 用に`継承した施策$を返す: ◎ Given a feature (feature) and a browsing context (context), this algorithm returns the inherited policy for that feature.
- ~IF[ %文脈 は`入子の閲覧文脈$である ] ⇒ ~RET `容器~内の特色機能~用に継承される施策を定義する$( %特色機能, %文脈 の`閲覧文脈~容器$ ) ◎ If context is a nested browsing context, return the result of executing §10.10 Define an inherited policy for feature in container on context’s browsing context container.
- ~RET `可能化される^i ◎ Otherwise, return 'Enabled'.
10.10. %容器 内の %特色機能 用に継承される施策を定義する
この~algoは、所与の ( `特色機能$ %特色機能, `閲覧文脈~容器$ %容器 ) に対し, %容器 が %特色機能 用に`継承した施策$を返す: ◎ Given a feature (feature) and a browsing context container (container), this algorithm returns the inherited policy for that feature.
- %親 ~LET %容器 の`~node文書$ ◎ Let parent be container’s node document.
- %生成元 ~LET %親 の`生成元$ ◎ Let origin be parent’s origin
- %容器~施策 ~LET `特色機能~施策~属性を処理する$( %容器 ) ◎ Let container policy be the result of running §10.5 Process feature policy attributes on container.
-
~IF[ %容器~施策[ %特色機能 ] ~NEQ ε ]: ◎ If feature is a key in container policy:
- ~IF[ `許容listは生成元に合致する$( %容器~施策[ %特色機能 ], %生成元 ) ]~AND[ %親 が`継承した施策$[ %特色機能 ] ~EQ `可能化される^i ] ⇒ ~RET `可能化される^i ◎ If the allowlist for feature in container policy matches origin, and parent’s inherited policy for feature is "Enabled", return "Enabled".
- ~RET `不能化される^i ◎ Otherwise return "Disabled".
- ~RET `特色機能は施策により生成元~用に可能化されるか?$( %特色機能, %親, %生成元 ) ◎ Otherwise, if feature is enabled in parent for origin, return "Enabled". ◎ Otherwise return "Disabled".
10.11. %文書 内の %特色機能 は %生成元 用に可能化されるか?
この~algoは、所与の ( 特色機能 %特色機能, `文書$ %文書, `生成元$ %生成元 ) に対し,[ %特色機能 は不能化されるべきと見なされるならば `不能化される^i / ~ELSE_ `可能化される^i ]を返す: ◎ Given a feature (feature), a Document object (document), and an origin (origin), this algorithm returns "Disabled" if feature should be considered disabled, and "Enabled" otherwise.
- %施策 ~LET %文書 の`特色機能~施策$ ◎ Let policy be document’s Feature Policy
- ~IF[ %施策 が`継承した施策$[ %特色機能 ] ~EQ `不能化される^i ] ⇒ ~RET `不能化される^i ◎ If policy’s inherited policy for feature is Disabled, return "Disabled".
-
~IF[ %施策 の`宣言-済み施策$[ %特色機能 ] ~NEQ ε ]: ◎ If feature is present in policy’s declared policy:
- ~IF[ `許容listは生成元に合致する$( %施策 の`宣言-済み施策$[ %特色機能 ], %生成元 ) ] ⇒ ~RET `可能化される^i ◎ If the allowlist for feature in policy’s declared policy matches origin, then return "Enabled".
- ~RET `不能化される^i ◎ Otherwise return "Disabled".
- ~IF[ %特色機能 の`既定の許容list$ ~EQ `全~生成元$i ] ⇒ ~RET `可能化される^i ◎ If feature’s default allowlist is *, return "Enabled".
- ~IF[ %特色機能 の`既定の許容list$ ~EQ `'self'^l ]~AND[ ( %生成元, %文書 の生成元 ) は`同じ生成元~domain$である ] ⇒ ~RET `可能化される^i ◎ If feature’s default allowlist is 'self', and origin is same origin-domain with document’s origin, return "Enabled".
- ~RET `不能化される^i ◎ Return "Disabled".
10.12. %設定群 上で %特色機能~施策 の違反~用に %~message を伴う報告を生成する
この~algoは、所与の ( `特色機能$ %特色機能, 文字列 %~message, `環境~設定群~obj$ %設定群, 文字列 %~group (省略時は `default^l ) ) に対し,[ %特色機能 に対する施策の`違反$についての %~message ]を包含する`報告$を生成する: ◎ Given a feature (feature), a string (message), an environment settings object (settings), and an optional string (group), this algorithm generates a report, containing message, about the violation of the policy on feature.
- %本体 ~LET 次のように初期化された新たな `FeaturePolicyViolationReportBody$I ⇒# `featureId$m ~SET %特色機能 の文字列~表現, `message$m ~SET %~message, `sourceFile$m ~SET ~NULL, `lineNumber$m ~SET ~NULL, `columnNumber$m ~SET ~NULL, `disposition$m ~SET `enforce^l ◎ Let body be a new FeaturePolicyViolationReportBody, initialized as follows: ◎ featureId • feature’s string representation. message • message sourceFile • null lineNumber • null columnNumber • null disposition • "enforce"
- ~IF[ ~UAは現在~scriptを実行している ]~AND[ %設定群 から~source~fileの[ ~URL, 行番号, 列番号 ]を抽出できる† ] ⇒ それに則って, %本体 の[ `sourceFile$m, `lineNumber$m, `columnNumber$m ]を設定する 【† ~URLのみ抽出できる場合もあるかもしれない。その場合、 `sourceFile^m のみ設定されることになりそうだが,何もしないようにも読める。】 ◎ If the user agent is currently executing script, and can extract the source file’s URL, line number, and column number from settings, then set body’s sourceFile, lineNumber, and columnNumber accordingly.
- `報告先~group用に~dataを~queueする$( %本体, `feature-policy-violation^l, %~group, %設定群 ) ◎ ↑↑If group is omitted, set group to "default". ◎ Execute Reporting API §#queue-report with body, "feature-policy-violation", group, and settings.
注記: 特色機能~施策が`違反-$されたときには、この~algoが~callされるべきである。 ◎ Note: This algorithm should be called when a feature policy has been violated.
11. ~IANA 考慮点
恒久的~message~header~registryは、次の登録で更新されるべきである `RFC3864$r : ◎ The permanent message header field registry should be updated with the following registration [RFC3864]:
- ~header名
- `Feature-Policy^h
- 適用-可能な~protocol
- http
- 位置付け
- 標準
- Author/Change controller
- W3C
- 仕様~文書
- Feature Policy API 【この仕様】
12. ~privacyと~security
この仕様は、埋込まれる頁~上で施行することになる施策を設定するための仕組みを標準~化する。 `iframe^e 要素の `sandbox$aF 属性と同様に、これは,埋込まれる頁から許可が明示されなくとも行える。 それは、すでに公表された~web~site内に存在している特色機能の挙動を変更できることを意味する — 別の文書~内で、それらの頁を,適切な容器~施策を伴わせて埋込むことにより。 ◎ This specification standardizes a mechanism for an embedding page to set a policy which will be enforced on an embedded page. Similar to iframe sandbox, this can be done without the express permission of the embedded page, which means that behaviors of existing features can be changed in published web sites, by embedding them in another document with an appropriate container policy.
そのようなわけで、最も重大な ~privacy/~security 上の懸念は: ◎ As such, the biggest privacy and security concerns are:
- 非同一生成元 下位frame内の挙動が,それを埋込んでいる側に公開されること ◎ Exposure of behavior in a cross-origin subframe to its embedder
- 埋込んだ側が制御することによる、下位frameにおける挙動の予想外の変化 ◎ Unanticipated behavior changes in subframes controlled by the embedder
これらの懸念は、すでにある程度~web~platformに在する。 この仕様は、少なくとも それを無用に悪化させないよう試みる。 ◎ To a degree, these concerns are already present in the web platform, and this specification attempts to at least not make them needlessly worse.
個々の特色機能の設計も,~securityと~privacyの課題をもたらし得るので、この仕様と統合するときには,~careされ~MUST。 この節は、どの種類の挙動がそのような課題をもたらし得るかについて,いくつかの手引きを供することを試みる。 ◎ Security and privacy issues may also be caused by the design of individual features, so care must be taken when integrating with this specification. This section attempts to provide some guidance as to what kinds of behaviors could cause such issues.
12.1. 埋込まれた非同一生成元の挙動の公開
特色機能は、[ ~frame化された文書における施策の`違反$は、他の~frame内の文書からは観測-可能にならない ]ように,設計されるべきである。 具体例として、仮に,ある特色機能が[ 施策により不能化されている下で利用されたときは、当の~frameを埋込んでいる文書に向けて~eventを発火させる ]となると、埋込まれた文書の状態についての情報を抽出することにも利用できることになる。 具体例として,[ その特色機能は,利用者が~siteに~log-inしている間に限り利用される ]ことが既知である場合、埋込んだ側は — その特色機能を当の~frameに対し不能化した上で,結果の~eventを~listenすることにより — 利用者が~log-inしているかどうか決定することもできる。 ◎ Features should be designed such that a violation of the policy in a framed document is not observable by documents in other frames. For instance, a hypothetical feature which caused a event to be fired in the embedding document if it is used while disabled by policy, could be used to extract information about the state of an embedded document. If the feature is known only to be used while a user is logged in to the site, for instance, then the embedder could disable that feature for the frame, and then listen for the resulting events to determine whether or not the user is logged in.
自己検分~APIは、[ 下位frameの施策について、埋込んでいる文書から,すでに演繹できる情報 ]のみを示すように設計されている。 この`観測-可能な施策$は、~frame化された文書に伴って送達された どの~HTTP~headerからも影響されない。 加えて、~frame自身が他へ~navigateされても — その先が,異なる施策が適用される異なる生成元であっても — 変化しない。 `観測-可能な施策$を更新させるのは、 `iframe^e 要素の `src$aF 属性を設定して生じる~naviに限られる。 ◎ The introspection API is designed to only show information about a subframe’s policy which could already be deduced by the embedding document. This observable policy is not affected by any HTTP headers delivered with the framed document, and does not change when the frame navigates itself, even if such navigation is to a different origin, where a different policy applies. Only navigations caused by setting the src attribute of the <iframe> element will cause the observable policy to be updated.
12.2. 挙動の予想外の変化
特色機能~施策は、[ ある下位frameが読込まれる時点で,[ その~frame内で,どの特色機能が可用になるか, ならないか ]を制御する能 ]を,文書に是認する。 当の特色機能が,~web~platformに長期に存在していた挙動を表現しているならば、このことは[ ~web上に公表された既存の内容において,特定0の~APIが失敗し得る ]ことを意味する(内容がそれを予期することなく書かれたならば)。 ◎ Feature policy grants a document the ability to control which features will and will not be availble in a subframe at the time it is loaded. When a feature represents an existing, long-standing behavior of the web platform, this may mean that existing published content on the web was not written with the expectation that a particular API could fail.
(不自然だが)実用的な例として、[ 利用者が頁に~accessするに足る特権を有するかどうか ]を,同期的 `XMLHttpRequest$I を利用して決定している文書を考える: ◎ As a practical (though contrived) example, consider a document which uses synchronous XMLHttpRequest to determine whether a user has sufficient privileges to access the page:
<!DOCTYPE html> <h1>Welcome to SecureCorp!</h1> <script> var %req = new XMLHttpRequest(); %req.open("GET", "/api/security_check.json", false); %req.send(); if (%req.response == "untrusted user") { /* 利用者は~log-inしていない — 安全な頁へ~redirectする ◎ User is not logged in; redirect to a safe page */ location.href = "/security_check_failed.html"; } </script> <!-- 頁は、利用者が~log-inした前提の下で継続する ◎ Page continues with assumption that user is logged in -->
この文書がある頁に埋込まれ,その頁が `sync-xhr^l 特色機能を不能化した場合、 `XMLHttpRequest.open()^m の~callは失敗して,~security検査は迂回されることになる。 ◎ If this document is embedded by a page which disables the "sync-xhr" feature, the call to XMLHttpRequest.open() would fail, and the security check would be bypassed.
~web上では、この類の挙動の強制-法はすでにアリなことに注意。 特色機能には、 `iframe^e には許容されず,~top-level文書~内に限り許容されるものもある。 また, `iframe^e ~sandbox法は、類似する仕方で,~frameを — それが依存し得る特色機能に~accessすることなく — 埋込むときに利用できる。 ◎ Note that this sort of behavior forcing is already possible on the web: some features are only allowed in top-level documents, and not in any iframes, and iframe sandboxing can be used in a similar way to embed a frame without access to features which it may be depending on.
一般に,この懸念を軽減するには、 2 つの仕方がある: ◎ In general, this concern is mitigated in two ways:
- 脆弱な頁は、 `X-Frame-Options^h ~HTTP~headerを伴わせて ~serveできる — そうすれば、攻撃者が~frame化するのは許容されなくなるので。 ◎ The vulnerable page may be served with an X-Frame-Options HTTP header which does not allow it to be framed by an attacker.
- ~siteは、~APIや挙動を利用しようと試みる前に,それが可用かどうかを特色機能~検出を利用して決定した上で、~callした~APIから[ 返された~error/投出された例外 ]を取扱うべきである。 ◎ Sites should use feature detection to determine whether an API or behavior is available before attempting to use it, and should handle any documented errors returned or exceptions thrown by the APIs they call.
- 特色機能~検出がアリでない事例では、新たな~web内容は[ `Policy$I ~objを利用して,現在~施行されている特色機能~施策を検分した上で、それに則って挙動や~UIを調整する ]ように書ける。 ◎ In the case where feature detection is not possible, new web content can be written to use the policy object to inspect the feature policy which is currently enforced, and adjust behaviour or user interface accordingly.
自身による特色機能を この仕様と統合している策定者は、[ 当の特色機能が不能化されている下で,文書がそれを利用しようと試みたとき、それが いつどのように失敗することになるか ]を裁定できる。 策定者は、既存の失敗~mode【既存の例外~名など】が存在するならば,それを用立てようと試みるべきである — そうすれば、そのような失敗をすでに正しく取扱っている既存の内容への~~影響は抑えられるので。 ◎ Authors integrating their features with Feature Policy can decide when and how the feature will fail when a document attempts to use it while it is disabled. Authors should attempt to make use of existing failure modes, when they exist, to increase the chance that existing content will already be correctly handling such failures.
12.3. 埋込んでいる側の施策の公開
ある頁が非同一生成元~頁を埋込んでいるとき — 埋込んだ側が,埋込まれた側の挙動について推定できる情報を制限するよう~careされていたとしても — 局面によっては、埋込まれた側が,埋込んだ側の情報について推定することも — [ 自身に対し,埋込んだ側が施行した施策 ]を精査することにより — アリになり得る。 ◎ Care has been taken to limit the information which an page can infer about the behavior of cross-origin pages which it embeds. It may be possible in some scenarios however, for the embedded page to infer information about its embedder, by examining the policy which the embedder has enforced on it.
これは既存の `document.fullscreenEnabled$m に類似する。 それは、埋込まれた側の文書が[ 埋込んだ側は、埋込まれた側に `FULLSCREEN$r ~APIを利用する能を是認したかどうか ]を推定するために利用できる。 これが ある種の事例 — 具体例として,利用者が埋込んだ側の~siteに~log-inしたとき — に限り是認される場合、埋込まれた側の~siteは,埋込んだ側の状態について何かを知り得るようになる。 ◎ This is similar to the existing document.fullscreenEnabled property, which can be used by the embedded document to infer whether its embedder has granted it the ability to use the Fullscreen API. If this is only granted in certain cases — when the user is logged in to the embedding site, for instance — then the embedded site can learn something about the state of its embedder.