1. はじめに
この節は非規範的です。
Cookie とストレージがトップフレームサイトによってパーティション化される Web では、[Protected-Audience] API によって提供される
インタレストグループベースの広告や、Conversion
Lift
Measurements)
など、同じページ内に異なるパーティションからのコンテンツを表示できると有用な場合があります。これは、異なる
パーティションのデータを含む Document
が互いに分離され、
同じページ上に視覚的に合成されていても通信できない場合にのみ、プライバシーを保護する形で実現できます。
iframe
要素は、埋め込み元との意図的な通信チャネルを多数提供しているため、これには適していません。この仕様は、
fencedframe
要素を導入します。これは、ページ上に Document
を埋め込むための新しい要素であり、
Document
とその埋め込み元との間の通信を明示的に防ぎます。
この仕様は、新しい要素、その Web プラットフォームの残りの部分との統合
(§ 3 HTML との統合 および § 4
他の仕様との相互作用 を含む)、ならびに
通常の
URL
や "src" 属性の代わりに
fencedframe
への主要な入力となる
FencedFrameConfig
などの補助プリミティブを定義します。この仕様は新しい要素とそのプラットフォームの残りの部分との統合を
定義するものであるため、十分なクロスブラウザーサポートがあることを前提として、最終的に
[HTML] に統合されることを
目標とした、その標準への大きなモンキーパッチとして読むべきです。
2. fencedframe 要素
- カテゴリー:
- フローコンテンツ.
- 句内容.
- 埋め込みコンテンツ.
- インタラクティブコンテンツ.
- パルパブルコンテンツ.
- 句内容.
- この要素を使用できるコンテキスト:
- 埋め込みコンテンツが期待される場所。
- 内容モデル:
- なし.
- 内容属性:
- グローバル属性
width— 水平方向の寸法height— 垂直方向の寸法—allowfencedframeの 内容に適用される 権限ポリシー - アクセシビリティ上の考慮事項:
-
TODO
- DOM インターフェイス:
-
[
Exposed =Window ]interface :HTMLFencedFrameElement HTMLElement { [HTMLConstructor ](); [constructor CEReactions ]attribute FencedFrameConfig ?config ; [CEReactions ]attribute DOMString width ; [CEReactions ]attribute DOMString height ; [SameObject ,PutForwards =value ]readonly attribute DOMTokenList sandbox ; [CEReactions ]attribute DOMString allow ; };
fencedframe
要素は、その fenced navigable を
表します。
fencedframe
要素の子孫は何も表しません。
各
fencedframe
は config を持ちます。これは
FencedFrameConfig
または null です。初期値は null です。
各
fencedframe
は fencedframe sandboxing flag set を持ちます。これは
sandboxing flag set です。fencedframe sandboxing flag set 内のどのフラグが
特定の時点で設定されているかは、
fencedframe
要素の
sandbox
属性によって決まります。
-
embedder が
iframe要素である場合: embedder の iframe sandboxing flag set に設定されているフラグ。 -
embedder が
fencedframe要素である場合: embedder の fencedframe sandboxing flag set に設定されているフラグ。
fencedframe
要素 element が、非 null の
browsing context を持つ文書に
挿入されたとき、次の手順を実行します:
-
nested traversable を、element のために 新しい nested traversable を作成する結果とします。
-
nested traversable の loading mode を "
fencedframe" に設定します。 -
element が
sandbox属性を持つ場合、その属性値と element の fencedframe sandboxing flag set を与えて、sandboxing directive を構文解析するを実行します。
通常の
子
navigable の作成や トップレベル
traversable の作成中に行うように URL
and history update steps を呼び出す必要はありませんが、新しい navigable 内で
History.length
を初期化する仕組みは依然として必要です。これは HTML
Standard に存在する既存の課題です: https://github.com/whatwg/html/issues/9030。
fencedframe
要素が文書から
削除されたとき、ユーザーエージェントは次の手順を実行しなければなりません:
-
TODO: nested traversable を破棄する。
-
並列に、
Documentの node navigable の top-level traversable を与えて、 すべての fenced frame 子孫の untrusted network status を再計算する。
config IDL 属性の取得手順は、
this の
config を返すことです。
config
IDL 属性の設定手順は次のとおりです:
-
-
Assert: this の fenced navigable は null です。
注: これは、要素が DOM から削除されると、 その削除手順によって fenced navigable が ただちに破棄されるため成り立ちます。
-
-
instance を、this の 関連するグローバルオブジェクト の browsing context の fenced frame config instance とします。
-
instance が null でなく、かつその untrusted network status が enabled でない場合、return します。
-
navigation url or urn を、与えられた
FencedFrameConfigの url が null でない場合はその url とし、そうでない場合は、与えられたFencedFrameConfigの urn とします。 -
navigation url or urn が failure である場合、return します。
-
shared storage context を、与えられた
FencedFrameConfigの sharedStorageContext とします。 -
element の fenced navigable を navigation url or urn へ、element の node document を用いて ナビゲートします。その際、historyHandling を "
replace" に、referrerPolicy を "no-referrer" に設定し、shared storage context を指定します。注: 通常の ナビゲーションフローに対する
fencedframe固有の 変更については、§ 3.8.5 実際のナビゲーション変更を参照してください。
allow 属性は、指定された場合、
Document
の permissions policy が
fencedframe
の
fenced navigable 内で初期化されるときに
使用される
container policy を決定します。その値は
シリアル化された permissions policy でなければなりません。
[PERMISSIONS-POLICY]
sandbox 属性は、指定された場合、
fencedframe
によってホストされる任意のコンテンツに対して、追加の制限の集合を有効にします。
その値は、ASCII 大文字小文字を区別しない
一意な空白区切りトークンの順序なし集合
でなければなりません。許可される値は次のとおりです:
IDL 属性 allow および
sandbox は、
同名のそれぞれの内容属性を
反映しなければなりません。
sandbox
の
DOMTokenList
に対応するトークンは、
sandbox
属性で定義され、ユーザーエージェントが対応する許可値です。
fencedframe
要素に対して使用されます:
-
Assert: namespace は HTML namespace です。
-
localName が
sandboxである場合:-
value が null である場合、element の fencedframe sandboxing flag set を 空にします。
-
そうでない場合、value と element の fencedframe sandboxing flag set を与えて sandboxing directive を構文解析するを実行します。
-
2.1. 寸法属性
この節では、[HTML] の
Dimension
attributes 節へのモンキーパッチを詳述します。その節は、
fencedframe
を、独自の width および height 寸法属性が
[HTML] で定義される一般的な
width
および
height
寸法属性に適用されるものと同じ作成者要件を持つ要素の一覧に含めるよう更新されます。
さらに、IDL 属性 width および
height は、
同名のそれぞれの内容属性を
反映しなければなりません。
2.2. Fenced frame config mapping
各 traversable navigable は、fenced frame config mapping を持ちます。これは fenced frame config mapping です。
注: この mapping は navigation 中に参照され、私たちが口語的に
URN-generating APIs または config-generating APIs と呼ぶものによって書き込まれます。これらは、
fencedframe
および
iframe
要素のナビゲーションに使用するため、
urn
uuids と fenced
frame configs の両方を生成します。
たとえば [Protected-Audience] API および [Shared-Storage] 仕様を参照してください。
fenced frame config mapping は3つのサブマッピングを持ちます:
- pending config mapping
-
map。その keys は urn uuids であり、 その values は fenced frame configs です
- finalized config mapping
-
map。その keys は urn uuids であり、 その values は fenced frame configs です
- nested config mapping
-
map。その keys は urn uuids であり、 その values は fenced frame configs です
注: pending configs の目的は、config-generating APIs が、
タイミングサイドチャネルを作成しない方法で configs を非同期に解決できるようにすることです。すなわち、
pending config は、cross-site data に依存する計算の前に、一定時間で Web プラットフォームへ返されます。
このプライバシーは、pending config がいつ finalized されたかを Web プラットフォームが識別できないことに
依存するため、すべての
visibilities および transparent fields の値が、pending
config から finalized config へ変化しないことが重要です。これらは FencedFrameConfig
の
getters を通して検査できるためです。したがって、Web プラットフォームに作成・公開された
FencedFrameConfig
は、
config の
urn によって
表される fenced frame
config が技術的に "pending" であり、後で完全に
解決を終えるとしても、実質的に不変です。
各 fenced frame config mapping は、maximum number of configs を持ちます。これは実装定義です。maximum number of configs は、 非負数または infinity であってよいです。
注: maximum number of configs の 挙動を指定することは重要です。なぜなら、その意味論はプライバシー上センシティブな方法で config-generating APIs と相互作用しうるためです。
高いレベルでは、fenced frame config を fenced frame config mapping に 保存するために、config の作成者はまず pending config を保存し、その後 pending config を finalized config に 変換しなければなりません。これらの手順は次のとおりです:
-
pendingMapping を、mapping の pending config mapping とします。
-
pendingMapping の size + mapping の finalized config mapping の size ≥ mapping の maximum number of configs である場合、failure を返します。
-
urn を、ランダムに生成された urn uuid とします。
-
pendingMapping[urn] を config に 設定します。
-
urn を返します。
-
pendingMapping を、mapping の pending config mapping とします。
-
finalizedMapping を、mapping の finalized config mapping とします。
-
pendingMapping[urn] が 存在しない場合、 failure を返します。
-
pendingMapping[urn] を 削除します。
-
finalizedMapping[urn] を config に 設定します。
-
nestedMapping を、mapping の nested config mapping とします。
-
nestedConfigs が null である場合、return します。
-
nestedConfigs の各 urn → config について 反復します:
-
nestedMapping[urn] を config に 設定します。
-
nestedMapping[urn] の is ad component を true に設定します。
-
-
nestedMapping を、mapping の nested config mapping とします。
-
pendingMapping を、mapping の pending config mapping とします。
-
finalizedMapping を、mapping の finalized config mapping とします。
-
nestedMapping[urn] が 存在する場合、 その値を返します。
-
finalizedMapping[urn] が 存在する場合、 その値を返します。
-
failure を返します。
2.3. Fenced frame configs
2.3.1. はじめに
この節は非規範的です。
fencedframe
要素の重要な特徴は、Web プラットフォーム API が、セキュリティおよびプライバシー上の理由から、
他の実行コンテキストがこの構成を変更または検査する能力を制限する方法で、フレームの挙動を構成できることです。
たとえば、[Protected-Audience] API は
cross-site data を用いたデバイス上の広告オークションを実行します。そして、オークションに勝った広告を、
API 呼び出し元がどの広告が勝ったかを知ることなく、また広告が読み込まれる環境を操作できることなく、
フレームに読み込めることが重要です。
これは "fenced frame
config" の概念を用いて実現します。
fenced frame
config は、
fencedframe
要素へ読み込むことができ、結果として生じる環境を指定するフィールドの集合です。
Fenced frame
configs は、特定の Web プラットフォーム API によってのみ
作成でき、スクリプトによって構築または変更することはできません。それらのフィールドには
"visibilities" も含まれます。これは、
FencedFrameConfig
インターフェイスを通して検査されたときに、そのフィールドを "redacted" すべきかどうかを指示します。
[Protected-Audience] や [Shared-Storage] API のような
Config-generating APIs は、各フィールドのプライバシー上の影響を検討したことを保証するため、
それらの
fenced frame
configs のすべてのフィールドに値を指定しなければなりません。ただし、それらの値を null に設定することは
選択できます。
fencedframe
が fenced
frame config へナビゲートするたび、それは新しい
fenced frame config instance としてインスタンス化されます。
これは
fenced navigable 内の特定の
browsing context group を管理します。
2.3.2. ユースケース
広告オークションを通して作成された広告のレンダリング:
広告オークション API はオークションを実行し、勝者となる広告を決定します。勝者の広告に関する詳細は
埋め込み元から隠されなければならず、埋め込みコンテキストは
fencedframe
の環境へ影響を及ぼすことを許されません。そのいずれかが可能であると、fenced frame
境界を越えて情報が流れることになり、共謀する当事者が cross-site data を結合してユーザーのプロファイルを
構築することを可能にします。これを防ぐため、広告オークション API は、
埋め込みコンテキストに対して不透明な基底
URL を持つ
fenced frame
config を
構築します。fenced frame config は、フレームの
container size および content size
が何でなければならないか、またフレームの
permissions policy が何でなければならないかに関する
制限とともにも構築されます。これらはフィンガープリンティングのベクトルとして使用されうるためです。
パーソナライズされた支払いボタンの表示:
EC サイトは、"Pay now" ボタンを持つ
fencedframe
を埋め込みます。EC サイトは、ユーザーのクレジットカードに関する情報をブラウザーに first-party storage として
保存します。最初は、
Document
が
fencedframe
内でホストされていても、first-party cookie/storage へのアクセスを持たないため、クレジットカード情報が
cross-site data と結合されるリスクなしに、情報は自由に出入りできます。そのため、fenced frame は、
プライバシーを損なうことなく
FencedFrameConfig
コンストラクターを用いて Web プラットフォームから直接構築できます。この時点では、クレジットカードデータへ
まだアクセスできないため、ボタンにはパーソナライズされたデータは含まれません。
Document
は、
disableUntrustedNetwork()
によってすべてのネットワークアクセスを無効にした後にのみ、そのクレジットカードデータを読み取ることができます。
これにより、そのデータが fenced frame の外へ流出すること、および cross-site data と結合されてユーザー
プロファイルを構築することが防止されます。それを行うと、ボタンは、EC プラットフォームの origin に対する
first-party storage partition の中でブラウザーに保存されている、ユーザーのクレジットカード番号の下4桁を
表示します。
2.3.3. fenced frame config struct
ここで、いくつかの予備的な型を確立します:
visibility は、"opaque" または "transparent" のいずれかです。
size は、次の items を持つ struct です:
- width
-
非負整数
- height
-
非負整数
TODO: これらのメンバーに異なる数値型を用いることを検討する。
interest group descriptor は、次の items を持つ struct です:
permissions policy behavior は、"fixed" または "flexible" のいずれかです。
default fenced frame effective sandboxing flags は、次のフラグを持つ sandboxing flag set です:
pending event は、次の items を持つ struct です:
- destination
- event
- request initiator
- initiator referrer policy
reporting destination info は、次の items を持つ struct です:
- reporting url declarer origin
- reporting url map
- reporting macro map
fenced frame reporting map は
map
であり、その keys
は FenceReportingDestination
であり、その values は次のいずれかです:
-
lists of pending events(メタデータがまだ finalized されていないため、 非同期に報告する必要があるイベントを表すために使用されます); または
-
reporting destination infos(finalized された後の 実際のメタデータを表すために使用されます)。
注: この表現は、 config-generating APIs が fenced frame config を構築して返した後(さらには config が読み込まれ、イベント報告が fenced frame 内で生成された後)に、reporting destinations の値を非同期に解決することでレイテンシーを削減できるように することを意図しています。config-generating API が fenced frame reporting map を宣言するとき、 特定の destinations を空の list を用いて pending としてマークし、後のために map への参照を保持できます。fenced frame がまだ pending である destination へ イベントを報告しようとした場合、 後で処理するためにイベントをこの list に保存します。 config-generating API またはそのコールバックが、保持していた参照を通して最終的に reporting destination を finalize すると、 list に保存されたすべての pending events を処理します。destination が決して finalized されない場合、その pending events は送信されません。
untrusted network status は、"enabled"、
"disabled for this tree"、または
"disabled for this tree and fenced subtrees"
のいずれかです。
注: Disabled for this tree は最終的な ネットワーク遮断状態ではありません。これは、fenced frame 境界を越えていないフレームツリー内のすべてのフレームが ネットワークアクセスを取り消されたものの、少なくとも1つの sub-fenced frame tree がまだネットワークアクセスを 持っている中間状態です。この段階では、取得した情報がネットワークアクセスを持つ sub-fenced frame を通して 依然として外部流出しうるため、特別な API アクセスは得られません。すべての sub-fenced frames も untrusted network を無効化されると、fenced frame の status は最終的な disabled for this tree and fenced subtrees 状態に切り替わります。
FenceReportingDestination
destination、origin reporting url declarer origin、
map
destination map(その keys
は
strings、その
values は urls)、および macro
map(null、または
map
で、その keys は strings、その values は strings)を与えて、次の
手順を実行します:
-
Assert: reporting map[destination] は list です(すなわち destination の metadata はまだ finalized されていません)。
-
pending event list を reporting map[destination] とします。
-
reporting map[destination] を、次の items を持つ struct に 設定します:
- reporting url declarer origin
-
reporting url declarer origin
- reporting url map
-
destination map
- reporting macro map
-
macro map
-
pending event list の各 pending event について 反復します:
-
destination map、pending event の event、 pending event の request initiator、および pending event の initiator referrer policy を用いて Send a beacon します。
-
fenced frame reporting metadata は、次の items を持つ struct です:
- fenced frame reporting map
- direct seller is seller
-
boolean、初期値は true
- allowed reporting origins
-
null、または list of origins。destination URL event report の destination になるには、origin がこの list 内に存在しなければなりません。
- attempted custom url report to disallowed origin
-
boolean、初期値は false
automatic beacon event type は、"reserved.top_navigation_start"、
"reserved.top_navigation_commit"、
または "reserved.top_navigation"
のいずれかです。
reserved.top_navigation
は
reserved.top_navigation_commit
の以前の
命名です。
両者は同じことを行いますが、
reserved.top_navigation
は将来削除される予定であり、新しいコードでは使用すべきではありません。
fenced frame reporter は、次の items を持つ struct です:
- fenced frame reporting metadata reference
-
fenced frame reporting metadata への mutable reference TODO: ポインター/参照をより仕様らしい方法で扱う
destination enum event は、次の items を持つ struct です:
- type
- data
- attributionReportingEnabled
- attributionReportingContextOrigin
destination URL event は URL です。
automatic beacon event は、次の items を持つ struct です:
- type
- data
- attributionReportingEnabled
- attributionReportingContextOrigin
destination event は、 destination enum event、destination URL event、または automatic beacon event のいずれかです。
-
destination url を空の string とします。
-
attributionReportingEligibility を "
unset" とします。 -
processResponse を null とします。
-
useParallelQueue を false とします。
-
event が destination enum event または automatic beacon event のいずれかである場合:
-
destination map を destination info の reporting url map とします。
-
eventType を、event がどちらの variant であるかに応じて、 event の destination type、または automatic type のいずれかとします。
-
destination map[eventType] が 存在しない場合、 return します。
-
destination url を destination map[eventType] に設定します。
-
event の attributionReportingEnabled が true であり、かつ event の attributionReportingContextOrigin が suitable である場合:
-
event の
eventTypeが automatic beacon event type 値のいずれかと一致する場合、attributionReportingEligibility を "navigation-source" に設定します。 -
そうでない場合、attributionReportingEligibility を "
event-source" に設定します。 -
processResponse を、response response を与えられた 次の手順に設定します:
-
fenced を true とします。
-
event の attributionReportingContextOrigin、 attributionReportingEligibility、fenced、および response を用いて process an attribution eligible response を実行します。
-
-
useParallelQueue を true に設定します。
-
-
-
そうでない場合:
-
Assert: event は destination URL event です。
-
macro map を destination info の reporting macro map とします。
-
macro map が null である場合、return します。
-
destination url を event に設定します。
-
destination url を、macro map を用いて destination url に substituting macros した結果とします。
-
-
任意で return します。
注: この 実装定義の条件は、たとえばユーザーのオプトアウトや destination url の site が 登録済みでないことなど、さまざまな理由で ユーザーエージェントが beacon を破棄できるようにすることを意図しています。
-
request を、次のプロパティを持つ新しい request とします:
- method
-
event が destination enum event である場合は
、そうでない場合はPOST。GET - URL
-
destination url
- header list
-
header を含む新しい header list。その name は
"Content-Type"、その value は"text/plain"です。 - body
-
event が destination enum event である場合は、 その source が event の data である body、そうでない場合は null。
- client
-
null
- service-workers mode
-
"all"既定値は
"all"であるため、技術的にはここで何も設定する必要はありません。しかし、 他の beacons のように、ここでは service workers をスキップする方が適切かもしれないことを思い出すために設定しています。 - origin
-
event が destination URL event である場合は request initiator、そうでない場合は destination info の reporting url declarer origin。
注: destination URL event の reporting destination は、
reportEvent()を呼び出すDocumentによって決定されます。一方、 destination enum event や automatic beacon event の reporting destinations は、このDocumentを読み込んだ fenced frame config を作成した worklet 内で決定されます。クロスサイトリクエストフォージェリを防ぐため、 origin を、reporting destination を決定したDocumentまたは worklet の origin に設定します。 - referrer
-
request initiator
- referrer policy
-
initiator referrer policy
- mode
-
"cors" - credentials mode
-
"omit" - Attribution Reporting eligibility
-
attributionReportingEligibility
-
request を Fetch します。その際、processResponse が null でない場合は processResponse を processResponse とし、 useParallelQueue を useParallelQueue とします。
注: このアルゴリズムは、 並列に実行されている間、または
Documentの メイン スレッド上で実行されている間に呼び出される可能性があります。並列に呼び出された場合を正しく扱うため、任意の response 処理アルゴリズムが使用されるときには、 fetch を useParallelQueue を true に設定して呼び出します。 それ以外の場合、このアルゴリズムが他の事例で 並列に実行されていても、そうする必要はありません。
FenceReportingDestination
destination、origin request initiator、
referrer policy initiator referrer policy、および
destination event
event を与えて、次の手順を実行します:
-
metadata を reporter の fenced frame reporting metadata reference とします。
-
destination が
"direct-seller"である場合:-
metadata の direct seller is seller が true である場合、 destination を
"seller"に設定します。 -
そうでない場合、destination を
"component-seller"に設定します。
-
-
event が destination URL event である場合:
-
event の origin が、metadata の allowed reporting origins 内のどのエントリとも same origin でない場合:
-
metadata の attempted custom url report to disallowed origin を true に設定します。
-
-
metadata の attempted custom url report to disallowed origin が true である場合、return します。
-
-
reporting map を、metadata の fenced frame reporting map への参照とします。
-
reporting map[destination] が 存在しない場合、return します。
-
reporting map[destination] が list である場合:
-
newEvent を、次を持つ新しい pending event とします:
- destination
-
destination
- event
-
event
- request initiator
-
request initiator
- initiator referrer policy
-
initiator referrer policy
-
newEvent を reporting map[destination] に 追加します。
-
Return します。
注: pending event は非同期に送信されます。
-
-
Assert: reporting map[destination] は map です(すなわち destination の metadata は finalized 済みです)。
-
reporting map[destination]、event、request initiator、および initiator referrer policy を用いて Send a beacon します。
exfiltration budget metadata は、次の items を持つ struct です:
- origin
- amount to debit
-
非負の妥当な浮動小数点数
exfiltration budget metadata reference は、次の items を持つ struct です:
- origin
- amount to debit reference
-
非負の妥当な浮動小数点数への mutable reference TODO: ポインター/参照をより仕様らしい方法で扱う
partition nonce は 実装定義の値です。
注: これは network partition key に似ており、Fetch によって使用されます。
fenced frame config は、次の items を持つ struct です:
- mapped url
-
- value
- visibility
- container size
-
null、または size
- content size
-
- value
- visibility
- interest group descriptor
-
- value
- visibility
- on navigate callback
-
null、または一連の手順
- effective sandboxing flags
-
- value
- visibility
- effective enabled permissions
-
- value
- visibility
-
注: 非 null の場合、これは、この config の生成者が、 この config へナビゲートする
fencedframeの内部で排他的に有効化されていることに依存する list of policy-controlled features です。具体的には、 ナビゲーションが成功するためには、この list 内の各 feature は、この config へナビゲートするとき、fencedframeの fenced navigable の permissions policy の inherited policy によって有効化されて いなければなりません。この list 内の features は強制的に有効化されるのではなく、 前述の inherited policy に影響を与える 埋め込み元環境が、これらの必須 features をサポートするのに十分緩和されているかを確認するために使用されます。 これらの features のいずれかについて inherited policy value が "Disabled" である場合、この config へのナビゲーションは失敗します。この list に 含まれていない任意の policy-controlled feature は、この config へナビゲートするfencedframe内で "Disabled" にはなりません。
- fenced frame reporting metadata
-
- value
- visibility
- exfiltration budget metadata
-
- value
- visibility
- nested configs
-
- value
- visibility
- embedder shared storage context
-
null、または string
- is ad component
-
boolean、初期値は false。
注: true の場合、この fenced frame config は ad component を表します。ad component は複数の部分から構成される広告を構築するために使用できます。 Protected Audience explainer を参照してください。ad component では、イベント報告の処理が異なります。 これを説明する Fenced Frame Ads Reporting explainer を参照してください。
- cross-origin reporting allowed
-
boolean、初期値は false。
2.3.4. fenced frame config instance struct
fenced frame config instance は、次の items を持つ struct です:
- mapped url
- container size
-
null、または size
- content size
-
null、または size
- interest group descriptor
-
null、または interest group descriptor
- on navigate callback
-
null、または一連の手順
- effective sandboxing flags
-
null、または sandboxing flag set
- permissions policy behavior
- effective enabled permissions
-
null、または list of policy-controlled features
- fenced frame reporter
-
null、または fenced frame reporter
- exfiltration budget metadata reference
- nested configs
-
null、または map。その keys は urn uuids であり、 その values は fenced frame configs です
- partition nonce
- embedder shared storage context
-
null、または string
- is ad component
- untrusted network status
-
untrusted network status。 初期値は enabled です。
- on network disabled promises
-
map。その keys は global objects であり、values は
Promisesの lists です。初期状態では空です。注: これは、
disableUntrustedNetwork()中に作成された、さまざまな globals からの各種Promisesを格納します。ここに格納することで、fencedframeとその子孫の fenced frames のネットワークアクセスが完全に取り消されたとき (すなわち untrusted network status が disabled for this tree and fenced subtrees であるとき)に、それらすべてを一度に resolve できます。 - cross-origin reporting allowed
-
boolean。初期値は false です。
- mapped url
-
config の mapped url の value
- container size
-
config の container size
- content size
-
null である場合は config の content size、そうでない場合は config の content size の value
- interest group descriptor
-
null である場合は config の interest group descriptor、 そうでない場合は config の interest group descriptor の value
- on navigate callback
-
config の on navigate callback
- effective sandboxing flags
-
null である場合は config の effective sandboxing flags、 そうでない場合は config の effective sandboxing flags の value
- permissions policy behavior
-
config の effective enabled permissions が null である場合は flexible、そうでない場合は fixed。
- effective enabled permissions
-
null である場合は config の effective enabled permissions、そうでない場合は config の effective enabled permissions の value
- fenced frame reporter
-
-
config の fenced frame reporting metadata の value が null である場合、null に設定します。
-
そうでない場合、次のメンバーを持つ fenced frame reporter に 設定します:
-
- exfiltration budget metadata reference
-
-
config の exfiltration budget metadata が null である場合、null に設定します。
-
そうでない場合、exfiltration budget metadata reference に設定します:
- origin
-
config の exfiltration budget metadata の value の origin
- amount to debit reference
-
config の exfiltration budget metadata の value の amount to debit への参照
-
- nested configs
-
-
config の nested configs が null である場合、 null に設定します。
-
そうでない場合:
-
results を新しい map とします。
-
config の nested configs の value の各 nested config について 反復します:
-
nested configs を results に設定します。
-
-
- partition nonce
-
ランダムで一意な partition nonce
- embedder shared storage context
-
config の embedder shared storage context
- is ad component
-
config の is ad component
- cross-origin reporting allowed
-
config の cross-origin reporting allowed
- untrusted network status
- on network disabled promises
-
空の map。
各 browsing context は、fenced frame config instance を持ちます。 これは fenced frame config instance または null であり、 初期値は null です。
この fenced frame config instance は
本来は
browsing context group 上に存在すべきです。しかし、third-party cookies が
廃止されるまで、
この仕様は
fencedframe
の多くの概念を
iframe
要素上でもサポートします。これにより、短期的には、通常の content navigable が
fenced frame
config を読み込め、その結果、その navigation に対応する fenced frame config
instance へアクセスできる必要があります。
2.3.5.
FencedFrameConfig
インターフェイス
fencedframe
要素への主要な入力の1つが、
内部の fenced frame
config struct に対応する
FencedFrameConfig
インターフェイスです。
enum {OpaqueProperty }; ["opaque" Exposed =Window ,Serializable ]interface {FencedFrameConfig constructor (USVString );url undefined setSharedStorageContext (DOMString ); };contextString
各 FencedFrameConfig
は次を持ちます:
注: config の url が null になるのは、urn が 与えられた場合だけです。
FencedFrameConfig(url)
コンストラクターメソッドの手順は次のとおりです:
-
config を新しい
FencedFrameConfigオブジェクトとします。 -
config の url を、url に対して URL parser を実行した結果に設定します。
-
config を返します。
setSharedStorageContext(contextString)
メソッド手順は、this の
sharedStorageContext を
contextString に設定することです。
FencedFrameConfig
オブジェクトは serializable objects です。その
serialization steps は、value,
serialized, および forStorage を与えられ、次のとおりです:
-
forStorage が true である場合、
DataCloneErrorDOMExceptionを throw します。 -
serialized.[[Url]] を value の url に設定します。
-
serialized.[[Urn]] を value の urn に設定します。
-
serialized.[[SharedStorageContext]] を value の sharedStorageContext に設定します。
-
value の url を serialized.[[Url]] に初期化します。
-
value の urn を serialized.[[Urn]] に初期化します。
-
value の sharedStorageContext を serialized.[[SharedStorageContext]] に初期化します。
注: 導入を容易にするため、
2026年まで、API
navigator.deprecatedReplaceInURN()
をサポートします。これは、与えられた urn
uuid または
FencedFrameConfig
に対応する mapped url へ macros を代入できるようにします。
注: 導入を容易にするため、
third
party cookie の廃止まで、
API navigator.deprecatedURNtoURL()
をサポートします。これは、与えられた urn
uuid または
FencedFrameConfig
に対応する mapped url を返します。
typedef (USVString or FencedFrameConfig );UrnOrConfig partial interface Navigator {Promise <undefined >deprecatedReplaceInURN (UrnOrConfig ,urnOrConfig record <USVString ,USVString >);replacements Promise <USVString >deprecatedURNtoURL (UrnOrConfig ,urnOrConfig optional boolean =send_reports false );sequence <USVString >adAuctionComponents (unsigned short ); };numAdComponents
-
TODO: これを仕様化する。 macros の keys を、対応する values とともに string に代入し、 新しい string を返します。再帰的な代入はありません。
deprecatedReplaceInURN(urnOrConfig, replacements)
メソッド手順は次のとおりです:
-
urn を null とします。
-
urnOrConfig が
USVStringである場合、urn を urnOrConfig に設定します。 -
そうでない場合、urn を urnOrConfig の urn に設定します。
-
urn が妥当な urn uuid でない場合(すなわち urn uuid の Section 3 の ABNF に合格しない場合)、
TypeErrorを throw します。 -
replacements の各 key → _ について 反復します:
-
p を 新しい promise とします。
-
global を this の relevant global object とします。
-
次の手順を 並列に実行します:
-
mapping を global の navigable の traversable navigable の fenced frame config mapping とします。
-
config を、mapping 内で urn により config を見つける結果とします。
-
config が failure である場合、global を与えて DOM manipulation task source 上に global task をキューし、 p を
undefinedで resolve して、これらの手順を中止します。 -
substitutedUrl を、replacements を用いて config の mapped url の value へ substituting macros した結果とします。
-
config の mapped url の value を substitutedUrl に設定します。
-
global を与えて DOM manipulation task source 上に global task をキューし、 p を
undefinedで resolve します。
-
-
p を返します。
deprecatedURNtoURL(urnOrConfig, send_reports)
メソッド
手順は次のとおりです:
-
urn を null とします。
-
urnOrConfig が
USVStringである場合、urn を urnOrConfig に設定します。 -
そうでない場合、urn を urnOrConfig の urn に設定します。
-
urn が妥当な urn uuid でない場合(すなわち urn uuid の Section 3 の ABNF に合格しない場合)、
TypeErrorを throw します。 -
p を 新しい promise とします。
-
global を this の relevant global object とします。
-
次の手順を 並列に実行します:
-
mapping を global の navigable の traversable navigable の fenced frame config mapping とします。
-
mapping の finalized config mapping[urn] が 存在しない場合、global を与えて DOM manipulation task source 上に global task をキューし、 p を
undefinedで resolve して、これらの手順を中止します。 -
config を mapping の finalized config mapping[urn] とします。
-
global を与えて DOM manipulation task source 上に global task をキューし、 p を config の mapped url の value で resolve します。
-
send_reports が true である場合、config の on navigate callback 内の 手順を実行します。
-
-
p を返します。
adAuctionComponents(numAdComponents)
-
instance を this の relevant global object の browsing context の fenced frame config instance とします。
-
instance が null である場合、
InvalidStateErrorDOMExceptionを throw します。 -
this の relevant settings object の origin と instance の mapped url の origin が same origin でない場合、
InvalidStateErrorDOMExceptionを throw します。 -
maxAdComponents を 40 とします。
-
numAdComponents > maxAdComponents である場合、numAdComponents を maxAdComponents に設定します。
-
instance の nested configs の各 urn → config について 反復します:
-
adComponentsURNs を返します。
2.4. Fence
インターフェイス
フェンス付きフレームに固有のいくつかの API は、Fence インターフェイス上で定義されます。
enum {FenceReportingDestination ,"buyer" ,"seller" ,"component-seller" ,"direct-seller" , };"shared-storage-select-url" dictionary { // This dictionary has two mutually exclusive modes that aren’t represented as // distinct IDL types due to distinguishability issues: // // When reporting to a preregistered destination (specified by enum), the following // properties are used:FenceEvent DOMString ;eventType DOMString ;eventData sequence <FenceReportingDestination >; // Determines if this data can be sent in a reportEvent() beacon or automatic // beacon that originates from a document that is cross-origin to the mapped // URL of the fenced frame config that loaded this frame tree. // Note that automatic beacon data can only be set from documents that are // same-origin to the fenced frame config’s mapped URL, so this effectively // opts in the data to being used in a cross-origin subframe.destination boolean =crossOriginExposed false ; // When setting event data to be used later in an automatic beacon, the // following properties are used:boolean =once false ; // When reporting to a custom destination URL (with substitution of macros defined by // the Protected Audience buyer), the following property is used:USVString ; };destinationURL typedef (FenceEvent or DOMString ); [ReportEventType Exposed =Window ]interface {Fence undefined reportEvent (optional ReportEventType = {});event undefined setReportEventDataForAutomaticBeacons (optional FenceEvent = {});event sequence <FencedFrameConfig >getNestedConfigs ();Promise <undefined >disableUntrustedNetwork ();undefined notifyEvent (Event ); };event
reportEvent(event) メソッド手順は次のとおりです:
-
document を、this の relevant global object の associated Document とします。
-
document が fully active でない場合、
SecurityErrorDOMExceptionを throw します。 -
instance を this の relevant global object の browsing context の fenced frame config instance とします。
-
instance が null である場合、return します。
-
instance の is ad component が true である場合、 return します。
-
instance の fenced frame reporter が null である場合、return します。
-
request initiator を、this の relevant settings object の origin とします。
-
initiator referrer policy を document の policy container の referrer policy とします。
-
event が
DOMStringである場合:-
this の relevant settings object の origin と instance の mapped url の origin が same origin でない場合、return します。
-
instance の fenced frame reporter を用い、event を指定して、report a private aggregation event を実行します。
-
-
event が
FenceEventである場合:-
次の条件がすべて true である場合:
-
this の relevant settings object の origin と instance の mapped url の origin が same origin でない;
-
event の
crossOriginExposedが false である、または instance の cross-origin reporting allowed が false である;
その場合、return します。
-
-
event が
destinationURLを持つ場合:-
event が
destinationまたはeventTypeまたはeventDataを持つ場合: -
destinationURL を、
destinationURLに対して URL parser を実行した結果とします。 -
次のいずれかの条件が成り立つ場合、
TypeErrorを throw します:-
destinationURL が failure である;
-
destinationURL の scheme が "
https" でない;
-
-
instance の fenced frame reporter を用い、
buyer, request initiator, initiator referrer policy、および event のdestinationURLである destination URL event を指定して、report an event を実行します。
-
-
そうでない場合:
-
event が
destinationを持たない、または event がeventTypeを持たない場合: -
attributionReportingEnabled を、document が "
" feature を 使用することを許可されているかどうかを決定した結果とします。attribution-reporting -
attributionReportingContextOrigin を、document の context origin とします。
-
event の
destinationの各 destination について 反復します:-
instance の fenced frame reporter を用い、destination, request initiator, initiator referrer policy、および次の items を持つ destination enum event を指定して、report an event を実行します:
- attributionReportingEnabled
-
attributionReportingEnabled
- attributionReportingContextOrigin
-
attributionReportingContextOrigin
-
-
テスト
- fence-report-event.https.html (ライブ テスト) (ソース)
- fence-report-event-destination-url.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin-content-initiated.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin-nested-urn-iframe.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin-nested.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin-no-embedder-opt-in.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin-no-subframe-opt-in.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin-urn-iframe-content-initiated.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin-urn-iframe-no-embedder-opt-in.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin-urn-iframe-no-subframe-opt-in.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin-urn-iframe.https.html (ライブ テスト) (ソース)
- fence-report-event-cross-origin.sub.https.html (ライブ テスト) (ソース)
- fence-report-event-sub-fencedframe.https.html (ライブ テスト) (ソース)
setReportEventDataForAutomaticBeacons(event)
メソッド手順は次のとおりです:
-
this の relevant global object の associated Document が fully active でない場合、
SecurityErrorDOMExceptionを throw します。 -
event が
destinationを持たない、または event がeventTypeを持たない場合: -
event の
eventTypeが automatic beacon event type 値のいずれとも一致しない場合、return します。 -
instance を this の relevant global object の browsing context の fenced frame config instance とします。
-
instance が null である場合、return します。
-
this の relevant settings object の origin と instance の mapped url の origin が same origin でなく、かつ event の
crossOriginExposedが false である場合、return します。 -
instance の fenced frame reporter が null である場合、return します。
-
this の relevant global object の associated Document の automatic beacon data mapping[event の
eventType] を、次の items を持つ automatic beacon data に設定します:- eventData
-
event の
eventDataが定義されており、かつ instance の is ad component が false である場合はそれ、それ以外の場合は空の string。 - destination
-
event の
destination - once
-
event の
once - crossOriginExposed
-
event の
crossOriginExposed
getNestedConfigs() メソッド手順は次のとおりです:
-
instance を this の relevant global object の browsing context の fenced frame config instance とします。
-
instance が null である場合、return します。
-
this の relevant settings object の origin と instance の mapped url の origin が same origin でない場合、return します。
-
instance の nested configs が null である場合、 return します。
-
results を
FencedFrameConfigs の空の list とします。 -
instance の nested configs の各 urn → config について 反復します:
-
newConfig を、this の relevant realm で作成された、新しい
FencedFrameConfigオブジェクトとし、次を持たせます:- urn
-
urn
- sharedStorageContext
-
config の embedder shared storage context
-
newConfig を results に 追加します。
-
-
results を返します。
notifyEvent(event) メソッド手順は次のとおりです:
-
this の relevant global object の associated Document が fully active でない場合、
SecurityErrorDOMExceptionを throw します。 -
navigable を、this の relevant global object の navigable とします。
-
次のいずれかの条件が満たされる場合、
SecurityErrorDOMExceptionを throw します:-
navigable が fenced navigable でない;
-
event の
isTrustedが false である; -
event の dispatch flag が unset である;
-
event の
typeが "click" でない
-
-
this の relevant global object が transient activation を持たない場合、return します。
-
Consume user activation を、this の relevant global object に対して行います。
-
parentNavigable を、navigable の unfenced parent とします。
-
parentNavigable の active window を与えて、DOM manipulation task source 上に global task をキューし、次の手順を実行します:
-
activation notification 手順を実行します。
-
"
fencedtreeclick" という名前の event を発火させます。対象は navigable の fenced navigable container です。 event のbubblesおよびcancelable属性をtrueに初期化します。 inner event creation steps を実行するとき、time を、このメソッドのすべての呼び出しで 一貫する 実装定義の値に設定します。
-
disableUntrustedNetwork() メソッド手順は次のとおりです:
-
p を 新しい promise とします。
-
this の relevant global object の associated Document が fully active でない場合、
SecurityErrorDOMExceptionを throw します。 -
instance を this の relevant global object の browsing context の fenced frame config instance とします。
-
instance が null である場合、return します。
-
relevant settings object の origin と instance の mapped url の origin が same origin でない場合、p を
TypeErrorで reject します。 -
this の relevant global object の navigable の traversable navigable が fenced navigable でない場合、 p を
undefinedで resolve し、p を返します。 -
global を this の relevant global object とします。
-
settings を this の relevant settings object とします。
-
For each、relevant global object が global である各
WebSocketobject webSocket について、webSocket を与えて fail the WebSocket connection を実行します。 -
For each、relevant global object が global である各
WebTransportobject webTransport について、新たに created されたWebTransportError(そのsourceは"session")で、webTransport を cleanup します。注:
WebTransportCloseInfoを渡さないことで、WebTransportobject は"closed"状態ではなく"failed"状態に設定されます。 -
次の手順を 並列に実行します:
-
fencedFrameNonce を instance の partition nonce とします。
-
credentiallessNonce を global の page credentialless nonce とします。
-
settings を用いて、fencedFrameNonce に対して revoke network for a partition nonce を呼び出します。
-
credentiallessNonce が非 null である場合、settings を用いて credentiallessNonce に対して revoke network for a partition nonce を呼び出します。
-
instance の untrusted network status を disabled for this tree に設定します。
-
promises を instance の on network disabled promises とします。
-
global の browsing context の top-level traversable を与えて、 すべての fenced frame 子孫の untrusted network status を再計算する。
-
-
p を返します。
-
navigables を、topLevelTraversable の active document の inclusive descendant navigables とし、 unfenced を true に設定します。
-
navigablesWithNetworkChildren を、fenced navigables の set とし、 初期状態では空とします。
-
-
currentNavigable を、navigables から pop した結果とします。
-
ongoingNavigation を currentNavigable の ongoing navigation とします。
-
currentNavigable が fenced navigable でない場合:
-
ongoingNavigation が null でない場合:
-
ancestorFencedRoot を currentNavigable の traversable navigable とします。
-
ancestorFencedRoot が fenced navigable である場合、 ancestorFencedRoot を navigablesWithNetworkChildren に append します。
-
-
continue します。
-
-
config を currentNavigable の active browsing context の fenced frame config instance とします。
-
config の untrusted network status が disabled for this tree and fenced subtrees であり、かつ ongoingNavigation が null である場合、continue します。
-
networkCutoffReady を、navigablesWithNetworkChildren が currentNavigable を 含まず、かつ config の untrusted network status が disabled for this tree である場合は true、それ以外の場合は false とします。
注: fenced navigable は、 ネットワーク遮断の準備ができていないと判断された別の fenced frame の unfenced ancestor であるときに、 navigablesWithNetworkChildren に追加されます。
-
networkCutoffReady が true である場合:
-
config の untrusted network status を disabled for this tree and fenced subtrees に設定します。
注: untrusted network が disabled であることに依存する API は、promises の解決が完了する前であっても、この時点でただちに 使用可能になります。
-
config の on network disabled promises 内の各 global → promises について 反復します:
-
promises 内の各 promise について 反復します:
-
global を与えて、DOM manipulation task source 上に global task をキューし、 promise を
undefinedで resolve します。
-
-
-
config の on network disabled promises を clear します。
-
-
networkCutoffReady が false である、または ongoingNavigation が null でない場合:
-
ancestorFencedRoot を currentNavigable の unfenced parent の traversable navigable とします。
-
ancestorFencedRoot が fenced navigable である場合、 ancestorFencedRoot を navigablesWithNetworkChildren に append します。
-
-
注: Chromium 内部の web platform test は third_party/blink/web_tests/wpt_internal/fenced_frame/disable-untrusted-network-ongoing-navigation.https.html で利用できます。WICG/fenced-frame#192 が解決され次第、 upstream され、ここにリンクされる予定です。
iframe
要素の HTML iframe element removing steps を、
次のように書き換えます:
iframe
HTML element removing steps は、
removedNode を与えられ、次のとおりです:
-
topLevelTraversable を、removedNode の content navigable の top-level traversable とします。
-
removedNode を与えて、 Destroy a child navigable します。
-
並列に、topLevelTraversable を与えて すべての fenced frame 子孫の untrusted network status を再計算する。
-
newValue が null である場合、並列に、navigable の top-level traversable を与えて、 すべての fenced frame 子孫の untrusted network status を再計算する。
ユーザーエージェントは、関連付けられた network revocation nonce set を持ちます。これは set of partition nonces です。また、 network revocation exemption map も持ちます。これは map であり、その keys は partition nonces、その values は sets of URLs です。
注: network revocation exemption map は web platform tests のためだけに使用されます。通常の使用では、常に空です。 この list は、network revocation から特定の URL を exempt する関数呼び出しによって、web platform tests 内で直接変更されます。
これには、WPT web driver に
テスト専用関数を追加するための RFC が必要になります。
(WICG/fenced-frame#192)
その web driver の変更が行われたら、
disableUntrustedNetwork()
に関する既存の Chromium 内部 web platform tests を upstream し、ここにリンクする必要があります。
(WICG/fenced-frame#207)
-
nonce をユーザーエージェントの network revocation nonce set に append します。
-
settings の fetch group を terminate します。
-
key を、 request に対して determine the network partition key を実行した結果とします。
-
nonce を key の nonce とします。
-
ユーザーエージェントの network revocation exemption map[nonce] が 存在し、かつ request の URL がその中に 存在する場合、 allowed を返します。
-
ユーザーエージェントの network revocation nonce set が nonce を 含む場合、 blocked を返します。
-
allowed を返します。
2.5. ネットワーク失効のためのモンキーパッチ
この導入節は非規範的です。
この節のネットワーク失効メカニズムは、ネットワーク リクエストを行う標準へのパッチ適用を必要とします。私たちのパッチ以前は、これらの標準は、 最終的にリクエストを開始したコンテキストのネットワーク失効状態を認識しないまま、ネットワーク リクエスト(WebSocket 接続の開始など)を行っていました。私たちのパッチは、それらの標準の アルゴリズムにチェックを追加し、リクエストが行われる前に、開始元コンテキストのネットワーク 失効状態を考慮するようにします。詳しくは、これらの各種 API をテストする非外部 WPT があり、ここで 見つける ことができます。 これらが現在外部化されていないのは、ネットワーク失効機能がまだローンチされていないためです。 ローンチ後、WPT リポジトリに公開されます。
ネットワーク失効メカニズムは、[FETCH] Standard に対する次のモンキーパッチを必要とします。
request が bad port によりブロックされるべきか、 request の fetch が mixed content としてブロックされるべきか、または request が Content Security Policy によりブロックされるべきか が blocked を返す場合、 response を network error に設定します。
"should request be blocked by Content Security Policy" の後の条件に、"must be blocked due to a revoked partition nonce" を追加します。
これには、fenced frame nonce と、 存在する場合は iframe credentialless nonce の両方を渡す必要があります。 (WICG/fenced-frame#191)
-
nonce を key の nonce とします。
-
ユーザーエージェントの network revocation exemption map[nonce] が 存在するが、 network revocation exemption map[nonce][yrl] が 存在しない場合:
-
ユーザーエージェントの network revocation nonce set が nonce を 含む場合、failure を返します。
-
ステップ 1 の前に次の手順を挿入します:
-
nonce を key の nonce とします。
-
ユーザーエージェントの network revocation exemption map[nonce] が 存在するが、 network revocation exemption map[nonce][url] が 存在しない場合:
-
ユーザーエージェントの network revocation nonce set が nonce を 含む場合、failure を返します。
-
ネットワーク失効メカニズムは、[WebSockets] Standard に対する次のモンキーパッチを必要とします。
-
client の global object の navigable を与えて determine if a navigable has revoked network for itself を実行した結果が true である場合、 fail the WebSocket connection を行います。
ネットワーク失効メカニズムは、[WebTransport] Standard に対する次のモンキーパッチを必要とします。
-
次の条件のいずれかが true である場合:
-
request を用いて should request be blocked by Content Security Policy? を実行すると "Blocked" を返す;
-
request を用いて should request be blocked due to a bad port を 実行すると "blocked" を返す;
-
client の global object の navigable を与えて determine if a navigable has revoked network for itself を実行すると true を返す;
その場合、残りの手順を中止し、transport を用いて network task をキューし、次の手順を実行します:
-
ネットワーク失効メカニズムは、[Reporting] Standard に対する次のモンキーパッチを必要とします。
-
context が
Documentであり、かつ context の node navigable を与えて determine if a navigable has revoked network for itself を実行した結果が true である場合、return します。
ネットワーク失効メカニズムは、[Webpackage] Standard に対する次のモンキーパッチを必要とします。
-
request が must be blocked due to a revoked partition nonce かどうかを判定した結果が false である場合、 並列に、parsedExchange と report に対して wait and queue a report for します。
2.6. 新しい request destination
fencedframe
の
navigation request の処理モデルは、通常の
navigation request の処理モデルから十分に逸脱しており、新しい request destination 値を正当化します。
この仕様は、request destination 列挙に新しい
エントリ "fencedframe" を含めるよう更新します。[FETCH] Standard に対して次のモンキーパッチを実行します。
"fencedframe" を non-subresource request list および navigation
request list に追加します。
"fencedframe" を RequestDestination
enum に追加します。
ユーザーエージェントは、request の destination について switch し、該当するものがあれば、 value を最初に一致する文に設定するべきです:
"fencedframe" を、"document",
"frame", および "iframe" と並ぶ switch cases に追加します。
非規範的に、DOM intro の destination
table を更新し、
fencedframe
navigation requests が次のプロパティを持つことを示します:
-
"
fencedframe" の destination -
initiator ""
-
CSP directive of
fenced-frame-src -
HTML の
<fencedframe>としての Features
2.7. ネットワーク失効に基づくメソッドのゲーティング
この導入節は非規範的です。
fenced frame が untrusted network access を完全に無効化した後、すなわち
disableUntrustedNetwork()
によって返された
Promise
が resolved
した後、特定の強力なインターフェイスメソッドが、
fenced frame 内で実行されるスクリプトから利用可能になります。これらのメソッドは他の仕様で
定義され、それらの仕様は、呼び出しが成功できるかどうかを決定するために、下記の最初のアルゴリズムを使用します。
untrusted network access の失効の背後でゲートされるメソッドの一例は、get()
であり、SharedStorageWorklet
の外で呼び出される場合です。
このメソッドは [Shared-Storage] draft specification で定義されています。
disableUntrustedNetwork()
が呼び出されたが、返された
Promise
がまだ resolved していない中間状態では、ネットワーク越しのリクエストを行う機能に制限があります。
下記の2番目のアルゴリズムは、それらの機能が許可されるかどうかを決定するために使用されます。
私たちは "fully revoked" と "revoked for self" を区別します。
これは、ネストされた fenced frame tree がまだネットワークアクセスを持つ可能性があり、それらも
disableUntrustedNetwork()
を呼び出すまで、これらの制限が適用されないためです。
-
navigable の traversable navigable が fenced navigable でない場合、 false を返します。
-
config を navigable の active browsing context の fenced frame config instance とします。
-
config の untrusted network status が disabled for this tree and fenced subtrees でない場合、false を返します。
-
true を返します。
-
navigable の traversable navigable が fenced navigable でない場合、 false を返します。
-
config を navigable の active browsing context の fenced frame config instance とします。
-
config の untrusted network status が enabled である場合、false を返します。
-
true を返します。
-
sourceSnapshotParams の target fenced frame config が null である場合、 false を返します。
意図としては、 sourceSnapshotParams の target fenced frame config は embedder-initiated
fencedframenavigation では non-null、 それ以外では null であるべきです。しかし、この issue が解決されるまでは、 これは true ではありません。 -
navigable の traversable navigable の unfenced parent が null である場合、false を返します。
注: navigable の traversable navigable の unfenced parent が null である場合、 navigable は、navigable の fenced navigable container が destroyed されているため stop loading します。
-
次がすべて true である場合:
-
navigable を与えて determine if a navigable has revoked network for itself を実行した結果が true である; かつ
-
navigable の traversable navigable の unfenced parent を与えて determine if a navigable has revoked network for itself を実行した結果が true である,
注: アルゴリズム determine if a navigable has revoked network for itself は、 navigable と navigable の traversable navigable の unfenced parent の両方で実行されます。 これは、親 fenced frame が、すでに untrusted network access を無効化した子 fenced frame を ナビゲートできるためです。子 fenced frame navigation が開始された直後に親 fenced frame が untrusted network access を無効化した場合、その navigation はブロックされなければなりません。 したがって、このアルゴリズムは親と子の両方で実行されなければなりません。そうしないと、navigation の commit が許可された場合に、 親 fenced frame は untrusted network access を無効化しているが、子 fenced frame は無効化していないことになります。
その場合、true を返します。
-
-
そうでない場合、false を返します。
2.8. 自動報告
この最初の導入段落は非規範的です。
fenced boundary model の副作用として、広告はクリックが成功した navigation につながったかどうかを知る能力を失います。
これは、fenced frame から発生したトップレベル
navigation から読み込まれたページが、読み込まれたことを fenced frame に報告することを許可されないためです
(たとえば
window.opener
のようなものを通して)。
代わりに、特別なイベントレベルの reporting types、
reserved.top_navigation_start
および
reserved.top_navigation_commit
を導入します。これらは、fenced frame が
top-level
traversable への成功した navigation を開始したときに、event-level beacon を自動的に送信します。
Document
targetDocument、および
automatic beacon event type
eventType を与えて、attempt to send an automatic beacon するには、次の手順を実行します:
-
targetDocument の node navigable の traversable navigable が top-level traversable でない場合、これらの手順を中止します。
-
sourceSnapshotParams の has transient activation が false に設定されている場合、これらの手順を中止します。
-
config を sourceSnapshotParams の initiator fenced frame config instance とします。
-
config が null である場合、これらの手順を中止します。
注: このアルゴリズムはすべての navigations に対して 無条件に呼び出されるため、これは
fencedframeから発生しない top-level traversable への navigation のケースを捕捉するために使用されます。 -
request initiator を、config の is ad component が false である場合は sourceOrigin、そうでない場合は sourceSnapshotParams の initiator ancestor root origin とします。
-
initiator referrer policy を、config の is ad component が false である場合は sourceSnapshotParams の source policy container の referrer policy、そうでない場合は sourceSnapshotParams の initiator ancestor root referrer policy とします。
-
isCrossOrigin を、sourceOrigin が config の mapped url の origin と same origin でない場合は true、そうでない場合は false とします。
-
beaconMapping を、isCrossOrigin が false である場合は sourceSnapshotParams の snapshot automatic beacon store の data mapping、 そうでない場合は sourceSnapshotParams の snapshot automatic beacon store の cross-origin exposed data mapping とします。
-
beaconData を beaconMapping[eventType] とします。
-
automaticBeaconsAllowed を sourceSnapshotParams の automatic beacons allowed とします。
注: これは、 `
Allow-Fenced-Frame-Automatic-Beacons` header による opt-in があったかどうかを追跡します。この値が false であっても、same-origin documents または データ設定によって opt-in した documents のいずれかでは、automatic beacons を送信できます。 -
beaconData が null であり、かつ automaticBeaconsAllowed が false である場合、 これらの手順を中止します。
-
isCrossOrigin が true であり、かつ automaticBeaconsAllowed が false である場合、 これらの手順を中止します。
-
config の fenced frame reporter の fenced frame reporting metadata reference の fenced frame reporting map の keys の各 destination について 反復します:
-
config の fenced frame reporter を用い、destination, request initiator, initiator referrer policy、および次の items を持つ automatic beacon event を指定して、 report an event を実行します:
- type
-
eventType
- data
-
beaconData が null である場合は空文字列、そうでない場合は beaconData の eventData。
- attributionReportingEnabled
-
sourceSnapshotParams の attribution reporting enabled
- attributionReportingContextOrigin
-
sourceSnapshotParams の attribution reporting context origin
-
-
beaconData の once が true である場合、 beaconMapping[eventType] を null に設定します。
テスト
- automatic-beacon-anchor-click-handler.https.html (ライブ テスト) (ソース)
- automatic-beacon-click-handler.https.html (ライブ テスト) (ソース)
- automatic-beacon-two-events-clear.https.html (ライブ テスト) (ソース)
- automatic-beacon-two-events-persist.https.html (ライブ テスト) (ソース)
- automatic-beacon-unfenced-top.https.html (ライブ テスト) (ソース)
- automatic-beacon-no-destination.https.html (ライブ テスト) (ソース)
- automatic-beacon-no-opt-in.https.html (ライブ テスト) (ソース)
- automatic-beacon-shared-storage.https.html (ライブ テスト) (ソース)
- automatic-beacon-cross-origin-false.https.html (ライブ テスト) (ソース)
- automatic-beacon-cross-origin-navigation.https.html (ライブ テスト) (ソース)
- automatic-beacon-cross-origin-no-data.https.html (ライブ テスト) (ソース)
- automatic-beacon-cross-origin-no-opt-in.https.html (ライブ テスト) (ソース)
- automatic-beacon-use-ancestor-data.https.html (ライブ テスト) (ソース)
- automatic-beacon-data-cross-origin-ancestor.sub.https.html (ライブ テスト) (ソース)
- automatic-beacon-data-set-by-sibling.https.html (ライブ テスト) (ソース)
- automatic-beacon-data-multiple-ancestors.https.html (ライブ テスト) (ソース)
-
sourceSnapshotParams, initiatorOriginSnapshot, navigable の関連付けられた
Document, およびreserved.top_navigation_startを与えて、Attempt to send an automatic beacon します。
-
failure が false である場合:
-
sourceSnapshotParams, entry の document state の initiator origin, document、および
reserved.top_navigation_commitを与えて、Attempt to send an automatic beacon します。 -
sourceSnapshotParams, entry の document state の initiator origin, document、および
reserved.top_navigationを与えて、Attempt to send an automatic beacon します。
-
3. HTML 統合
3.1. Window
インターフェイスへの拡張
partial interface Window { // Collection of fenced frame APIsreadonly attribute Fence ?fence ; };
各 Window
object は、関連付けられた fence を持ちます。これは、Window
とともに作成される Fence
instance です。
fence getter 手順は次のとおりです:
-
this の browsing context の fenced frame config instance が null でない場合、this の fence を返します。
-
null を返します。
3.2. Document
の補助概念
まず、いくつかの予備的な型を確立します:
automatic beacon data は、次の items を持つ struct です:
- eventData
- destination
- once
- crossOriginExposed
automatic beacon data mapping は、map です。その keys は automatic beacon event types であり、その values は null または automatic beacon data です。
snapshot automatic beacon store は、次の items を持つ struct です:
- data mapping
- cross-origin exposed data mapping
各 Document
object は、関連付けられた automatic beacon data mapping を持ちます。
これは automatic beacon data mapping です。
各 Document
object は、関連付けられた automatic beacons allowed を持ちます。これは
boolean
であり、初期値は false です。
3.3. browsing context 作成への変更
-
creator が non-null である場合:
代わりに、より厳密な条件を使用するように書き換えます:
-
creator が non-null であり、かつ embedder が
fencedframeelement でない場合:
注: これは、creator の referrer、origin、document base url、policy container が fenced frame boundary をまたいで漏れないようにする必要があるためです。
このアルゴリズムの(上で変更した)ステップ 4 に、次のサブステップを追加します:
-
browsingContext の fenced frame config instance を、 creator の browsing context の fenced frame config instance に設定します。
3.4. Policy container の継承
local
URL への
navigation request を作成するとき、
iframes
は、その
policy container を、navigation
request の initiator である Document
から clone します。
fencedframes
が同じことを行うと、initiator の
policy container に関する情報が fenced frame
boundary をまたいで漏れることを許してしまいます。この節では、その漏れを閉じるために
policy container 継承にパッチを当てます。
ステップ 3 を次のように書き換えます:
-
responseURL is local であり、initiatorPolicyContainer が null でなく、 fenced false である場合、 initiatorPolicyContainer の clone を返します。
注: responseURL が
about:srcdoc
である場合を変更する必要はありません。なぜなら
about:srcdoc
への navigations は fenced frames でサポートされていないためです。
-
fenced を、navigable が fenced navigable である場合は true、 そうでない場合は false とします。
注: これにより、initiator である
Documentが navigable の active document であるか、その unfenced parent であるかにかかわらず、fenced が true であることが保証されます。
ステップ 23(現在のステップ 24)を次のように書き換えます:
-
resultPolicyContainer を、response の URL、 entry の document state の history policy container、 sourceSnapshotParams の source policy container、null、 responsePolicyContainer、および fenced を与えて determining navigation params policy container した結果とします。
注:
fencedframe
Document
初期作成時の
policy container 継承は、
§ 3.3 browsing context 作成への変更
節で扱われます。
3.5. 入れ子の traversables
3.5.1. はじめに
この節は非規範的です。
[HTML] Standard は、navigables を2つのカテゴリに整理します: child navigables と
traversable navigables(top-level traversables とも呼ばれます)です。
fenced frames のような機能、そして程度は小さいですが portals
の導入は、ときどき
child navigable のような
新しい種類の traversable navigable を追加することで、このモデルを複雑にします。
これらの新しい frame 型は、embedder とは別の browsing context group に収容されるため、ある具体的なレベルの分離が期待され、
かつ要求されます。一方で、それらは 他の browsing context groups の内部に視覚的に合成されるため、時には
たとえば
iframes
で見られる通常の child navigables のように振る舞う必要があります。
ここでの複雑さは、navigable container、 navigable parent、および descendant navigables のような用語が、 いつ traversable navigable/browsing context group 境界を越える必要があるのか、またそうすると安全でない または正しくないのはいつかを決定する点にあります。以下の例はこの点を示します。
ユーザーが
Document
内の content を
activates すると、通常は
activation notification steps が、すべての
ancestor navigables と、すべての same
origin descendant navigables に user activation を与えます。しかし
fencedframe
は embedder から分離される必要がある機微な content をホストでき、
また user activation および consumption は、この2者の間の通信
ベクトルを提供するため、user activation の目的では、
fencedframe
の
fenced navigable は、その
embedder の descendant と見なすことはできず、またその embedder も
fencedframe
の
fenced navigable の ancestor と見なすことはできません。
これは、現在の user activation アルゴリズムがそれらの用語を用いる方法においてです。
言い換えると、私たちは user activation を fenced と見なし、それが
fenced navigable boundary
を決して越えないことを示します。
unfenced であれば、それは
iframes
と同じように振る舞い、user activation が frame boundary を自由に流れることを許します。
user activation とは異なり、
fencedframe
の
fenced navigable が created または navigated されるとき、それは通常の
child navigables 内の Documents
で標準であるように、embedder
Document
の
active sandboxing flag set をそのまま
inherit must。
これをしない場合、
fencedframe
element は自明な sandbox bypass になります。
fencedframe
の sandbox flag 継承は
iframe
elements におけるそれと同様に振る舞うため、私たちは sandbox inheritance を unfenced と見なします。
上記で言及した分離と、その条件付き緩和を提供するため、この仕様は traversable navigables のための新しい種類の parent として unfenced parent を定義します。これは、上で説明したように、 unfenced である必要があるときにアルゴリズムが意図的に使用できる embedder へのリンクを提供します。
注: 新しい種類の parent(unfenced parent)の導入は、意図的な設計判断です。
これは、デフォルトでは
fencedframe
boundary が private かつ isolated であることを意味します。
なぜなら、デフォルトでは web platform の何ものも、
fencedframe
の
fenced navigable からその embedder へ traverse
しないためです。
アルゴリズムを変更して、
fencedframe
fenced navigable boundary をまたいで traverse
できるようにするときは、
注意が払われなければなりません。この種の各変更は個別に評価され、この仕様に現れます。
この節の残りでは、関連する navigables の集合を扱うさまざまな [HTML] definitions(およびそれらの使用箇所)へのパッチを提供し、 web platform のさまざまな部分を適切に fencing および unfencing することを意図します。
3.5.2. Traversable navigables
[HTML] の Traversable navigables 節に、次を追加します:
navigable のプロパティに加えて、traversable navigable は次を持ちます:
-
unfenced parent。navigable または null。初期値は null です。
注: unfenced parent link は、
fencedframe
の
fenced navigable に embedder
へのリンクを与えるものです。
これは、focus processing model の一部のアルゴリズムのように、"unfenced" である必要があるものに対して
注意深く使用されます。
-
navigable が child navigable である場合、navigable の parent を返します。
-
Assert: navigable は fenced navigable です。
-
navigable の unfenced parent を返します。
注: このアルゴリズムは、traversable navigable の unfenced parent getter とは異なります。というのは、この アルゴリズムは、navigable が通常の child navigable である場合、まず navigable の 通常の parent を取得しようとするためです。
-
parentNavigable を navigable の unfenced parent とします。
-
parentNavigable の active document を返します。
3.5.3. 入れ子の traversables
[HTML] の Navigables 節に、"Nested traversables" という題名の新しい小節を追加し、次のテキスト、定義、および アルゴリズムを含めます。
navigable containers とそれぞれの content navigables と同様に、
他の elements(これまでのところ
fencedframe
element のみ)は、より分離された navigable を
ユーザーに提示します。これらの elements は fenced navigable containers と呼ばれます。
fenced navigable container は fenced navigable を持ちます。これは、non-null の unfenced parent を持つ traversable navigable、または null です。初期値は null です。
-
documentState を与えて Initialize the navigable traversable します。
-
traversable の unfenced parent を parent に設定します。
-
group を新しい browsing context group とします。
注: create a new browsing context group and document がするように、group をユーザーエージェントの browsing context group set に append する理由はないように見えます。
-
document を、element の node document、element、および group を与えて creating a new browsing context and document した2番目の戻り値とします。
-
documentState を新しい document state とし、その document は document とします。
-
traversable を新しい traversable navigable とします。
-
parentNavigable を element の node navigable とします。
-
documentState と parentNavigable を与えて、Initialize the nested traversable traversable します。
-
element の fenced navigable を traversable に設定します。
-
initialHistoryEntry を traversable の active session history entry とします。
-
initialHistoryEntry の step を 0 に設定します。
-
initialHistoryEntry を traversable の session history entries に Append します。
-
traversable を返します。
注: create a new nested traversable アルゴリズムは、top-level traversable ではない 最初の種類の traversable navigable を作成します。これにより、 [HTML] の Top-level traversables 節にある nested traversables についての注記を削除する必要があります。
3.5.4. トップレベル traversables
[HTML] Standard は現在、 top-level traversable を、traversable navigable であって、その parent が null であるもの、と定義しています。しかしこれは不十分な定義であり、この 仕様はそれを変更します。[HTML] は、この仕様の外では、すべての traversable navigables は top-level traversables であると 述べていますが、将来の仕様が nested である一種の traversable を 作成し、non-null の parent によって nesting を実現したいかもしれない、とも「想定」しています。そのため、 top-level traversables と traversable navigables の区別は、parent が null であるかどうかに依存します。
この仕様が提案する fenced navigable は、[HTML] が top-level traversables と traversable navigables の区別のために余地を設けたときに 想定していたものそのものです。しかしこの仕様は、fenced navigables に対して parent ポインターを使用しません。その理由は 上記で説明したとおりです(代わりに unfenced parent ポインターを使用します)。つまり、 デフォルトでは、top-level traversables と fenced navigables はどちらも null の parents を持つため、その区別は無意味になります。
top-level traversables と fenced navigables の意図された区別を 修復するために、次の定義を以下のように patch します:
-
navigable を inputNavigable とします。
-
-
navigable の parent と unfenced parent が どちらも null である場合、break します。
-
navigable を、navigable の parent または unfenced parent のうち、 non-null である方に設定します。
注: ここでは、 navigable の parent または unfenced parent の ちょうど一方だけが non-null になります。
-
-
navigable を返します。
注: これらの新しい定義では、top-level traversable は、§ 3.5.1 はじめに で説明した "unfenced" と本質的に同じです。
3.6. navigable を走査するアルゴリズムへの変更
さらに、このアルゴリズムのステップ 2 を次のように書き換えます:
-
navigables を、Extend し、document の descendant navigables を含めます。その unfenced は unfenced に設定します。
-
navigables を新しい list とします。
-
navigableContainers を、document のすべての shadow-including descendants のうち、 navigable containers(または unfenced が true の場合は fenced navigable containers)であるものの list とし、 shadow-including tree order 順にします。
-
navigableContainers の各 navigableContainer について 反復します:
-
navigableContainer の content navigable と fenced navigable が どちらも null である場合、continue します。
-
descendantNavigable を、navigableContainer の content navigable または fenced navigable の どちらか non-null である方とします。
-
navigables を、descendantNavigable の active document の inclusive descendant navigables で Extend します。その unfenced は unfenced に設定します。
-
-
navigables を返します。
-
navigable を document の node navigable の parent とします。
-
navigable が null で、かつ unfenced が true である場合、navigable を document の node navigable の traversable navigable の unfenced parent に設定します。
-
ancestors を空の list とします。
-
navigable が null でない間:
-
navigable を ancestors に Prepend します。
-
navigable を navigable の parent に設定します。
-
navigable が null で、かつ unfenced が true である場合、navigable を navigable の traversable navigable の unfenced parent に設定します。
-
-
ancestors を返します。
3.7. focusing アルゴリズムへの変更
[HTML] standard は、
focusing elements と Windows
を
ユーザー操作と script-initiated APIs の両方によってどのように扱うかを定義しています。fenced frames は
fenced frame boundary をまたいだ通信を防ぐように設計されているため、focus を注意深く扱う必要があります。
これは、focus が
fencedframe
boundary を越えると、boundary の両側の contexts がその変化を検出でき、それが
fencedframe
とその embedder の間に通信チャネルを開くために使用され得るためです。
これを行うため、focusing steps が script-initiated focus を fenced frame boundary を越えて移動することを許可しません。
ユーザーが
button
のような element を
fencedframe
の内部でクリックし、その一方で
fencedframe
の 外側 にある別の element が focused
されている場合、
focusing steps は
button
が gain focus することを許可します。これは特に
user-initiated action であるためです。それを許可しなければ、
fencedframe
内のいかなる element も
gain focus できなくなってしまいます。
この
仕様以前の現状のまま、すべての elements が focus()
method を介して focused されることを許可し続けた場合、fenced navigable
container とその fenced navigable は、一連の
focus()
calls を使用して fenced frame boundary をまたいで任意のデータを送信でき、これはプライバシー漏洩です。
これを避けるために、focus()
method を実質的に "fence" します。これはプライバシーのために一部の機能を犠牲にします。
アルゴリズムの(new focus target を変更する)ステップ 3 の後に、次の新しいステップを追加します:
-
new focus target が、non-null の fenced navigable を持つ fenced navigable container である場合、 new focus target を、その fenced navigable の active document に設定します。
new chain 変数を定義するステップの後に、次の新しいステップを追加します:
-
unfenced が false であり、new chain が
Documentdocument を 含む場合で、その node navigable の traversable navigable が fenced navigable であり、 かつ old chain が document を 含まない場合、return します。注: これは、focus が fence を越えようとしている場合に、 focus update steps を呼び出す直前で早期に抜ける方法です。
focusing steps におけるアルゴリズム手順の後の user agent 文を、次のように変更します:
ユーザーエージェントは、ユーザーが candidate へ focus を移動しようとするたびに、 immediately に、focusable area または navigable candidate について、unfenced を true に設定して focusing steps を実行しなければなりません。
-
element について、unfenced を true に設定して、focusing steps を実行します。
-
element に対して
clickevent を発火します。
ユーザーが click focusable focusable area を
activates するとき、ユーザーエージェントは
focusable area に対して、focus trigger を
"click" に設定し、unfenced を true に設定して、
focusing steps を実行しなければなりません。
-
previouslyFocusedElement が null でない場合:
-
element の previously focused element を null に設定します。
-
focusPreviousElement が true である場合、previouslyFocusedElement に対して、 unfenced を true に設定して focusing steps を実行します。このステップを行っても viewport はスクロールされるべきではありません。
-
注: popover を手動で閉じることは user-initiated gesture ですが、 focusing steps は、それが user gesture から呼び出されたか script call 経由で呼び出されたかにかかわらず、unfenced を false に設定して呼び出されます。
-
ユーザーエージェントは、その過程でそれらの elements の1つを focus してもよく、その element に対して focusing steps を実行してもよく、 document の scrolling position を変更しても、または element をユーザーの注意に向ける他の action を実行してもよいです。 これらの手順が user gesture によって呼び出された場合、focusing steps は unfenced を true に設定して呼び出せます。 form-associated custom elements である elements については、ユーザーエージェントは これらの actions の目的で、代わりにそれらの face validation anchor を使用するべきです。
-
candidate の focused area が、non-null の fenced navigable を持つ fenced navigable container である場合、 candidate を、その fenced navigable container の fenced navigable の active document に設定します。
-
currentObject が focusable area である場合、currentObject を currentObject の DOM anchor の node document に設定します。
そうでなく、currentObject が、その node navigable の parent が non-null である
Documentである場合、currentObject を currentObject の node navigable の parent に設定します。そうでなく、currentObject が、その node navigable が traversable navigable であり、その unfenced parent が non-null である
Documentである場合、 currentObject を currentObject の node navigable の unfenced parent に設定します。そうでなければ、break します。
- focus target が、non-null の fenced navigable を持つ fenced navigable container である場合
-
その fenced navigable container の fenced navigable の active document を返します。
注: このアルゴリズムは、無条件に "jump the fence" boundary できます。なぜなら、その戻り値は常に fence boundary を注意深く考慮するアルゴリズムへ 入力されるためです。
-
candidate の focused area が、non-null の content navigable を持つ navigable container、または non-null の fenced navigable を持つ fenced navigable container のいずれかである間、While: candidate を、その navigable container の content navigable またはその fenced navigable container の fenced navigable のうち、 non-null である方の active document に設定します。
-
candidate が null でない場合、candidate に対して focusing steps を実行します。その unfenced は true に設定し、return します。
sequential focus navigation アルゴリズムのステップ 9 を次のように変更します:
-
そうでなければ、starting point は、その node document の node navigable が child navigable または fenced navigable である focusable area です。 starting point をその node navigable の unfenced parent に設定し、loop とラベル付けされたステップに戻ります。
-
candidate が、non-null の content navigable を持つ navigable container である場合、new candidate を、 candidate の content navigable を第1引数、 direction を第2引数、 sequential を第3引数として sequential navigation search algorithm を実行した結果とします。
candidate が、non-null の fenced navigable を持つ fenced navigable container である場合、 new candidate を、 candidate の fenced navigable を第1引数、 direction を第2引数、 sequential を第3引数として sequential navigation search algorithm を実行した結果とします。
new candidate が null である場合、starting point を candidate とし、このアルゴリズムの先頭へ戻ります。そうでない場合、 candidate を new candidate とします。
テスト
3.8. Navigation
この節では、
fencedframe
element が、さまざまな headers、isolation mechanisms、および policies との統合を含む、ますます複雑な
navigation の process とどのように相互作用するかを説明します。
3.8.1.
`Supports-Loading-Mode` HTTP
response header
この節は [HTML] Standard を
monkeypatch することを意図しています。しかし、
`Supports-Loading-Mode` header
はまだ [HTML] に merge されておらず、
代わりに [Prerendering-Revamped] specification に存在するため、この節は実質的に
その monkeypatch specification を monkeypatch します。
以下の新しい token を、`Supports-Loading-Mode` response
header に対する有効な tokens の
list に追加します:
`fenced-frame`
token は、その response が fenced navigable の内部で
Document
を作成するために使用できることを示します。この明示的な opt-in がない場合、fenced navigable 内のすべての
navigations は、§ 3.8 Navigation に概説されるように失敗します。
-
そうでなく、次の条件がすべて true である場合:
-
navigationParams の navigable の traversable navigable が fenced navigable である;
-
navigationParams の response の URL の scheme が "
https" である; かつ -
navigationParams の response について getting the supported loading modes を行った結果が `
fenced-frame` を 含まない
その場合、failure を true に設定します。
-
3.8.2.
`Allow-Fenced-Frame-Automatic-Beacons`
HTTP response header
その browsing context の fenced frame config
instance の mapped url と same
origin でない
Document
に読み込まれる document resource を、Allow-Fenced-Frame-Automatic-Beacons
HTTP response header とともに提供すると、その
Document
は、navigations を実行したときに automatic beacon events を trigger することへ opt in します。この header は
structured header であり、その値は boolean
でなければなりません。
3.8.3.
`Allow-Cross-Origin-Event-Reporting`
HTTP response header
fenced frame config instance によって
fencedframe
に読み込まれる document resource を、Allow-Cross-Origin-Event-Reporting
HTTP
response header とともに提供すると、その Document
の
cross-origin child navigables が
reportEvent()
beacons を送信できるよう opt in します。この header は structured
header であり、その値は
boolean でなければなりません。
3.8.4. COOP、COEP、および cross-origin isolation
この仕様の外では、`Cross-Origin-Opener-Policy`
header は、すべての navigables ではなく、top-level
traversables のみに 適用
され、この仕様も、この header が fenced navigables に影響せず、またその embedder から
継承されない限りにおいて、この意図を維持します。したがって、fenced traversable navigable の内部に
hosted される browsing context group
は、常にその cross-origin isolation mode が "none" に設定されます。
それでも、fenced navigable は、その unfenced parent の embedder policy に従います。これは以下で達成されます:
-
navigable の container document
次に置き換えます:
-
navigable の unfenced container document
注: これにより、
fencedframe
内の navigations は、適切な
`Cross-Origin-Embedder-Policy` header
とともに提供されない場合、
iframes
と同様に失敗します。
queue a cross-origin embedder policy inheritance violation アルゴリズムを fence する必要があるか unfence する必要があるかを判定します。unfenced のままにすると プライバシー漏洩を引き起こす可能性があります。
-
response が network error でなく、navigable が child navigable または fenced navigable であり、 かつ navigable の unfenced container document の origin、navigable の unfenced container document の relevant settings object、request の destination、response、および true を用いて cross-origin resource policy check を 実行した結果が blocked である場合、response を network error に設定し、break します。
注: ここでは cross-origin resource policy check を navigable 自身ではなく、 unfenced parent navigable に対して実行しています。 これは、navigation source ではなく、embedded content と embedder の context との same-originness("fence" を無視したもの)が重要だからです。
queue a cross-origin embedder policy CORP violation report アルゴリズムを fence する必要があるか unfence する必要があるかを判定します。unfenced のままにすると プライバシー漏洩を引き起こす可能性があります。
テスト
3.8.5. 実際の navigation の変更
- initiator fenced frame config instance
-
fenced frame config instance または null。 初期値は null。
- initiator ancestor root origin
-
origin または null。初期値は null。
- initiator ancestor root referrer policy
-
referrer policy または null。初期値は null。
- target fenced frame config
-
fenced frame config または null。初期値は null。
注: initiator fenced frame
config instance は、navigation initiator の browsing context に読み込まれている
fenced frame config instance です(存在する場合)。
initiator ancestor root
origin は、component ads では、top-level ad container の origin です(存在する場合)。
initiator ancestor root
referrer policy は、component ads では、top-level ad container の referrer policy です(存在する場合)。
これらは attempt to send an automatic beacon アルゴリズムで、
origin を比較し、
FenceReportingDestination
のどれに、どの情報で beacons を送信するかを決定するために使用されます。
これは
fencedframe
から開始された
navigation が成功した場合です。一方、target fenced frame config は、
fenced frames を対象とする navigations で
fencedframe
element に読み込まれる、まだ instantiated されていない fenced frame config です。
これらの fields は意味のある形で 一緒に 相互作用することはありません。
- attribution reporting enabled
- attribution reporting context origin
- automatic beacons allowed
- snapshot automatic beacon store
Document
sourceDocument が与えられたとき、
snapshot the automatic beacon data mapping するには:
-
Assert: これらの手順は sourceDocument の event loop 上で実行されています。
-
info を、新しい空の snapshot automatic beacon store とします。
-
mapping を info の data mapping とします。
-
crossOriginMapping を info の cross-origin exposed data mapping とします。
-
current navigable を sourceDocument の node navigable とします。
-
current navigable が null でない間 While:
-
current navigable の active document の automatic beacon data mapping の各 type → data について 反復します:
-
mapping[type] が 存在しない場合、 mapping[type] を data に設定します。
注: これにより、特定の type に対する automatic beacon data を含む最初の ancestor が、navigation を開始する document から利用可能であることが保証されます。 これはまた、ancestor が document に対して、より上位の ancestor で設定された data の使用を blocking することも防ぎます。
-
crossOriginMapping[type] が 存在せず、かつ data の crossOriginExposed が true である場合、crossOriginMapping[type] を data に設定します。
-
-
current navigable を current navigable の parent に設定します。
-
-
info を返します。
注: info に格納される maps は、
info を構築するために使われた元の Document
の
automatic beacon data mapping への参照を
保持することを意図しています。これらは後で attempt to send an automatic beacon 内で
変更され、once が true に設定された beacon data が消去されます。
Document
sourceDocument の
get the initiator’s fenced grand-ancestor’s
navigable を取得するには:
-
navigable を sourceDocument の node navigable とします。
-
navigable が null でなく、かつ navigable が fenced navigable でない間:
-
navigable を navigable の parent に設定します。
-
-
navigable が null である場合、null を返します。
-
Assert: navigable は fenced navigable です。
-
navigable を navigable の unfenced parent に設定します。
-
navigable が null でなく、かつ navigable が fenced navigable でない間:
-
navigable を navigable の parent に設定します。
-
-
navigable を返します。
Document
が
fencedframe
の内部に埋め込まれている場合、このアルゴリズムは、その document の最も近い fenced frame ancestor の
最も近い fenced frame ancestor の navigable を取得します。そのような "fenced frame grand-ancestor" が存在しない場合、
このアルゴリズムは null を返します。したがって、このアルゴリズムが navigable を返すのは、少なくとも、
それ自体が fenced frame の中にある fenced frame 内の Document が与えられた場合だけです。
たとえば、次の frame tree structure について:
Main frame (origin A)
<fencedframe> (origin B)
<iframe> (origin C)
<fencedframe> (origin D)
<iframe> (origin E)
<fencedframe> (origin F)
このアルゴリズムは、各 document が与えられたとき、次を返します:
-
Main frame (origin A)はnullを返します。 -
<fencedframe> (origin B)はnullを返します。 -
<iframe> (origin C)はnullを返します。 -
<fencedframe> (origin D)は<fencedframe> (origin B)を返します。 -
<iframe> (origin E)は<fencedframe> (origin B)を返します。 -
<fencedframe> (origin F)は<fencedframe> (origin D)を返します。
- initiator fenced frame config instance
-
sourceDocument の browsing context の fenced frame config instance
- initiator ancestor root origin
-
sourceDocument に対して get the initiator’s fenced grand-ancestor’s navigable を実行した結果が null である場合は null。 そうでない場合、sourceDocument の initiator’s fenced grand-ancestor’s navigable の active document の origin。
- initiator ancestor root referrer policy
-
sourceDocument に対して get the initiator’s fenced grand-ancestor’s navigable を実行した結果が null である場合は null。 そうでない場合、sourceDocument の initiator’s fenced grand-ancestor’s navigable の active document の policy container の referrer policy。
- attribution reporting enabled
-
sourceDocument が "
" feature を 使用することを許可されているかどうかを決定した結果attribution-reporting - attribution reporting context origin
-
sourceDocument の context origin
- automatic beacons allowed
-
sourceDocument の automatic beacons allowed
- snapshot automatic beacon store
-
sourceDocument に対して snapshot the automatic beacon data mapping を実行した結果。
-
document の relevant global object の navigable が fenced navigable である;
注: これにより、
fencedframe内の すべての navigations が、initiator にかかわらず、 "replace" mode で行われることが保証されます。
テスト
- history-back-and-forward-should-not-work-in-fenced-tree.https.html (ライブ テスト) (ソース)
- history-length-fenced-navigations-replace-do-not-contribute-to-joint.https.html (ライブ テスト) (ソース)
- history-length-outer-page-navigation-not-reflected-in-fenced.https.html (ライブ テスト) (ソース)
- history-length-outer-page-navigation-not-reflected-in-fenced-nested-iframe.https.html (ライブ テスト) (ソース)
[HTML] の navigate アルゴリズムのステップ 5 の後に、次のステップを追加します:
-
sourceDocument の node navigable を与えて determine if a navigable has revoked network for itself を実行した結果が true である場合、return します。
[HTML] の navigate アルゴリズムのステップ 13("If all of the following are true:")を変更し、 次の条件を含めます:
-
sourceDocument の node navigable が fenced navigable container ではなく、 同時に navigable が fenced navigable である。
注: これにより、embedder-initiated navigations が
fencedframe内で fragment navigation を 決して trigger できないことが保証されます。
ステップ 22、すなわち in parallel に入るステップの直後に、これらのステップを挿入します。 これにより、以下が patch されたアルゴリズムで in parallel に実行される最初の手順になります:
-
url が urn uuid であり、かつ navigable が fenced navigable である場合:
-
config を、sourceDocument の node navigable の traversable navigable の fenced frame config mapping 内で finding a config した結果とします。
注: これは、urn uuid url に関連付けられた config が fenced frame config mapping 内で "finalized" されるまで、任意の時間 "wait" する可能性があります。 これが、このステップが in parallel に実行される理由です。この navigation は、 その後 embedder-initiated navigations が発生した場合、ongoing navigation を追跡する通常の仕組みによって cancel される should です。
-
config の embedder shared storage context を sharedStorageContext に設定します。
-
Assert: sourceSnapshotParams の target fenced frame config は null です。
-
sourceSnapshotParams の target fenced frame config を config に設定します。
-
Assert: config の mapped url の value は、その scheme が "
https" である URL です。 -
url を config の mapped url の value に設定します。
-
config の on navigate callback 内の steps を実行します。
-
-
navigable が fenced navigable であり、かつ sourceDocument の node navigable が、unfenced を true に設定した navigable の active document の ancestor navigables 内にある場合:
-
config を、次の items を持つ新しい fenced frame config とします:
-
Assert: sourceSnapshotParams の target fenced frame config は null です。
-
sourceSnapshotParams の target fenced frame config を config に設定します。
-
"Let unloadPromptCanceled be the result of" で始まるステップを次のように書き換えます:
-
unloadPromptCanceled を、navigable が fenced navigable である場合は false、 そうでない場合は navigable の active document の inclusive descendant navigables について checking if unloading is user-canceled した結果とします。
ステップ 22.8.2(Let finalSandboxFlags be the union...)の後に、 次のステップを追加します:
-
sourceSnapshotParams の target fenced frame config が null でなく、 かつ sourceSnapshotParams の target fenced frame config の effective sandboxing flags が null でない場合、finalSandboxFlags を、 finalSandboxFlags と sourceSnapshotParams の target fenced frame config の effective sandboxing flags の value との union に設定します。
注: これにより、 finalSandboxFlags が target fenced frame config で定義される effective sandboxing flags と 少なくとも 同じくらい制限的であることが保証されます。blocked by sandboxing flags? アルゴリズム内の別のチェックにより、 finalSandboxFlags が effective sandboxing flags より制限的でないことが保証されます。
以下の patches は、事前に割り当てられた target fenced frame config を使用し、 navigation が finalized されるときに使用する準備として、それを instantiating します。
- fenced frame config instance
-
fenced frame config instance または null。 初期値は null。
注: これは embedder-initiated
fencedframenavigations の場合にのみ設定され、そのような navigation の結果として新しいDocumentが作成された場合、この member は新しい fenced navigable の active browsing context の fenced frame config instance member に転送されます。
- fenced frame config instance
-
sourceSnapshotParams の target fenced frame config が null である場合は null。そうでない場合、sourceSnapshotParams の target fenced frame config を instantiating した結果。
最後に、以下の patches は navigation params の fenced frame config instance を使用し、 navigation によって開始された browsing context の fenced frame config instance の assignment を扱います。
注: browsing context の fenced frame config instance は
2つの異なる方法で割り当てられます: (1) この節の残りで説明する embedder-initiated
fencedframe
navigation の間、および (2) child navigables 内で、その traversable navigable が fenced navigable である
Documents
の初期 Document
作成時に継承されます。これは § 3.3 browsing context 作成への変更 節で扱われます。
fencedframe
内の成功した navigation では、それが
fencedframe
内の content によって開始されたか、その embedder によって開始されたかにかかわらず、次の2つのうち
正確に1つが起こります:
-
Embedder-initiated navigations: navigation params の fenced frame config instance は、無条件に
fencedframeの fenced navigable container の fenced navigable の active browsing context の fenced frame config instance に 割り当てられます。 -
Inner-content-initiated navigations: 直前の項目で参照された fenced frame config instance は、この種の cross-
Documentnavigation を通して存続します。
-
navigationParams の fenced frame config instance が null でない場合:
-
Assert: browsingContext は navigationParams の navigable の active browsing context と等しくありません。
注: これは、 embedder-initiated navigations(navigationParams の fenced frame config instance が non-null であることにより示される)が常に § 3.8.6 Browsing context group swap を発生させるためです。
-
navigationParams の fenced frame config instance の cross-origin reporting allowed を、navigationParams の response の header list に対して、 `
Allow-Cross-Origin-Event-Reporting` と "item" を与えて get a structured field value を実行した結果に設定します。 -
browsingContext の fenced frame config instance を navigationParams の fenced frame config instance に設定します。
-
ステップ 9 の後に、次の新しいステップを追加します:
-
automaticBeaconsAllowed を、navigationParams の response の header list に対して、 `
Allow-Fenced-Frame-Automatic-Beacons` と "item" を与えて get a structured field value を 実行した結果とします。
さらに、ステップ 10(現在のステップ 12)を、新しい Document
を追加パラメーター付きで返すように書き換えます:
- automatic beacons allowed
-
automaticBeaconsAllowed。
-
navigable と sourceSnapshotParams を与えて determine if an embedder-initiated fenced frame navigation should be blocked を実行した結果が true である;
3.8.6. Browsing context group swap
fencedframe
の embedder が frame 内の navigations を開始するとき、frame 内の context を完全に reset し、次の
Document
に漏れ得るものが何も残らないようにするため、
browsing context group swap を実行しなければなりません。
-
次の条件がすべて true である場合:
-
navigable が fenced navigable である;
-
sourceSnapshotParams の fetch client が navigable の active document の relevant settings object では ない;
-
navigationParams が non-null である
その場合、navigationParams の COOP enforcement result の needs a browsing context group switch boolean を true に設定します。
これは実際に 動作しますが、fenced frames を念頭に置かずに設計された COOP の仕組みに便乗するのではなく、 これを実行するための別の mechanism を使うことを検討するべきです。COOP は進化して、この仕様に望ましくない side-effects を与える可能性があります。
-
3.8.7.
"_unfencedTop" navigation target
Fenced frames は、navigation のために追加の reserved navigation target "_unfencedTop" を使用します。
この節では、この新しい reserved keyword のサポートを追加するため、[HTML] spec の関連部分に patch を当てます。
_unfencedTop" という名前の新しい keyword を含めます。
下の paragraph を変更し、次のテキストを置き換えます:
-
"top" means the top-level traversable of the navigable that the link or script is in,
次に置き換えます:
-
"top" means the traversable navigable of the navigable that the link or script is in, "outermost top" means the top-level traversable of the navigable that the link or script is in,
注: この変更が必要なのは、この spec が traversable navigable と top-level traversable の間に 区別を追加し、これらは以前は機能的に同等だったためです。
下の table に、"Effect in a fenced frame" という名前の column を追加します。この column の既存の すべての行の値は "ordinary effect" と同じです。次に、次の2行を追加します:
| Keyword | Ordinary effect | Effect in an iframe with...
| Effect in a fencedframe>
| |
|---|---|---|---|---|
sandbox=""
| sandbox="allow-top-navigation"
| |||
_unfencedTop if outermost top is current
| new | maybe new | maybe new | current |
_unfencedTop if outermost top is not current
| new | maybe new | maybe new | outermost top |
6.5. そうでなく、name が "_unfencedTop" と ASCII case-insensitive match し、
currentNavigable の traversable navigable が fenced navigable である場合、
chosen を currentNavigable の top-level traversable に設定します。
3.9. Page visibility
Page visibility section of [HTML] は、 ユーザーエージェントが traversable navigable の system visibility state を変更するときに実行されるアルゴリズムの 最初のステップが、inclusive descendant navigables アルゴリズムを unfenced を true に設定して呼び出すように変更されます。
3.10. Events
3.10.1.
onfencedtreeclick
event handler
event handlers on elements, Document objects, and Window objects section of [HTML] の table は、新しい row を含むように変更されます。
| Event handler | Event handler event type |
|---|---|
onfencedtreeclick
| fencedtreeclick
|
GlobalEventHandlers
interface は次のように変更されます:
partial interface mixin GlobalEventHandlers {attribute EventHandler ; };onfencedtreeclick
さらに、任意の HTML element に指定できる event handler content attributes の list は、[HTML] で 新しい row を含むように変更されます:
3.10.2.
fencedtreeclick
event type
Events table in the
Index section of [HTML] は、新しい row を含むように変更されます。
| Event | Interface | Interesting targets | Description |
|---|---|---|---|
fencedtreeclick
| Event
| Elements |
fencedframe
element に対して、その
fenced navigable の Document
が notifyEvent()
を呼び出した後に非同期に発火されます
|
4. 他の仕様との相互作用
fencedframe
element と、それが navigable や browsing context group のような core concepts と相互作用する性質は、
必然的に cross-cutting であるため、この仕様に照らして usages を再評価しなければならない terms に依存する
仕様が多数あります。この節には、私たちが他の仕様に提案するさまざまな変更を置きます。
4.1. Prerendering
Prerendering Revamped specification は、navigable の loading mode と、それが取り得る値を定義しています。 私たちの仕様は fenced frames のために別の値を追加します:
- "
fencedframe" -
この navigable は
fencedframeの content を表示しています
4.2. Content Security Policy
この導入節は非規範的です。
Content Security Policy [CSP] は通常、
navigable container をホストする
Document
に関連付けられた web content によって、child navigable 内の navigations の source を制限するために使用できます。
[CSP] が、
fencedframe
内の navigations の URL を、その embedder を運用している site に露出する communication side-channel として
使用されることを防ぐため、
fencedframe
navigation に影響できる source
expressions は次のものだけです:
-
scheme-source "
https:" -
host-source "
https://*:*" -
string "
*"
これについて説明している CSP explainer を参照してください。
4.2.1. アルゴリズム
-
request の destination が "
fencedframe" であり、 かつこの directive の value が "https:", "https://*:*", または "*" のいずれも 含まない場合、 "Blocked" を返します。
-
request の destination が "
fencedframe" であり、 かつこの directive の value が "https:", "https://*:*", または "*" のいずれも 含まない場合、 "Blocked" を返します。
次に、[CSPEE] specification の挙動を変更します。embedding frame が required CSP を指定している場合、fenced frames は読み込まれません。 これは embedder から fenced frame への任意の data flow を防ぐために行われます。
-
context の required csp が
nullでなく、 かつ request の destination が "fencedframe" である場合、 "Blocked" を返します。
4.2.2. 新しい fenced-frame-src [CSP] directive
fencedframe
は
iframe
とは異なる element であるため、frame-src
directive を使用しても、web sites は CSP rules に対して十分な制御を得られません。新しい [CSP]
directive: fenced-frame-src を導入します。monkey-patched
specification
は以下のとおりです:
fencedframe
の
fenced navigable に読み込める
URLs を制限します。directive の name と value の syntax は、次の ABNF により記述されます:
directive-name = "fenced-frame-src" directive-value = serialized-source-list
Content-Security-Policy: fenced-frame-src https://example.com/
次の code に対する fetches は、提供された URL が fenced-frame-src の source
list と一致しないため、network error を返します:
< fencedframe src = "https://example.org/" > </ fencedframe >
Pre-request check と Post-request check は、 frame-src の check と同じになります。
Content-Security-Policy: connect-src 'self'; ... worker-src 'self'
現在は次のように書かれます:
Content-Security-Policy: connect-src 'self'; ... fenced-frame-src 'self'; ... worker-src 'self'
- "
fenced-frame-src" -
-
<< "fenced-frame-src", "frame-src", "child-src", "default-src" >>を返します。
-
- "
fencedframe" -
-
fenced-frame-srcを返します。
-
テスト
- ancestor-throttle.https.html (ライブ テスト) (ソース)
- csp-allowed.https.html (ライブテスト) (ソース)
- csp-blocked.https.html (ライブテスト) (ソース)
- csp-fenced-frame-src-allowed.https.html (ライブ テスト) (ソース)
- csp-fenced-frame-src-blocked.https.html (ライブ テスト) (ソース)
- csp-frame-src-allowed.https.html (ライブ テスト) (ソース)
- csp-frame-src-blocked.https.html (ライブ テスト) (ソース)
- csp-allowed-transparent.https.html (ライブ テスト) (ソース)
- csp-blocked-transparent.https.html (ライブ テスト) (ソース)
- csp.https.html (ライブテスト) (ソース)
- cspee.https.html (ライブテスト) (ソース)
- embedder-csp-not-propagate.https.html (ライブ テスト) (ソース)
4.3. Permissions Policies
この導入小節は非規範的です。
fencedframe
内の
Documents
で利用できる policy-controlled features と、
それらが計算される方法は、
fencedframe
が navigate する
fenced frame
config
がどのように構築されるかによって異なります。
web platform 上の FencedFrameConfig
constructor を介して作成された fenced frame config instance は、flexible な permissions policy behavior を持ち、
それが navigate する
fencedframe
の内部
Document
は、それらが fenced frame
allowed permissions list の一部である限り、permissions を継承することを許可されます。その他すべての
policy-controlled features は無効化されます。
fenced frame config instance が、
その effective enabled permissions を設定する
config-generating API を介して作成された場合、その instance は fixed
permissions policy behavior を持ち、
それが navigate する
fencedframe
の内部
Document
では、effective enabled permissions が、その
Document
で有効になる policy-controlled features の排他的な
list になります(それ以外はすべて無効化されます)。
fixed permissions policy behavior を持つ
fenced frame config instance への
fencedframe
navigation の間、それは navigate 先の fenced frame config instance の effective enabled
permissions を、結果として得られる Document
の
permissions policy の inherited policy と比較します。navigation は、
inherited policy value が "Enabled" である
inherited feature のそれぞれが、fenced frame config instance の
effective enabled
permissions にも現れる場合にのみ成功します。そうでない場合、
fencedframe
が埋め込まれている environment は、その fenced frame config に不適合と見なされ、
navigation はブロックされます。
同時に、
fencedframe
の
embedder が、その navigation の origin(origin は cross-site data から派生するため)に基づいて
frame 内の content に直接影響しないようにするため、この仕様はさまざまな [PERMISSIONS-POLICY] algorithms を変更し、
fencedframe
Document
の
inherited policy が、その origin
が embedder の origin と same
origin であるかどうかを考慮せずに計算されるようにします。
したがって、feature は、その embedder が the special value * allowlist を介して 明示的に delegate した場合にのみ、
fencedframe
内で有効化できます。
上記のすべてを考慮すると、fixed permissions policy behavior navigations について、 次の興味深い含意が得られます:
-
effective enabled permissions 内に 存在する feature が default allowlist として the special value * を持ち、かつ
fencedframeembedder に `Permissions-Policy` header が提供されず、allowattribute が空である場合、fencedframe内の navigation は成功し、その結果として得られるDocumentはその feature を 使用することを許可されます(つまり、有効になります)。 -
effective enabled permissions 内に 存在する feature が default allowlist として
'self'を持ち、かつfencedframeembedder に `Permissions-Policy` header が提供されず、allowattribute が空である場合、fencedframe内の navigation はブロックされます。注: これは、通常であれば、この feature は subframe の
Documentが embedder と same origin である場合にのみ有効になるためです。この仕様では fenced frames についてその check を避けます。なぜならfencedframes のDocumentの origin は cross-site data から派生するためです。したがって、私たちは単に "fail close" します。 -
effective enabled permissions 内に 存在する feature が default allowlist として
'self'を持ち、かつfencedframeのallowattribute がその feature を含むが allowlist を含まない場合、allowattribute section で説明される rules により、 feature のデフォルトの allowlist は'src'になります。これは embedder-supplied navigation URL を表すことを意図していますが、fencedframeを navigate するときにはそのようなものはありません。navigation URL は fenced frame config によって決定されるためです。 navigation はブロックされます。 -
effective enabled permissions 内に 存在する feature が default allowlist として
'self'を持つが、fencedframeの embedder で提供される `Permissions-Policy` header またはallowattribute のいずれかが、その feature の allowlist を the special value * に設定する場合、fencedframe内の navigation は成功し、結果として得られるDocumentはその feature を 使用することを許可されます。 -
fencedframe内の navigation がそうでなければ成功するが、fencedframe内の navigation 上の response が、effective enabled permissions 内の feature について、allowlist を "none" または互換性のない origin に設定する `Permissions-Policy` header とともに提供される場合でも、 navigation は成功しますが、fencedframe内のDocumentはその feature を 使用することを許可されません。注: これは問題ありません。なぜなら、 particular feature を無効化する決定を行っているのは
fencedframeの content 自身 であり、その embedder environment ではないためです。
下記の節の patches は、上記の説明内容で述べられた結果を達成するために、適切な [PERMISSIONS-POLICY] および [HTML] algorithms を "fence" します。
4.3.1. 定義
fenced
frame allowed permissions は、"private-aggregation",
"shared-storage", または "shared-storage-select-url" のいずれかです。
4.3.2. アルゴリズム patches
allow attribute of the iframe element section を "The allow
attribute of the iframe
and fencedframe element" に rename し、その section を次のように書き換えます:
iframe
および
fencedframe
elements はそれぞれ allow attributes
(iframe:
allow;
fencedframe:
allow)
を持ち、それらは ASCII-serialized policy directive を含みます。
attribute で named された features の allowlist は空でもよく、その場合、allowlist のデフォルト値は "src" です。これは iframe の
src
attribute 内の URL の origin、または fencedframe の fenced frame config を表します。
空でない場合、
iframe
の
allow
または
fencedframe
の
allow
attribute は、構築時に
iframe
または
fencedframe
の
container policy に、各 supported feature の allowlist を追加する結果になります。
fenced navigable container (container) と origin (origin) が与えられた場合、この algorithm は 新しい Permissions Policy を返します。
-
fencedFrameConfig を、container の node document の active browsing context の fenced frame config instance とします。
-
inheritedPolicy を新しい ordered map とします。
-
fencedFrameConfig が null でなく、かつ fencedFrameConfig の permissions policy behavior が fixed である場合:
-
-
fencedFrameConfig の effective enabled permissions が feature を 含む場合、 inheritedPolicy[feature] を "
Enabled" に設定します。そうでない場合、inheritedPolicy[feature] を "
Disabled" に設定します。
注: これは
allowattribute を考慮しませんが、これは呼び出される時点ではすでに Should navigation response to navigation request be blocked by Permissions Policy? により checked されています。allowで指定された policy が制限的すぎる場合、fenced frame は読み込まれないことになり、 effective enabled permissions で指定されたものより permissive な policy は無視されます。 -
-
-
そうでない場合:
-
-
feature が fenced frame allowed permissions のいずれかに一致する場合、inheritedPolicy[feature] を、 feature, container, および origin を与えて Define an inherited policy for feature in container at origin を実行した結果に設定します。
そうでない場合、inheritedPolicy[feature] を "
Disabled" に設定します。
-
-
-
policy を、inherited policy inheritedPolicy と、2つの新しい ordered maps に初期化された declared policy を持つ、新しい permissions policy とします。
-
policy を返します。
null または element (container)、origin (origin)、およびデフォルトが false の optional な boolean matchAll が与えられた場合、この algorithm は新しい permissions policy を返します。
ステップ 1 を次のように書き換えます:
-
Assert: null でない場合、container は navigable container または fenced navigable container のいずれかです。
ステップ 3 を次のように書き換えます:
-
-
isInherited を、feature, container, origin, および matchAll に対して Define an inherited policy for feature in container at origin を実行した結果とします。
-
inherited policy[feature] を isInherited に設定します。
-
null、navigable container-または-fenced navigable container (container)、origin (origin)、および response (response) が与えられた場合、この algorithm は新しい permissions policy を返します。
ステップ 1 を次のように書き換えます:
-
container が fenced navigable container である場合、 policy を、container と origin を与えて create a permissions policy for a fenced navigable を実行した結果とします。
そうでない場合、policy を、container と origin を与えて Create a Permissions Policy for a navigable を 実行した結果とします。
-
element が
iframeelement でもfencedframeelement でもない場合、空の policy directive を返します。
-
navigationParams を与えて should navigation response to navigation request be blocked by Permissions Policy? を実行した結果が "
Blocked" である; -
navigationParams と sourceSnapshotParams を与えて should navigation response to navigation request be blocked by sandboxing flags? を実行した結果が "
Blocked" である;
注: これらの algorithms のいずれかが
"Blocked" を返す場合、
fencedframe
内の既存の Document
は残らず、error page が読み込まれます。
navigation params (navigationParams) が与えられた場合、
この algorithm は "Blocked" または
"Allowed" を返します:
-
navigable を navigationParams の navigable とします。
-
navigable が fenced navigable でない場合、 "
Allowed" を返します。 -
origin を navigationParams の origin とします。
-
effective permissions を、navigable の active browsing context の fenced frame config instance の effective enabled permissions とします。
pull request #84 で省略された作業によると、config instance はまだ browsing context に割り当てられていません。 代わりに instance を navigationParams 内に格納し、ここから参照することを検討するべきです。
-
permissionsPolicy を、navigable の fenced navigable container, origin, および true を与えて creating a permissions policy を実行した結果とします。
注: これは、この pending navigation の最終的な
Documentを navigation が構築するときに created される permissions policy とほとんど同じです。 違いは、この algorithm が iframes で呼び出される場合と同様に、allowattribute で指定されたすべての permissions を含むことです。たとえその permission が fenced frame config の effective enabled permissions で指定されていなくてもです。navigation が失敗するかどうかを判断する適切な時点であるため、 ここでこれを作成して tests を実行し、その後破棄します。navigation が成功した場合、それは再作成され、Documentに無条件に install されます。しかし、再作成されたものには effective enabled permissions に含まれていない追加の enabled permissions は含まれず、 enabled permissions は実質的に effective enabled permissions で指定されたものだけに固定されます。 -
inheritedPolicy を permissionsPolicy の inherited policy とします。
-
effective permissions の各 effective permission について 反復します:
-
inheritedPolicy[effective permission] が "Disabled" である場合、 "
Blocked" を返します。
-
-
"
Allowed." を返します。
navigation params (navigationParams) と
source snapshot params
(sourceSnapshotParams) が与えられた場合、この algorithm は "Blocked" または
"Allowed" を返します:
-
navigable を navigationParams の navigable とします。
-
navigable が fenced navigable でない場合、 "
Allowed" を返します。 -
effectiveSandboxingFlags を、sourceSnapshotParams の target fenced frame config の effective sandboxing flags とします。
-
navigationParams の final sandboxing flag set が effectiveSandboxingFlags の subset でない場合、 "
Blocked" を返します。注: これは、final sandboxing flag set が、effective sandboxing flags ですでに制限されていない feature を制限できないことを意味します。追加の制限は communication channel として 使用され得るためです。この時点までに、final sandboxing flag set はすでに effective sandboxing flags と 少なくとも 同じくらい制限的なものに設定されています。
-
そうでない場合、"
Allowed" を返します。
feature (feature)、null または navigable container (container)、 その container 内の document の origin (origin)、およびデフォルトが false の optional な boolean matchAll が与えられた場合、この algorithm は、その feature の inherited policy を返します。
ステップ 3 を次のように書き換えます:
-
feature, container の node document, origin, および matchAll に対して Is feature enabled in document for origin? を実行した結果が "Disabled" である場合、 "Disabled" を返します。
注: step 2 も同じ algorithm に delegate しますが、
matchAll boolean を渡すように書き換える必要はありません。なぜなら step 2 は、
container の内部に hosted される Document
ではなく、container の node
document で
feature が enabled であるかを check することに関係するためです。
ステップ 7 を次のように書き換えます:
-
matchAll が false、feature の default allowlist が
'self'、かつ origin が container の node document の origin と same origin である場合、"Enabled"を返します。
feature (feature)、Document
object (document)、origin
(origin)、およびデフォルトが false の
optional な boolean matchAll が与えられた場合、この algorithm は、
feature が disabled と見なされるべきであれば "Disabled" を返し、
そうでなければ "Enabled" を返します。
ステップ 3 を次のように書き換えます:
-
feature が policy の declared policy に present である場合、
-
matchAll が false であり、かつ policy の declared policy にある feature の allowlist が origin と matches する場合、 "
Enabled" を返します。 -
そうでなく、matchAll が true であり、かつ policy の declared policy にある feature の allowlist が the special value * である場合、 "
Enabled" を返します。 -
そうでない場合、"
Disabled" を返します。
-
ステップ 5 を次のように書き換えます:
-
matchAll が false、feature の default allowlist が
'self'、かつ origin が document の origin と same origin である場合、 "Enabled" を返します。
-
node の node document の browsing context の fenced frame config instance が null でない場合、node の node document の browsing context の fenced frame config instance の mapped url を返します。
注: これにより、
allow
attribute に設定できる 'src' allowlist が、
fenced frame
config を使用して
fencedframe
を navigate する場合(または fenced
frame config に map する urn を使って
iframe
を navigate する場合)に機能することが保証されます。
テスト
- allow-attribute-src.https.html (ライブ テスト) (ソース)
- default-enabled-features-allow-all.https.html (ライブ テスト) (ソース)
- default-enabled-features-allow-none.https.html (ライブ テスト) (ソース)
- default-enabled-features-allow-self.https.html (ライブ テスト) (ソース)
- default-enabled-features-attribute-allow.https.html (ライブ テスト) (ソース)
- default-enabled-features-attribute-change.https.html (ライブ テスト) (ソース)
- default-enabled-features-attribute-disallow.https.html (ライブ テスト) (ソース)
- default-enabled-features-attribution-disabled.https.html (ライブ テスト) (ソース)
- default-enabled-features-subframe.https.html (ライブ テスト) (ソース)
- default-enabled-features-unset.https.html (ライブ テスト) (ソース)
- permission-api-denied-non-standard.https.html (ライブ テスト) (ソース)
- permission-api-denied.https.html (ライブ テスト) (ソース)
- permission-geolocation.https.html (ライブ テスト) (ソース)
- permission-notification.https.html (ライブ テスト) (ソース)
4.4. CSSOM View
[CSSOM-VIEW]
specification は、scrollIntoView()
method を定義しており、それは
scroll a target into view algorithm を呼び出します。これは
target を visible にするために Element
または
viewport を scroll するだけでなく、必要に応じて ancestors も scroll して
target を visible にし、本質的に scroll が "bubble up" することを引き起こします。これは、
scrollIntoView()
が child navigable または fenced navigable 内で実行されると、その
embedder から観測でき、fenced frame
boundary をまたいだ collusion を可能にすることを意味します。この節では、その
collusion を防ぐため、ある程度の utility を犠牲にして、scroll a target into view algorithm に patch を当てます。
-
scrolling box の associated
Elementの associatedDocumentの node navigable の traversable navigable が fenced navigable である場合、または scrolling box の associated viewport の associatedDocumentの node navigable の traversable navigable が fenced navigable である場合、 これを、この後に続くはずだったさらなる recursive instances を停止する、この algorithm の最後の instance とします。
注: これにより、scrolling は fenced frame boundary までは "bubble up" できますが、それを越えることはできません。
4.5. Iframe credentialless
この最初の導入節は非規範的です。
[IFRAME-CREDENTIALLESS] specification は、新しい object である page credentialless nonce を定義します。高いレベルでは、partition nonce は page credentialless nonce と同じ 目的(storage と network の partitioning)を果たします。しかし、各 fenced frame は固有の nonce を持つ一方、page credentialless nonce は traversable navigable の active window に scoped された単一のものであり、すべての descendent credentialless iframes に共有されます。
fenced frames と credentialless iframes が同じ tree に存在する場合、child の nonce は 常に parent のものより優先されます。例:
-
credentialless iframe が fenced frame の child である場合、その iframe の resources を partition するために page credentialless nonce が 使用されます。
-
fenced frame が credentialless iframe の child である場合、fenced frame の partition nonce が resources を partition するために使用されます。
resource partitioning に加えて、partition nonce は fenced frames で network access を revoke するためにも使用されます。以下の monkeypatches を [IFRAME-CREDENTIALLESS] spec に適用します。
次の algorithm を追加します:
-
credentialless が true である場合、associated browsing context の top-level browsing context の page credentialless nonce を返します。
-
newFencedFrameNonce が null でない場合、newFencedFrameNonce を返します。
-
instance を、associated browsing context の fenced frame config instance とします。
-
instance が null でない場合は instance の partition nonce を返し、 そうでない場合は null を返します。
network partition key は、次のものから成る tuple です:
-
site。
-
null または implementation-defined value。
-
nonce(null または implementation-defined value)。
create navigation params by fetching で、 18 と 19 の間に、次のように書かれた新しい step を追加します:
-
partitionNonce を、browsingContext について、 browsingContext で navigation’s credentialless flag を計算した結果と null を与えて、computing the effective partition nonce を実行した結果とします。
注: ここで computing the effective partition nonce に null を渡すのは、 fenced frame から発生した navigation fetches が fenced frame 自身と同じ partition を使用することを望むためです。 navigation fetch が完了して document を initialize した後は、fenced frame config instance の partition nonce を介して 正しい partition nonce に access できます。
step 19 を 20 に renumber し、step 20.2.4 を次のように書き換えます:
-
request の reserved client を、新しい environment に設定します。その id は unique opaque string、target browsing context は navigable の active browsing context、creation URL は currentURL、top-level creation URL は topLevelCreationURL、top-level origin は topLevelOrigin、そして partition nonce は partitionNonce.
6.9. partitionNonce を、browsingContext について、navigationParams の credentialless と、 navigationParams の fenced frame config instance が null である場合は null、そうでなければ navigationParams の fenced frame config instance の partition nonce を与えて computing the effective partition nonce を実行した結果とします。
4.6. WebRTC
[WEBRTC] specification は、「media と generic
application data を、適切な real-time protocols の集合を実装している別の browser または device へ送信し、
そこから受信することを可能にする WebIDL における ECMAScript APIs」を定義します。peers への connections を容易にする
interface は
RTCPeerConnection
です。この interface の construction、したがって
WebRTC を介した peers への connection は、fenced frames では許可されません。
RTCPeerConnection
constructor
algorithm を変更し、新しい first および
second steps を追加します。内容は次のとおりです:
-
navigable を、this の relevant global object の navigable とします。
-
navigable が null でなく、かつ navigable の traversable navigable が fenced navigable である場合、
NotAllowedErrorDOMExceptionを throw します。
5. Security & Privacy に関する考慮事項
この material は私たちの explainer からこの specification へ upstream されている最中であり、その間は 次の resources を参照できます: