펜스드 프레임

초안 커뮤니티 그룹 보고서,

이 버전:
https://wicg.github.io/fenced-frame/
편집자:
Dominic Farolino (Google)
(Google)
참여:
GitHub WICG/fenced-frame (새 이슈, 열린 이슈)
커밋:
GitHub spec.bs 커밋
테스트 스위트:
https://wpt.fyi/results/fenced-frame/

초록

펜스드 프레임은 임베딩 페이지와 크로스 사이트 임베드 문서 사이에 경계를 적용하여, 두 사이트에 보이는 사용자 데이터를 서로 결합할 수 없도록 한다.

이 문서의 상태

이 명세는 웹 플랫폼 인큐베이터 커뮤니티 그룹에서 게시했다. 이는 W3C 표준이 아니며 W3C 표준화 트랙에 있지도 않다. W3C 커뮤니티 기여자 라이선스 계약 (CLA)에 따라 제한적인 옵트아웃 및 기타 조건이 적용됨에 유의하라. W3C 커뮤니티 및 비즈니스 그룹에 대해 자세히 알아보기.

1. 소개

이 섹션은 비규범적이다.

쿠키와 저장소가 최상위 프레임 사이트별로 파티셔닝된 웹에서는, [Protected-Audience] API가 제공하는 관심 그룹 기반 광고나 전환 리프트 측정)과 같이, 같은 페이지 안에서 서로 다른 파티션의 콘텐츠를 표시하는 것이 유용한 경우가 있다. 이는 서로 다른 파티션의 데이터를 담고 있는 Document들이 서로 격리되어, 같은 페이지에서 시각적으로 함께 구성되더라도 통신할 수 없는 경우에만 개인정보 보호를 보존하는 방식으로 수행될 수 있다. iframe 요소는 임베더와 의도적인 통신 채널을 많이 제공하므로 이에 적합하지 않다. 이 명세는 페이지에 Document를 임베드하기 위한 새 요소인 fencedframe 요소를 도입하며, 이 요소는 Document와 그 임베더 사이의 통신을 명시적으로 방지한다.

이 명세는 새 요소, § 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 요소는 자신의 펜스드 내비게이블나타낸다.

fencedframe 요소의 자손은 아무것도 나타내지 않는다.

fencedframe에는 config가 있으며, 이는 FencedFrameConfig 또는 null이다. 처음에는 null이다.

fencedframe에는 fencedframe sandboxing flag set가 있으며, 이는 샌드박싱 플래그 집합이다. 특정 시점에 fencedframe sandboxing flag set에서 어떤 플래그가 설정되는지는 fencedframe 요소의 sandbox 속성에 의해 결정된다.

생성 샌드박싱 플래그 결정 알고리즘을 수정한다. union의 두 번째 단계를 다음 2단계로 다시 작성한다:
fencedframe 요소 element가 null이 아닌 브라우징 컨텍스트를 가진 문서에 삽입될 때, 다음 단계를 실행한다:
  1. nested traversableelement에 대해 새 중첩 순회 가능 항목을 생성한 결과로 둔다.

  2. nested traversable로딩 모드를 "fencedframe"로 설정한다.

  3. elementsandbox 속성을 가지면, 그 속성의 값과 elementfencedframe sandboxing flag set을 주어 샌드박싱 지시문을 파싱한다.

일반적인 자식 내비게이블 생성 또는 최상위 순회 가능 항목 생성 중에 하는 것처럼 URL 및 히스토리 업데이트 단계를 호출할 필요는 없지만, 새 내비게이블에서 History.length를 초기화할 메커니즘은 여전히 필요하다. 이는 HTML Standard의 기존 이슈이다: https://github.com/whatwg/html/issues/9030.

fencedframe 요소가 문서에서 제거되면, 사용자 에이전트는 다음 단계를 실행해야 한다:
  1. TODO: 중첩 순회 가능 항목을 파괴한다.

  2. 병렬로, Document노드 내비게이블최상위 순회 가능 항목을 주어 모든 펜스드 프레임 자손의 신뢰할 수 없는 네트워크 상태를 다시 계산한다.

config IDL 속성 getter 단계는 thisconfig를 반환하는 것이다.

config IDL 속성 setter 단계는 다음과 같다:
  1. this연결되어 있지 않다면:

    1. Assert: this펜스드 내비게이블은 null이다.

      Note: 요소가 DOM에서 제거되었을 때, 그 제거 단계가 즉시 펜스드 내비게이블을 파괴하므로 이것이 성립한다.

  2. instancethis관련 전역 객체브라우징 컨텍스트펜스드 프레임 설정 인스턴스로 둔다.

  3. instance가 null이 아니고, 그 신뢰할 수 없는 네트워크 상태enabled가 아니면, 반환한다.

  4. navigation url or urn을 주어진 FencedFrameConfigurl이 null이 아닌 경우 그 url로, 그렇지 않으면 주어진 FencedFrameConfigurn으로 둔다.

  5. navigation url or urn이 failure이면 반환한다.

  6. shared storage context를 주어진 FencedFrameConfigsharedStorageContext로 둔다.

  7. element펜스드 내비게이블navigation url or urn으로 Navigate하되, element노드 문서를 사용하고, historyHandling을 "replace"로, referrerPolicy"no-referrer"로 설정하고, shared storage context를 사용한다.

    Note: 일반 내비게이션 흐름에 대한 fencedframe별 변경 사항은 § 3.8.5 실제 내비게이션 변경을 보라.

테스트

allow 속성은 지정될 때, Document권한 정책fencedframe펜스드 내비게이블 안에서 초기화될 때 사용될 컨테이너 정책을 결정한다. 그 값은 직렬화된 권한 정책이어야 한다. [PERMISSIONS-POLICY]

sandbox 속성은 지정될 때, fencedframe에서 호스트되는 모든 콘텐츠에 추가 제한 집합을 활성화한다. 그 값은 공백으로 구분된 고유 토큰의 순서 없는 집합이어야 하며, 이 토큰들은 ASCII 대소문자 비구분이다. 허용되는 값은 다음과 같다:

IDL 속성 allowsandbox는 같은 이름의 각각의 콘텐츠 속성을 반영해야 한다.

sandboxDOMTokenList에 대해 지원되는 토큰은 sandbox 속성에 정의되고 사용자 에이전트가 지원하는 허용 값이다.

다음 속성 변경 단계element, localName, oldValue, value, 그리고 namespace가 주어졌을 때 모든 fencedframe 요소에 사용된다:
  1. Assert: namespaceHTML 네임스페이스이다.

  2. localNamesandbox이면, 다음을 실행한다:

    1. value가 null이면, elementfencedframe sandboxing flag set비운다.

    2. 그렇지 않으면, valueelementfencedframe sandboxing flag set을 주어 샌드박싱 지시문을 파싱한다.

2.1. 치수 속성

이 섹션은 [HTML]치수 속성 섹션에 대한 몽키패치를 자세히 설명한다. 해당 섹션은 [HTML]에 정의된 일반 widthheight 치수 속성에 적용되는 동일한 작성자 요구사항을 자신의 widthheight 치수 속성에 적용받는 요소 목록에 fencedframe을 포함하도록 업데이트될 것이다.

또한, IDL 속성 widthheight는 같은 이름의 각각의 콘텐츠 속성을 반영해야 한다.

2.2. 펜스드 프레임 설정 매핑

순회 가능 내비게이블펜스드 프레임 설정 매핑을 가지며, 이는 펜스드 프레임 설정 매핑이다.

Note: 이 매핑은 내비게이션 중에 참조되며, 우리가 구어적으로 URN 생성 API 또는 설정 생성 API라고 부르는 것들이 fencedframeiframe 요소를 내비게이트하는 데 사용할 urn uuid펜스드 프레임 설정을 모두 생성하면서 이 매핑에 쓴다. 예를 들어 [Protected-Audience] API 및 [Shared-Storage] 명세를 보라.

펜스드 프레임 설정 매핑은 세 가지 하위 매핑을 가진다:

pending config mapping

map이며, 그 urn uuid이고 그 펜스드 프레임 설정이다

finalized config mapping

map이며, 그 urn uuid이고 그 펜스드 프레임 설정이다

nested config mapping

map이며, 그 urn uuid이고 그 펜스드 프레임 설정이다

Note: pending config의 목적은 설정 생성 API가 교차 사이트 데이터에 의존하는 시간이 걸리는 계산 이전에, 일정한 시간 안에 pending config를 웹 플랫폼에 반환함으로써 타이밍 사이드 채널을 만들지 않는 방식으로 설정을 비동기적으로 해결할 수 있게 하는 것이다. 이 개인정보 보호는 웹 플랫폼이 pending config가 언제 finalized되는지 알아낼 수 없다는 점에 달려 있으므로, FencedFrameConfig의 getter를 통해 검사할 수 있다는 점을 고려하면 모든 가시성과 투명 필드의 값이 pending config에서 finalized config로 바뀌지 않는 것이 중요하다. 따라서 웹 플랫폼에 노출되도록 생성된 FencedFrameConfigconfigurn이 나타내는 펜스드 프레임 설정이 기술적으로 "pending"이고 나중에 완전히 해결되더라도 사실상 불변이다.

펜스드 프레임 설정 매핑에는 최대 설정 수가 있으며, 이는 구현 정의이다. 최대 설정 수는 음이 아닌 수 또는 무한대일 수 있다.

Note: 최대 설정 수의 동작을 명시하는 것이 중요한 이유는 그 의미가 개인정보 보호에 민감한 방식으로 설정 생성 API와 상호작용할 수 있기 때문이다.

높은 수준에서, 펜스드 프레임 설정 매핑펜스드 프레임 설정을 저장하려면, 설정의 생성자는 먼저 pending config를 저장한 다음 pending config를 finalized config로 바꿔야 한다. 그 절차는 다음과 같다:

펜스드 프레임 설정 매핑 mapping펜스드 프레임 설정 config가 주어졌을 때 pending config를 저장하려면, 다음 단계를 실행한다:
  1. pendingMappingmappingpending config mapping으로 둔다.

  2. pendingMapping크기 + mappingfinalized config mapping크기mapping최대 설정 수 이상이면 failure를 반환한다.

  3. urn을 무작위로 생성한 urn uuid로 둔다.

  4. Assert: urnpendingMapping존재하지 않는다.

  5. pendingMapping[urn]을 config설정한다.

  6. urn을 반환한다.

펜스드 프레임 설정 매핑 mappingurn uuid urn펜스드 프레임 설정 config가 주어졌을 때 pending config를 finalize하려면, 다음 단계를 실행한다:
  1. pendingMappingmappingpending config mapping으로 둔다.

  2. finalizedMappingmappingfinalized config mapping으로 둔다.

  3. pendingMapping[urn]이 존재하지 않으면 failure를 반환한다.

  4. pendingMapping[urn]을 제거한다.

  5. finalizedMapping[urn]을 config설정한다.

펜스드 프레임 설정 매핑 mapping중첩 설정 nestedConfigs가 주어졌을 때 중첩 설정을 저장하려면, 다음 단계를 실행한다:
  1. nestedMappingmappingnested config mapping으로 둔다.

  2. nestedConfigs가 null이면 반환한다.

  3. nestedConfigs의 각 urnconfig에 대해 For each:

    1. nestedMapping[urn]을 config설정한다.

    2. nestedMapping[urn]의 is ad component를 true로 설정한다.

펜스드 프레임 설정 매핑 mappingurn uuid urn이 주어졌을 때 그 안에서 설정을 찾으려면, 다음 단계를 실행한다:
  1. nestedMappingmappingnested config mapping으로 둔다.

  2. pendingMappingmappingpending config mapping으로 둔다.

  3. finalizedMappingmappingfinalized config mapping으로 둔다.

  4. nestedMapping[urn]이 존재하면, 그 값을 반환한다.

  5. pendingMapping[urn]이 존재하면, 그것이 존재하지 않을 때까지 기다린다.

  6. finalizedMapping[urn]이 존재하면, 그 값을 반환한다.

  7. failure를 반환한다.

2.3. 펜스드 프레임 설정

2.3.1. 소개

이 섹션은 비규범적이다.

fencedframe 요소의 핵심 기능은, 보안 및 개인정보 보호상의 이유로 다른 실행 컨텍스트가 이 설정을 수정하거나 검사할 수 있는 능력을 제한하는 방식으로 웹 플랫폼 API가 프레임의 동작을 구성할 수 있다는 것이다. 예를 들어 [Protected-Audience] API는 교차 사이트 데이터에 대해 온디바이스 광고 경매를 수행하며, 경매에서 이긴 광고가 프레임 안에 로드될 수 있으면서도 API 호출자는 어떤 광고가 경매에서 이겼는지 알 수 없고 그 광고가 로드되는 환경을 조작할 수도 없도록 하는 것이 중요하다.

이를 위해 "펜스드 프레임 설정" 개념을 사용한다. 펜스드 프레임 설정fencedframe 요소에 로드될 수 있고 결과 환경을 지정하는 필드들의 모음이다. 펜스드 프레임 설정은 특정 웹 플랫폼 API에 의해서만 생성될 수 있으며, 스크립트로 구성하거나 수정할 수 없다. 그 필드에는 "가시성"도 포함되며, 이는 FencedFrameConfig 인터페이스를 통해 검사될 때 해당 필드가 "redacted"되어야 하는지를 지시한다. [Protected-Audience][Shared-Storage] API와 같은 설정 생성 API는 각 필드의 개인정보 보호 영향을 검토했음을 보장하기 위해 자신의 펜스드 프레임 설정의 모든 필드에 값을 지정해야 하며, 다만 그 값을 null로 설정할 수는 있다.

fencedframe펜스드 프레임 설정으로 내비게이트할 때마다, 그것은 펜스드 프레임 설정 인스턴스로 새로 인스턴스화되며, 이는 펜스드 내비게이블 안의 특정 브라우징 컨텍스트 그룹을 지배한다.

2.3.2. 사용 사례

광고 경매를 통해 생성된 광고 렌더링:

광고 경매 API는 경매를 실행하고 낙찰 광고를 결정한다. 낙찰 광고에 대한 세부 사항은 임베더로부터 숨겨져야 하며, 임베딩 컨텍스트는 fencedframe의 환경에 영향을 줄 수 없어야 한다. 이 둘 중 하나라도 가능하면 정보가 펜스드 프레임 경계를 넘어 흐를 수 있고, 공모하는 당사자들이 교차 사이트 데이터를 결합하여 사용자 프로필을 만들 수 있다. 이를 방지하기 위해, 광고 경매 API는 그 기반 URL이 임베딩 컨텍스트에 불투명한 펜스드 프레임 설정구성한다. 펜스드 프레임 설정은 또한 프레임의 컨테이너 크기콘텐츠 크기, 그리고 프레임의 권한 정책이 무엇이어야 하는지에 대한 제한과 함께 구성되며, 이들은 지문 채취 벡터로 사용될 수 있기 때문이다.

개인화된 결제 버튼 표시:

전자상거래 사이트는 "Pay now" 버튼이 있는 fencedframe을 임베드한다. 전자상거래 사이트는 사용자의 신용카드 정보를 브라우저에 일급 저장소로 저장한다. 처음에는 Documentfencedframe 안에 호스트되더라도 일급 쿠키/저장소 접근 권한이 없으므로, 신용카드 정보가 교차 사이트 데이터와 결합될 위험 없이 정보가 자유롭게 드나들 수 있다. 그 때문에, 펜스드 프레임은 개인정보 보호를 손상시키지 않고 FencedFrameConfig 생성자를 사용해 웹 플랫폼에서 직접 구성될 수 있다. 이 시점의 버튼은 아직 신용카드 데이터에 접근할 수 없으므로 개인화된 데이터가 없다. DocumentdisableUntrustedNetwork()를 통해 모든 네트워크 접근을 끈 뒤에만 해당 신용카드 데이터를 읽을 수 있으며, 이를 통해 데이터가 펜스드 프레임 밖으로 흘러나가거나 교차 사이트 데이터와 결합되어 사용자 프로필을 만드는 것을 방지한다. 이렇게 하고 나면, 버튼은 전자상거래 플랫폼의 origin에 대한 일급 저장소 파티션 안에 브라우저에 저장되어 있는 사용자의 신용카드 번호 마지막 4자리를 표시하게 된다.

2.3.3. 펜스드 프레임 설정 구조체

이제 몇 가지 예비 타입을 정한다:

visibility는 "opaque" 또는 "transparent" 중 하나이다.

size는 다음 항목을 가진 구조체이다:

width

음이 아닌 정수

height

음이 아닌 정수

TODO: 이 멤버들에 대해 다른 숫자 타입을 고려한다.

interest group descriptor는 다음 항목을 가진 구조체이다:

owner

origin

name

문자열

permissions policy behavior는 "fixed" 또는 "flexible" 중 하나이다.

default fenced frame effective sandboxing flags는 다음 플래그를 가진 샌드박싱 플래그 집합이다:

pending event는 다음 항목을 가진 구조체이다:

destination

FenceReportingDestination

event

destination event

request initiator

origin

initiator referrer policy

referrer policy

reporting destination info는 다음 항목을 가진 구조체이다:

reporting url declarer origin

origin

reporting url map

map이며, 그 문자열이고 그 URL이다

reporting macro map

null 또는 map이며, 그 문자열이고 그 문자열이다

fenced frame reporting mapFenceReportingDestination로 갖는 map이며, 그 은 다음 중 하나이다:

Note: 이 표현은 설정 생성 API가 펜스드 프레임 설정을 이미 구성하고 반환한 뒤에도(그리고 설정이 로드되고, 펜스드 프레임 내부에서 이벤트 보고서가 생성된 뒤에도) 보고 대상 값들을 비동기적으로 해결함으로써 지연 시간을 줄일 수 있게 하려는 것이다. 설정 생성 API가 fenced frame reporting map을 선언할 때, 특정 대상을 빈 list를 사용해 pending으로 표시하고, 나중을 위해 그 map에 대한 참조를 유지할 수 있다. 대상이 아직 pending인 동안 펜스드 프레임이 해당 대상으로 이벤트를 보고하려 하면, 나중 처리를 위해 이 list에 이벤트를 저장한다. 설정 생성 API 또는 그 콜백이 자신이 유지한 참조를 통해 결국 보고 대상을 finalize하면, 이 list에 저장된 모든 pending event를 처리한다. 대상이 결코 finalized되지 않으면, pending event는 결코 전송되지 않는다.

untrusted network status는 "enabled", "disabled for this tree", 또는 "disabled for this tree and fenced subtrees" 중 하나이다.

Note: Disabled for this tree는 최종 네트워크 차단 상태가 아니다. 이는 프레임 트리 안에서 펜스드 프레임 경계를 넘지 않는 모든 프레임의 네트워크 접근은 철회되었지만, 적어도 하나의 하위 펜스드 프레임 트리는 여전히 네트워크 접근을 가지고 있는 중간 상태이다. 이 단계에서 특별한 API 접근 권한을 얻지는 않는다. 그 접근 권한을 통해 얻은 모든 정보는 네트워크 접근 권한이 있는 하위 펜스드 프레임을 통해 여전히 유출될 수 있기 때문이다. 모든 하위 펜스드 프레임도 신뢰할 수 없는 네트워크를 비활성화하면, 펜스드 프레임의 상태는 최종 disabled for this tree and fenced subtrees 상태로 전환된다.

fenced frame reporting map reporting map, FenceReportingDestination destination, origin reporting url declarer origin, map destination map(그 문자열이고 그 url), 그리고 null 또는 mapmacro map(그 문자열이고 그 문자열)이 주어졌을 때, 보고 대상을 finalize하려면 다음 단계를 실행한다:
  1. reporting map[destination]이 list임을 Assert한다 (즉, destination의 메타데이터가 아직 finalized되지 않았음을 의미한다).

  2. pending event listreporting map[destination]으로 둔다.

  3. reporting map[destination]을 다음 항목을 가진 구조체설정한다:

    reporting url declarer origin

    reporting url declarer origin

    reporting url map

    destination map

    reporting macro map

    macro map

  4. pending event list의 각 pending event에 대해 For each:

    1. destination map, pending eventevent, pending eventrequest initiator, 그리고 pending eventinitiator referrer policy를 사용해 비콘을 전송한다.

fenced frame reporting metadata는 다음 항목을 가진 구조체이다:

fenced frame reporting map

fenced frame reporting map

direct seller is seller

boolean, 처음에는 true

allowed reporting origins

null 또는 listorigin. origin은 destination URL event 보고의 대상이 되려면 이 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_navigationreserved.top_navigation_commit의 이전 이름이다. 둘은 같은 일을 하지만, reserved.top_navigation은 앞으로 제거될 예정이므로 새 코드에는 사용하지 않아야 한다.

fenced frame reporter는 다음 항목을 가진 구조체이다:

fenced frame reporting metadata reference

fenced frame reporting metadata에 대한 가변 참조 TODO: 포인터/참조를 더 명세다운 방식으로 처리한다

destination enum event는 다음 항목을 가진 구조체이다:

type

문자열

data

문자열

attributionReportingEnabled

boolean

attributionReportingContextOrigin

origin

destination URL eventURL이다.

automatic beacon event는 다음 항목을 가진 구조체이다:

type

automatic beacon event type

data

문자열

attributionReportingEnabled

boolean

attributionReportingContextOrigin

origin

destination eventdestination enum event, destination URL event, 또는 automatic beacon event 중 하나이다.

reporting destination info destination info, destination event event, origin request initiator, 그리고 referrer policy initiator referrer policy가 주어졌을 때 비콘을 전송하려면 다음 단계를 실행한다:
  1. destination url을 빈 문자열로 둔다.

  2. attributionReportingEligibility를 "unset"으로 둔다.

  3. processResponse를 null로 둔다.

  4. useParallelQueue를 false로 둔다.

  5. eventdestination enum event 또는 automatic beacon event 중 하나이면, 다음을 실행한다:

    1. destination mapdestination inforeporting url map으로 둔다.

    2. eventType을, event가 어떤 변종인지에 따라 eventdestination type 또는 automatic type으로 둔다.

    3. destination map[eventType]이 존재하지 않으면 반환한다.

    4. destination urldestination map[eventType]로 설정한다.

    5. eventattributionReportingEnabled가 true이고 eventattributionReportingContextOrigin적합하면:

      1. eventeventTypeautomatic beacon event type 값 중 하나와 일치하면, attributionReportingEligibility를 "navigation-source"로 설정한다.

      2. 그렇지 않으면, attributionReportingEligibility를 "event-source"로 설정한다.

      3. response response가 주어졌을 때의 다음 단계를 processResponse로 설정한다:

        1. fenced를 true로 둔다.

        2. eventattributionReportingContextOrigin, attributionReportingEligibility, fenced, 그리고 response를 사용해 attribution eligible response를 처리한다.

      4. useParallelQueue를 true로 설정한다.

  6. 그렇지 않으면:

    1. Assert: eventdestination URL event이다.

    2. macro mapdestination inforeporting macro map으로 둔다.

    3. macro map이 null이면 반환한다.

    4. destination urlevent로 설정한다.

    5. destination urlmacro map으로 destination url매크로를 치환한 결과로 둔다.

  7. 선택적으로 반환한다.

    Note:구현 정의 조건은 사용자 에이전트가 여러 이유로 비콘을 삭제할 수 있게 하려는 것이다. 예를 들어 사용자 opt-out 또는 destination urlsite등록되어 있지 않은 경우가 있다.

  8. request를 다음 속성을 가진 새 request로 둔다:

    method

    eventdestination enum event이면 POST, 그렇지 않으면 GET.

    URL

    destination url

    header list

    header 하나를 포함하는 새 header list. 그 name"Content-Type"이고 value"text/plain"이다.

    body

    eventdestination enum event이면, eventdatasource로 가진 body, 그렇지 않으면 null.

    client

    null

    service-workers mode

    "all"

    기본값은 "all"이므로 기술적으로 여기서 아무것도 설정하지 않아도 된다. 다만 일부 다른 비콘처럼 여기서는 서비스 워커를 건너뛰는 것이 더 적절할 수 있음을 스스로 상기하기 위해 이렇게 한다.

    origin

    eventdestination URL event이면 request initiator, 그렇지 않으면 destination inforeporting url declarer origin.

    Note: destination URL event의 보고 대상은 reportEvent()를 호출하는 Document에 의해 결정된다. 이는 이 Document를 로드한 펜스드 프레임 설정을 만든 worklet에서 보고 대상이 결정되는 destination enum eventautomatic beacon event와는 다르다. 교차 사이트 요청 위조를 방지하기 위해 origin을 보고 대상을 결정한 Document 또는 worklet의 origin으로 설정한다.

    referrer

    request initiator

    referrer policy

    initiator referrer policy

    mode

    "cors"

    credentials mode

    "omit"

    Attribution Reporting eligibility

    attributionReportingEligibility

  9. requestFetch하되, processResponse가 null이 아니면 processResponseprocessResponse로 하고, useParallelQueueuseParallelQueue로 한다.

    Note: 이 알고리즘은 병렬 상태에서 또는 Document의 메인 스레드에서 호출될 수 있다. 병렬 호출을 올바르게 처리하기 위해, 선택적 response 처리 알고리즘이 사용될 때 fetchuseParallelQueue를 true로 설정하여 호출한다. 그 외의 경우에는 이 알고리즘이 다른 인스턴스에서 병렬로 실행 중이더라도 이를 수행할 필요가 없다.

fenced frame reporter reporter, FenceReportingDestination destination, origin request initiator, referrer policy initiator referrer policy, 그리고 destination event event를 사용해 이벤트를 보고하려면, 다음 단계를 실행한다:
  1. metadatareporterfenced frame reporting metadata reference로 둔다.

  2. destination"direct-seller"이면:

    1. metadatadirect seller is seller가 true이면, destination"seller"로 설정한다.

    2. 그렇지 않으면, destination"component-seller"로 설정한다.

  3. eventdestination URL event이면:

    1. eventoriginmetadataallowed reporting origins 안의 어떤 항목과도 same origin이 아니면:

      1. metadataattempted custom url report to disallowed origin을 true로 설정한다.

    2. metadataattempted custom url report to disallowed origin이 true이면 반환한다.

  4. reporting mapmetadatafenced frame reporting map에 대한 참조로 둔다.

  5. reporting map[destination]이 존재하지 않으면 반환한다.

  6. reporting map[destination]이 list이면:

    1. newEvent를 다음을 가진 새 pending event로 둔다:

      destination

      destination

      event

      event

      request initiator

      request initiator

      initiator referrer policy

      initiator referrer policy

    2. newEventreporting map[destination]에 추가한다.

    3. 반환한다.

      Note: pending event는 비동기적으로 전송된다.

  7. reporting map[destination]이 map임을 Assert한다 (즉, destination의 메타데이터가 finalized되었음을 의미한다).

  8. reporting map[destination], event, request initiator, 그리고 initiator referrer policy를 사용해 비콘을 전송한다.

fenced frame reporter reporter문자열 event를 사용해 private aggregation event를 보고하려면, 다음 단계를 실행한다:
  1. eventeventType이 "reserved."로 시작하면 반환한다.

  2. reporter event TODO: 여기를 채운다

exfiltration budget metadata는 다음 항목을 가진 구조체이다:

origin

origin

amount to debit

음이 아닌 유효한 부동소수점 수

exfiltration budget metadata reference는 다음 항목을 가진 구조체이다:

origin

origin

amount to debit reference

음이 아닌 유효한 부동소수점 수에 대한 가변 참조 TODO: 포인터/참조를 더 명세다운 방식으로 처리한다

partition nonce구현 정의 값이다.

Note: 이는 네트워크 파티션 키와 유사하며, 이는 Fetch에서 사용된다.

fenced frame config는 다음 항목을 가진 구조체이다:

mapped url

다음 항목을 가진 구조체:

value

URL

visibility

visibility

container size

null, 또는 size

content size

null, 또는 다음 항목을 가진 구조체:

value

size

visibility

visibility

interest group descriptor

null, 또는 다음 항목을 가진 구조체:

value

interest group descriptor

visibility

visibility

on navigate callback

null, 또는 일련의 단계

effective sandboxing flags

null, 또는 다음 항목을 가진 구조체:

value

샌드박싱 플래그 집합

visibility

visibility

effective enabled permissions

null, 또는 다음 항목을 가진 구조체:

value

listpolicy-controlled feature

visibility

visibility

Note: null이 아닐 때, 이는 이 설정의 생성자가 이 설정으로 내비게이트하는 fencedframe 내부에서만 활성화되는 데 의존하는 listpolicy-controlled feature이다. 구체적으로, 이 list의 각 feature는 이 설정으로 내비게이트가 성공하려면 fencedframe펜스드 내비게이블권한 정책상속된 정책에서 활성화되어 있어야 한다. 이 list의 feature들은 강제로 활성화되는 것이 아니라, 앞서 언급한 상속된 정책에 영향을 주는 임베더 환경이 이러한 필수 feature들을 지원할 만큼 충분히 완화되어 있는지 확인하는 데 사용된다. 이 feature들 중 어느 것의 상속된 정책 값이라도 "Disabled"이면, 이 설정으로의 내비게이션은 실패한다. 이 list에 없는 모든 policy-controlled feature는 이 설정으로 내비게이트하는 fencedframe에서 "Disabled"가 되지 않는다.

fenced frame reporting metadata

null, 또는 다음 항목을 가진 구조체:

value

fenced frame reporting metadata

visibility

visibility

exfiltration budget metadata

null, 또는 다음 항목을 가진 구조체:

value

exfiltration budget metadata

visibility

visibility

nested configs

null, 또는 다음 항목을 가진 구조체:

value

listfenced frame configs

visibility

visibility

embedder shared storage context

null, 또는 문자열

is ad component

boolean, 처음에는 false.

Note: true이면 이 fenced frame config는 광고 컴포넌트를 나타낸다. 광고 컴포넌트는 여러 조각으로 구성된 광고를 만드는 데 사용될 수 있다. Protected Audience 설명서를 보라. 광고 컴포넌트의 경우 이벤트 보고가 다르게 처리된다. 이를 설명하는 Fenced Frame Ads Reporting 설명서를 보라.

cross-origin reporting allowed

boolean, 처음에는 false.

2.3.4. 펜스드 프레임 설정 인스턴스 구조체

fenced frame config instance는 다음 구조체이며, 다음 항목을 가진다:

mapped url

URL

container size

null, 또는 size

content size

null, 또는 size

interest group descriptor

null, 또는 interest group descriptor

on navigate callback

null, 또는 일련의 단계

effective sandboxing flags

null, 또는 샌드박싱 플래그 집합

permissions policy behavior

permissions policy behavior

effective enabled permissions

null, 또는 listpolicy-controlled feature

fenced frame reporter

null, 또는 fenced frame reporter

exfiltration budget metadata reference

null, 또는 exfiltration budget metadata reference

nested configs

null, 또는 map이며, 그 urn uuid이고 그 fenced frame configs이다

partition nonce

partition nonce

embedder shared storage context

null, 또는 문자열

is ad component

boolean

untrusted network status

untrusted network status, 처음에는 enabled.

on network disabled promises

map이며, 그 전역 객체이고 listPromise이며, 처음에는 비어 있다.

Note: 이는 disableUntrustedNetwork() 중에 생성된 다양한 전역의 여러 Promise를 저장한다. 우리는 이들을 여기에 저장하여 fencedframe과 그 자손 펜스드 프레임들의 네트워크 접근이 완전히 철회될 때(즉, untrusted network statusdisabled for this tree and fenced subtrees일 때) 한 번에 모두 resolve할 수 있게 한다.

cross-origin reporting allowed

boolean, 처음에는 false.

fenced frame config config가 주어졌을 때 config를 인스턴스화하려면, 다음 멤버를 가진 fenced frame config instance를 반환한다:
mapped url

configmapped urlvalue

container size

configcontainer size

content size

null이면 configcontent size, 그렇지 않으면 configcontent sizevalue

interest group descriptor

null이면 configinterest group descriptor, 그렇지 않으면 configinterest group descriptorvalue

on navigate callback

configon navigate callback

effective sandboxing flags

null이면 configeffective sandboxing flags, 그렇지 않으면 configeffective sandboxing flagsvalue

permissions policy behavior

configeffective enabled permissions가 null이면 flexible, 그렇지 않으면 fixed.

effective enabled permissions

null이면 configeffective enabled permissions, 그렇지 않으면 configeffective enabled permissionsvalue

fenced frame reporter
  1. configfenced frame reporting metadatavalue가 null이면, null로 설정한다.

  2. 그렇지 않으면, 다음 멤버를 가진 fenced frame reporter로 설정한다:

    fenced frame reporting metadata reference

    configfenced frame reporting metadatavalue에 대한 참조

exfiltration budget metadata reference
  1. configexfiltration budget metadata가 null이면, null로 설정한다.

  2. 그렇지 않으면, exfiltration budget metadata reference로 설정한다:

    origin

    configexfiltration budget metadatavalueorigin

    amount to debit reference

    configexfiltration budget metadatavalueamount to debit에 대한 참조

nested configs
  1. confignested configs가 null이면, null로 설정한다.

  2. 그렇지 않으면:

    1. results를 새 map으로 둔다.

    2. confignested configsvalue에 있는 각 nested config에 대해 For each:

      1. urn을 무작위로 생성한 urn uuid로 둔다.

      2. results[urn]을 nested config설정한다.

    3. nested configsresults로 설정한다.

partition nonce

무작위의 고유한 partition nonce

embedder shared storage context

configembedder shared storage context

is ad component

configis ad component

cross-origin reporting allowed

configcross-origin reporting allowed

untrusted network status

enabled

on network disabled promises

map.

브라우징 컨텍스트fenced frame config instance를 가지며, 이는 fenced frame config instance 또는 null이고, 처음에는 null이다.

fenced frame config instance는 실제로는 브라우징 컨텍스트 그룹에 존재해야 하지만, 서드 파티 쿠키가 지원 중단되기 전까지는 이 명세가 fencedframe 개념 중 많은 것을 iframe 요소에서도 지원한다. 이를 위해 단기적으로 일반 콘텐츠 내비게이블fenced frame config를 로드할 수 있어야 하고, 따라서 그 내비게이션에 대응하는 fenced frame config instance에 접근할 수 있어야 한다.

2.3.5. FencedFrameConfig 인터페이스

fencedframe 요소에 대한 주요 입력 중 하나는 FencedFrameConfig 인터페이스이며, 이는 내부 fenced frame config 구조체에 매핑된다.

enum OpaqueProperty {"opaque"};

[Exposed=Window, Serializable]
interface FencedFrameConfig {
  constructor(USVString url);
  undefined setSharedStorageContext(DOMString contextString);
};

FencedFrameConfig는 다음을 가진다:

Note: config의 urlurn이 제공된 경우에만 null이다.

FencedFrameConfig(url) 생성자 메서드 단계는 다음과 같다:
  1. config FencedFrameConfig 객체로 둔다.

  2. configurlurl에 대해 URL parser를 실행한 결과로 설정한다.

  3. config를 반환한다.

setSharedStorageContext(contextString) 메서드 단계는 thissharedStorageContextcontextString으로 설정하는 것이다.
FencedFrameConfig 객체는 직렬화 가능한 객체이다. 그 직렬화 단계value, serialized, 그리고 forStorage가 주어졌을 때 다음과 같다:
  1. forStorage가 true이면, DataCloneError DOMExceptionthrow한다.

  2. serialized.[[Url]]을 valueurl로 설정한다.

  3. serialized.[[Urn]]을 valueurn으로 설정한다.

  4. serialized.[[SharedStorageContext]]을 valuesharedStorageContext로 설정한다.

역직렬화 단계serialized, value, 그리고 targetRealm이 주어졌을 때 다음과 같다:
  1. valueurlserialized.[[Url]]로 초기화한다.

  2. valueurnserialized.[[Urn]]로 초기화한다.

  3. valuesharedStorageContextserialized.[[SharedStorageContext]]로 초기화한다.

Note: 도입을 쉽게 하기 위해, 2026년까지 우리는 주어진 urn uuid 또는 FencedFrameConfig에 대응하는 mapped url에 매크로를 치환할 수 있게 하는 API navigator.deprecatedReplaceInURN()를 지원할 것이다.

Note: 도입을 쉽게 하기 위해, 서드 파티 쿠키 지원 중단 전까지 우리는 주어진 urn uuid 또는 FencedFrameConfig에 대응하는 mapped url을 반환하는 API navigator.deprecatedURNtoURL()를 지원할 것이다.

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);
};
ordered mapmacros(문자열 문자열 을 가짐)을 문자열 string매크로 치환하려면, 다음 단계를 실행한다:
  1. TODO: 이를 명세화한다. macros의 키를 해당 값으로 string에 치환하고, 새 문자열을 반환한다. 재귀 치환은 없다.

deprecatedReplaceInURN(urnOrConfig, replacements) 메서드 단계는 다음과 같다:
  1. urn을 null로 둔다.

  2. urnOrConfigUSVString이면, urnurnOrConfig로 설정한다.

  3. 그렇지 않으면, urnurnOrConfigurn으로 설정한다.

  4. urn이 유효한 urn uuid가 아니면(즉, urn uuid의 섹션 3에 있는 ABNF를 통과하지 못하면), TypeErrorthrow한다.

  5. replacements의 각 key → _에 대해 For each:

    1. key${ 또는 %%시작하지 않으면, TypeErrorthrow한다.

    2. key} 또는 %%끝나지 않으면, TypeErrorthrow한다.

  6. p새 promise로 둔다.

  7. globalthis관련 전역 객체로 둔다.

  8. 다음 단계를 병렬로 실행한다:

    1. mappingglobal내비게이블순회 가능 내비게이블fenced frame config mapping으로 둔다.

    2. configmapping에서 urn을 사용해 config를 찾은 결과로 둔다.

    3. config가 failure이면, global이 주어졌을 때 DOM manipulation task source전역 task를 큐에 넣어 pundefinedresolve하고, 이 단계를 중단한다.

    4. substitutedUrlreplacementsconfigmapped urlvalue매크로를 치환한 결과로 둔다.

    5. configmapped urlvaluesubstitutedUrl로 설정한다.

    6. global이 주어졌을 때 DOM manipulation task source전역 task를 큐에 넣어 pundefinedresolve한다.

  9. p를 반환한다.

테스트
deprecatedURNtoURL(urnOrConfig, send_reports) 메서드 단계는 다음과 같다:
  1. urn을 null로 둔다.

  2. urnOrConfigUSVString이면, urnurnOrConfig로 설정한다.

  3. 그렇지 않으면, urnurnOrConfigurn으로 설정한다.

  4. urn이 유효한 urn uuid가 아니면(즉, urn uuid의 섹션 3에 있는 ABNF를 통과하지 못하면), TypeErrorthrow한다.

  5. p새 promise로 둔다.

  6. globalthis관련 전역 객체로 둔다.

  7. 다음 단계를 병렬로 실행한다:

    1. mappingglobal내비게이블순회 가능 내비게이블fenced frame config mapping으로 둔다.

    2. mappingfinalized config mapping[urn]이 존재하지 않으면, global이 주어졌을 때 DOM manipulation task source전역 task를 큐에 넣어 pundefinedresolve하고, 이 단계를 중단한다.

    3. configmappingfinalized config mapping[urn]으로 둔다.

    4. global이 주어졌을 때 DOM manipulation task source전역 task를 큐에 넣어 pconfigmapped urlvalueresolve한다.

    5. send_reports가 true이면, configon navigate callback에 있는 단계를 실행한다.

  8. p를 반환한다.

테스트
adAuctionComponents(numAdComponents)
  1. instancethis관련 전역 객체브라우징 컨텍스트fenced frame config instance로 둔다.

  2. instance가 null이면, InvalidStateError DOMExceptionthrow한다.

  3. this관련 설정 객체origininstancemapped urloriginsame origin이 아니면, InvalidStateError DOMExceptionthrow한다.

  4. maxAdComponents를 40으로 둔다.

  5. numAdComponents > maxAdComponents이면, numAdComponentsmaxAdComponents로 설정한다.

  6. adComponentsURNslisturn으로 된 빈 list로 둔다.

  7. instancenested configs에 있는 각 urnconfig에 대해 For each:

    1. numAdComponents가 0이면, break한다.

    2. urnadComponentsURNs추가한다.

    3. numAdComponentsnumAdComponents − 1로 설정한다.

  8. adComponentsURNs를 반환한다.

2.4. Fence 인터페이스

펜스드 프레임에 특화된 여러 API는 Fence 인터페이스에 정의된다.

enum FenceReportingDestination {
  "buyer",
  "seller",
  "component-seller",
  "direct-seller",
  "shared-storage-select-url",
};

dictionary FenceEvent {
  // 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:
  DOMString eventType;
  DOMString eventData;
  sequence<FenceReportingDestination> destination;

  // 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.
  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) 메서드 단계는 다음과 같다:
  1. documentthis관련 전역 객체연관된 Document로 둔다.

  2. document완전히 활성 상태가 아니면, SecurityError DOMExceptionthrow한다.

  3. instancethis관련 전역 객체브라우징 컨텍스트fenced frame config instance로 둔다.

  4. instance가 null이면 반환한다.

  5. instanceis ad component가 true이면 반환한다.

  6. instancefenced frame reporter가 null이면 반환한다.

  7. request initiatorthis관련 설정 객체origin으로 둔다.

  8. initiator referrer policydocument정책 컨테이너referrer policy로 둔다.

  9. eventDOMString이면:

    1. this관련 설정 객체origininstancemapped urloriginsame origin이 아니면 반환한다.

    2. instancefenced frame reporterevent를 사용해 private aggregation event를 보고한다.

  10. eventFenceEvent이면:

    1. eventeventType이 "reserved."로 시작하면 반환한다.

    2. 다음 조건이 모두 true이면:

      반환한다.

    3. eventdestinationURL이 있으면:

      1. eventdestination이나 eventType 또는 eventData가 있으면:

        1. TypeErrorthrow한다.

      2. destinationURLdestinationURL에 대해 URL parser를 실행한 결과로 둔다.

      3. 다음 조건 중 하나라도 성립하면 TypeErrorthrow한다:

        • destinationURL이 failure이다;

        • destinationURL scheme이 "https"가 아니다;

      4. instancefenced frame reporterbuyer, request initiator, initiator referrer policy, 그리고 eventdestinationURLdestination URL event를 사용해 이벤트를 보고한다.

    4. 그렇지 않으면:

      1. eventdestination이 없거나 eventeventType이 없으면:

        1. TypeErrorthrow한다.

      2. attributionReportingEnableddocument가 "attribution-reporting" feature를 사용하도록 허용되는지 결정한 결과로 둔다.

      3. attributionReportingContextOrigindocumentcontext origin으로 둔다.

      4. eventdestination에 있는 각 destination에 대해 For each:

        1. instancefenced frame reporterdestination, request initiator, initiator referrer policy, 그리고 다음 항목을 가진 destination enum event를 사용해 이벤트를 보고한다:

          type

          eventeventType

          data

          eventeventData (정의되어 있지 않으면 빈 문자열).

        attributionReportingEnabled

        attributionReportingEnabled

        attributionReportingContextOrigin

        attributionReportingContextOrigin

테스트
setReportEventDataForAutomaticBeacons(event) 메서드 단계는 다음과 같다:
  1. this관련 전역 객체연관된 Document완전히 활성 상태가 아니면, SecurityError DOMExceptionthrow한다.

  2. eventdestination이 없거나 eventeventType이 없으면:

    1. TypeErrorthrow한다.

  3. eventeventTypeautomatic beacon event type 값 중 하나와 일치하지 않으면 반환한다.

  4. instancethis관련 전역 객체브라우징 컨텍스트fenced frame config instance로 둔다.

  5. instance가 null이면 반환한다.

  6. this관련 설정 객체origininstancemapped urloriginsame origin이 아니고, eventcrossOriginExposed가 false이면 반환한다.

  7. instancefenced frame reporter가 null이면 반환한다.

  8. this관련 전역 객체연관된 Documentautomatic beacon data mapping[eventeventType]을 다음 항목을 가진 automatic beacon data로 설정한다:

    eventData

    정의되어 있고 instanceis ad component가 false이면 eventeventData, 그렇지 않으면 빈 문자열.

    destination

    eventdestination

    once

    eventonce

    crossOriginExposed

    eventcrossOriginExposed

테스트
getNestedConfigs() 메서드 단계는 다음과 같다:
  1. instancethis관련 전역 객체브라우징 컨텍스트fenced frame config instance로 둔다.

  2. instance가 null이면 반환한다.

  3. this관련 설정 객체origininstancemapped urloriginsame origin이 아니면 반환한다.

  4. instancenested configs가 null이면 반환한다.

  5. resultsFencedFrameConfig로 된 빈 list로 둔다.

  6. instancenested configs에 있는 각 urnconfig에 대해 For each:

    1. newConfigthis관련 realm에서 생성된 FencedFrameConfig 객체로 두며, 다음을 가진다:

      urn

      urn

      sharedStorageContext

      configembedder shared storage context

    2. newConfigresults추가한다.

  7. results를 반환한다.

테스트
notifyEvent(event) 메서드 단계는 다음과 같다:
  1. this관련 전역 객체연관된 Document완전히 활성 상태가 아니면, SecurityError DOMExceptionthrow한다.

  2. navigablethis관련 전역 객체내비게이블로 둔다.

  3. 다음 조건 중 하나라도 충족되면, SecurityError DOMExceptionthrow한다:

  4. this관련 전역 객체일시적 활성화를 가지고 있지 않으면 반환한다.

  5. 사용자 활성화를 소비한다. 대상은 this관련 전역 객체이다.

  6. parentNavigablenavigableunfenced parent로 둔다.

  7. parentNavigable활성 window가 주어졌을 때, 다음 단계를 실행하도록 전역 task를 큐에 넣는다. 대상은 DOM manipulation task source이다:

    1. activation notification 단계를 수행한다.

    2. navigable펜스드 내비게이블 컨테이너에서 "fencedtreeclick"이라는 이름의 이벤트를 fire한다. 이벤트의 bubblescancelable 속성을 true로 초기화한다. inner event creation steps를 실행할 때, time을 이 메서드의 모든 호출에 대해 일관적인 구현 정의 값으로 설정한다.

테스트
disableUntrustedNetwork() 메서드 단계는 다음과 같다:
  1. p새 promise로 둔다.

  2. this관련 전역 객체연관된 Document완전히 활성 상태가 아니면, SecurityError DOMExceptionthrow한다.

  3. instancethis관련 전역 객체브라우징 컨텍스트fenced frame config instance로 둔다.

  4. instance가 null이면 반환한다.

  5. 관련 설정 객체origininstancemapped urloriginsame origin이 아니면, pTypeErrorreject한다.

  6. this관련 전역 객체내비게이블순회 가능 내비게이블펜스드 내비게이블이 아니면, pundefinedresolve하고 p를 반환한다.

  7. globalthis관련 전역 객체로 둔다.

  8. settingsthis관련 설정 객체로 둔다.

  9. For each WebSocket 객체 webSocket 중 그 관련 전역 객체global인 것마다, webSocket을 주어 WebSocket 연결을 실패시킨다.

  10. For each WebTransport 객체 webTransport 중 그 관련 전역 객체global인 것마다, 새로 생성된 WebTransportError (그 source"session"인 것)으로 webTransportcleanup한다.

    Note: WebTransportCloseInfo를 전달하지 않으면 WebTransport 객체가 "closed" 상태가 아니라 "failed" 상태로 설정된다.

  11. 다음 단계를 병렬로 실행한다:

    1. fencedFrameNonceinstancepartition nonce로 둔다.

    2. credentiallessNonceglobalpage credentialless nonce로 둔다.

    3. settings를 사용하여 fencedFrameNonce에 대해 partition nonce에 대한 네트워크를 철회한다.

    4. credentiallessNonce가 null이 아니면, settings를 사용하여 credentiallessNonce에 대해 partition nonce에 대한 네트워크를 철회한다.

    5. instanceuntrusted network statusdisabled for this tree로 설정한다.

    6. promisesinstanceon network disabled promises로 둔다.

    7. promises[global]이 존재하면, ppromises[global]에 추가한다.

      그렇지 않으면, promises[global]을 list « p »로 설정한다.

    8. global브라우징 컨텍스트최상위 순회 가능 항목이 주어졌을 때 모든 펜스드 프레임 자손의 untrusted network status를 다시 계산한다.

  12. p를 반환한다.

최상위 순회 가능 항목 topLevelTraversable가 주어졌을 때 모든 펜스드 프레임 자손의 untrusted network status를 다시 계산하려면, 다음 단계를 실행한다:
  1. Assert: 이는 병렬로 실행 중이다.

  2. navigablestopLevelTraversable활성 문서포괄적 자손 내비게이블들로 두되, unfenced를 true로 설정한다.

  3. navigablesWithNetworkChildrenset펜스드 내비게이블로 둔다. 처음에는 비어 있다.

  4. navigables비어 있지 않은 동안 While:

    1. currentNavigablenavigables에서 pop한 결과로 둔다.

    2. ongoingNavigationcurrentNavigable진행 중인 내비게이션으로 둔다.

    3. currentNavigable펜스드 내비게이블이 아니면:

      1. ongoingNavigation이 null이 아니면:

        1. ancestorFencedRootcurrentNavigable순회 가능 내비게이블로 둔다.

        2. ancestorFencedRoot펜스드 내비게이블이면, ancestorFencedRootnavigablesWithNetworkChildren추가한다.

      2. continue한다.

    4. configcurrentNavigable활성 브라우징 컨텍스트fenced frame config instance로 둔다.

    5. configuntrusted network statusdisabled for this tree and fenced subtrees이고 ongoingNavigation이 null이면, continue한다.

    6. networkCutoffReady를 다음과 같이 둔다: navigablesWithNetworkChildrencurrentNavigable포함하지 않고 configuntrusted network statusdisabled for this tree이면 true, 그렇지 않으면 false.

      Note: 펜스드 내비게이블은 네트워크 차단 준비가 되지 않은 것으로 판단된 다른 펜스드 프레임의 unfenced 조상일 때 navigablesWithNetworkChildren에 추가된다.

    7. networkCutoffReady가 true이면:

      1. configuntrusted network statusdisabled for this tree and fenced subtrees로 설정한다.

        Note: untrusted network가 비활성화된 것에 게이트된 모든 API는, promise들이 resolve를 마치기 전이라도 이 시점에서 즉시 사용할 수 있다.

      2. configon network disabled promises 안의 각 globalpromises에 대해 For each:

        1. promises 안의 각 promise에 대해 For each:

          1. global이 주어졌을 때 DOM manipulation task source전역 task를 큐에 넣어 promiseundefinedresolve한다.

      3. configon network disabled promises비운다.

    8. networkCutoffReady가 false이거나 ongoingNavigation이 null이 아니면:

      1. ancestorFencedRootcurrentNavigableunfenced parent순회 가능 내비게이블로 둔다.

      2. ancestorFencedRoot펜스드 내비게이블이면, ancestorFencedRootnavigablesWithNetworkChildren추가한다.

Note: 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 stepsremovedNode가 주어졌을 때 다음과 같다:

  1. topLevelTraversableremovedNode content navigable최상위 순회 가능 항목으로 둔다.

  2. removedNode가 주어졌을 때 자식 내비게이블을 파괴한다.

  3. 병렬로, topLevelTraversable가 주어졌을 때 모든 펜스드 프레임 자손의 untrusted network status를 다시 계산한다.

진행 중인 내비게이션을 설정하는 알고리즘을 수정한다. 단계 2 뒤에 다음과 같은 새 단계를 추가한다:
  1. newValue가 null이면, 병렬로, navigable최상위 순회 가능 항목이 주어졌을 때 모든 펜스드 프레임 자손의 untrusted network status를 다시 계산한다.

사용자 에이전트는 관련된 network revocation nonce set를 가지며, 이는 setpartition nonce이다. 또한 network revocation exemption map을 가지며, 이는 map으로, 그 partition nonce이고 setURL이다.

Note: network revocation exemption map은 web platform test에서만 사용된다. 일반 사용에서는 항상 비어 있다. 이 목록은 특정 URL을 네트워크 철회에서 제외하기 위해 web platform test에서 함수 호출로 직접 수정된다.

이는 WPT web driver에 테스트 전용 함수를 추가하기 위한 RFC를 필요로 할 것이다. (WICG/fenced-frame#192) 해당 web driver 변경이 이루어지면, disableUntrustedNetwork()에 대한 기존 Chromium 내부 web platform test들을 upstream하고 여기에 연결해야 한다. (WICG/fenced-frame#207)

partition nonce nonce를 사용하고 관련 설정 객체 settings가 주어졌을 때 partition nonce에 대한 네트워크를 철회하려면, 다음 단계를 실행한다:
  1. Assert: 이는 병렬로 실행 중이다.

  2. nonce를 사용자 에이전트의 network revocation nonce set추가한다.

  3. settingsfetch group종료한다.

request request를 fetch하는 것이 철회된 partition nonce 때문에 차단되어야 하는지 결정하려면, 다음 단계를 실행한다:
  1. keyrequest에 대해 네트워크 파티션 키를 결정한 결과로 둔다.

  2. noncekeynonce로 둔다.

  3. 사용자 에이전트의 network revocation exemption map[nonce]이 존재하고, requestURL이 그 안에 존재하면, allowed를 반환한다.

  4. 사용자 에이전트의 network revocation nonce setnonce포함하면 blocked를 반환한다.

  5. allowed를 반환한다.

2.5. 네트워크 철회를 위한 몽키패치

이 소개 섹션은 비규범적이다.

이 섹션의 네트워크 철회 메커니즘은 네트워크 요청을 만드는 표준들을 패치해야 한다. 우리의 패치 전에는, 이러한 표준들이 요청을 최종적으로 시작한 컨텍스트의 네트워크 철회 상태를 알지 못한 채 네트워크 요청(예: WebSocket 연결 시작)을 만들었다. 우리의 패치는 요청이 만들어지기 전에 시작 컨텍스트의 네트워크 철회 상태를 고려하도록 해당 표준들의 알고리즘에 검사를 추가한다. 자세한 내용은 이러한 여러 API를 테스트하는 비외부 WPT가 있으며, 이는 여기에서 찾을 수 있다. 현재 외부에 공개되지 않은 이유는 단순히 네트워크 철회 기능이 아직 출시되지 않았기 때문이다. 출시되면 WPT 저장소에 게시될 것이다.

네트워크 철회 메커니즘은 [FETCH] Standard에 다음 몽키패치가 필요하다.

fetch 알고리즘의 단계 7에서 다음과 같이 말하는 곳:

나쁜 포트 때문에 request가 차단되어야 하는지, request fetch가 혼합 콘텐츠로서 차단되어야 하는지, 또는 request가 Content Security Policy에 의해 차단되어야 하는지blocked를 반환하면, responsenetwork error로 설정한다.

"should request be blocked by Content Security Policy" 뒤의 조건들에 "철회된 partition nonce 때문에 차단되어야 하는지"를 추가한다.

이는 fenced frame nonce와 iframe credentialless nonce가 존재하는 경우 둘 다 전달해야 한다. (WICG/fenced-frame#191)

obtain a connection 알고리즘을 수정하여, 단계 1 앞에 다음 단계들을 삽입한다:
  1. noncekeynonce로 둔다.

  2. 사용자 에이전트의 network revocation exemption map[nonce]이 존재하지만, network revocation exemption map[nonce][yrl]이 존재하지 않으면:

    1. 사용자 에이전트의 network revocation nonce setnonce포함하면 failure를 반환한다.

resolve an origin 알고리즘을 수정하여 추가 매개변수인 URL url을 포함한다.

단계 1 앞에 다음 단계들을 삽입한다:

  1. noncekeynonce로 둔다.

  2. 사용자 에이전트의 network revocation exemption map[nonce]이 존재하지만, network revocation exemption map[nonce][url]이 존재하지 않으면:

    1. 사용자 에이전트의 network revocation nonce setnonce포함하면 failure를 반환한다.

네트워크 철회 메커니즘은 [WebSockets] Standard에 다음 몽키패치가 필요하다.

establish a WebSocket connection 알고리즘을 수정한다. 단계 10 뒤에 다음과 같은 새 단계를 추가한다:
  1. client전역 객체내비게이블이 주어졌을 때 내비게이블이 자기 자신에 대해 네트워크를 철회했는지 결정한 결과가 true이면, WebSocket 연결을 실패시킨다.

네트워크 철회 메커니즘은 [WebTransport] Standard에 다음 몽키패치가 필요하다.

initialize WebTransport over HTTP 알고리즘을 수정한다. 단계 5(모든 하위 단계는 그대로 유지)를 다음과 같이 다시 작성한다:
  1. 다음 조건 중 하나라도 true이면:

    그러면 나머지 단계를 중단하고, transport를 사용해 다음 단계를 실행하도록 network task를 큐에 넣는다:

네트워크 철회 메커니즘은 [Reporting] Standard에 다음 몽키패치가 필요하다.

generate and queue a report 알고리즘을 수정한다. 단계 1 뒤에 다음과 같은 새 단계를 추가한다:
  1. contextDocument이고, context노드 내비게이블이 주어졌을 때 내비게이블이 자기 자신에 대해 네트워크를 철회했는지 결정한 결과가 true이면, 반환한다.

네트워크 철회 메커니즘은 [Webpackage] Standard에 다음 몽키패치가 필요하다.

몽키패치HTTP fetch에 수정한다. "b2" 또는 "b3" switch case 아래의 단계 4를 다음과 같이 다시 작성한다:
  1. request철회된 partition nonce 때문에 차단되어야 하는지를 결정한 결과가 false이면, 병렬로, parsedExchangereport에 대해 wait and queue a report for를 실행한다.

2.6. request destination

fencedframe의 내비게이션 요청 처리 모델은 일반 navigation request의 처리 모델과 충분히 다르므로, 새로운 request destination 값이 정당화된다. 이 명세는 request destination 열거형을 업데이트하여 새 항목 "fencedframe"을 포함한다. [FETCH] Standard에 다음 몽키패치를 수행한다.

"fencedframe"를 non-subresource request 목록과 navigation request 목록에 추가한다.

"fencedframe"를 RequestDestination enum에 추가한다.

fetch 알고리즘의 단계 13.2에서 다음과 같이 말하는 곳:

사용자 에이전트는 request의 destination에 대해 switch하면서, 일치하는 문장이 있다면 첫 번째로 일치하는 문장으로 값을 설정해야 한다:

"fencedframe"를 "document", "frame", 및 "iframe"와 함께 switch case에 추가한다.

테스트

비규범적으로, DOM 소개의 destination table을 업데이트하여 fencedframe navigation request가 다음 속성을 가진다는 것을 보여준다:

2.7. 네트워크 철회에 따른 메서드 게이팅

이 소개 섹션은 비규범적이다.

펜스드 프레임이 신뢰할 수 없는 네트워크 접근을 완전히 비활성화한 뒤, 즉 PromisedisableUntrustedNetwork()에 의해 반환되고 resolved되면, 특정 강력한 인터페이스 메서드들이 펜스드 프레임 안에서 실행되는 스크립트에 사용 가능해진다. 이러한 메서드들은 다른 명세에 정의되어 있으며, 호출이 성공적으로 일어날 수 있는지 결정하기 위해 아래 첫 번째 알고리즘을 사용할 것이다. 신뢰할 수 없는 네트워크 접근의 철회 뒤에 게이트되는 메서드의 한 예는 get()이며, 이는 SharedStorageWorklet 밖에서 호출될 때이다. 이 메서드는 [Shared-Storage] 초안 명세에 정의되어 있다.

disableUntrustedNetwork()가 호출되었지만 반환된 Promise가 아직 resolved되지 않은 중간 상태에서는, 네트워크를 통해 요청을 만드는 기능에 제한이 있다. 아래 두 번째 알고리즘은 이러한 기능이 허용되는지 결정하는 데 사용된다.

우리는 "fully revoked"와 "revoked for self"를 구분한다. 중첩된 펜스드 프레임 트리가 여전히 네트워크 접근 권한을 가질 수 있으며, 이러한 제한은 그들도 disableUntrustedNetwork()를 호출하기 전까지는 적용되지 않기 때문이다.

내비게이블 navigable이 주어졌을 때 내비게이블이 네트워크를 완전히 철회했는지 결정하려면:
  1. navigable순회 가능 내비게이블펜스드 내비게이블이 아니면 false를 반환한다.

  2. confignavigable활성 브라우징 컨텍스트fenced frame config instance로 둔다.

  3. configuntrusted network statusdisabled for this tree and fenced subtrees가 아니면 false를 반환한다.

  4. true를 반환한다.

내비게이블 navigable이 주어졌을 때 내비게이블이 자기 자신에 대해 네트워크를 철회했는지 결정하려면:
  1. navigable순회 가능 내비게이블펜스드 내비게이블이 아니면 false를 반환한다.

  2. confignavigable활성 브라우징 컨텍스트fenced frame config instance로 둔다.

  3. configuntrusted network statusenabled이면 false를 반환한다.

  4. true를 반환한다.

내비게이블 navigablesource snapshot params sourceSnapshotParams가 주어졌을 때 embedder가 시작한 fenced frame 내비게이션이 차단되어야 하는지 결정하려면:
  1. sourceSnapshotParamstarget fenced frame config가 null이면 false를 반환한다.

    의도는 sourceSnapshotParamstarget fenced frame config가 embedder가 시작한 fencedframe 내비게이션에 대해서는 null이 아니고 그 외에는 null이어야 한다는 것이다. 하지만 이는 이 이슈가 해결되기 전까지 참이 아니다.

  2. navigable순회 가능 내비게이블unfenced parent가 null이면 false를 반환한다.

    Note: navigable순회 가능 내비게이블unfenced parent가 null이면, navigablenavigablefenced navigable container파괴되는 중이므로 loading을 중지한다.

  3. 다음이 모두 true이면:

    true를 반환한다.

  4. 그렇지 않으면 false를 반환한다.

2.8. 자동 보고

이 첫 번째 소개 단락은 비규범적이다.

펜스드 경계 모델의 부작용은 광고가 클릭이 성공적인 내비게이션으로 이어졌는지 알 수 있는 능력을 잃게 된다는 것이다. 이는 펜스드 프레임에서 시작된 최상위 내비게이션으로부터 로드된 페이지가, 자신이 로드되었음을 펜스드 프레임에 보고하는 것 (예: window.opener를 통한 것)이 허용되지 않기 때문이다. 대신, 우리는 특별한 이벤트 수준 reporting type, reserved.top_navigation_startreserved.top_navigation_commit를 도입한다. 이들은 펜스드 프레임이 최상위 순회 가능 항목으로의 성공적인 내비게이션을 시작할 때 이벤트 수준 비콘을 자동으로 전송한다.

source snapshot params sourceSnapshotParams, origin sourceOrigin, Document targetDocument, 그리고 automatic beacon event type eventType가 주어졌을 때, automatic beacon 전송을 시도하려면, 다음 단계를 실행한다:
  1. targetDocument노드 내비게이블순회 가능 내비게이블최상위 순회 가능 항목이 아니면, 이 단계를 중단한다.

  2. sourceSnapshotParamshas transient activation이 false로 설정되어 있으면, 이 단계를 중단한다.

  3. configsourceSnapshotParamsinitiator fenced frame config instance로 둔다.

  4. config가 null이면, 이 단계를 중단한다.

    Note: 이 알고리즘은 모든 내비게이션에 대해 무조건 호출되므로, 이는 내비게이션fencedframe에서 시작되지 않고 최상위 순회 가능 항목으로 향하는 경우를 잡아내는 데 사용된다.

  5. request initiatorconfigis ad component가 false이면 sourceOrigin으로, 그렇지 않으면 sourceSnapshotParamsinitiator ancestor root origin으로 둔다.

  6. initiator referrer policyconfigis ad component가 false이면 sourceSnapshotParamssource policy containerreferrer policy로, 그렇지 않으면 sourceSnapshotParamsinitiator ancestor root referrer policy로 둔다.

  7. isCrossOriginsourceOriginconfigmapped urloriginsame origin이 아니면 true, 그렇지 않으면 false로 둔다.

  8. beaconMappingisCrossOrigin이 false이면 sourceSnapshotParamssnapshot automatic beacon storedata mapping으로, 그렇지 않으면 sourceSnapshotParamssnapshot automatic beacon storecross-origin exposed data mapping으로 둔다.

  9. beaconDatabeaconMapping[eventType]으로 둔다.

  10. automaticBeaconsAllowedsourceSnapshotParamsautomatic beacons allowed로 둔다.

    Note: 이는 `Allow-Fenced-Frame-Automatic-Beacons` header를 통해 opt-in이 있었는지를 추적한다. automatic beacon은 이 값이 false인 동안에도 same-origin 문서이거나 데이터 설정을 통해 opt-in한 문서에 대해서는 여전히 전송될 수 있다.

  11. beaconData가 null이고 automaticBeaconsAllowed가 false이면, 이 단계를 중단한다.

  12. isCrossOrigin이 true이고 automaticBeaconsAllowed가 false이면, 이 단계를 중단한다.

  13. configfenced frame reporterfenced frame reporting metadata referencefenced frame reporting map에 있는 각 destination에 대해 For each:

    1. configfenced frame reporterdestination, request initiator, initiator referrer policy, 그리고 다음 항목을 가진 automatic beacon event를 사용해 이벤트를 보고한다:

      type

      eventType

      data

      beaconData가 null이면 빈 문자열, 그렇지 않으면 beaconDataeventData.

      attributionReportingEnabled

      sourceSnapshotParamsattribution reporting enabled

      attributionReportingContextOrigin

      sourceSnapshotParamsattribution reporting context origin

  14. beaconDataonce가 true이면, beaconMapping[eventType]을 null로 설정한다.

테스트
[HTML]navigate 알고리즘을 수정한다. 단계 4 뒤에 다음과 같은 새 단계를 추가한다:
  1. sourceSnapshotParams, initiatorOriginSnapshot, navigable의 연관된 Document, 그리고 reserved.top_navigation_start가 주어졌을 때 automatic beacon 전송을 시도한다.

[HTML]history entry의 document를 채우려고 시도 알고리즘을 수정한다. 단계 6, 하위 단계 11에서 단계 5 뒤에 다음과 같은 새 단계를 추가한다:
  1. failure가 false이면:

    1. sourceSnapshotParams, entrydocument stateinitiator origin, document, 그리고 reserved.top_navigation_commit가 주어졌을 때 automatic beacon 전송을 시도한다.

    2. sourceSnapshotParams, entrydocument stateinitiator origin, document, 그리고 reserved.top_navigation가 주어졌을 때 automatic beacon 전송을 시도한다.

3. HTML 통합

3.1. Window 인터페이스 확장

partial interface Window {
  // Collection of fenced frame APIs
  readonly attribute Fence? fence;
};

Window 객체는 연관된 fence를 가지며, 이는 Fence 인스턴스로 Window와 함께 생성된다.

fence getter 단계는 다음과 같다:
  1. this브라우징 컨텍스트fenced frame config instance가 null이 아니면, thisfence를 반환한다.

  2. null을 반환한다.

테스트

3.2. Document 지원 개념

먼저 몇 가지 예비 타입을 설정한다:

automatic beacon data는 다음 구조체이며, 다음 항목을 가진다:

eventData

문자열

destination

FenceReportingDestination들의 list

once

boolean

crossOriginExposed

boolean

automatic beacon data mappingmap이며, 그 automatic beacon event type이고 그 은 null 또는 automatic beacon data이다.

snapshot automatic beacon store구조체이며 다음 항목을 가진다:

data mapping

automatic beacon data mapping

cross-origin exposed data mapping

automatic beacon data mapping

Document 객체는 연관된 automatic beacon data mapping을 가지며, 이는 automatic beacon data mapping이다.

Document 객체는 연관된 automatic beacons allowed를 가지며, 이는 boolean이고, 처음에는 false이다.

3.3. 브라우징 컨텍스트 생성에 대한 수정

[HTML]creating a new browsing context and document 알고리즘에서, 다음으로 시작하는 두 단계 (현재 단계 4와 15)를 다시 작성한다;

대신 더 엄격한 조건을 사용한다:

Note: 이는 fenced frame 경계를 넘어 creatorreferrer, origin, document base url, policy container를 누출하지 않도록 보장해야 하기 때문이다.

위에서 수정된 이 알고리즘의 단계 4에 다음 하위 단계를 추가한다:

  1. browsingContextfenced frame config instancecreator브라우징 컨텍스트fenced frame config instance로 설정한다.

3.4. 정책 컨테이너 상속

local URLnavigation request를 만들 때, iframe들은 navigation requestinitiator Document에서 자신의 policy container를 복제한다. 만약 fencedframe들도 같은 일을 한다면, 이는 initiator의 policy container에 대한 정보가 fenced frame 경계를 넘어 누출되도록 허용할 것이다. 이 섹션은 그 누출을 막기 위해 policy container 상속을 패치한다.

determine navigation params policy container 알고리즘을 수정하여, 기본값이 false인 새로운 선택적 boolean 매개변수 fenced를 가지게 한다.

단계 3을 다음과 같이 다시 작성한다:

  1. responseURLlocal이고, initiatorPolicyContainer가 null이 아니며, fenced false이면, initiatorPolicyContainerclone을 반환한다.

Note: responseURLabout:srcdoc인 경우를 수정할 필요는 없다. about:srcdoc로의 내비게이션은 fenced frame에서 지원되지 않기 때문이다.

create navigation params by fetching의 단계 23 앞에 다음 단계를 추가한다:
  1. fencednavigable펜스드 내비게이블이면 true, 그렇지 않으면 false로 둔다.

    Note: 이는 initiator Documentnavigable활성 문서인지 또는 그 unfenced parent인지와 관계없이 fenced가 true가 되도록 보장한다.

단계 23(이제 단계 24)을 다음과 같이 다시 작성한다:

  1. resultPolicyContainerresponseURL, entrydocument statehistory policy container, sourceSnapshotParamssource policy container, null, responsePolicyContainer, 및 fenced가 주어졌을 때 determining navigation params policy container의 결과로 둔다.

Note: fencedframe policy container의 초기 Document 생성 시 상속은 § 3.3 브라우징 컨텍스트 생성에 대한 수정 섹션에서 처리된다.

3.5. 중첩 순회 가능 항목

3.5.1. 소개

이 섹션은 비규범적이다.

[HTML] Standard는 내비게이블들을 두 범주로 구성한다: 자식 내비게이블순회 가능 내비게이블(최상위 순회 가능 항목이라고도 함). fenced frames와, 그보다 정도는 덜하지만 portals 같은 기능의 도입은 때때로 자식 내비게이블과 같은 새로운 타입의 순회 가능 내비게이블을 추가하여 이 모델을 복잡하게 만든다. 이러한 새 프레임 타입은 embedder와 별도의 브라우징 컨텍스트 그룹에 들어 있으므로, 어느 정도 구체적인 수준의 격리가 기대되고 필요하다. 반면 이들은 시각적으로 다른 브라우징 컨텍스트 그룹 안에 합성되므로, 때로는 예를 들어 iframe들에서 볼 수 있는 일반 자식 내비게이블처럼 동작해야 한다.

여기서의 복잡성은 내비게이블 컨테이너, 내비게이블 부모, 및 자손 내비게이블 같은 용어가 언제 순회 가능 내비게이블/브라우징 컨텍스트 그룹 경계를 넘어야 하는지, 그리고 언제 그렇게 하는 것이 안전하지 않거나 올바르지 않은지를 결정하는 데 있다. 아래 예시는 이 점을 보여준다.

사용자가 Document 안의 콘텐츠를 활성화하면, 일반적으로 activation notification 단계는 모든 조상 내비게이블과 모든 same origin 자손 내비게이블에 사용자 활성화를 부여한다. 그러나 fencedframe은 embedder로부터 격리되어야 하는 민감한 콘텐츠를 호스팅할 수 있고, user activationconsumption은 이 두 당사자 사이의 통신 벡터를 제공하므로, 사용자 활성화의 목적에서는 fencedframe펜스드 내비게이블이 embedder의 자손으로 간주될 수 없고, 그 embedder도 현재 user activation 알고리즘이 해당 용어들을 사용하는 방식으로 fencedframe펜스드 내비게이블의 조상으로 간주될 수 없다. 다시 말해, 우리는 사용자 활성화를 fenced된 것으로 간주하여, 이것이 펜스드 내비게이블 경계를 절대 넘지 않음을 나타낸다. 만약 unfenced라면, iframe에서와 같이 동작하여 user activation이 프레임 경계를 자유롭게 흐르도록 허용할 것이다.

테스트

user activation과 달리, fencedframe펜스드 내비게이블생성되거나 내비게이트될 때, 그것은 일반 자식 내비게이블 안의 Document들에 대해 표준적인 것처럼, embedder Documentactive sandboxing flag set을 그대로 반드시 상속해야 한다. 이렇게 하지 않으면 fencedframe 요소는 사소한 샌드박스 우회가 될 것이다. fencedframe sandbox flag 상속은 iframe 요소에서의 동작 방식과 비슷하게 동작하므로, 우리는 sandbox 상속을 unfenced된 것으로 간주한다.

위에서 언급한 격리와 그 조건부 완화를 제공하기 위해, 이 명세는 순회 가능 내비게이블을 위한 새로운 종류의 부모인 unfenced parent를 정의한다. 이는 알고리즘이 위에서 설명한 것처럼 unfenced되어야 할 때 의도적으로 사용할 수 있는 embedder로의 링크를 제공한다.

Note: 새로운 종류의 부모(unfenced parent)를 도입하는 것은 의도적인 설계 결정이다. 이는 기본적으로 fencedframe 경계가 private하고 isolated됨을 의미한다. 기본적으로 웹 플랫폼의 어떤 것도 fencedframe펜스드 내비게이블에서 그 embedder로 순회하지 않기 때문이다. 알고리즘을 수정하여 fencedframe 펜스드 내비게이블 경계를 넘어 순회할 수 있게 할 때는 주의를 반드시 기울여야 하며, 이런 종류의 각 수정은 독립적으로 평가되어 이 명세에 나타날 것이다.

이 섹션의 나머지는 관련 내비게이블들의 컬렉션을 다루는 다양한 [HTML] 정의(및 그 사용)에 대한 패치를 제공하며, 웹 플랫폼의 여러 부분을 적절히 fencing 및 unfencing하려는 의도를 가진다.

3.5.2. 순회 가능 내비게이블

[HTML]Traversable navigables 섹션에 다음을 추가한다:

내비게이블의 속성에 더해, 순회 가능 내비게이블은 다음을 가진다:

Note: unfenced parent 링크는 fencedframe펜스드 내비게이블에 그 embedder로의 링크를 제공하는 것으로, 포커스 처리 모델의 일부 알고리즘처럼 "unfenced"되어야 하는 것에 대해 신중하게 사용된다.

내비게이블 navigableunfenced parent를 얻으려면:
  1. navigable자식 내비게이블이면, navigableparent를 반환한다.

  2. Assert: navigable펜스드 내비게이블이다.

  3. navigableunfenced parent를 반환한다.

Note: 이 알고리즘은 순회 가능 내비게이블unfenced parent getter와 다르다. 이 알고리즘은 먼저 navigable이 일반 자식 내비게이블인 경우 내비게이블의 일반 parent를 얻으려 하기 때문이다.

내비게이블 navigableunfenced container document를 얻으려면:
  1. parentNavigablenavigableunfenced parent로 둔다.

  2. parentNavigable활성 문서를 반환한다.

3.5.3. 중첩 순회 가능 항목

[HTML]Navigables 섹션에 "Nested traversables"라는 제목의 새 하위 섹션을 추가하고, 다음 텍스트, 정의, 알고리즘을 포함한다.

내비게이블 컨테이너와 각각의 콘텐츠 내비게이블과 비슷하게, 다른 요소들(지금까지는 fencedframe 요소만)은 사용자에게 더 격리된 내비게이블을 제공한다. 이러한 요소들은 펜스드 내비게이블 컨테이너라고 부른다.

펜스드 내비게이블 컨테이너펜스드 내비게이블을 가지며, 이는 null이 아닌 unfenced parent를 가진 순회 가능 내비게이블이거나 null이다. 처음에는 null이다.

테스트
document state documentState내비게이블 parent가 주어졌을 때, 중첩 순회 가능 항목을 초기화하려면 traversable에 대해:
  1. documentState가 주어졌을 때 traversable내비게이블을 초기화한다.

  2. traversableunfenced parentparent로 설정한다.

요소 element가 주어졌을 때 새 중첩 순회 가능 항목을 생성하려면:
  1. group을 새 브라우징 컨텍스트 그룹으로 둔다.

Note: create a new browsing context group and document가 하는 것처럼 group을 사용자 에이전트의 browsing context group setappend할 이유는 없어 보인다.

  1. element 노드 문서, element, 및 group이 주어졌을 때 creating a new browsing context and document의 두 번째 반환값을 document로 둔다.

  2. documentState를 새 document state로 두며, 그 documentdocument이다.

  3. traversable을 새 순회 가능 내비게이블로 둔다.

  4. parentNavigableelement노드 내비게이블로 둔다.

  5. documentStateparentNavigable가 주어졌을 때 traversable중첩 순회 가능 항목을 초기화한다.

  6. element펜스드 내비게이블traversable로 설정한다.

  7. initialHistoryEntrytraversable활성 세션 히스토리 엔트리로 둔다.

  8. initialHistoryEntrystep을 0으로 설정한다.

  9. initialHistoryEntrytraversablesession history entriesAppend한다.

  10. traversable을 반환한다.

Note: 새 중첩 순회 가능 항목을 생성하는 알고리즘은 최상위 순회 가능 항목이 아닌 첫 번째 종류의 순회 가능 내비게이블을 생성한다. 이는 [HTML]Top-level traversables 섹션에서 중첩 순회 가능 항목에 대한 note를 제거해야 함을 요구할 것이다.

3.5.4. 최상위 순회 가능 항목

[HTML] Standard는 현재 최상위 순회 가능 항목순회 가능 내비게이블로 정의하며, 그 parent가 null인 것이라고 한다. 그러나 이는 불충분한 정의이며, 이 명세가 이를 변경한다. [HTML]은 이 명세 밖에서는 모든 순회 가능 내비게이블최상위 순회 가능 항목이라고 언급하지만, 중첩된 종류의 순회 가능 항목을 만들고자 하는 미래 명세를 “envisions”하며, 그 중첩은 null이 아닌 parent를 통해 이루어진다. 따라서 최상위 순회 가능 항목순회 가능 내비게이블의 구분은 parent가 null인지에 의존한다.

이 명세가 제안하는 펜스드 내비게이블[HTML]최상위 순회 가능 항목순회 가능 내비게이블 사이의 구분을 위한 공간을 마련할 때 정확히 상정했던 것이다. 그러나 이 명세는 펜스드 내비게이블에 대해 parent 포인터를 사용하지 않는다. 이는 위에서 설명한 이유 때문이다(대신 이들은 unfenced parent 포인터를 사용한다). 이는 기본적으로 최상위 순회 가능 항목펜스드 내비게이블 모두 null인 parents를 가져, 그 구분을 무의미하게 만든다는 뜻이다.

최상위 순회 가능 항목펜스드 내비게이블 사이의 의도된 구분을 바로잡기 위해, 다음 정의들을 다음과 같이 패치한다:

최상위 순회 가능 항목순회 가능 내비게이블이며, 그 parentunfenced parent가 모두 null인 것이다.
내비게이블 inputNavigable최상위 순회 가능 항목을 얻으려면:
  1. navigableinputNavigable로 둔다.

  2. While:

    1. navigableparentunfenced parent가 모두 null이면, break한다.

    2. navigablenavigableparent 또는 unfenced parent 중 null이 아닌 것으로 설정한다.

      Note: 여기서는 navigableparent 또는 unfenced parent 중 정확히 하나만 null이 아닐 것이다.

  3. navigable을 반환한다.

Note: 이러한 새 정의에 따르면, 최상위 순회 가능 항목은 본질적으로 § 3.5.1 소개에서 설명한 것처럼 "unfenced"된 것이다.

inclusive descendant navigables 알고리즘을 수정하여, 기본값이 false인 새로운 선택적 boolean 인수 unfenced를 받게 한다.

또한 이 알고리즘의 단계 2를 다음과 같이 다시 작성한다:

  1. documentdescendant navigables를 사용해 navigables확장하되, unfencedunfenced로 설정한다.

descendant navigables 알고리즘을 수정하여, 기본값이 false인 새로운 선택적 boolean 인수 unfenced를 받게 하고, 알고리즘을 다음과 같이 다시 작성한다:
  1. navigables를 새 list로 둔다.

  2. navigableContainersdocument의 모든 shadow-including descendants내비게이블 컨테이너인 것(또는 unfenced가 true이면 펜스드 내비게이블 컨테이너인 것)의 list로 두며, shadow-including tree order 순서로 둔다.

  3. navigableContainers의 각 navigableContainer에 대해 For each:

    1. navigableContainercontent navigablefenced navigable가 모두 null이면, continue한다.

    2. descendantNavigablenavigableContainercontent navigable 또는 fenced navigable 중 null이 아닌 것으로 둔다.

    3. descendantNavigable활성 문서inclusive descendant navigablesnavigables확장하되, unfencedunfenced로 설정한다.

  4. navigables를 반환한다.

ancestor navigables 알고리즘을 수정하여, 기본값이 false인 새로운 선택적 boolean 인수 unfenced를 받게 하고, 알고리즘을 다음과 같이 다시 작성한다:
  1. navigabledocumentnode navigableparent로 둔다.

  2. navigable이 null이고 unfenced가 true이면, navigabledocumentnode navigable순회 가능 내비게이블unfenced parent로 설정한다.

  3. ancestors를 빈 list로 둔다.

  4. navigable이 null이 아닌 동안:

    1. navigableancestorsPrepend한다.

    2. navigablenavigableparent로 설정한다.

    3. navigable이 null이고 unfenced가 true이면, navigablenavigable순회 가능 내비게이블unfenced parent로 설정한다.

  5. ancestors를 반환한다.

3.7. 포커싱 알고리즘에 대한 수정

[HTML] standard는 요소와 Window의 포커싱을 처리하는 방법을 정의하며, 이는 사용자 제스처와 스크립트가 시작한 API를 통해 모두 이루어진다. fenced frames는 fenced frame 경계를 넘는 통신을 방지하도록 설계되었으므로, 포커싱을 신중하게 처리해야 한다. 이는 포커스가 fencedframe 경계를 넘을 때, 경계 양쪽의 컨텍스트가 그 변화를 감지할 수 있고, 이것이 fencedframe과 그 embedder 사이의 통신 채널을 여는 데 사용될 수 있기 때문이다.

우리는 focusing steps가 스크립트가 시작한 포커스를 fenced frame 경계를 넘어 이동하지 못하게 함으로써 이를 수행한다.

사용자가 button 같은 요소를 fencedframe 안에서 클릭할 때, fencedframe 밖의 다른 요소가 focused되어 있다면, focusing stepsbuttonfocus를 얻는 것을 허용할 것이다. 이는 특별히 사용자 시작 동작이기 때문이다. 이를 허용하지 않으면, fencedframe 안의 어떤 요소도 focus를 얻을 수 없게 된다.

이 명세 이전의 현 상태처럼 모든 요소가 focus() 메서드를 통해 계속 focused될 수 있도록 허용한다면, 펜스드 내비게이블 컨테이너와 그 펜스드 내비게이블은 일련의 focus() 호출을 사용해 fenced frame 경계를 넘어 임의의 데이터를 보낼 수 있으며, 이는 개인정보 누출이다. 이를 피하기 위해 우리는 사실상 focus() 메서드를 "fence"하며, 이는 개인정보 보호를 위해 일부 기능을 희생한다.

focusing steps를 수정하여, 기본값이 false인 새로운 선택적 boolean 인수 unfenced를 받게 한다.

알고리즘의 단계 3(새 focus target을 변경하는 단계) 뒤에 다음 새 단계를 추가한다:

  1. new focus target이 null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너이면, new focus target을 그 fenced navigable활성 문서로 설정한다.

new chain 변수를 정의하는 단계 뒤에 다음 새 단계를 추가한다:

  1. unfenced가 false이고, new chain포함하는 Document document가 있으며, 그 node navigable순회 가능 내비게이블펜스드 내비게이블이고, old chaindocument를 역시 포함하지 않으면, 반환한다.

    Note: 이것은 포커스가 fence를 넘으려는 경우에, focus update steps를 호출하기 바로 전에 일찍 중단하는 방식이다.

focusing steps의 알고리즘 단계 뒤에 있는 user agent 문장을 다음과 같이 수정한다:

사용자 에이전트는 사용자가 candidate로 포커스를 이동하려고 시도할 때마다 즉시 focusable area 또는 내비게이블 candidate에 대한 focusing steps를 실행해야 하며, unfenced는 true로 설정한다.

accesskey attribute command 알고리즘의 동작을 다음과 같이 수정한다:
  1. unfenced를 true로 설정하여 해당 요소에 대해 focusing steps를 실행한다.

  2. 해당 요소에서 click 이벤트를 fire한다.

사용자가 활성화하는 click focusable focusable area의 동작을 다음과 같이 수정한다:

사용자가 활성화하는 click focusable focusable area에 대해, 사용자 에이전트는 그 focusable area에서 focusing steps를 실행해야 한다. 이때 focus trigger는 "click"으로 설정하고 unfenced는 true로 설정한다.

hide popover algorithm의 단계 10을 다음과 같이 수정한다:
  1. previouslyFocusedElement가 null이 아니면:

    1. elementpreviously focused element를 null로 설정한다.

    2. focusPreviousElement가 true이면, previouslyFocusedElement에 대해 focusing steps를 실행하되, unfenced를 true로 설정한다. 이 단계를 수행함으로써 viewport가 스크롤되어서는 안 된다.

Note: popover를 수동으로 dismiss하는 것은 사용자 시작 제스처이지만, 이것이 사용자 제스처에서 호출되었는지 스크립트 호출을 통해 호출되었는지와 관계없이 focusing stepsunfenced를 false로 설정하여 호출된다.

interactively validate the constraints 알고리즘의 단계 3의 첫 번째 bullet point를 다음과 같이 수정한다:
has focus steps 알고리즘의 while loop 단계 2 뒤에 다음 단계를 추가한다:
  1. candidatefocused area가 null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너이면, candidate를 그 펜스드 내비게이블 컨테이너fenced navigable활성 문서로 설정한다.

focus chain 알고리즘의 while loop 단계 3을 다음과 같이 수정한다:
  1. currentObjectfocusable area이면, currentObjectcurrentObjectDOM anchor노드 문서로 설정한다.

    그렇지 않고, currentObjectDocument이며 그 node navigableparent 가 null이 아니면, currentObjectcurrentObjectnode navigableparent로 설정한다.

    그렇지 않고, currentObjectDocument이며 그 node navigable순회 가능 내비게이블이고 그 unfenced parent가 null이 아니면, currentObjectcurrentObjectnode navigableunfenced parent로 설정한다.

    그렇지 않으면, break한다.

get the focusable area 알고리즘을 수정한다. switch 문에 새 case를 추가한다:
focus target이 null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너인 경우

펜스드 내비게이블 컨테이너fenced navigable활성 문서를 반환한다.

Note: 이 알고리즘은 무조건 fence 경계를 “jump”할 수 있다. 그 반환값은 항상 fence 경계를 신중하게 고려하는 알고리즘에 공급되기 때문이다.

currently focused area of a top-level traversable 알고리즘의 단계 3을 다음과 같이 수정한다:
  1. candidatefocused area가 null이 아닌 content navigable를 가진 내비게이블 컨테이너이거나, null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너인 동안: candidate를 해당 내비게이블 컨테이너content navigable 또는 해당 펜스드 내비게이블 컨테이너fenced navigable 중 null이 아닌 것의 활성 문서로 설정한다.

sequential focus navigation 알고리즘의 단계 6을 다음과 같이 수정한다:
  1. candidate가 null이 아니면, candidate에 대해 focusing steps를 실행하되, unfenced를 true로 설정하고 반환한다.

sequential focus navigation 알고리즘의 단계 9를 다음과 같이 수정한다:

  1. 그렇지 않으면, starting pointfocusable area이며, 그 노드 문서node navigable자식 내비게이블 또는 펜스드 내비게이블이다. starting point를 그 node navigableunfenced parent로 설정하고, loop라고 레이블된 단계로 돌아간다.

sequential navigation search algorithm의 단계 2를 다음과 같이 수정한다:
  1. candidate가 null이 아닌 content navigable를 가진 내비게이블 컨테이너이면, new candidatecandidatecontent navigable를 첫 번째 인수로, direction을 두 번째 인수로, sequential을 세 번째 인수로 하여 sequential navigation search algorithm을 실행한 결과로 둔다.

    candidate가 null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너이면, new candidatecandidatefenced navigable를 첫 번째 인수로, direction을 두 번째 인수로, sequential을 세 번째 인수로 하여 sequential navigation search algorithm을 실행한 결과로 둔다.

    new candidate가 null이면, starting pointcandidate로 두고, 이 알고리즘의 맨 위로 돌아간다. 그렇지 않으면, candidatenew candidate로 둔다.

테스트

이 섹션은 fencedframe 요소가 내비게이션이라는 계속 복잡해지는 과정과 어떻게 상호작용하는지 설명한다. 이 과정에는 다양한 헤더, 격리 메커니즘 및 정책과의 통합이 포함된다.

3.8.1. `Supports-Loading-Mode` HTTP 응답 헤더

이 섹션은 [HTML] Standard를 몽키패치하기 위한 것이다. 그러나 `Supports-Loading-Mode` 헤더가 아직 [HTML]에 병합되지 않았고, 대신 [Prerendering-Revamped] 명세에 존재하므로, 이 섹션은 사실상 그 몽키패치 명세를 몽키패치한다.

아래의 새 token을 `Supports-Loading-Mode` 응답 헤더에 대한 유효한 tokens 목록에 추가한다:

`fenced-frame` token은 응답이 fenced navigable 안에서 Document를 생성하는 데 사용될 수 있음을 나타낸다. 이 명시적 opt-in이 없으면, fenced navigable 안의 모든 내비게이션은 § 3.8 내비게이션에 설명된 것처럼 실패한다.

[HTML]history entry의 document를 채우려고 시도 알고리즘은 다음과 같이 수정된다. queued task 안에서 "If failure is true, then:"으로 시작하는 단계 바로 앞에 새 단계를 삽입한다:
  1. 그렇지 않고, 다음 조건이 모두 true이면:

    그러면 failure를 true로 설정한다.

3.8.2. `Allow-Fenced-Frame-Automatic-Beacons` HTTP 응답 헤더

same origin이 아닌 Document로 로드되는 문서 리소스를, 그 Documentbrowsing contextfenced frame config instancemapped url과 함께, Allow-Fenced-Frame-Automatic-Beacons HTTP response header로 제공하면, Document가 navigation을 수행할 때 automatic beacon events가 트리거되도록 opt in한다. 이 header는 값이 반드시 boolean이어야 하는 structured header이다.

3.8.3. `Allow-Cross-Origin-Event-Reporting` HTTP 응답 헤더

Allow-Cross-Origin-Event-Reporting HTTP 응답 헤더와 함께 문서 리소스를 제공하면, 그 문서 리소스가 fenced frame config instance에 의해 fencedframe 안으로 로드될 때, 해당 Document의 cross-origin 자식 내비게이블reportEvent() beacon을 보낼 수 있도록 opt in한다. 이 헤더는 structured header이며, 그 값은 반드시 boolean이어야 한다.

3.8.4. COOP, COEP, 그리고 cross-origin isolation

이 명세 밖에서는 `Cross-Origin-Opener-Policy` 헤더가 모든 내비게이블 대신 최상위 순회 가능 항목에만 적용되며, 이 명세는 이 헤더가 펜스드 내비게이블에 영향을 미치지 않고, 그 embedder로부터 상속되지 않는 한에서 이 의도를 계속 유지한다. 따라서 펜스드 순회 가능 내비게이블 안에 호스팅된 브라우징 컨텍스트 그룹은 항상 그 cross-origin isolation mode가 "none"으로 설정된다.

그럼에도 불구하고, 펜스드 내비게이블은 그 unfenced parentembedder policy를 존중하며, 이는 아래에서 달성된다:

check a navigation response’s adherence to its embedder policy 알고리즘에서 다음의 모든 출현을 다시 작성한다:

다음으로:

Note: 이는 fencedframe 안의 내비게이션이 적절한 `Cross-Origin-Embedder-Policy` 헤더와 함께 제공되지 않으면 실패하게 한다. 이는 iframe들이 동작하는 것과 같다.

개인정보 누출을 일으킬 수 있으므로, queue a cross-origin embedder policy inheritance violation 알고리즘을 fence해야 하는지 unfence해야 하는지 결정한다.

다음으로, cross-origin resource policy checknavigation requests에 적용되는 방식을 수정한다. create navigation params by fetching 알고리즘의 단계 19, 하위 단계 13을 다음과 같이 다시 작성한다:
  1. responsenetwork error가 아니고, navigable자식 내비게이블 또는 펜스드 내비게이블이며, navigableunfenced container documentorigin, navigableunfenced container document관련 설정 객체, requestdestination, response, 및 true로 cross-origin resource policy check를 수행한 결과가 blocked이면, responsenetwork error로 설정하고 break한다.

    Note: 여기서는 cross-origin resource policy checknavigable 자체가 아니라 unfenced parent navigable에 대해 실행한다. 이는 (“fence”를 무시하고) embedded content와 embedder의 컨텍스트 사이의 same-originness가 중요하기 때문이며, 내비게이션 source가 중요하기 때문이 아니다.

개인정보 누출을 일으킬 수 있으므로, queue a cross-origin embedder policy CORP violation report 알고리즘을 fence해야 하는지 unfence해야 하는지 결정한다.

테스트
다음 새 항목들을 source snapshot params 구조체에 추가한다:
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.

Note: initiator fenced frame config instance는 존재한다면 내비게이션 initiator의 브라우징 컨텍스트에 로드된 fenced frame config instance이다. component ads의 경우 initiator ancestor root origin은 존재한다면 최상위 ad container의 origin이다. component ads의 경우 initiator ancestor root referrer policy는 존재한다면 최상위 ad container의 referrer policy이다. 이들은 attempt to send an automatic beacon 알고리즘에서 origin들을 비교하고, 만약 fencedframe이 시작한 내비게이션이 성공한다면 어떤 FenceReportingDestination들에 어떤 정보와 함께 비콘을 보낼지 결정하는 데 사용된다. 반면 target fenced frame config는 fenced frames를 대상으로 하는 내비게이션에서 fencedframe 요소에 로드될, 아직 인스턴스화되지 않은 fenced frame config이다. 이 필드들은 어떤 의미 있는 방식으로도 함께 상호작용하지 않는다.

attribution reporting enabled

boolean.

attribution reporting context origin

origin.

automatic beacons allowed

boolean.

snapshot automatic beacon store

snapshot automatic beacon store.

Document sourceDocument가 주어졌을 때 automatic beacon data mapping을 snapshot하려면:
  1. Assert: 이 단계들은 sourceDocumentevent loop에서 실행 중이다.

  2. info를 새 빈 snapshot automatic beacon store로 둔다.

  3. mappinginfodata mapping으로 둔다.

  4. crossOriginMappinginfocross-origin exposed data mapping으로 둔다.

  5. current navigablesourceDocumentnode navigable로 둔다.

  6. current navigable이 null이 아닌 동안 While:

    1. current navigable활성 문서automatic beacon data mapping에 있는 각 typedata에 대해 For each:

      1. mapping[type]이 존재하지 않으면, mapping[type]을 data로 설정한다.

      Note: 이는 특정 type에 대한 automatic beacon data를 포함하는 첫 번째 조상이 내비게이션을 시작하는 문서에 의해 사용 가능함을 보장한다. 또한 조상이 문서가 더 높은 조상에서 설정된 데이터를 사용하는 것을 차단하지 못하게 한다.

      1. crossOriginMapping[type]이 존재하지 않고 datacrossOriginExposed가 true이면, crossOriginMapping[type]을 data로 설정한다.

    2. current navigablecurrent navigableparent로 설정한다.

  7. info를 반환한다.

Note: info에 저장된 map들은 info를 만드는 데 사용된 원래 Documentautomatic beacon data mapping들에 대한 참조를 보유하도록 의도된 것이다. 이들은 나중에 attempt to send an automatic beacon에서 once가 true로 설정된 beacon data를 비우기 위해 수정된다.

주어진 Document sourceDocumentinitiator의 fenced grand-ancestor의 navigable을 얻으려면:
  1. navigablesourceDocumentnode navigable로 둔다.

  2. navigable이 null이 아니고 navigable펜스드 내비게이블이 아닌 동안:

    1. navigablenavigableparent로 설정한다.

  3. navigable이 null이면 null을 반환한다.

  4. Assert: navigable펜스드 내비게이블이다.

  5. navigablenavigableunfenced parent로 설정한다.

  6. navigable이 null이 아니고 navigable펜스드 내비게이블이 아닌 동안:

    1. navigablenavigableparent로 설정한다.

  7. navigable을 반환한다.

Documentfencedframe 안에 임베드되어 있을 때, 이 알고리즘은 해당 document의 가장 가까운 fenced frame 조상의 가장 가까운 fenced frame 조상의 navigable을 얻는다. 이러한 "fenced frame grand-ancestor"가 존재하지 않으면, 알고리즘은 null을 반환한다. 따라서 이 알고리즘은 주어진 Document가 최소한 자신도 fenced frame 안에 있는 fenced frame 안에 있을 때에만 navigable을 반환한다. 예를 들어, 주어진 frame tree 구조가 다음과 같다면:
메인 프레임 (origin A)
  <fencedframe> (origin B)
    <iframe> (origin C)
      <fencedframe> (origin D)
        <iframe> (origin E)
          <fencedframe> (origin F)

알고리즘은 각 document가 주어졌을 때 다음을 반환한다:

  • 메인 프레임 (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)를 반환한다.

snapshot source snapshot params 알고리즘을 수정하여 다음 추가 필드들이 있는 source snapshot params를 반환하게 한다:
initiator fenced frame config instance

sourceDocument브라우징 컨텍스트fenced frame config instance

initiator ancestor root origin

sourceDocument에 대해 get the initiator’s fenced grand-ancestor’s navigable를 실행한 결과가 null이면 null. 그렇지 않으면 sourceDocumentinitiator’s fenced grand-ancestor’s navigable활성 문서origin.

initiator ancestor root referrer policy

sourceDocument에 대해 get the initiator’s fenced grand-ancestor’s navigable를 실행한 결과가 null이면 null. 그렇지 않으면 sourceDocumentinitiator’s fenced grand-ancestor’s navigable활성 문서policy containerreferrer policy.

attribution reporting enabled

sourceDocument가 "attribution-reporting" feature를 사용하도록 허용되는지 결정한 결과

attribution reporting context origin

sourceDocumentcontext origin

automatic beacons allowed

sourceDocumentautomatic beacons allowed

snapshot automatic beacon store

sourceDocument에 대해 snapshot the automatic beacon data mapping을 실행한 결과.

the navigation must be a replace 알고리즘을 수정한다. 다음 새 조건을 추가한다:
테스트
[HTML]navigate 알고리즘을 수정하여 추가 매개변수, 즉 선택적 문자열 sharedStorageContext(기본값 null)를 포함한다.

[HTML]navigate 알고리즘 단계 5 뒤에 다음 단계를 추가한다:

  1. sourceDocumentnode navigable가 주어졌을 때 determine if a navigable has revoked network for itself를 실행한 결과가 true이면, 반환한다.

[HTML]navigate 알고리즘 단계 13("If all of the following are true:")을 수정하여 다음 조건을 포함한다:

테스트

병렬로 진행되는 단계인 단계 22 바로 뒤에 이 단계들을 삽입하여, 뒤따르는 단계들이 패치된 알고리즘에서 병렬로 실행되는 첫 단계가 되도록 한다:

  1. urlurn uuid 이고 navigable펜스드 내비게이블이면:

    위 조건은 필요한 만큼 엄격하지 않다. 예를 들어, fencedframe이 config-generating API를 사용해 FencedFrameConfig를 생성한 뒤, 해당 config의 urn:uuid를 정확히 추측하면, location API 같은 것을 통해 추측한 urn을 URL로 navigate 알고리즘에 전달하여 이론적으로 자신을 그 config로 내비게이트할 수 있다. 이는 좋지 않다. FencedFrameConfig의 목적은 embedder만이 config 객체를 직접 사용하여 fencedframe을 그 config가 나타내는 resource로 내비게이트할 수 있도록 보장하는 것이기 때문이다. 이를 고치는 방안에 대해서는 #194를 보라.

    1. configsourceDocumentnode navigable순회 가능 내비게이블fenced frame config mapping에서 config를 찾은 결과로 둔다.

      Note: 이는 urn uuid url과 관련된 configfenced frame config mapping에서 "finalized"될 때까지 임의의 시간 동안 "wait"할 수 있다. 이 때문에 이 단계는 병렬로 실행된다. 이 내비게이션은, 이후 embedder가 시작한 내비게이션이 발생할 경우, 진행 중인 내비게이션을 추적하는 일반 메커니즘에 의해 취소될 것이다.

    2. configembedder shared storage contextsharedStorageContext로 설정한다.

    3. Assert: sourceSnapshotParamstarget fenced frame config는 null이다.

    4. sourceSnapshotParamstarget fenced frame configconfig로 설정한다.

    5. Assert configmapped urlvalueURL이며, 그 scheme은 "https"이다.

    6. urlconfigmapped urlvalue로 설정한다.

    7. configon navigate callback 안의 단계들을 실행한다.

  2. navigable펜스드 내비게이블이고 sourceDocumentnode navigablenavigable활성 문서ancestor navigables에 있고, unfenced가 true로 설정되어 있으면:

    1. config를 다음 항목을 가진 새 fenced frame config로 둔다:

      mapped url

      다음 항목을 가진 구조체:

      value

      url

      visibility

      transparent

      effective sandboxing flags

      다음 항목을 가진 구조체:

      value

      default fenced frame effective sandboxing flags.

      visibility

      opaque

      effective enabled permissions

      null

    2. Assert: sourceSnapshotParamstarget fenced frame config는 null이다.

    3. sourceSnapshotParamstarget fenced frame configconfig로 설정한다.

테스트

"Let unloadPromptCanceled be the result of"로 시작하는 단계를 다음과 같이 다시 작성한다:

  1. unloadPromptCancelednavigable펜스드 내비게이블이면 false로, 그렇지 않으면 navigable활성 문서inclusive descendant navigables에 대해 checking if unloading is user-canceled한 결과로 둔다.

단계 22.8.2(finalSandboxFlagsunion으로 두는 단계...) 뒤에 다음 단계를 추가한다:

  1. sourceSnapshotParamstarget fenced frame config가 null이 아니고, sourceSnapshotParamstarget fenced frame configeffective sandboxing flags가 null이 아니면, finalSandboxFlagsfinalSandboxFlagssourceSnapshotParamstarget fenced frame configeffective sandboxing flagsvalueunion으로 설정한다.

    Note: 이는 finalSandboxFlagstarget fenced frame config에 정의된 effective sandboxing flags만큼 최소한 제한적임을 보장한다. blocked by sandboxing flags? 알고리즘의 별도 검사는 finalSandboxFlagseffective sandboxing flags보다 더 제한적이지 않도록 보장한다.

테스트


아래 패치들은 이전에 할당된 target fenced frame config를 사용하여, 내비게이션이 finalize될 때 사용할 준비를 위해 이를 인스턴스화한다.

항목navigation params 구조체에 추가한다:
fenced frame config instance

fenced frame config instance 또는 null, 처음에는 null.

Note: 이는 embedder가 시작한 fencedframe 내비게이션에 대해서만 설정되며, 그러한 내비게이션의 결과로 새 Document가 생성되면, 이 member는 새 펜스드 내비게이블활성 브라우징 컨텍스트fenced frame config instance member로 전송된다.

[HTML]create navigation params by fetching 알고리즘을 수정하여, navigation params를 반환하는 마지막 단계가 다음 추가 할당을 가지도록 한다:
fenced frame config instance

sourceSnapshotParamstarget fenced frame config가 null이면 null; 그렇지 않으면 sourceSnapshotParamstarget fenced frame config인스턴스화한 결과.


마지막으로, 아래 패치들은 navigation paramsfenced frame config instance를 사용하고, 내비게이션에 의해 시작되는 브라우징 컨텍스트fenced frame config instance 할당을 처리한다.

Note: 브라우징 컨텍스트fenced frame config instance는 두 가지 다른 방식으로 할당된다: (1) 이 섹션의 나머지에서 설명하는 것처럼 embedder가 시작한 fencedframe 내비게이션 동안, 그리고 (2) 그 순회 가능 내비게이블펜스드 내비게이블자식 내비게이블 안의 Document들을 위한 초기 Document 생성 중에 상속되며, 이는 § 3.3 브라우징 컨텍스트 생성에 대한 수정 섹션에서 처리된다.

fencedframe 안의 성공적인 내비게이션에서는, 그 내비게이션이 fencedframe 안의 content에 의해 시작되었든 그 embedder에 의해 시작되었든 관계없이, 정확히 두 가지 중 하나가 일어난다:

[HTML]create and initialize a Document object 알고리즘을 수정하여, 단계 2 뒤에 다음 단계를 삽입한다:
  1. navigationParamsfenced frame config instance가 null이 아니면:

    1. Assert: browsingContextnavigationParamsnavigable활성 브라우징 컨텍스트와 같지 않다.

      Note: 이는 (navigationParamsfenced frame config instance가 null이 아님으로 표시되는) embedder가 시작한 내비게이션이 항상 § 3.8.6 브라우징 컨텍스트 그룹 swap을 일으키기 때문이다.

    2. navigationParamsfenced frame config instancecross-origin reporting allowednavigationParamsresponseheader list에 대해 `Allow-Cross-Origin-Event-Reporting`와 "item"을 주어 structured field value를 얻은 결과로 설정한다.

    3. browsingContextfenced frame config instancenavigationParamsfenced frame config instance로 설정한다.

단계 9 뒤에 다음 새 단계를 추가한다:

  1. automaticBeaconsAllowednavigationParamsresponseheader list에 대해 `Allow-Fenced-Frame-Automatic-Beacons`와 "item"을 주어 structured field value를 얻은 결과로 둔다.

또한 단계 10(이제 단계 12)을 다시 작성하여 추가 매개변수가 있는 새 Document를 반환하게 한다:

automatic beacons allowed

automaticBeaconsAllowed.

[HTML]attempt to populate the history entry’s document 알고리즘의 단계 5, 하위 단계 4("Otherwise, if any of the following are true:")를 수정하여 다음 조건을 포함한다:

3.8.6. 브라우징 컨텍스트 그룹 swap

fencedframe의 embedder가 frame 안에서 내비게이션을 시작할 때, 우리는 frame 안의 컨텍스트를 완전히 재설정하기 위해 브라우징 컨텍스트 그룹 swap을 수행해야 한다. 이는 다음 Document로 누출될 것이 남아 있지 않도록 보장하기 위해서이다.

[HTML]attempt to populate the history entry’s document 알고리즘을 수정한다. "6. Queue a global task on the navigation and traversal task source"라고 쓰인 단계 앞에 다음 단계를 추가한다:
  1. 다음 조건이 모두 true이면:

    그러면 navigationParamsCOOP enforcement resultneeds a browsing context group switch boolean을 true로 설정한다.

    이는 실제로 동작하지만, fenced frames를 염두에 두지 않고 설계된 COOP 메커니즘에 편승하는 대신, 이를 수행하기 위한 별도 메커니즘을 사용하는 것을 고려해야 한다. COOP 메커니즘은 이 명세에 원치 않는 부작용을 주는 방식으로 진화할 수 있기 때문이다.

3.8.7. "_unfencedTop" 내비게이션 대상

Fenced frames는 내비게이트하기 위해 추가 예약 내비게이션 대상 "_unfencedTop"을 사용한다. 이 섹션은 이 새 예약 keyword에 대한 지원을 추가하기 위해 [HTML] 명세의 관련 부분을 패치한다.

valid navigable target name or keyword를 수정하여 "_unfencedTop"이라는 새 keyword를 포함한다.

아래 단락을 수정하여 다음 텍스트를 대체한다:

다음으로:

Note: 이 변경은 이 명세가 이전에는 기능적으로 동등했던 traversable navigabletop-level traversable 사이에 구분을 추가하기 때문에 필요하다.

아래 표에서 "Effect in a fenced frame"이라는 열을 추가한다. 이 열에서 기존 모든 행의 값은 "ordinary effect"와 같다. 그런 다음, 다음 두 행을 추가한다:

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
the rules for choosing a navigable에 현재 단계 6과 7 사이에 다음과 같은 추가 단계를 추가한다:

6.5. 그렇지 않고, name이 ASCII 대소문자 구분 없이 "_unfencedTop"와 일치하고 currentNavigable순회 가능 내비게이블펜스드 내비게이블이면, chosencurrentNavigabletop-level traversable로 설정한다.

3.9. Page visibility

Page visibility 섹션([HTML])은 사용자 에이전트가 순회 가능 내비게이블system visibility state를 변경할 때 실행되는 알고리즘의 첫 단계가 inclusive descendant navigables 알고리즘을 unfenced를 true로 설정하여 호출하도록 수정된다.

3.10. 이벤트

3.10.1. onfencedtreeclick event handler

event handlers on elements, Document objects, and Window objects 섹션([HTML])의 표를 수정하여 새 행을 포함한다.
Event handler Event handler event type
onfencedtreeclick fencedtreeclick

GlobalEventHandlers 인터페이스는 다음과 같이 수정된다:

partial interface mixin GlobalEventHandlers {
  attribute EventHandler onfencedtreeclick;
};

또한, [HTML]에서 어떤 HTML 요소에도 지정될 수 있는 event handler content attributes 목록을 수정하여 새 행을 포함한다:

3.10.2. fencedtreeclick event type

Events 표(Index 섹션, [HTML])를 수정하여 새 행을 포함한다.
Event Interface Interesting targets Description
fencedtreeclick Event Elements fenced navigableDocumentnotifyEvent()를 호출한 뒤, fencedframe 요소에서 비동기적으로 fire된다

4. 다른 명세와의 상호작용

fencedframe 요소와 navigablebrowsing context group 같은 핵심 개념과의 상호작용은 필연적으로 여러 영역에 걸쳐 있으므로, 이 명세를 고려하여 term 사용을 재평가해야 하는 여러 명세가 있다. 이 섹션은 우리가 다른 명세에 제안하는 여러 변경을 담는다.

4.1. Prerendering

Prerendering Revamped 명세는 navigableloading mode와 그것이 가질 수 있는 값을 정의한다. 우리 명세는 fenced frames를 위한 또 다른 값을 추가한다:

"fencedframe"

navigablefencedframe의 content를 표시하고 있다

다음을 유도하는 동작을 명시한다:

테스트

4.2. Content Security Policy

이 소개 섹션은 비규범적이다.

Content Security Policy [CSP]는 일반적으로 navigable container를 호스팅하는 Document와 관련된 웹 콘텐츠가 child navigable 안의 내비게이션 source를 제한하는 데 사용할 수 있다.

[CSP]fencedframe 안의 내비게이션 URL을 그 embedder를 운영하는 site에 노출하는 통신 부채널로 사용되는 것을 방지하기 위해, fencedframe 내비게이션에 영향을 줄 수 있는 유일한 source expressions는 다음과 같다:

이를 설명하는 우리의 CSP explainer를 보라.

4.2.1. 알고리즘

frame-src pre-request check의 단계 2 뒤에 다음과 같은 단계를 추가한다:
  1. requestdestination이 "fencedframe"이고, 이 directive의 value가 "https:", "https://*:*", 또는 "*" 중 어느 것도 포함하지 않으면, "Blocked"를 반환한다.

frame-src post-request check의 단계 2 뒤에 다음과 같은 단계를 추가한다:
  1. request destination이 "fencedframe"이고, 이 directive의 value가 "https:", "https://*:*", 또는 "*" 중 어느 것도 포함하지 않으면, "Blocked"를 반환한다.

다음으로, [CSPEE] 명세의 동작을 수정한다. embedding frame이 required CSP를 지정하면, fenced frames는 로드되지 않는다. 이는 embedder에서 fenced frame으로 임의의 데이터 흐름을 방지하기 위해 수행된다.

Is response to request blocked by context’s required CSP? 알고리즘의 단계 1 뒤에 다음과 같은 단계를 추가한다:
  1. contextrequired cspnull이 아니고, request destination이 "fencedframe"이면, "Blocked"를 반환한다.

4.2.2. 새 fenced-frame-src [CSP] directive

fencedframeiframe과 다른 요소이므로, frame-src directive를 사용하는 것만으로는 웹 사이트가 자신의 CSP 규칙을 충분히 제어할 수 없다. 새 [CSP] directive, fenced-frame-src를 도입한다. 몽키패치된 명세는 아래에 표시된다:

fenced-frame-src directive는 fencedframe펜스드 내비게이블에 로드될 수 있는 URL을 제한한다. directive의 name과 value에 대한 구문은 다음 ABNF로 설명된다:
directive-name  = "fenced-frame-src"
directive-value = serialized-source-list
다음 Content Security Policy를 가진 페이지가 주어졌을 때:
Content-Security-Policy: fenced-frame-src https://example.com/

다음 코드에 대한 fetch는 제공된 URL이 fenced-frame-srcsource list와 일치하지 않으므로 network error를 반환한다:

<fencedframe src="https://example.org/">
</fencedframe>

Pre-request checkPost-request checkframe-src의 check와 동일하다.

default-src directive의 Example 7과 Example 8은 수정된다. 다음과 같이 되어 있는 곳:
Content-Security-Policy: connect-src 'self';
                        ...
                        worker-src 'self'

이제 다음과 같이 된다:

Content-Security-Policy: connect-src 'self';
                        ...
                        fenced-frame-src 'self';
                        ...
                        worker-src 'self'
directive fallback list의 단계 1에서, 목록에 새 항목을 추가한다:
"fenced-frame-src"
  1. << "fenced-frame-src", "frame-src", "child-src", "default-src" >>를 반환한다.

Get the effective directive for request 알고리즘의 단계 3의 switch를 수정하여 다음 case를 포함한다:
"fencedframe"
  1. fenced-frame-src를 반환한다.

테스트

4.3. Permissions Policies

이 소개 하위 섹션은 비규범적이다.

fencedframe 안의 Document들에서 사용할 수 있는 policy-controlled features와 그 계산 방식은 fencedframe이 내비게이트하는 fenced frame config가 어떻게 구성되는지에 따라 달라진다.

웹 플랫폼에서 FencedFrameConfig constructor를 통해 생성된 fenced frame config instanceflexible permissions policy behavior를 가지며, 이 config가 내비게이트하는 fencedframe의 내부 Document는 해당 permission들이 fenced frame allowed permissions 목록에 포함되는 한 permission을 상속하도록 허용된다. 그 밖의 모든 policy-controlled features는 비활성화된다.

effective enabled permissions를 설정하는 config-generating API를 통해 생성된 fenced frame config instancefixed permissions policy behavior를 가지며, 이 config가 내비게이트하는 fencedframe의 내부 Documenteffective enabled permissions가 해당 Document에서 활성화될 policy-controlled features의 배타적 목록이 되도록 한다 (다른 모든 것은 비활성화된다).

fixed permissions policy behavior를 가진 fenced frame config instancefencedframe 내비게이션을 수행하는 동안, 이는 내비게이트 대상인 fenced frame config instanceeffective enabled permissions를 결과 Documentpermissions policyinherited policy와 비교한다. 내비게이션은 inherited policy value가 "Enabled"인 각 상속된 feature가 fenced frame config instanceeffective enabled permissions에도 나타날 때만 성공한다. 그렇지 않으면, fencedframe이 임베드된 환경은 fenced frame config에 부적합한 것으로 간주되고, 내비게이션은 차단된다.

동시에, fencedframe의 embedder가 해당 내비게이션의 origin에 기반하여 frame 안의 content에 직접 영향을 주지 않도록 보장하기 위해(origin은 cross-site data에서 파생되기 때문에), 이 명세는 여러 [PERMISSIONS-POLICY] 알고리즘을 수정하여 fencedframe Documentinherited policy가 그 origin이 embedder의 origin과 same origin인지 고려하지 않고 계산되도록 한다. 따라서 feature는 그 embedder가 the special value * allowlist를 통해 명시적으로 위임하는 경우에만 fencedframe 안에서 활성화될 수 있다.

위의 모든 것을 고려하면, fixed permissions policy behavior 내비게이션에 대해 다음과 같은 흥미로운 함의가 나온다:

아래 섹션의 패치들은 위 설명 내용에 서술된 결과를 달성하기 위해 적절한 [PERMISSIONS-POLICY][HTML] 알고리즘을 "fence"한다.

4.3.1. 정의

fenced frame allowed permissions는 "private-aggregation", "shared-storage", 또는 "shared-storage-select-url"이다.

4.3.2. 알고리즘 패치

iframe 요소의 allow attribute 섹션의 이름을 "iframefencedframe 요소의 allow attribute"로 바꾸고, 섹션을 다음과 같이 다시 작성한다:

iframefencedframe 요소는 각각 allow attribute를 가진다 (iframe: allow; fencedframe: allow). 이 attribute는 ASCII-serialized policy directive를 포함한다.

attribute에 명명된 feature들에 대한 allowlist는 비어 있을 수 있다. 이 경우 allowlist의 기본값은 "src"이며, 이는 iframe의 src attribute 안의 URL의 origin, 또는 fencedframe의 fenced frame config를 나타낸다.

비어 있지 않을 때, iframeallow 또는 fencedframeallow attribute는 구성될 때 iframe 또는 fencedframecontainer policy에 각 supported feature에 대한 allowlist를 추가하게 된다.

Create a permissions policy for a fenced navigable라는 새 알고리즘을 만든다.

펜스드 내비게이블 컨테이너(container)와 origin(origin)이 주어졌을 때, 이 알고리즘은 새 Permissions Policy를 반환한다.

  1. fencedFrameConfigcontainer노드 문서활성 브라우징 컨텍스트fenced frame config instance로 둔다.

  2. inheritedPolicy를 새 ordered map으로 둔다.

  3. fencedFrameConfig가 null이 아니고 fencedFrameConfigpermissions policy behaviorfixed이면:

    1. For each supported feature에 대해:

      1. fencedFrameConfigeffective enabled permissionsfeature포함하면, inheritedPolicy[feature]를 "Enabled"로 설정한다.

        그렇지 않으면 inheritedPolicy[feature]를 "Disabled"로 설정한다.

      Note: 이는 allow attribute를 고려하지 않지만, 이것이 호출될 때까지는 Should navigation response to navigation request be blocked by Permissions Policy? 때문에 이미 검사되어 있을 것이다. allow에 지정된 policy가 너무 제한적이면 fenced frame이 로드되지 않았을 것이고, effective enabled permissions에 지정된 것보다 더 허용적인 policy는 무시될 것이다.

  4. 그렇지 않으면:

    1. For each supported feature에 대해:

      1. featurefenced frame allowed permissions 중 하나와 일치하면, inheritedPolicy[feature]를 feature, container, origin이 주어졌을 때 Define an inherited policy for feature in container at origin을 실행한 결과로 설정한다.

        그렇지 않으면 inheritedPolicy[feature]를 "Disabled"로 설정한다.

  5. policy를 새 permissions policy로 두며, inherited policyinheritedPolicy이고 declared policy는 두 개의 새 ordered maps로 초기화된다.

  6. policy를 반환한다.

Create a Permissions Policy for a navigable 알고리즘을 수정한다:

null 또는 element(container), origin(origin), 그리고 기본값이 false인 선택적 boolean matchAll이 주어졌을 때, 이 알고리즘은 새 permissions policy를 반환한다.

단계 1을 다음과 같이 다시 작성한다:

  1. Assert: null이 아니면, container내비게이블 컨테이너이거나 펜스드 내비게이블 컨테이너이다.

단계 3을 다음과 같이 다시 작성한다:

  1. For each supported feature에 대해:

    1. isInheritedfeature, container, origin, 그리고 matchAll에 대해 Define an inherited policy for feature in container at origin을 실행한 결과로 둔다.

    2. inherited policy[feature]를 isInherited로 설정한다.

Create a Permissions Policy for a navigable from response 알고리즘을 다음과 같이 읽히도록 수정한다:

null, 내비게이블 컨테이너-또는-펜스드 내비게이블 컨테이너(container), origin(origin), 그리고 response (response)가 주어졌을 때, 이 알고리즘은 새 permissions policy를 반환한다.

단계 1을 다음과 같이 다시 작성한다:

  1. container펜스드 내비게이블 컨테이너이면, policycontainerorigin이 주어졌을 때 create a permissions policy for a fenced navigable를 실행한 결과로 둔다.

    그렇지 않으면, policycontainerorigin이 주어졌을 때 Create a Permissions Policy for a navigable를 실행한 결과로 둔다.

Process permissions policy attributes 알고리즘의 단계 1을 다음과 같이 읽히도록 수정한다:
  1. elementiframe 요소도 아니고 fencedframe 요소도 아니면, 빈 policy directive를 반환한다.

[HTML]attempt to populate the history entry’s document 알고리즘을 수정한다. 단계 6.4(Otherwise, if any of the following are true:)에 다음 조건을 추가한다:

Note: 이러한 알고리즘 중 하나라도 "Blocked"를 반환하면, fencedframe 안의 기존 Document는 남아 있지 않으며, error page가 로드된다.

Should navigation response to navigation request be blocked by Permissions Policy?

navigation params(navigationParams)가 주어졌을 때, 이 알고리즘은 "Blocked" 또는 "Allowed"를 반환한다:

  1. navigablenavigationParamsnavigable로 둔다.

  2. navigable펜스드 내비게이블이 아니면, "Allowed"를 반환한다.

  3. originnavigationParamsorigin으로 둔다.

  4. effective permissionsnavigable활성 브라우징 컨텍스트fenced frame config instanceeffective enabled permissions로 둔다.

    pull request #84에서 생략된 작업에 따르면, config instance는 아직 browsing context에 할당되지 않았다. 대신 instance를 navigationParams 안에 저장하고 여기서 그것을 참조하는 것을 고려해야 한다.

  5. permissionsPolicynavigablefenced navigable container, origin, 그리고 true가 주어졌을 때 creating a permissions policy한 결과로 둔다.

    Note: 이는 이 pending 내비게이션에 대한 최종 Document를 내비게이션이 구성할 때 생성permissions policy와 거의 동일하다. 차이점은 이 알고리즘이 iframe에서 호출될 때와 마찬가지로, allow attribute에 지정된 모든 permission을 포함한다는 것이다. 해당 permission이 fenced frame configeffective enabled permissions에 지정되어 있지 않더라도 그렇다. 내비게이션이 실패할지 결정하기에 적절한 시점이므로 지금 이를 만들고 테스트를 실행한 뒤 버린다. 내비게이션이 성공하면, 이는 다시 생성되어 Document에 무조건 설치된다. 그러나 재생성은 effective enabled permissions에 포함되지 않은 추가 활성 permission을 포함하지 않으며, 사실상 활성화된 permission을 effective enabled permissions에 지정된 것만으로 잠근다.

  6. inheritedPolicypermissionsPolicyinherited policy로 둔다.

  7. effective permissions의 각 effective permission에 대해 For each:

    1. inheritedPolicy[effective permission]이 "Disabled"이면 "Blocked"를 반환한다.

  8. "Allowed."를 반환한다.

Should navigation response to navigation request be blocked by sandboxing flags?

navigation params(navigationParams)와 source snapshot params (sourceSnapshotParams)가 주어졌을 때, 이 알고리즘은 "Blocked" 또는 "Allowed"를 반환한다:

  1. navigablenavigationParamsnavigable로 둔다.

  2. navigable펜스드 내비게이블이 아니면, "Allowed"를 반환한다.

  3. effectiveSandboxingFlagssourceSnapshotParamstarget fenced frame configeffective sandboxing flags로 둔다.

  4. navigationParamsfinal sandboxing flag seteffectiveSandboxingFlagssubset이 아니면, "Blocked"를 반환한다.

    Note: 이는 final sandboxing flag seteffective sandboxing flags에서 이미 제한되지 않은 feature를 제한할 수 없음을 의미한다. 추가 제한은 통신 채널로 사용될 수 있기 때문이다. 이 시점에서 final sandboxing flag set은 이미 effective sandboxing flags만큼 최소한 제한적으로 설정되어 있을 것이다.

  5. 그렇지 않으면 "Allowed"를 반환한다.

Define an inherited policy for feature in container at origin 알고리즘을 다음과 같이 읽히도록 수정한다:

feature(feature), null 또는 내비게이블 컨테이너(container), 해당 container 안의 document에 대한 origin(origin), 그리고 기본값이 false인 선택적 boolean matchAll이 주어졌을 때, 이 알고리즘은 해당 feature에 대한 inherited policy를 반환한다.

단계 3을 다음과 같이 다시 작성한다:

  1. feature, container노드 문서, origin, 그리고 matchAll에 대해 Is feature enabled in document for origin?를 실행한 결과가 "Disabled"이면, "Disabled"를 반환한다.

Note: 동일한 알고리즘에 위임하는 단계 2를 다시 작성하여 matchAll boolean을 전달할 필요는 없다. 단계 2는 featurecontainer노드 문서에서 활성화되어 있는지 검사하는 것과 관련되어 있으며, container 안에 호스팅된 Document와 관련된 것이 아니기 때문이다.

단계 7을 다음과 같이 다시 작성한다:

  1. matchAll이 false이고, featuredefault allowlist'self'이며, origincontainer노드 문서의 origin과 same origin이면, "Enabled"를 반환한다.

Is feature enabled in document for origin? 알고리즘을 다음과 같이 읽히도록 수정한다:

feature(feature), Document 객체(document), origin (origin), 그리고 기본값이 false인 선택적 boolean matchAll이 주어졌을 때, 이 알고리즘은 feature가 disabled로 간주되어야 하면 "Disabled"를 반환하고, 그렇지 않으면 "Enabled"를 반환한다.

단계 3을 다음과 같이 다시 작성한다:

  1. featurepolicydeclared policy에 존재하면,

    1. matchAll이 false이고, policydeclared policy 안에서 feature에 대한 allowlistoriginmatches이면, "Enabled"를 반환한다.

    2. 그렇지 않고, matchAll이 true이고, policydeclared policy 안에서 feature에 대한 allowlistthe special value *이면, "Enabled"를 반환한다.

    3. 그렇지 않으면 "Disabled"를 반환한다.

단계 5를 다음과 같이 다시 작성한다:

  1. matchAll이 false이고, featuredefault allowlist'self'이며, origindocument의 origin과 same origin이면, "Enabled"를 반환한다.

declared origin 알고리즘을 수정한다. 단계 3 뒤에 다음 새 단계를 추가한다:
  1. node노드 문서브라우징 컨텍스트fenced frame config instance가 null이 아니면, node노드 문서브라우징 컨텍스트fenced frame config instancemapped url을 반환한다.

Note: 이는 allow attribute에 설정될 수 있는 'src' allowlistfenced frame config를 사용해 fencedframe을 내비게이트할 때(또는 fenced frame config로 매핑되는 urn으로 iframe을 내비게이트할 때) 동작하도록 보장한다.

테스트

4.4. CSSOM View

[CSSOM-VIEW] 명세는 scroll a target into view 알고리즘을 호출하는 scrollIntoView() 메서드를 정의한다. 이는 대상이 보이도록 Element 또는 viewport를 스크롤할 뿐 아니라, 필요하다면 대상이 보이도록 ancestor들도 스크롤하며, 본질적으로 스크롤이 "bubble up"되도록 한다. 이는 child navigable 또는 fenced navigable 안에서 수행된 scrollIntoView()를 그 embedder가 관찰할 수 있음을 의미하며, fenced frame 경계를 가로지르는 담합을 허용한다. 이 섹션은 일부 유용성을 희생하면서 그러한 담합을 방지하기 위해 scroll a target into view 알고리즘을 패치한다.

scroll a target into view 알고리즘을 수정하여 알고리즘 끝에 다음과 같은 단계를 추가한다:
  1. scrolling box의 연관된 Element의 연관된 Documentnode navigabletraversable navigablefenced navigable이거나, 또는 scrolling box의 연관된 viewport의 연관된 Documentnode navigabletraversable navigablefenced navigable이면, 이를 그렇지 않으면 뒤따를 추가 재귀 인스턴스를 중단시키는 이 알고리즘의 마지막 인스턴스로 둔다.

Note: 이는 스크롤이 fenced frame 경계까지 "bubble up"되는 것은 허용하지만, 이를 넘지는 못하게 한다.

테스트

4.5. Iframe credentialless

이 첫 번째 소개 섹션은 비규범적이다.

[IFRAME-CREDENTIALLESS] 명세는 새로운 객체인 page credentialless nonce를 정의한다. 높은 수준에서 partition noncepage credentialless nonce와 같은 목적(저장소와 네트워크 파티셔닝)을 수행한다. 그러나 각 fenced frame은 고유한 nonce를 가지는 반면, page credentialless noncetraversable navigableactive window에 scope되는 단일 nonce이며, 모든 descendant credentialless iframes가 공유한다.

fenced frames와 credentialless iframes가 같은 tree 안에 존재하는 경우, 자식의 nonce는 항상 그 부모의 nonce보다 우선한다. 예를 들어:

리소스 파티셔닝에 더해, partition nonce는 fenced frames에서 네트워크 접근을 철회하는 데도 사용된다. 다음 monkeypatch들을 [IFRAME-CREDENTIALLESS] 명세에 적용한다.

다음 알고리즘을 추가한다:

boolean credentiallesspartition nonce-or-null newFencedFrameNonce가 주어졌을 때 effective partition nonce를 계산하려면:
  1. credentialless가 true이면, 연관된 browsing contexttop-level browsing contextpage credentialless nonce를 반환한다.

  2. newFencedFrameNonce가 null이 아니면, newFencedFrameNonce를 반환한다.

  3. instance를 연관된 browsing contextfenced frame config instance로 둔다.

  4. instance가 null이 아니면 instancepartition nonce를 반환하고, 그렇지 않으면 null을 반환한다.

network partition key 재정의 전체를 다음과 같이 다시 작성한다:

network partition key는 다음으로 구성된 tuple이다:

섹션 6.1.9.1 전체를 다음과 같이 다시 작성한다:

create navigation params by fetching에서, 단계 18과 19 사이에 다음과 같은 새 단계를 추가한다:

  1. partitionNoncebrowsingContext에 대해 effective partition nonce를 계산한 결과로 둔다. 이때 browsingContext에 대해 navigation’s credentialless flag를 계산한 결과와 null이 주어진다.

Note: 여기서 effective partition nonce를 계산할 때 null을 전달하는 이유는 fenced frame에서 발생한 navigation fetch가 fenced frame 자체와 같은 partition을 사용하기를 원하기 때문이다. navigation fetch가 완료되고 document를 초기화한 뒤에는 fenced frame config instancepartition nonce를 통해 올바른 partition nonce에 접근할 수 있다.

단계 19를 20으로 번호를 다시 매기고, 단계 20.2.4를 다음과 같이 다시 작성한다:

  1. requestreserved client를 새 environment로 설정한다. 그 id는 고유한 불투명 문자열이고, target browsing contextnavigableactive browsing context, creation URLcurrentURL, top-level creation URLtopLevelCreationURL, top-level origin topLevelOrigin, 그리고 partition noncepartitionNonce.이다.

initialize the document object에 추가된 단계를 다음과 같이 읽히도록 수정한다:

6.9. partitionNoncebrowsingContext에 대해 effective partition nonce를 계산한 결과로 둔다. 이때 navigationParamscredentialless와, navigationParamsfenced frame config instance가 null이면 null, 그렇지 않으면 navigationParamsfenced frame config instancepartition nonce가 주어진다.

4.6. WebRTC

[WEBRTC] 명세는 "적절한 실시간 프로토콜 집합을 구현하는 다른 브라우저나 장치로 미디어 및 일반 application data를 보내고 받을 수 있게 하는 WebIDL의 ECMAScript API"를 정의한다. peers와의 연결을 가능하게 하는 인터페이스는 RTCPeerConnection이다. 이 인터페이스의 생성, 따라서 WebRTC를 통한 peers와의 연결은 fenced frames에서 허용되지 않는다.

RTCPeerConnection constructor 알고리즘을 수정하여 다음과 같은 새 첫 번째 및 두 번째 단계를 추가한다:
  1. navigablethisrelevant global objectnavigable로 둔다.

  2. navigable이 null이 아니고 navigabletraversable navigablefenced navigable이면, throw a NotAllowedError DOMException.

5. 보안 및 개인정보 고려사항

이 자료는 우리 explainer에서 이 명세로 upstream되는 중이며, 그동안에는 다음 리소스를 참조할 수 있다:

색인

이 명세에서 정의된 용어

참조로 정의된 용어

참고문헌

규범적 참고문헌

[ANONYMOUS-IFRAME]
Iframe credentialless. Draft Community Group Report. URL: https://wicg.github.io/anonymous-iframe/
[ATTRIBUTION-REPORTING-API]
Attribution Reporting. Draft Community Group Report. URL: https://wicg.github.io/attribution-reporting-api/
[CSP]
Mike West; Antonio Sartori. Content Security Policy Level 3. URL: https://w3c.github.io/webappsec-csp/
[CSPEE]
Mike West. Prerendering Revamped. CG-DRAFT. URL: https://w3c.github.io/webappsec-cspee/
[CSS2]
Bert Bos; et al. Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification. URL: https://drafts.csswg.org/css2/
[CSSOM-VIEW]
Simon Pieters. CSSOM View Module. URL: https://drafts.csswg.org/cssom-view/
[DOM]
Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/
[FETCH]
Anne van Kesteren. Fetch Standard. Living Standard. URL: https://fetch.spec.whatwg.org/
[HTML]
Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[IFRAME-CREDENTIALLESS]
Arthur Sonzogni; Camille Lamy. Iframe credentialless. CG-DRAFT. URL: https://wicg.github.io/anonymous-iframe/
[INFRA]
Anne van Kesteren; Domenic Denicola. Infra Standard. Living Standard. URL: https://infra.spec.whatwg.org/
[MIXED-CONTENT]
Emily Stark; Mike West; Carlos IbarraLopez. Mixed Content. URL: https://w3c.github.io/webappsec-mixed-content/
[PERMISSIONS-POLICY]
Ian Clelland. Permissions Policy. URL: https://w3c.github.io/webappsec-permissions-policy/
[Prerendering-Revamped]
Domenic Denicola; Dominic Farolino. Prerendering Revamped. CG-DRAFT. URL: https://wicg.github.io/nav-speculation/prerendering.html
[REFERRER-POLICY]
Jochen Eisinger; Emily Stark. Referrer Policy. URL: https://w3c.github.io/webappsec-referrer-policy/
[Reporting]
Douglas Creager; Ian Clelland; Mike West. Reporting API. URL: https://w3c.github.io/reporting/
[RFC6455]
I. Fette; A. Melnikov. The WebSocket Protocol. 2011년 12월. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc6455
[RFC8941]
M. Nottingham; P-H. Kamp. Structured Field Values for HTTP. 2021년 2월. Proposed Standard. URL: https://httpwg.org/specs/rfc8941.html
[Shared-Storage]
Cammie Barnes. Shared Storage API. CG-DRAFT. URL: https://wicg.github.io/shared-storage/
[TURTLEDOVE]
Protected Audience (formerly FLEDGE). Draft Community Group Report. URL: https://wicg.github.io/turtledove/
[URL]
Anne van Kesteren. URL Standard. Living Standard. URL: https://url.spec.whatwg.org/
[WEBIDL]
Edgar Chen; Timothy Gu. Web IDL Standard. Living Standard. URL: https://webidl.spec.whatwg.org/
[Webpackage]
Loading Signed Exchanges. Draft Community Group Report. URL: https://wicg.github.io/webpackage/loading.html
[WEBRTC]
Cullen Jennings; et al. WebRTC: Real-Time Communication in Browsers. URL: https://w3c.github.io/webrtc-pc/
[WebSockets]
Adam Rice. WebSockets Standard. Living Standard. URL: https://websockets.spec.whatwg.org/
[WebTransport]
Nidhi Jaju; Victor Vasiliev. WebTransport. URL: https://w3c.github.io/webtransport/

정보성 참고문헌

[Protected-Audience]
Paul Jensen. Protected Audience API. CG-DRAFT. URL: https://wicg.github.io/turtledove/

IDL 색인

[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;
};

enum OpaqueProperty {"opaque"};

[Exposed=Window, Serializable]
interface FencedFrameConfig {
  constructor(USVString url);
  undefined setSharedStorageContext(DOMString contextString);
};

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);
};

enum FenceReportingDestination {
  "buyer",
  "seller",
  "component-seller",
  "direct-seller",
  "shared-storage-select-url",
};

dictionary FenceEvent {
  // 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:
  DOMString eventType;
  DOMString eventData;
  sequence<FenceReportingDestination> destination;

  // 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.
  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);
};

partial interface Window {
  // Collection of fenced frame APIs
  readonly attribute Fence? fence;
};

partial interface mixin GlobalEventHandlers {
  attribute EventHandler onfencedtreeclick;
};

이슈 색인

일반적인 child navigable 생성 또는 top-level traversable 생성 중에 하는 것처럼 URL and history update steps를 호출할 필요는 없지만, 새 navigable에서 History.length를 초기화하는 메커니즘은 여전히 필요하다. 이는 HTML Standard의 기존 이슈이다: https://github.com/whatwg/html/issues/9030.
기본값은 "all"이므로, 기술적으로는 여기서 아무것도 설정하지 않아도 된다. 일부 다른 beacon처럼 여기서 service worker를 건너뛰는 것이 더 적절할 수도 있음을 스스로에게 상기시키기 위해 설정한다.
이는 WPT web driver에 테스트 전용 함수를 추가하기 위한 RFC가 필요하다. (WICG/fenced-frame#192) 그 web driver 변경이 이루어지면, disableUntrustedNetwork()에 대한 기존 Chromium 내부 web platform tests를 upstream하고 여기에 링크해야 한다. (WICG/fenced-frame#207)
이는 fenced frame nonce와 iframe credentialless nonce가 존재한다면 둘 다 전달되어야 한다. (WICG/fenced-frame#191)
의도는 sourceSnapshotParamstarget fenced frame config가 embedder-initiated fencedframe navigation에서는 non-null이고 그 외에는 null이어야 한다는 것이다. 그러나 이 이슈가 해결되기 전까지는 이것이 true가 아니다.
queue a cross-origin embedder policy inheritance violation 알고리즘을 fence해야 하는지 또는 unfence해야 하는지 결정한다. 이를 unfenced 상태로 두면 privacy leak이 발생할 수 있기 때문이다.
queue a cross-origin embedder policy CORP violation report 알고리즘을 fence해야 하는지 또는 unfence해야 하는지 결정한다. 이를 unfenced 상태로 두면 privacy leak이 발생할 수 있기 때문이다.
위 조건은 필요한 만큼 엄격하지 않다. 예를 들어, fencedframe이 config-generating API를 사용해 FencedFrameConfig를 생성한 뒤, config의 urn:uuid를 정확히 추측하면, 이론적으로는 추측한 urn을 URL로서 navigate 알고리즘에 전달하여, 예컨대 location API 같은 것을 통해 자기 자신을 그 config로 navigate할 수 있다. 이는 좋지 않다. FencedFrameConfig의 목적은 embedder만이 config 객체를 직접 사용해 fencedframe을 해당 config가 나타내는 리소스로 navigate할 수 있도록 보장하는 것이기 때문이다. 이를 수정하는 방안은 #194를 참고한다.
이것은 실제로 동작하지만, fenced frames를 염두에 두지 않고 설계된 COOP 메커니즘에 편승하는 대신, 이를 수행하기 위한 별도의 메커니즘 사용을 고려해야 한다. COOP 메커니즘은 이 명세에 원치 않는 side-effect를 줄 수 있는 방식으로 발전할 수 있기 때문이다.
다음으로 이어지는 동작을 명시한다:
pull request #84에서 생략된 작업에 따르면, config instance는 아직 browsing context에 할당되지 않았다. 대신 instance를 navigationParams 안에 저장하고 여기서 참조하는 것을 고려해야 한다.