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
속성에 의해 결정된다.
-
embedder가
iframe요소이면: embedder의 iframe sandboxing flag set에 설정된 플래그. -
embedder가
fencedframe요소이면: embedder의 fencedframe sandboxing flag set에 설정된 플래그.
fencedframe
요소 element가 null이 아닌 브라우징 컨텍스트를 가진 문서에
삽입될 때,
다음 단계를 실행한다:
-
nested traversable을 element에 대해 새 중첩 순회 가능 항목을 생성한 결과로 둔다.
-
nested traversable의 로딩 모드를 "
fencedframe"로 설정한다. -
element가
sandbox속성을 가지면, 그 속성의 값과 element의 fencedframe sandboxing flag set을 주어 샌드박싱 지시문을 파싱한다.
일반적인 자식
내비게이블 생성 또는 최상위
순회 가능 항목 생성 중에 하는 것처럼 URL
및 히스토리 업데이트 단계를 호출할 필요는 없지만, 새 내비게이블에서
History.length를
초기화할 메커니즘은 여전히 필요하다. 이는 HTML
Standard의 기존 이슈이다: https://github.com/whatwg/html/issues/9030.
fencedframe
요소가 문서에서 제거되면, 사용자 에이전트는 다음 단계를 실행해야 한다:
-
TODO: 중첩 순회 가능 항목을 파괴한다.
-
병렬로,
Document의 노드 내비게이블의 최상위 순회 가능 항목을 주어 모든 펜스드 프레임 자손의 신뢰할 수 없는 네트워크 상태를 다시 계산한다.
config IDL 속성 getter 단계는
this의 config를
반환하는 것이다.
config
IDL 속성 setter 단계는 다음과 같다:
-
instance를 this의 관련 전역 객체의 브라우징 컨텍스트의 펜스드 프레임 설정 인스턴스로 둔다.
-
instance가 null이 아니고, 그 신뢰할 수 없는 네트워크 상태가 enabled가 아니면, 반환한다.
-
navigation url or urn을 주어진
FencedFrameConfig의 url이 null이 아닌 경우 그 url로, 그렇지 않으면 주어진FencedFrameConfig의 urn으로 둔다. -
navigation url or urn이 failure이면 반환한다.
-
shared storage context를 주어진
FencedFrameConfig의 sharedStorageContext로 둔다. -
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 속성 allow와
sandbox는 같은 이름의 각각의 콘텐츠 속성을
반영해야 한다.
sandbox의
DOMTokenList에
대해 지원되는 토큰은
sandbox
속성에 정의되고 사용자 에이전트가 지원하는 허용 값이다.
fencedframe
요소에 사용된다:
-
Assert: namespace는 HTML 네임스페이스이다.
-
localName이
sandbox이면, 다음을 실행한다:-
value가 null이면, element의 fencedframe sandboxing flag set을 비운다.
-
그렇지 않으면, value와 element의 fencedframe sandboxing flag set을 주어 샌드박싱 지시문을 파싱한다.
-
2.1. 치수 속성
이 섹션은 [HTML]의 치수
속성 섹션에 대한 몽키패치를 자세히 설명한다. 해당 섹션은
[HTML]에 정의된 일반
width
및
height
치수 속성에 적용되는 동일한 작성자 요구사항을 자신의
width와 height 치수 속성에 적용받는 요소 목록에
fencedframe을
포함하도록 업데이트될 것이다.
또한, IDL 속성 width와
height는
같은 이름의 각각의 콘텐츠 속성을
반영해야 한다.
2.2. 펜스드 프레임 설정 매핑
각 순회 가능 내비게이블은 펜스드 프레임 설정 매핑을 가지며, 이는 펜스드 프레임 설정 매핑이다.
Note: 이 매핑은 내비게이션 중에 참조되며, 우리가 구어적으로 URN 생성 API 또는
설정 생성 API라고 부르는 것들이
fencedframe
및
iframe
요소를 내비게이트하는 데 사용할
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로 바뀌지 않는 것이 중요하다. 따라서 웹 플랫폼에 노출되도록
생성된 FencedFrameConfig는
config의
urn이
나타내는 펜스드 프레임 설정이
기술적으로 "pending"이고 나중에 완전히
해결되더라도 사실상 불변이다.
각 펜스드 프레임 설정 매핑에는 최대 설정 수가 있으며, 이는 구현 정의이다. 최대 설정 수는 음이 아닌 수 또는 무한대일 수 있다.
Note: 최대 설정 수의 동작을 명시하는 것이 중요한 이유는 그 의미가 개인정보 보호에 민감한 방식으로 설정 생성 API와 상호작용할 수 있기 때문이다.
높은 수준에서, 펜스드 프레임 설정 매핑에 펜스드 프레임 설정을 저장하려면, 설정의 생성자는 먼저 pending config를 저장한 다음 pending config를 finalized config로 바꿔야 한다. 그 절차는 다음과 같다:
-
pendingMapping을 mapping의 pending config mapping으로 둔다.
-
pendingMapping의 크기 + mapping의 finalized config mapping의 크기가 mapping의 최대 설정 수 이상이면 failure를 반환한다.
-
urn을 무작위로 생성한 urn uuid로 둔다.
-
pendingMapping[urn]을 config로 설정한다.
-
urn을 반환한다.
-
pendingMapping을 mapping의 pending config mapping으로 둔다.
-
finalizedMapping을 mapping의 finalized config mapping으로 둔다.
-
pendingMapping[urn]이 존재하지 않으면 failure를 반환한다.
-
pendingMapping[urn]을 제거한다.
-
finalizedMapping[urn]을 config로 설정한다.
-
nestedMapping을 mapping의 nested config mapping으로 둔다.
-
nestedConfigs가 null이면 반환한다.
-
nestedConfigs의 각 urn → config에 대해 For each:
-
nestedMapping[urn]을 config로 설정한다.
-
nestedMapping[urn]의 is ad component를 true로 설정한다.
-
-
nestedMapping을 mapping의 nested config mapping으로 둔다.
-
pendingMapping을 mapping의 pending config mapping으로 둔다.
-
finalizedMapping을 mapping의 finalized config mapping으로 둔다.
-
nestedMapping[urn]이 존재하면, 그 값을 반환한다.
-
finalizedMapping[urn]이 존재하면, 그 값을 반환한다.
-
failure를 반환한다.
2.3. 펜스드 프레임 설정
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을
임베드한다. 전자상거래 사이트는 사용자의 신용카드 정보를 브라우저에 일급 저장소로 저장한다.
처음에는
Document가
fencedframe
안에
호스트되더라도 일급 쿠키/저장소 접근 권한이 없으므로, 신용카드 정보가 교차 사이트 데이터와
결합될 위험 없이 정보가 자유롭게 드나들 수 있다. 그 때문에, 펜스드 프레임은 개인정보 보호를
손상시키지 않고 FencedFrameConfig
생성자를 사용해 웹 플랫폼에서 직접 구성될 수 있다. 이 시점의 버튼은 아직 신용카드 데이터에
접근할 수 없으므로 개인화된 데이터가 없다. Document는
disableUntrustedNetwork()를
통해 모든 네트워크 접근을 끈 뒤에만 해당 신용카드 데이터를 읽을 수 있으며, 이를 통해 데이터가
펜스드 프레임 밖으로 흘러나가거나 교차 사이트 데이터와 결합되어 사용자 프로필을 만드는 것을
방지한다. 이렇게 하고 나면, 버튼은 전자상거래 플랫폼의 origin에 대한 일급 저장소 파티션 안에
브라우저에 저장되어 있는 사용자의 신용카드 번호 마지막 4자리를 표시하게 된다.
2.3.3. 펜스드 프레임 설정 구조체
이제 몇 가지 예비 타입을 정한다:
visibility는 "opaque" 또는 "transparent" 중 하나이다.
- width
-
음이 아닌 정수
- height
-
음이 아닌 정수
TODO: 이 멤버들에 대해 다른 숫자 타입을 고려한다.
interest group descriptor는 다음 항목을 가진 구조체이다:
permissions policy behavior는 "fixed" 또는 "flexible" 중 하나이다.
default fenced frame effective sandboxing flags는 다음 플래그를 가진 샌드박싱 플래그 집합이다:
pending event는 다음 항목을 가진 구조체이다:
- destination
- event
- request initiator
- initiator referrer policy
reporting destination info는 다음 항목을 가진 구조체이다:
- reporting url declarer origin
- reporting url map
- reporting macro map
fenced frame reporting map은
FenceReportingDestination를
키로 갖는
map이며,
그 값은 다음 중 하나이다:
-
pending event의 list (메타데이터가 아직 finalized되지 않았기 때문에 비동기적으로 보고해야 하는 이벤트를 나타내는 데 사용됨); 또는
-
reporting destination info (finalized된 뒤의 실제 메타데이터를 나타내는 데 사용됨).
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 상태로 전환된다.
FenceReportingDestination
destination, origin reporting url declarer origin,
map
destination map(그 키는
문자열이고
그 값은 url),
그리고 null 또는 map인
macro
map(그 키는 문자열이고 그 값은
문자열)이 주어졌을 때,
보고 대상을
finalize하려면 다음 단계를 실행한다:
-
reporting map[destination]이 list임을 Assert한다 (즉, destination의 메타데이터가 아직 finalized되지 않았음을 의미한다).
-
pending event list를 reporting map[destination]으로 둔다.
-
reporting map[destination]을 다음 항목을 가진 구조체로 설정한다:
- reporting url declarer origin
-
reporting url declarer origin
- reporting url map
-
destination map
- reporting macro map
-
macro map
-
pending event list의 각 pending event에 대해 For each:
-
destination map, pending event의 event, pending event의 request initiator, 그리고 pending event의 initiator referrer policy를 사용해 비콘을 전송한다.
-
fenced frame reporting metadata는 다음 항목을 가진 구조체이다:
- fenced frame reporting map
- direct seller is seller
-
boolean, 처음에는 true
- allowed reporting origins
-
null 또는 list의 origin. 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_navigation은
reserved.top_navigation_commit의
이전
이름이다.
둘은
같은 일을 하지만,
reserved.top_navigation은
앞으로 제거될 예정이므로 새 코드에는 사용하지 않아야 한다.
fenced frame reporter는 다음 항목을 가진 구조체이다:
- fenced frame reporting metadata reference
-
fenced frame reporting metadata에 대한 가변 참조 TODO: 포인터/참조를 더 명세다운 방식으로 처리한다
destination enum event는 다음 항목을 가진 구조체이다:
destination URL event는 URL이다.
automatic beacon event는 다음 항목을 가진 구조체이다:
- type
- data
- attributionReportingEnabled
- attributionReportingContextOrigin
destination event는 destination enum event, destination URL event, 또는 automatic beacon event 중 하나이다.
-
destination url을 빈 문자열로 둔다.
-
attributionReportingEligibility를 "
unset"으로 둔다. -
processResponse를 null로 둔다.
-
useParallelQueue를 false로 둔다.
-
event가 destination enum event 또는 automatic beacon event 중 하나이면, 다음을 실행한다:
-
destination map을 destination info의 reporting url map으로 둔다.
-
eventType을, event가 어떤 변종인지에 따라 event의 destination type 또는 automatic type으로 둔다.
-
destination map[eventType]이 존재하지 않으면 반환한다.
-
destination url을 destination map[eventType]로 설정한다.
-
event의 attributionReportingEnabled가 true이고 event의 attributionReportingContextOrigin이 적합하면:
-
event의
eventType이 automatic beacon event type 값 중 하나와 일치하면, attributionReportingEligibility를 "navigation-source"로 설정한다. -
그렇지 않으면, attributionReportingEligibility를 "
event-source"로 설정한다. -
response response가 주어졌을 때의 다음 단계를 processResponse로 설정한다:
-
fenced를 true로 둔다.
-
event의 attributionReportingContextOrigin, attributionReportingEligibility, fenced, 그리고 response를 사용해 attribution eligible response를 처리한다.
-
-
useParallelQueue를 true로 설정한다.
-
-
-
그렇지 않으면:
-
Assert: event는 destination URL event이다.
-
macro map을 destination info의 reporting macro map으로 둔다.
-
macro map이 null이면 반환한다.
-
destination url을 event로 설정한다.
-
destination url을 macro map으로 destination url에 매크로를 치환한 결과로 둔다.
-
-
선택적으로 반환한다.
Note: 이 구현 정의 조건은 사용자 에이전트가 여러 이유로 비콘을 삭제할 수 있게 하려는 것이다. 예를 들어 사용자 opt-out 또는 destination url의 site가 등록되어 있지 않은 경우가 있다.
-
request를 다음 속성을 가진 새 request로 둔다:
- method
-
event가 destination enum event이면
, 그렇지 않으면POST.GET - URL
-
destination url
- header list
-
header 하나를 포함하는 새 header list. 그 name은
"Content-Type"이고 value는"text/plain"이다. - body
-
event가 destination enum event이면, event의 data를 source로 가진 body, 그렇지 않으면 null.
- client
-
null
- service-workers mode
-
"all"기본값은
"all"이므로 기술적으로 여기서 아무것도 설정하지 않아도 된다. 다만 일부 다른 비콘처럼 여기서는 서비스 워커를 건너뛰는 것이 더 적절할 수 있음을 스스로 상기하기 위해 이렇게 한다. - origin
-
event가 destination URL event이면 request initiator, 그렇지 않으면 destination info의 reporting url declarer origin.
Note: destination URL event의 보고 대상은
reportEvent()를 호출하는Document에 의해 결정된다. 이는 이Document를 로드한 펜스드 프레임 설정을 만든 worklet에서 보고 대상이 결정되는 destination enum event나 automatic beacon event와는 다르다. 교차 사이트 요청 위조를 방지하기 위해 origin을 보고 대상을 결정한Document또는 worklet의 origin으로 설정한다. - referrer
-
request initiator
- referrer policy
-
initiator referrer policy
- mode
-
"cors" - credentials mode
-
"omit" - Attribution Reporting eligibility
-
attributionReportingEligibility
-
request를 Fetch하되, processResponse가 null이 아니면 processResponse를 processResponse로 하고, useParallelQueue를 useParallelQueue로 한다.
Note: 이 알고리즘은 병렬 상태에서 또는
Document의 메인 스레드에서 호출될 수 있다. 병렬 호출을 올바르게 처리하기 위해, 선택적 response 처리 알고리즘이 사용될 때 fetch를 useParallelQueue를 true로 설정하여 호출한다. 그 외의 경우에는 이 알고리즘이 다른 인스턴스에서 병렬로 실행 중이더라도 이를 수행할 필요가 없다.
FenceReportingDestination
destination, origin request initiator,
referrer policy initiator referrer policy, 그리고
destination event
event를 사용해 이벤트를
보고하려면, 다음 단계를 실행한다:
-
metadata를 reporter의 fenced frame reporting metadata reference로 둔다.
-
destination이
"direct-seller"이면:-
metadata의 direct seller is seller가 true이면, destination을
"seller"로 설정한다. -
그렇지 않으면, destination을
"component-seller"로 설정한다.
-
-
event가 destination URL event이면:
-
event의 origin이 metadata의 allowed reporting origins 안의 어떤 항목과도 same origin이 아니면:
-
metadata의 attempted custom url report to disallowed origin을 true로 설정한다.
-
-
metadata의 attempted custom url report to disallowed origin이 true이면 반환한다.
-
-
reporting map을 metadata의 fenced frame reporting map에 대한 참조로 둔다.
-
reporting map[destination]이 존재하지 않으면 반환한다.
-
reporting map[destination]이 list이면:
-
newEvent를 다음을 가진 새 pending event로 둔다:
- destination
-
destination
- event
-
event
- request initiator
-
request initiator
- initiator referrer policy
-
initiator referrer policy
-
newEvent를 reporting map[destination]에 추가한다.
-
반환한다.
Note: pending event는 비동기적으로 전송된다.
-
-
reporting map[destination]이 map임을 Assert한다 (즉, destination의 메타데이터가 finalized되었음을 의미한다).
-
reporting map[destination], event, request initiator, 그리고 initiator referrer policy를 사용해 비콘을 전송한다.
exfiltration budget metadata는 다음 항목을 가진 구조체이다:
- origin
- amount to debit
-
음이 아닌 유효한 부동소수점 수
exfiltration budget metadata reference는 다음 항목을 가진 구조체이다:
- origin
- amount to debit reference
-
음이 아닌 유효한 부동소수점 수에 대한 가변 참조 TODO: 포인터/참조를 더 명세다운 방식으로 처리한다
partition nonce는 구현 정의 값이다.
Note: 이는 네트워크 파티션 키와 유사하며, 이는 Fetch에서 사용된다.
fenced frame config는 다음 항목을 가진 구조체이다:
- mapped url
-
- value
- visibility
- container size
-
null, 또는 size
- content size
-
- value
- visibility
- interest group descriptor
-
- value
- visibility
- on navigate callback
-
null, 또는 일련의 단계
- effective sandboxing flags
-
- value
- visibility
- effective enabled permissions
-
- value
- visibility
-
Note: null이 아닐 때, 이는 이 설정의 생성자가 이 설정으로 내비게이트하는
fencedframe내부에서만 활성화되는 데 의존하는 list의 policy-controlled feature이다. 구체적으로, 이 list의 각 feature는 이 설정으로 내비게이트가 성공하려면fencedframe의 펜스드 내비게이블의 권한 정책의 상속된 정책에서 활성화되어 있어야 한다. 이 list의 feature들은 강제로 활성화되는 것이 아니라, 앞서 언급한 상속된 정책에 영향을 주는 임베더 환경이 이러한 필수 feature들을 지원할 만큼 충분히 완화되어 있는지 확인하는 데 사용된다. 이 feature들 중 어느 것의 상속된 정책 값이라도 "Disabled"이면, 이 설정으로의 내비게이션은 실패한다. 이 list에 없는 모든 policy-controlled feature는 이 설정으로 내비게이트하는fencedframe에서 "Disabled"가 되지 않는다.
- fenced frame reporting metadata
-
- value
- visibility
- exfiltration budget metadata
-
- value
- visibility
- nested configs
-
- value
- 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
- 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
- effective enabled permissions
-
null, 또는 list의 policy-controlled feature
- fenced frame reporter
-
null, 또는 fenced frame reporter
- exfiltration budget metadata reference
- nested configs
-
null, 또는 map이며, 그 키는 urn uuid이고 그 값은 fenced frame configs이다
- partition nonce
- embedder shared storage context
-
null, 또는 문자열
- is ad component
- untrusted network status
-
untrusted network status, 처음에는 enabled.
- on network disabled promises
-
map이며, 그 키는 전역 객체이고 값은 list의
Promise이며, 처음에는 비어 있다.Note: 이는
disableUntrustedNetwork()중에 생성된 다양한 전역의 여러Promise를 저장한다. 우리는 이들을 여기에 저장하여fencedframe과 그 자손 펜스드 프레임들의 네트워크 접근이 완전히 철회될 때(즉, untrusted network status가 disabled for this tree and fenced subtrees일 때) 한 번에 모두 resolve할 수 있게 한다. - cross-origin reporting allowed
-
boolean, 처음에는 false.
- mapped url
-
config의 mapped url의 value
- container size
-
config의 container size
- content size
-
null이면 config의 content size, 그렇지 않으면 config의 content size의 value
- interest group descriptor
-
null이면 config의 interest group descriptor, 그렇지 않으면 config의 interest group descriptor의 value
- on navigate callback
-
config의 on navigate callback
- effective sandboxing flags
-
null이면 config의 effective sandboxing flags, 그렇지 않으면 config의 effective sandboxing flags의 value
- permissions policy behavior
-
config의 effective enabled permissions가 null이면 flexible, 그렇지 않으면 fixed.
- effective enabled permissions
-
null이면 config의 effective enabled permissions, 그렇지 않으면 config의 effective enabled permissions의 value
- fenced frame reporter
-
-
config의 fenced frame reporting metadata의 value가 null이면, null로 설정한다.
-
그렇지 않으면, 다음 멤버를 가진 fenced frame reporter로 설정한다:
-
- exfiltration budget metadata reference
-
-
config의 exfiltration budget metadata가 null이면, null로 설정한다.
-
그렇지 않으면, exfiltration budget metadata reference로 설정한다:
- origin
-
config의 exfiltration budget metadata의 value의 origin
- amount to debit reference
-
config의 exfiltration budget metadata의 value의 amount to debit에 대한 참조
-
- nested configs
-
-
config의 nested configs가 null이면, null로 설정한다.
-
그렇지 않으면:
-
results를 새 map으로 둔다.
-
config의 nested configs의 value에 있는 각 nested config에 대해 For each:
-
nested configs를 results로 설정한다.
-
-
- partition nonce
-
무작위의 고유한 partition nonce
- embedder shared storage context
-
config의 embedder shared storage context
- is ad component
-
config의 is ad component
- cross-origin reporting allowed
-
config의 cross-origin reporting allowed
- untrusted network status
- on network disabled promises
-
빈 map.
각 브라우징 컨텍스트는 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의 url은 urn이 제공된 경우에만 null이다.
FencedFrameConfig(url)
생성자 메서드 단계는
다음과 같다:
-
config를 새
FencedFrameConfig객체로 둔다. -
config의 url을 url에 대해 URL parser를 실행한 결과로 설정한다.
-
config를 반환한다.
setSharedStorageContext(contextString)
메서드 단계는 this의
sharedStorageContext를
contextString으로 설정하는 것이다.
FencedFrameConfig
객체는 직렬화 가능한 객체이다. 그 직렬화 단계는
value, serialized, 그리고 forStorage가 주어졌을 때 다음과 같다:
-
forStorage가 true이면,
DataCloneErrorDOMException을 throw한다. -
serialized.[[Url]]을 value의 url로 설정한다.
-
serialized.[[Urn]]을 value의 urn으로 설정한다.
-
serialized.[[SharedStorageContext]]을 value의 sharedStorageContext로 설정한다.
-
value의 url을 serialized.[[Url]]로 초기화한다.
-
value의 urn을 serialized.[[Urn]]로 초기화한다.
-
value의 sharedStorageContext를 serialized.[[SharedStorageContext]]로 초기화한다.
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
-
TODO: 이를 명세화한다. macros의 키를 해당 값으로 string에 치환하고, 새 문자열을 반환한다. 재귀 치환은 없다.
deprecatedReplaceInURN(urnOrConfig, replacements)
메서드 단계는 다음과 같다:
-
urn을 null로 둔다.
-
urnOrConfig가
USVString이면, urn을 urnOrConfig로 설정한다. -
그렇지 않으면, urn을 urnOrConfig의 urn으로 설정한다.
-
urn이 유효한 urn uuid가 아니면(즉, urn uuid의 섹션 3에 있는 ABNF를 통과하지 못하면),
TypeError를 throw한다. -
replacements의 각 key → _에 대해 For each:
-
p를 새 promise로 둔다.
-
다음 단계를 병렬로 실행한다:
-
mapping을 global의 내비게이블의 순회 가능 내비게이블의 fenced frame config mapping으로 둔다.
-
config를 mapping에서 urn을 사용해 config를 찾은 결과로 둔다.
-
config가 failure이면, global이 주어졌을 때 DOM manipulation task source에 전역 task를 큐에 넣어 p를
undefined로 resolve하고, 이 단계를 중단한다. -
substitutedUrl을 replacements로 config의 mapped url의 value에 매크로를 치환한 결과로 둔다.
-
config의 mapped url의 value를 substitutedUrl로 설정한다.
-
global이 주어졌을 때 DOM manipulation task source에 전역 task를 큐에 넣어 p를
undefined로 resolve한다.
-
-
p를 반환한다.
deprecatedURNtoURL(urnOrConfig, send_reports)
메서드
단계는 다음과 같다:
-
urn을 null로 둔다.
-
urnOrConfig가
USVString이면, urn을 urnOrConfig로 설정한다. -
그렇지 않으면, urn을 urnOrConfig의 urn으로 설정한다.
-
urn이 유효한 urn uuid가 아니면(즉, urn uuid의 섹션 3에 있는 ABNF를 통과하지 못하면),
TypeError를 throw한다. -
p를 새 promise로 둔다.
-
다음 단계를 병렬로 실행한다:
-
mapping을 global의 내비게이블의 순회 가능 내비게이블의 fenced frame config mapping으로 둔다.
-
mapping의 finalized config mapping[urn]이 존재하지 않으면, global이 주어졌을 때 DOM manipulation task source에 전역 task를 큐에 넣어 p를
undefined로 resolve하고, 이 단계를 중단한다. -
config를 mapping의 finalized config mapping[urn]으로 둔다.
-
global이 주어졌을 때 DOM manipulation task source에 전역 task를 큐에 넣어 p를 config의 mapped url의 value로 resolve한다.
-
send_reports가 true이면, config의 on navigate callback에 있는 단계를 실행한다.
-
-
p를 반환한다.
adAuctionComponents(numAdComponents)
-
instance를 this의 관련 전역 객체의 브라우징 컨텍스트의 fenced frame config instance로 둔다.
-
instance가 null이면,
InvalidStateErrorDOMException을 throw한다. -
this의 관련 설정 객체의 origin과 instance의 mapped url의 origin이 same origin이 아니면,
InvalidStateErrorDOMException을 throw한다. -
maxAdComponents를 40으로 둔다.
-
numAdComponents > maxAdComponents이면, numAdComponents를 maxAdComponents로 설정한다.
-
instance의 nested configs에 있는 각 urn → config에 대해 For each:
-
adComponentsURNs를 반환한다.
2.4. Fence
인터페이스
펜스드 프레임에 특화된 여러 API는 Fence 인터페이스에 정의된다.
enum {FenceReportingDestination ,"buyer" ,"seller" ,"component-seller" ,"direct-seller" , };"shared-storage-select-url" dictionary { // This dictionary has two mutually exclusive modes that aren’t represented as // distinct IDL types due to distinguishability issues: // // When reporting to a preregistered destination (specified by enum), the following // properties are used:FenceEvent DOMString ;eventType DOMString ;eventData sequence <FenceReportingDestination >; // Determines if this data can be sent in a reportEvent() beacon or automatic // beacon that originates from a document that is cross-origin to the mapped // URL of the fenced frame config that loaded this frame tree. // Note that automatic beacon data can only be set from documents that are // same-origin to the fenced frame config’s mapped URL, so this effectively // opts in the data to being used in a cross-origin subframe.destination boolean =crossOriginExposed false ; // When setting event data to be used later in an automatic beacon, the // following properties are used:boolean =once false ; // When reporting to a custom destination URL (with substitution of macros defined by // the Protected Audience buyer), the following property is used:USVString ; };destinationURL typedef (FenceEvent or DOMString ); [ReportEventType Exposed =Window ]interface {Fence undefined reportEvent (optional ReportEventType = {});event undefined setReportEventDataForAutomaticBeacons (optional FenceEvent = {});event sequence <FencedFrameConfig >getNestedConfigs ();Promise <undefined >disableUntrustedNetwork ();undefined notifyEvent (Event ); };event
reportEvent(event) 메서드 단계는 다음과 같다:
-
document를 this의 관련 전역 객체의 연관된 Document로 둔다.
-
document가 완전히 활성 상태가 아니면,
SecurityErrorDOMException을 throw한다. -
instance를 this의 관련 전역 객체의 브라우징 컨텍스트의 fenced frame config instance로 둔다.
-
instance가 null이면 반환한다.
-
instance의 is ad component가 true이면 반환한다.
-
instance의 fenced frame reporter가 null이면 반환한다.
-
initiator referrer policy를 document의 정책 컨테이너의 referrer policy로 둔다.
-
event가
DOMString이면:-
this의 관련 설정 객체의 origin과 instance의 mapped url의 origin이 same origin이 아니면 반환한다.
-
instance의 fenced frame reporter와 event를 사용해 private aggregation event를 보고한다.
-
-
event가
FenceEvent이면:-
다음 조건이 모두 true이면:
-
this의 관련 설정 객체의 origin과 instance의 mapped url의 origin이 same origin이 아니며;
-
event의
crossOriginExposed가 false이거나 instance의 cross-origin reporting allowed가 false인 경우;
반환한다.
-
-
event에
destinationURL이 있으면:-
event에
destination이나eventType또는eventData가 있으면: -
destinationURL을
destinationURL에 대해 URL parser를 실행한 결과로 둔다. -
다음 조건 중 하나라도 성립하면
TypeError를 throw한다:-
destinationURL이 failure이다;
-
destinationURL scheme이 "
https"가 아니다;
-
-
instance의 fenced frame reporter와
buyer, request initiator, initiator referrer policy, 그리고 event의destinationURL인 destination URL event를 사용해 이벤트를 보고한다.
-
-
그렇지 않으면:
-
event에
destination이 없거나 event에eventType이 없으면: -
attributionReportingEnabled를 document가 "
" feature를 사용하도록 허용되는지 결정한 결과로 둔다.attribution-reporting -
attributionReportingContextOrigin을 document의 context origin으로 둔다.
-
event의
destination에 있는 각 destination에 대해 For each:-
instance의 fenced frame reporter와 destination, request initiator, initiator referrer policy, 그리고 다음 항목을 가진 destination enum event를 사용해 이벤트를 보고한다:
- attributionReportingEnabled
-
attributionReportingEnabled
- attributionReportingContextOrigin
-
attributionReportingContextOrigin
-
-
테스트
- fence-report-event.https.html (라이브 테스트) (소스)
- fence-report-event-destination-url.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin-content-initiated.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin-nested-urn-iframe.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin-nested.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin-no-embedder-opt-in.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin-no-subframe-opt-in.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin-urn-iframe-content-initiated.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin-urn-iframe-no-embedder-opt-in.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin-urn-iframe-no-subframe-opt-in.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin-urn-iframe.https.html (라이브 테스트) (소스)
- fence-report-event-cross-origin.sub.https.html (라이브 테스트) (소스)
- fence-report-event-sub-fencedframe.https.html (라이브 테스트) (소스)
setReportEventDataForAutomaticBeacons(event)
메서드 단계는 다음과 같다:
-
this의 관련 전역 객체의 연관된 Document가 완전히 활성 상태가 아니면,
SecurityErrorDOMException을 throw한다. -
event에
destination이 없거나 event에eventType이 없으면: -
event의
eventType이 automatic beacon event type 값 중 하나와 일치하지 않으면 반환한다. -
instance를 this의 관련 전역 객체의 브라우징 컨텍스트의 fenced frame config instance로 둔다.
-
instance가 null이면 반환한다.
-
this의 관련 설정 객체의 origin과 instance의 mapped url의 origin이 same origin이 아니고, event의
crossOriginExposed가 false이면 반환한다. -
instance의 fenced frame reporter가 null이면 반환한다.
-
this의 관련 전역 객체의 연관된 Document의 automatic beacon data mapping[event의
eventType]을 다음 항목을 가진 automatic beacon data로 설정한다:- eventData
-
정의되어 있고 instance의 is ad component가 false이면 event의
eventData, 그렇지 않으면 빈 문자열. - destination
-
event의
destination - once
-
event의
once - crossOriginExposed
-
event의
crossOriginExposed
getNestedConfigs() 메서드 단계는 다음과 같다:
-
instance를 this의 관련 전역 객체의 브라우징 컨텍스트의 fenced frame config instance로 둔다.
-
instance가 null이면 반환한다.
-
this의 관련 설정 객체의 origin과 instance의 mapped url의 origin이 same origin이 아니면 반환한다.
-
instance의 nested configs가 null이면 반환한다.
-
results를
FencedFrameConfig로 된 빈 list로 둔다. -
instance의 nested configs에 있는 각 urn → config에 대해 For each:
-
newConfig를 this의 관련 realm에서 생성된 새
FencedFrameConfig객체로 두며, 다음을 가진다:- urn
-
urn
- sharedStorageContext
-
config의 embedder shared storage context
-
newConfig를 results에 추가한다.
-
-
results를 반환한다.
notifyEvent(event) 메서드 단계는 다음과 같다:
-
this의 관련 전역 객체의 연관된 Document가 완전히 활성 상태가 아니면,
SecurityErrorDOMException을 throw한다. -
다음 조건 중 하나라도 충족되면,
SecurityErrorDOMException을 throw한다:-
navigable이 펜스드 내비게이블이 아니다;
-
event의
isTrusted가 false이다; -
event의 dispatch flag가 설정되어 있지 않다;
-
event의
type이 "click"이 아니다
-
-
사용자 활성화를 소비한다. 대상은 this의 관련 전역 객체이다.
-
parentNavigable을 navigable의 unfenced parent로 둔다.
-
parentNavigable의 활성 window가 주어졌을 때, 다음 단계를 실행하도록 전역 task를 큐에 넣는다. 대상은 DOM manipulation task source이다:
-
activation notification 단계를 수행한다.
-
navigable의 펜스드 내비게이블 컨테이너에서 "
fencedtreeclick"이라는 이름의 이벤트를 fire한다. 이벤트의bubbles및cancelable속성을true로 초기화한다. inner event creation steps를 실행할 때, time을 이 메서드의 모든 호출에 대해 일관적인 구현 정의 값으로 설정한다.
-
disableUntrustedNetwork() 메서드 단계는 다음과 같다:
-
p를 새 promise로 둔다.
-
this의 관련 전역 객체의 연관된 Document가 완전히 활성 상태가 아니면,
SecurityErrorDOMException을 throw한다. -
instance를 this의 관련 전역 객체의 브라우징 컨텍스트의 fenced frame config instance로 둔다.
-
instance가 null이면 반환한다.
-
관련 설정 객체의 origin과 instance의 mapped url의 origin이 same origin이 아니면, p를
TypeError로 reject한다. -
this의 관련 전역 객체의 내비게이블의 순회 가능 내비게이블이 펜스드 내비게이블이 아니면, p를
undefined로 resolve하고 p를 반환한다. -
For each
WebSocket객체 webSocket 중 그 관련 전역 객체가 global인 것마다, webSocket을 주어 WebSocket 연결을 실패시킨다. -
For each
WebTransport객체 webTransport 중 그 관련 전역 객체가 global인 것마다, 새로 생성된WebTransportError(그source가"session"인 것)으로 webTransport를 cleanup한다.Note:
WebTransportCloseInfo를 전달하지 않으면WebTransport객체가"closed"상태가 아니라"failed"상태로 설정된다. -
다음 단계를 병렬로 실행한다:
-
fencedFrameNonce를 instance의 partition nonce로 둔다.
-
credentiallessNonce를 global의 page credentialless nonce로 둔다.
-
settings를 사용하여 fencedFrameNonce에 대해 partition nonce에 대한 네트워크를 철회한다.
-
credentiallessNonce가 null이 아니면, settings를 사용하여 credentiallessNonce에 대해 partition nonce에 대한 네트워크를 철회한다.
-
instance의 untrusted network status를 disabled for this tree로 설정한다.
-
promises를 instance의 on network disabled promises로 둔다.
-
global의 브라우징 컨텍스트의 최상위 순회 가능 항목이 주어졌을 때 모든 펜스드 프레임 자손의 untrusted network status를 다시 계산한다.
-
-
p를 반환한다.
-
navigables를 topLevelTraversable의 활성 문서의 포괄적 자손 내비게이블들로 두되, unfenced를 true로 설정한다.
-
navigablesWithNetworkChildren를 set의 펜스드 내비게이블로 둔다. 처음에는 비어 있다.
-
navigables가 비어 있지 않은 동안 While:
-
currentNavigable을 navigables에서 pop한 결과로 둔다.
-
ongoingNavigation을 currentNavigable의 진행 중인 내비게이션으로 둔다.
-
currentNavigable이 펜스드 내비게이블이 아니면:
-
ongoingNavigation이 null이 아니면:
-
ancestorFencedRoot를 currentNavigable의 순회 가능 내비게이블로 둔다.
-
ancestorFencedRoot가 펜스드 내비게이블이면, ancestorFencedRoot를 navigablesWithNetworkChildren에 추가한다.
-
-
continue한다.
-
-
config를 currentNavigable의 활성 브라우징 컨텍스트의 fenced frame config instance로 둔다.
-
config의 untrusted network status가 disabled for this tree and fenced subtrees이고 ongoingNavigation이 null이면, continue한다.
-
networkCutoffReady를 다음과 같이 둔다: navigablesWithNetworkChildren가 currentNavigable을 포함하지 않고 config의 untrusted network status가 disabled for this tree이면 true, 그렇지 않으면 false.
Note: 펜스드 내비게이블은 네트워크 차단 준비가 되지 않은 것으로 판단된 다른 펜스드 프레임의 unfenced 조상일 때 navigablesWithNetworkChildren에 추가된다.
-
networkCutoffReady가 true이면:
-
config의 untrusted network status를 disabled for this tree and fenced subtrees로 설정한다.
Note: untrusted network가 비활성화된 것에 게이트된 모든 API는, promise들이 resolve를 마치기 전이라도 이 시점에서 즉시 사용할 수 있다.
-
config의 on network disabled promises 안의 각 global → promises에 대해 For each:
-
promises 안의 각 promise에 대해 For each:
-
global이 주어졌을 때 DOM manipulation task source에 전역 task를 큐에 넣어 promise를
undefined로 resolve한다.
-
-
-
config의 on network disabled promises를 비운다.
-
-
networkCutoffReady가 false이거나 ongoingNavigation이 null이 아니면:
-
ancestorFencedRoot를 currentNavigable의 unfenced parent의 순회 가능 내비게이블로 둔다.
-
ancestorFencedRoot가 펜스드 내비게이블이면, ancestorFencedRoot를 navigablesWithNetworkChildren에 추가한다.
-
-
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 steps는
removedNode가 주어졌을 때 다음과 같다:
-
topLevelTraversable을 removedNode content navigable의 최상위 순회 가능 항목으로 둔다.
-
removedNode가 주어졌을 때 자식 내비게이블을 파괴한다.
-
병렬로, topLevelTraversable가 주어졌을 때 모든 펜스드 프레임 자손의 untrusted network status를 다시 계산한다.
-
newValue가 null이면, 병렬로, navigable의 최상위 순회 가능 항목이 주어졌을 때 모든 펜스드 프레임 자손의 untrusted network status를 다시 계산한다.
사용자 에이전트는 관련된 network revocation nonce set를 가지며, 이는 set의 partition nonce이다. 또한 network revocation exemption map을 가지며, 이는 map으로, 그 키는 partition nonce이고 값은 set의 URL이다.
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)
-
nonce를 사용자 에이전트의 network revocation nonce set에 추가한다.
-
settings의 fetch group을 종료한다.
-
key를 request에 대해 네트워크 파티션 키를 결정한 결과로 둔다.
-
nonce를 key의 nonce로 둔다.
-
사용자 에이전트의 network revocation exemption map[nonce]이 존재하고, request의 URL이 그 안에 존재하면, allowed를 반환한다.
-
사용자 에이전트의 network revocation nonce set이 nonce를 포함하면 blocked를 반환한다.
-
allowed를 반환한다.
2.5. 네트워크 철회를 위한 몽키패치
이 소개 섹션은 비규범적이다.
이 섹션의 네트워크 철회 메커니즘은 네트워크 요청을 만드는 표준들을 패치해야 한다. 우리의 패치 전에는, 이러한 표준들이 요청을 최종적으로 시작한 컨텍스트의 네트워크 철회 상태를 알지 못한 채 네트워크 요청(예: WebSocket 연결 시작)을 만들었다. 우리의 패치는 요청이 만들어지기 전에 시작 컨텍스트의 네트워크 철회 상태를 고려하도록 해당 표준들의 알고리즘에 검사를 추가한다. 자세한 내용은 이러한 여러 API를 테스트하는 비외부 WPT가 있으며, 이는 여기에서 찾을 수 있다. 현재 외부에 공개되지 않은 이유는 단순히 네트워크 철회 기능이 아직 출시되지 않았기 때문이다. 출시되면 WPT 저장소에 게시될 것이다.
네트워크 철회 메커니즘은 [FETCH] Standard에 다음 몽키패치가 필요하다.
나쁜 포트 때문에 request가 차단되어야 하는지, request fetch가 혼합 콘텐츠로서 차단되어야 하는지, 또는 request가 Content Security Policy에 의해 차단되어야 하는지가 blocked를 반환하면, response를 network error로 설정한다.
"should request be blocked by Content Security Policy" 뒤의 조건들에 "철회된 partition nonce 때문에 차단되어야 하는지"를 추가한다.
이는 fenced frame nonce와 iframe credentialless nonce가 존재하는 경우 둘 다 전달해야 한다. (WICG/fenced-frame#191)
-
nonce를 key의 nonce로 둔다.
-
사용자 에이전트의 network revocation exemption map[nonce]이 존재하지만, network revocation exemption map[nonce][yrl]이 존재하지 않으면:
-
사용자 에이전트의 network revocation nonce set이 nonce를 포함하면 failure를 반환한다.
-
단계 1 앞에 다음 단계들을 삽입한다:
-
nonce를 key의 nonce로 둔다.
-
사용자 에이전트의 network revocation exemption map[nonce]이 존재하지만, network revocation exemption map[nonce][url]이 존재하지 않으면:
-
사용자 에이전트의 network revocation nonce set이 nonce를 포함하면 failure를 반환한다.
-
네트워크 철회 메커니즘은 [WebSockets] Standard에 다음 몽키패치가 필요하다.
-
client의 전역 객체의 내비게이블이 주어졌을 때 내비게이블이 자기 자신에 대해 네트워크를 철회했는지 결정한 결과가 true이면, WebSocket 연결을 실패시킨다.
네트워크 철회 메커니즘은 [WebTransport] Standard에 다음 몽키패치가 필요하다.
-
다음 조건 중 하나라도 true이면:
-
request로 should request be blocked by Content Security Policy?를 실행한 결과가 "Blocked"를 반환한다;
-
request로 나쁜 포트 때문에 request가 차단되어야 하는지를 실행한 결과가 "blocked"를 반환한다;
-
client의 전역 객체의 내비게이블이 주어졌을 때 내비게이블이 자기 자신에 대해 네트워크를 철회했는지 결정한 결과가 true를 반환한다;
그러면 나머지 단계를 중단하고, transport를 사용해 다음 단계를 실행하도록 network task를 큐에 넣는다:
-
네트워크 철회 메커니즘은 [Reporting] Standard에 다음 몽키패치가 필요하다.
-
context가
Document이고, context의 노드 내비게이블이 주어졌을 때 내비게이블이 자기 자신에 대해 네트워크를 철회했는지 결정한 결과가 true이면, 반환한다.
네트워크 철회 메커니즘은 [Webpackage] Standard에 다음 몽키패치가 필요하다.
-
request가 철회된 partition nonce 때문에 차단되어야 하는지를 결정한 결과가 false이면, 병렬로, parsedExchange와 report에 대해 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에 추가한다.
사용자 에이전트는 request의 destination에 대해 switch하면서, 일치하는 문장이 있다면 첫 번째로 일치하는 문장으로 값을 설정해야 한다:
"fencedframe"를 "document",
"frame", 및 "iframe"와 함께 switch case에 추가한다.
비규범적으로, DOM 소개의 destination
table을 업데이트하여
fencedframe
navigation request가 다음 속성을 가진다는 것을 보여준다:
-
"
fencedframe"의 destination -
initiator ""
-
fenced-frame-src의 CSP directive -
HTML의
<fencedframe>로서의 features
2.7. 네트워크 철회에 따른 메서드 게이팅
이 소개 섹션은 비규범적이다.
펜스드 프레임이 신뢰할 수 없는 네트워크 접근을 완전히 비활성화한 뒤, 즉 Promise가
disableUntrustedNetwork()에
의해
반환되고 resolved되면, 특정 강력한 인터페이스 메서드들이
펜스드 프레임 안에서 실행되는 스크립트에 사용 가능해진다. 이러한 메서드들은 다른 명세에
정의되어 있으며, 호출이 성공적으로 일어날 수 있는지 결정하기 위해 아래 첫 번째 알고리즘을
사용할 것이다. 신뢰할 수 없는 네트워크 접근의 철회 뒤에 게이트되는 메서드의 한 예는
get()이며,
이는 SharedStorageWorklet
밖에서 호출될 때이다.
이 메서드는 [Shared-Storage] 초안 명세에 정의되어 있다.
disableUntrustedNetwork()가
호출되었지만 반환된
Promise가
아직 resolved되지 않은 중간 상태에서는, 네트워크를 통해 요청을 만드는 기능에
제한이 있다. 아래 두 번째 알고리즘은 이러한 기능이 허용되는지 결정하는 데 사용된다.
우리는 "fully revoked"와 "revoked for self"를 구분한다. 중첩된 펜스드 프레임 트리가
여전히 네트워크 접근 권한을 가질 수 있으며, 이러한 제한은 그들도
disableUntrustedNetwork()를
호출하기 전까지는 적용되지 않기 때문이다.
-
navigable의 순회 가능 내비게이블이 펜스드 내비게이블이 아니면 false를 반환한다.
-
config를 navigable의 활성 브라우징 컨텍스트의 fenced frame config instance로 둔다.
-
config의 untrusted network status가 disabled for this tree and fenced subtrees가 아니면 false를 반환한다.
-
true를 반환한다.
-
navigable의 순회 가능 내비게이블이 펜스드 내비게이블이 아니면 false를 반환한다.
-
config를 navigable의 활성 브라우징 컨텍스트의 fenced frame config instance로 둔다.
-
config의 untrusted network status가 enabled이면 false를 반환한다.
-
true를 반환한다.
-
sourceSnapshotParams의 target fenced frame config가 null이면 false를 반환한다.
의도는 sourceSnapshotParams의 target fenced frame config가 embedder가 시작한
fencedframe내비게이션에 대해서는 null이 아니고 그 외에는 null이어야 한다는 것이다. 하지만 이는 이 이슈가 해결되기 전까지 참이 아니다. -
navigable의 순회 가능 내비게이블의 unfenced parent가 null이면 false를 반환한다.
Note: navigable의 순회 가능 내비게이블의 unfenced parent가 null이면, navigable은 navigable의 fenced navigable container가 파괴되는 중이므로 loading을 중지한다.
-
다음이 모두 true이면:
-
navigable이 주어졌을 때 내비게이블이 자기 자신에 대해 네트워크를 철회했는지 결정한 결과가 true이고;
-
navigable의 순회 가능 내비게이블의 unfenced parent가 주어졌을 때 내비게이블이 자기 자신에 대해 네트워크를 철회했는지 결정한 결과가 true이다,
Note: 내비게이블이 자기 자신에 대해 네트워크를 철회했는지 결정 알고리즘은 navigable과 navigable의 순회 가능 내비게이블의 unfenced parent 둘 다에 대해 실행된다. 이는 부모 펜스드 프레임이 이미 신뢰할 수 없는 네트워크 접근을 비활성화한 자식 펜스드 프레임을 내비게이트할 수 있기 때문이다. 부모 펜스드 프레임이 자식 펜스드 프레임 내비게이션이 시작된 직후 신뢰할 수 없는 네트워크 접근을 비활성화하면, 내비게이션은 차단되어야 한다. 따라서 알고리즘은 부모와 자식 둘 다에 대해 실행되어야 한다. 그렇지 않으면 내비게이션이 commit되도록 허용될 경우, 부모 펜스드 프레임은 신뢰할 수 없는 네트워크 접근이 비활성화되지만 자식 펜스드 프레임은 그렇지 않게 된다.
true를 반환한다.
-
-
그렇지 않으면 false를 반환한다.
2.8. 자동 보고
이 첫 번째 소개 단락은 비규범적이다.
펜스드 경계 모델의 부작용은 광고가 클릭이 성공적인 내비게이션으로 이어졌는지 알 수 있는 능력을
잃게 된다는 것이다. 이는 펜스드 프레임에서 시작된 최상위
내비게이션으로부터 로드된 페이지가, 자신이 로드되었음을 펜스드 프레임에 보고하는 것
(예:
window.opener를
통한 것)이 허용되지 않기 때문이다.
대신, 우리는 특별한 이벤트 수준 reporting type,
reserved.top_navigation_start
및
reserved.top_navigation_commit를
도입한다. 이들은 펜스드 프레임이 최상위
순회 가능 항목으로의 성공적인 내비게이션을 시작할 때
이벤트 수준 비콘을 자동으로 전송한다.
Document
targetDocument, 그리고
automatic beacon event type
eventType가 주어졌을 때,
automatic beacon 전송을 시도하려면, 다음 단계를 실행한다:
-
targetDocument의 노드 내비게이블의 순회 가능 내비게이블이 최상위 순회 가능 항목이 아니면, 이 단계를 중단한다.
-
sourceSnapshotParams의 has transient activation이 false로 설정되어 있으면, 이 단계를 중단한다.
-
config를 sourceSnapshotParams의 initiator fenced frame config instance로 둔다.
-
config가 null이면, 이 단계를 중단한다.
Note: 이 알고리즘은 모든 내비게이션에 대해 무조건 호출되므로, 이는 내비게이션이
fencedframe에서 시작되지 않고 최상위 순회 가능 항목으로 향하는 경우를 잡아내는 데 사용된다. -
request initiator를 config의 is ad component가 false이면 sourceOrigin으로, 그렇지 않으면 sourceSnapshotParams의 initiator ancestor root origin으로 둔다.
-
initiator referrer policy를 config의 is ad component가 false이면 sourceSnapshotParams의 source policy container의 referrer policy로, 그렇지 않으면 sourceSnapshotParams의 initiator ancestor root referrer policy로 둔다.
-
isCrossOrigin을 sourceOrigin이 config의 mapped url의 origin과 same origin이 아니면 true, 그렇지 않으면 false로 둔다.
-
beaconMapping을 isCrossOrigin이 false이면 sourceSnapshotParams의 snapshot automatic beacon store의 data mapping으로, 그렇지 않으면 sourceSnapshotParams의 snapshot automatic beacon store의 cross-origin exposed data mapping으로 둔다.
-
beaconData를 beaconMapping[eventType]으로 둔다.
-
automaticBeaconsAllowed를 sourceSnapshotParams의 automatic beacons allowed로 둔다.
Note: 이는 `
Allow-Fenced-Frame-Automatic-Beacons` header를 통해 opt-in이 있었는지를 추적한다. automatic beacon은 이 값이 false인 동안에도 same-origin 문서이거나 데이터 설정을 통해 opt-in한 문서에 대해서는 여전히 전송될 수 있다. -
beaconData가 null이고 automaticBeaconsAllowed가 false이면, 이 단계를 중단한다.
-
isCrossOrigin이 true이고 automaticBeaconsAllowed가 false이면, 이 단계를 중단한다.
-
config의 fenced frame reporter의 fenced frame reporting metadata reference의 fenced frame reporting map의 키에 있는 각 destination에 대해 For each:
-
config의 fenced frame reporter와 destination, request initiator, initiator referrer policy, 그리고 다음 항목을 가진 automatic beacon event를 사용해 이벤트를 보고한다:
- type
-
eventType
- data
-
beaconData가 null이면 빈 문자열, 그렇지 않으면 beaconData의 eventData.
- attributionReportingEnabled
-
sourceSnapshotParams의 attribution reporting enabled
- attributionReportingContextOrigin
-
sourceSnapshotParams의 attribution reporting context origin
-
-
beaconData의 once가 true이면, beaconMapping[eventType]을 null로 설정한다.
테스트
- automatic-beacon-anchor-click-handler.https.html (라이브 테스트) (소스)
- automatic-beacon-click-handler.https.html (라이브 테스트) (소스)
- automatic-beacon-two-events-clear.https.html (라이브 테스트) (소스)
- automatic-beacon-two-events-persist.https.html (라이브 테스트) (소스)
- automatic-beacon-unfenced-top.https.html (라이브 테스트) (소스)
- automatic-beacon-no-destination.https.html (라이브 테스트) (소스)
- automatic-beacon-no-opt-in.https.html (라이브 테스트) (소스)
- automatic-beacon-shared-storage.https.html (라이브 테스트) (소스)
- automatic-beacon-cross-origin-false.https.html (라이브 테스트) (소스)
- automatic-beacon-cross-origin-navigation.https.html (라이브 테스트) (소스)
- automatic-beacon-cross-origin-no-data.https.html (라이브 테스트) (소스)
- automatic-beacon-cross-origin-no-opt-in.https.html (라이브 테스트) (소스)
- automatic-beacon-use-ancestor-data.https.html (라이브 테스트) (소스)
- automatic-beacon-data-cross-origin-ancestor.sub.https.html (라이브 테스트) (소스)
- automatic-beacon-data-set-by-sibling.https.html (라이브 테스트) (소스)
- automatic-beacon-data-multiple-ancestors.https.html (라이브 테스트) (소스)
-
sourceSnapshotParams, initiatorOriginSnapshot, navigable의 연관된
Document, 그리고reserved.top_navigation_start가 주어졌을 때 automatic beacon 전송을 시도한다.
-
failure가 false이면:
-
sourceSnapshotParams, entry의 document state의 initiator origin, document, 그리고
reserved.top_navigation_commit가 주어졌을 때 automatic beacon 전송을 시도한다. -
sourceSnapshotParams, entry의 document state의 initiator origin, document, 그리고
reserved.top_navigation가 주어졌을 때 automatic beacon 전송을 시도한다.
-
3. HTML 통합
3.1. Window
인터페이스 확장
partial interface Window { // Collection of fenced frame APIsreadonly attribute Fence ?fence ; };
각 Window
객체는 연관된 fence를 가지며, 이는 Fence 인스턴스로
Window와
함께 생성된다.
fence getter 단계는 다음과 같다:
-
this의 브라우징 컨텍스트의 fenced frame config instance가 null이 아니면, this의 fence를 반환한다.
-
null을 반환한다.
3.2. Document
지원 개념
먼저 몇 가지 예비 타입을 설정한다:
automatic beacon data는 다음 구조체이며, 다음 항목을 가진다:
- eventData
- destination
- once
- crossOriginExposed
automatic beacon data mapping은 map이며, 그 키는 automatic beacon event type이고 그 값은 null 또는 automatic beacon data이다.
snapshot automatic beacon store는 구조체이며 다음 항목을 가진다:
- data mapping
- cross-origin exposed data mapping
각 Document
객체는 연관된 automatic beacon data mapping을 가지며,
이는 automatic beacon data mapping이다.
각 Document
객체는 연관된 automatic beacons allowed를 가지며, 이는
boolean이고,
처음에는 false이다.
3.3. 브라우징 컨텍스트 생성에 대한 수정
-
creator가 null이 아니면:
대신 더 엄격한 조건을 사용한다:
-
creator가 null이 아니고 embedder가
fencedframe요소가 아니면:
Note: 이는 fenced frame 경계를 넘어 creator의 referrer, origin, document base url, policy container를 누출하지 않도록 보장해야 하기 때문이다.
위에서 수정된 이 알고리즘의 단계 4에 다음 하위 단계를 추가한다:
-
browsingContext의 fenced frame config instance를 creator의 브라우징 컨텍스트의 fenced frame config instance로 설정한다.
3.4. 정책 컨테이너 상속
local
URL로
navigation request를 만들 때,
iframe들은
navigation
request의 initiator Document에서
자신의
policy container를 복제한다.
만약
fencedframe들도
같은 일을 한다면, 이는 initiator의
policy container에 대한 정보가 fenced frame
경계를 넘어 누출되도록 허용할 것이다. 이 섹션은 그 누출을 막기 위해
policy container 상속을 패치한다.
단계 3을 다음과 같이 다시 작성한다:
-
responseURL이 local이고, initiatorPolicyContainer가 null이 아니며, fenced false이면, initiatorPolicyContainer의 clone을 반환한다.
Note:
responseURL이
about:srcdoc인
경우를 수정할 필요는 없다.
about:srcdoc로의
내비게이션은 fenced frame에서 지원되지 않기 때문이다.
-
fenced를 navigable이 펜스드 내비게이블이면 true, 그렇지 않으면 false로 둔다.
Note: 이는 initiator
Document가 navigable의 활성 문서인지 또는 그 unfenced parent인지와 관계없이 fenced가 true가 되도록 보장한다.
단계 23(이제 단계 24)을 다음과 같이 다시 작성한다:
-
resultPolicyContainer를 response의 URL, entry의 document state의 history policy container, sourceSnapshotParams의 source policy container, null, responsePolicyContainer, 및 fenced가 주어졌을 때 determining navigation params policy container의 결과로 둔다.
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 activation과 consumption은 이 두 당사자 사이의 통신
벡터를 제공하므로, 사용자 활성화의 목적에서는
fencedframe의
펜스드 내비게이블이
embedder의 자손으로 간주될 수 없고,
그 embedder도 현재 user activation 알고리즘이 해당
용어들을 사용하는 방식으로
fencedframe의
펜스드 내비게이블의 조상으로 간주될 수 없다.
다시 말해, 우리는 사용자 활성화를 fenced된 것으로 간주하여, 이것이
펜스드 내비게이블 경계를 절대 넘지 않음을
나타낸다. 만약 unfenced라면,
iframe에서와
같이 동작하여 user activation이 프레임
경계를 자유롭게 흐르도록 허용할 것이다.
user activation과 달리,
fencedframe의
펜스드 내비게이블이 생성되거나 내비게이트될 때, 그것은 일반
자식 내비게이블 안의 Document들에
대해 표준적인 것처럼, embedder
Document의
active 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 섹션에 다음을 추가한다:
내비게이블의 속성에 더해, 순회 가능 내비게이블은 다음을 가진다:
-
unfenced parent, 즉 내비게이블 또는 null이며, 처음에는 null이다.
Note: unfenced parent 링크는
fencedframe의
펜스드 내비게이블에 그 embedder로의 링크를 제공하는 것으로,
포커스 처리 모델의 일부 알고리즘처럼 "unfenced"되어야 하는 것에 대해 신중하게 사용된다.
-
navigable의 unfenced parent를 반환한다.
Note: 이 알고리즘은 순회 가능 내비게이블의 unfenced parent getter와 다르다. 이 알고리즘은 먼저 navigable이 일반 자식 내비게이블인 경우 내비게이블의 일반 parent를 얻으려 하기 때문이다.
-
parentNavigable를 navigable의 unfenced parent로 둔다.
-
parentNavigable의 활성 문서를 반환한다.
3.5.3. 중첩 순회 가능 항목
[HTML]의 Navigables 섹션에 "Nested traversables"라는 제목의 새 하위 섹션을 추가하고, 다음 텍스트, 정의, 알고리즘을 포함한다.
내비게이블 컨테이너와 각각의 콘텐츠 내비게이블과 비슷하게,
다른 요소들(지금까지는
fencedframe
요소만)은 사용자에게 더 격리된 내비게이블을
제공한다. 이러한 요소들은 펜스드 내비게이블 컨테이너라고 부른다.
펜스드 내비게이블 컨테이너는 펜스드 내비게이블을 가지며, 이는 null이 아닌 unfenced parent를 가진 순회 가능 내비게이블이거나 null이다. 처음에는 null이다.
-
documentState가 주어졌을 때 traversable인 내비게이블을 초기화한다.
-
traversable의 unfenced parent를 parent로 설정한다.
-
group을 새 브라우징 컨텍스트 그룹으로 둔다.
Note: create a new browsing context group and document가 하는 것처럼 group을 사용자 에이전트의 browsing context group set에 append할 이유는 없어 보인다.
-
element 노드 문서, element, 및 group이 주어졌을 때 creating a new browsing context and document의 두 번째 반환값을 document로 둔다.
-
documentState를 새 document state로 두며, 그 document는 document이다.
-
traversable을 새 순회 가능 내비게이블로 둔다.
-
parentNavigable을 element의 노드 내비게이블로 둔다.
-
documentState와 parentNavigable가 주어졌을 때 traversable인 중첩 순회 가능 항목을 초기화한다.
-
element의 펜스드 내비게이블을 traversable로 설정한다.
-
initialHistoryEntry를 traversable의 활성 세션 히스토리 엔트리로 둔다.
-
initialHistoryEntry의 step을 0으로 설정한다.
-
initialHistoryEntry를 traversable의 session history entries에 Append한다.
-
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를 가져, 그 구분을 무의미하게 만든다는 뜻이다.
최상위 순회 가능 항목과 펜스드 내비게이블 사이의 의도된 구분을 바로잡기 위해, 다음 정의들을 다음과 같이 패치한다:
-
navigable을 inputNavigable로 둔다.
-
-
navigable의 parent와 unfenced parent가 모두 null이면, break한다.
-
navigable을 navigable의 parent 또는 unfenced parent 중 null이 아닌 것으로 설정한다.
Note: 여기서는 navigable의 parent 또는 unfenced parent 중 정확히 하나만 null이 아닐 것이다.
-
-
navigable을 반환한다.
Note: 이러한 새 정의에 따르면, 최상위 순회 가능 항목은 본질적으로 § 3.5.1 소개에서 설명한 것처럼 "unfenced"된 것이다.
3.6. 내비게이블 순회 알고리즘에 대한 수정
또한 이 알고리즘의 단계 2를 다음과 같이 다시 작성한다:
-
document의 descendant navigables를 사용해 navigables를 확장하되, unfenced를 unfenced로 설정한다.
-
navigables를 새 list로 둔다.
-
navigableContainers를 document의 모든 shadow-including descendants 중 내비게이블 컨테이너인 것(또는 unfenced가 true이면 펜스드 내비게이블 컨테이너인 것)의 list로 두며, shadow-including tree order 순서로 둔다.
-
navigableContainers의 각 navigableContainer에 대해 For each:
-
navigableContainer의 content navigable와 fenced navigable가 모두 null이면, continue한다.
-
descendantNavigable를 navigableContainer의 content navigable 또는 fenced navigable 중 null이 아닌 것으로 둔다.
-
descendantNavigable의 활성 문서의 inclusive descendant navigables로 navigables를 확장하되, unfenced를 unfenced로 설정한다.
-
-
navigables를 반환한다.
-
navigable을 document의 node navigable의 parent로 둔다.
-
navigable이 null이고 unfenced가 true이면, navigable을 document의 node navigable의 순회 가능 내비게이블의 unfenced parent로 설정한다.
-
ancestors를 빈 list로 둔다.
-
navigable이 null이 아닌 동안:
-
navigable를 ancestors에 Prepend한다.
-
navigable을 navigable의 parent로 설정한다.
-
navigable이 null이고 unfenced가 true이면, navigable을 navigable의 순회 가능 내비게이블의 unfenced parent로 설정한다.
-
-
ancestors를 반환한다.
3.7. 포커싱 알고리즘에 대한 수정
[HTML] standard는 요소와 Window의
포커싱을 처리하는 방법을 정의하며,
이는 사용자 제스처와 스크립트가 시작한 API를 통해 모두 이루어진다. fenced frames는 fenced frame
경계를 넘는 통신을 방지하도록 설계되었으므로, 포커싱을 신중하게 처리해야 한다. 이는 포커스가
fencedframe
경계를 넘을 때, 경계 양쪽의 컨텍스트가 그 변화를 감지할 수 있고, 이것이
fencedframe과
그 embedder 사이의 통신 채널을 여는 데 사용될 수 있기 때문이다.
우리는 focusing steps가 스크립트가 시작한 포커스를 fenced frame 경계를 넘어 이동하지 못하게 함으로써 이를 수행한다.
사용자가
button
같은 요소를
fencedframe
안에서 클릭할 때,
fencedframe
밖의 다른 요소가 focused되어 있다면,
focusing steps는
button이
focus를 얻는 것을 허용할 것이다. 이는 특별히
사용자 시작 동작이기 때문이다. 이를 허용하지 않으면,
fencedframe
안의 어떤 요소도
focus를 얻을 수 없게 된다.
이
명세 이전의 현 상태처럼 모든 요소가 focus()
메서드를 통해 계속
focused될 수 있도록 허용한다면, 펜스드 내비게이블 컨테이너와 그 펜스드 내비게이블은 일련의
focus()
호출을 사용해 fenced frame 경계를 넘어 임의의 데이터를 보낼 수 있으며, 이는 개인정보 누출이다. 이를
피하기 위해 우리는 사실상
focus()
메서드를 "fence"하며, 이는 개인정보 보호를 위해 일부 기능을 희생한다.
알고리즘의 단계 3(새 focus target을 변경하는 단계) 뒤에 다음 새 단계를 추가한다:
-
new focus target이 null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너이면, new focus target을 그 fenced navigable의 활성 문서로 설정한다.
new chain 변수를 정의하는 단계 뒤에 다음 새 단계를 추가한다:
-
unfenced가 false이고, new chain이 포함하는
Documentdocument가 있으며, 그 node navigable의 순회 가능 내비게이블이 펜스드 내비게이블이고, old chain이 document를 역시 포함하지 않으면, 반환한다.Note: 이것은 포커스가 fence를 넘으려는 경우에, focus update steps를 호출하기 바로 전에 일찍 중단하는 방식이다.
focusing steps의 알고리즘 단계 뒤에 있는 user agent 문장을 다음과 같이 수정한다:
사용자 에이전트는 사용자가 candidate로 포커스를 이동하려고 시도할 때마다 즉시 focusable area 또는 내비게이블 candidate에 대한 focusing steps를 실행해야 하며, unfenced는 true로 설정한다.
-
unfenced를 true로 설정하여 해당 요소에 대해 focusing steps를 실행한다.
-
해당 요소에서
click이벤트를 fire한다.
사용자가 활성화하는 click focusable focusable area에 대해, 사용자 에이전트는
그 focusable area에서 focusing steps를 실행해야 한다. 이때 focus trigger는
"click"으로 설정하고 unfenced는 true로 설정한다.
-
previouslyFocusedElement가 null이 아니면:
-
element의 previously focused element를 null로 설정한다.
-
focusPreviousElement가 true이면, previouslyFocusedElement에 대해 focusing steps를 실행하되, unfenced를 true로 설정한다. 이 단계를 수행함으로써 viewport가 스크롤되어서는 안 된다.
-
Note: popover를 수동으로 dismiss하는 것은 사용자 시작 제스처이지만, 이것이 사용자 제스처에서 호출되었는지 스크립트 호출을 통해 호출되었는지와 관계없이 focusing steps는 unfenced를 false로 설정하여 호출된다.
-
사용자 에이전트는 그 과정에서 해당 요소 중 하나에 대해 focusing steps를 실행하여 포커스할 수 있으며, 문서의 스크롤 위치를 변경하거나, 해당 요소를 사용자의 주의에 띄게 하는 다른 동작을 수행할 수 있다. 이러한 단계가 사용자 제스처에 의해 호출된 경우, focusing steps는 unfenced를 true로 설정하여 호출될 수 있다. form-associated custom elements인 요소의 경우, 사용자 에이전트는 이러한 동작의 목적상 그들의 face validation anchor를 대신 사용해야 한다.
-
candidate의 focused area가 null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너이면, candidate를 그 펜스드 내비게이블 컨테이너의 fenced navigable의 활성 문서로 설정한다.
-
currentObject가 focusable area이면, currentObject를 currentObject의 DOM anchor의 노드 문서로 설정한다.
그렇지 않고, currentObject가
Document이며 그 node navigable의 parent 가 null이 아니면, currentObject를 currentObject의 node navigable의 parent로 설정한다.그렇지 않고, currentObject가
Document이며 그 node navigable가 순회 가능 내비게이블이고 그 unfenced parent가 null이 아니면, currentObject를 currentObject의 node navigable의 unfenced parent로 설정한다.그렇지 않으면, break한다.
- focus target이 null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너인 경우
-
펜스드 내비게이블 컨테이너의 fenced navigable의 활성 문서를 반환한다.
Note: 이 알고리즘은 무조건 fence 경계를 “jump”할 수 있다. 그 반환값은 항상 fence 경계를 신중하게 고려하는 알고리즘에 공급되기 때문이다.
-
candidate의 focused area가 null이 아닌 content navigable를 가진 내비게이블 컨테이너이거나, null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너인 동안: candidate를 해당 내비게이블 컨테이너의 content navigable 또는 해당 펜스드 내비게이블 컨테이너의 fenced navigable 중 null이 아닌 것의 활성 문서로 설정한다.
-
candidate가 null이 아니면, candidate에 대해 focusing steps를 실행하되, unfenced를 true로 설정하고 반환한다.
sequential focus navigation 알고리즘의 단계 9를 다음과 같이 수정한다:
-
그렇지 않으면, starting point는 focusable area이며, 그 노드 문서의 node navigable는 자식 내비게이블 또는 펜스드 내비게이블이다. starting point를 그 node navigable의 unfenced parent로 설정하고, loop라고 레이블된 단계로 돌아간다.
-
candidate가 null이 아닌 content navigable를 가진 내비게이블 컨테이너이면, new candidate를 candidate의 content navigable를 첫 번째 인수로, direction을 두 번째 인수로, sequential을 세 번째 인수로 하여 sequential navigation search algorithm을 실행한 결과로 둔다.
candidate가 null이 아닌 fenced navigable를 가진 펜스드 내비게이블 컨테이너이면, new candidate를 candidate의 fenced navigable를 첫 번째 인수로, direction을 두 번째 인수로, sequential을 세 번째 인수로 하여 sequential navigation search algorithm을 실행한 결과로 둔다.
new candidate가 null이면, starting point를 candidate로 두고, 이 알고리즘의 맨 위로 돌아간다. 그렇지 않으면, candidate를 new candidate로 둔다.
테스트
3.8. 내비게이션
이 섹션은
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 내비게이션에 설명된 것처럼 실패한다.
-
그렇지 않고, 다음 조건이 모두 true이면:
-
navigationParams의 navigable의 순회 가능 내비게이블이 펜스드 내비게이블이다;
-
navigationParams의 response에 대해 supported loading modes를 얻은 결과가 `
fenced-frame`를 포함하지 않는다
그러면 failure를 true로 설정한다.
-
3.8.2.
`Allow-Fenced-Frame-Automatic-Beacons`
HTTP 응답 헤더
same origin이 아닌
Document로
로드되는 문서 리소스를,
그 Document의
browsing context의 fenced frame config
instance의 mapped 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 parent의 embedder policy를 존중하며, 이는 아래에서 달성된다:
-
navigable의 container document
다음으로:
-
navigable의 unfenced container document
Note: 이는
fencedframe
안의 내비게이션이 적절한
`Cross-Origin-Embedder-Policy` 헤더와 함께
제공되지 않으면 실패하게 한다. 이는
iframe들이
동작하는 것과 같다.
개인정보 누출을 일으킬 수 있으므로, queue a cross-origin embedder policy inheritance violation 알고리즘을 fence해야 하는지 unfence해야 하는지 결정한다.
-
response가 network error가 아니고, navigable이 자식 내비게이블 또는 펜스드 내비게이블이며, navigable의 unfenced container document의 origin, navigable의 unfenced container document의 관련 설정 객체, request의 destination, response, 및 true로 cross-origin resource policy check를 수행한 결과가 blocked이면, response를 network error로 설정하고 break한다.
Note: 여기서는 cross-origin resource policy check를 navigable 자체가 아니라 unfenced parent navigable에 대해 실행한다. 이는 (“fence”를 무시하고) embedded content와 embedder의 컨텍스트 사이의 same-originness가 중요하기 때문이며, 내비게이션 source가 중요하기 때문이 아니다.
개인정보 누출을 일으킬 수 있으므로, queue a cross-origin embedder policy CORP violation report 알고리즘을 fence해야 하는지 unfence해야 하는지 결정한다.
테스트
3.8.5. 실제 내비게이션 변경
- 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
- attribution reporting context origin
- automatic beacons allowed
- snapshot automatic beacon store
Document
sourceDocument가 주어졌을 때
automatic beacon data mapping을 snapshot하려면:
-
Assert: 이 단계들은 sourceDocument의 event loop에서 실행 중이다.
-
info를 새 빈 snapshot automatic beacon store로 둔다.
-
mapping을 info의 data mapping으로 둔다.
-
crossOriginMapping을 info의 cross-origin exposed data mapping으로 둔다.
-
current navigable을 sourceDocument의 node navigable로 둔다.
-
current navigable이 null이 아닌 동안 While:
-
current navigable의 활성 문서의 automatic beacon data mapping에 있는 각 type → data에 대해 For each:
-
mapping[type]이 존재하지 않으면, mapping[type]을 data로 설정한다.
Note: 이는 특정 type에 대한 automatic beacon data를 포함하는 첫 번째 조상이 내비게이션을 시작하는 문서에 의해 사용 가능함을 보장한다. 또한 조상이 문서가 더 높은 조상에서 설정된 데이터를 사용하는 것을 차단하지 못하게 한다.
-
crossOriginMapping[type]이 존재하지 않고 data의 crossOriginExposed가 true이면, crossOriginMapping[type]을 data로 설정한다.
-
-
current navigable을 current navigable의 parent로 설정한다.
-
-
info를 반환한다.
Note: info에 저장된 map들은
info를 만드는 데 사용된 원래 Document의
automatic beacon data mapping들에 대한
참조를 보유하도록 의도된 것이다. 이들은 나중에 attempt to send an automatic beacon에서
once가 true로 설정된 beacon data를 비우기 위해
수정된다.
Document
sourceDocument의
initiator의 fenced grand-ancestor의
navigable을 얻으려면:
-
navigable을 sourceDocument의 node navigable로 둔다.
-
navigable이 null이 아니고 navigable이 펜스드 내비게이블이 아닌 동안:
-
navigable을 navigable의 parent로 설정한다.
-
-
navigable이 null이면 null을 반환한다.
-
navigable을 navigable의 unfenced parent로 설정한다.
-
navigable이 null이 아니고 navigable이 펜스드 내비게이블이 아닌 동안:
-
navigable을 navigable의 parent로 설정한다.
-
-
navigable을 반환한다.
Document가
fencedframe
안에 임베드되어 있을 때, 이 알고리즘은 해당 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)를 반환한다.
- 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. 그렇지 않으면 sourceDocument의 initiator’s fenced grand-ancestor’s navigable의 활성 문서의 origin.
- initiator ancestor root referrer policy
-
sourceDocument에 대해 get the initiator’s fenced grand-ancestor’s navigable를 실행한 결과가 null이면 null. 그렇지 않으면 sourceDocument의 initiator’s fenced grand-ancestor’s navigable의 활성 문서의 policy container의 referrer policy.
- attribution reporting enabled
-
sourceDocument가 "
" feature를 사용하도록 허용되는지 결정한 결과attribution-reporting - attribution reporting context origin
-
sourceDocument의 context origin
- automatic beacons allowed
-
sourceDocument의 automatic beacons allowed
- snapshot automatic beacon store
-
sourceDocument에 대해 snapshot the automatic beacon data mapping을 실행한 결과.
-
document의 관련 전역 객체의 navigable이 펜스드 내비게이블이다;
Note: 이는 initiator와 관계없이
fencedframe안의 모든 내비게이션이 "replace" 모드로 수행되도록 보장한다.
테스트
- history-back-and-forward-should-not-work-in-fenced-tree.https.html (라이브 테스트) (소스)
- history-length-fenced-navigations-replace-do-not-contribute-to-joint.https.html (라이브 테스트) (소스)
- history-length-outer-page-navigation-not-reflected-in-fenced.https.html (라이브 테스트) (소스)
- history-length-outer-page-navigation-not-reflected-in-fenced-nested-iframe.https.html (라이브 테스트) (소스)
[HTML]의 navigate 알고리즘 단계 5 뒤에 다음 단계를 추가한다:
-
sourceDocument의 node navigable가 주어졌을 때 determine if a navigable has revoked network for itself를 실행한 결과가 true이면, 반환한다.
[HTML]의 navigate 알고리즘 단계 13("If all of the following are true:")을 수정하여 다음 조건을 포함한다:
-
sourceDocument의 node navigable이 펜스드 내비게이블 컨테이너가 아니면서 동시에 navigable이 펜스드 내비게이블이다.
Note: 이는 embedder가 시작한 내비게이션이
fencedframe안에서 fragment 내비게이션을 절대 트리거할 수 없도록 보장한다.
병렬로 진행되는 단계인 단계 22 바로 뒤에 이 단계들을 삽입하여, 뒤따르는 단계들이 패치된 알고리즘에서 병렬로 실행되는 첫 단계가 되도록 한다:
-
url이 urn uuid 이고 navigable이 펜스드 내비게이블이면:
-
config를 sourceDocument의 node navigable의 순회 가능 내비게이블의 fenced frame config mapping에서 config를 찾은 결과로 둔다.
Note: 이는 urn uuid url과 관련된 config가 fenced frame config mapping에서 "finalized"될 때까지 임의의 시간 동안 "wait"할 수 있다. 이 때문에 이 단계는 병렬로 실행된다. 이 내비게이션은, 이후 embedder가 시작한 내비게이션이 발생할 경우, 진행 중인 내비게이션을 추적하는 일반 메커니즘에 의해 취소될 것이다.
-
config의 embedder shared storage context를 sharedStorageContext로 설정한다.
-
Assert: sourceSnapshotParams의 target fenced frame config는 null이다.
-
sourceSnapshotParams의 target fenced frame config를 config로 설정한다.
-
Assert config의 mapped url의 value는 URL이며, 그 scheme은 "
https"이다. -
url을 config의 mapped url의 value로 설정한다.
-
config의 on navigate callback 안의 단계들을 실행한다.
-
-
navigable이 펜스드 내비게이블이고 sourceDocument의 node navigable이 navigable의 활성 문서의 ancestor navigables에 있고, unfenced가 true로 설정되어 있으면:
-
config를 다음 항목을 가진 새 fenced frame config로 둔다:
-
Assert: sourceSnapshotParams의 target fenced frame config는 null이다.
-
sourceSnapshotParams의 target fenced frame config를 config로 설정한다.
-
"Let unloadPromptCanceled be the result of"로 시작하는 단계를 다음과 같이 다시 작성한다:
-
unloadPromptCanceled를 navigable이 펜스드 내비게이블이면 false로, 그렇지 않으면 navigable의 활성 문서의 inclusive descendant navigables에 대해 checking if unloading is user-canceled한 결과로 둔다.
단계 22.8.2(finalSandboxFlags를 union으로 두는 단계...) 뒤에 다음 단계를 추가한다:
-
sourceSnapshotParams의 target fenced frame config가 null이 아니고, sourceSnapshotParams의 target fenced frame config의 effective sandboxing flags가 null이 아니면, finalSandboxFlags를 finalSandboxFlags와 sourceSnapshotParams의 target fenced frame config의 effective sandboxing flags의 value의 union으로 설정한다.
Note: 이는 finalSandboxFlags가 target fenced frame config에 정의된 effective sandboxing flags만큼 최소한 제한적임을 보장한다. blocked by sandboxing flags? 알고리즘의 별도 검사는 finalSandboxFlags가 effective sandboxing flags보다 더 제한적이지 않도록 보장한다.
아래 패치들은 이전에 할당된 target fenced frame config를 사용하여, 내비게이션이 finalize될 때 사용할 준비를 위해 이를 인스턴스화한다.
- fenced frame config instance
-
fenced frame config instance 또는 null, 처음에는 null.
Note: 이는 embedder가 시작한
fencedframe내비게이션에 대해서만 설정되며, 그러한 내비게이션의 결과로 새Document가 생성되면, 이 member는 새 펜스드 내비게이블의 활성 브라우징 컨텍스트의 fenced frame config instance member로 전송된다.
- fenced frame config instance
-
sourceSnapshotParams의 target fenced frame config가 null이면 null; 그렇지 않으면 sourceSnapshotParams의 target fenced frame config를 인스턴스화한 결과.
마지막으로, 아래 패치들은 navigation params의 fenced frame config instance를 사용하고, 내비게이션에 의해 시작되는 브라우징 컨텍스트의 fenced frame config instance 할당을 처리한다.
Note: 브라우징 컨텍스트의 fenced frame config instance는
두 가지 다른 방식으로 할당된다: (1) 이 섹션의 나머지에서 설명하는 것처럼 embedder가 시작한
fencedframe
내비게이션 동안, 그리고 (2) 그 순회 가능 내비게이블이 펜스드 내비게이블인
자식 내비게이블 안의
Document들을
위한 초기 Document
생성 중에 상속되며, 이는 § 3.3 브라우징 컨텍스트 생성에 대한 수정 섹션에서 처리된다.
fencedframe
안의 성공적인 내비게이션에서는, 그 내비게이션이
fencedframe
안의 content에 의해 시작되었든 그 embedder에 의해 시작되었든 관계없이, 정확히 두 가지 중 하나가 일어난다:
-
Embedder가 시작한 내비게이션: navigation params의 fenced frame config instance는 무조건
fencedframe의 펜스드 내비게이블 컨테이너의 펜스드 내비게이블의 활성 브라우징 컨텍스트의 fenced frame config instance에 할당된다. -
내부 content가 시작한 내비게이션: 바로 앞 항목에서 참조된 fenced frame config instance는 이러한 종류의 cross-
Document내비게이션을 거치며 유지된다.
-
navigationParams의 fenced frame config instance가 null이 아니면:
-
Assert: browsingContext는 navigationParams의 navigable의 활성 브라우징 컨텍스트와 같지 않다.
Note: 이는 (navigationParams의 fenced frame config instance가 null이 아님으로 표시되는) embedder가 시작한 내비게이션이 항상 § 3.8.6 브라우징 컨텍스트 그룹 swap을 일으키기 때문이다.
-
navigationParams의 fenced frame config instance의 cross-origin reporting allowed를 navigationParams의 response의 header list에 대해 `
Allow-Cross-Origin-Event-Reporting`와 "item"을 주어 structured field value를 얻은 결과로 설정한다. -
browsingContext의 fenced frame config instance를 navigationParams의 fenced frame config instance로 설정한다.
-
단계 9 뒤에 다음 새 단계를 추가한다:
-
automaticBeaconsAllowed를 navigationParams의 response의 header list에 대해 `
Allow-Fenced-Frame-Automatic-Beacons`와 "item"을 주어 structured field value를 얻은 결과로 둔다.
또한 단계 10(이제 단계 12)을 다시 작성하여 추가 매개변수가 있는 새 Document를
반환하게 한다:
- automatic beacons allowed
-
automaticBeaconsAllowed.
-
navigable과 sourceSnapshotParams가 주어졌을 때 determine if an embedder-initiated fenced frame navigation should be blocked를 실행한 결과가 true이다;
3.8.6. 브라우징 컨텍스트 그룹 swap
fencedframe의
embedder가 frame 안에서 내비게이션을 시작할 때, 우리는 frame 안의 컨텍스트를 완전히 재설정하기 위해
브라우징 컨텍스트 그룹 swap을 수행해야 한다. 이는 다음
Document로
누출될 것이 남아 있지 않도록 보장하기 위해서이다.
-
다음 조건이 모두 true이면:
-
navigable이 펜스드 내비게이블이다;
-
sourceSnapshotParams의 fetch client가 navigable의 활성 문서의 관련 설정 객체가 아니다;
-
navigationParams가 null이 아니다
그러면 navigationParams의 COOP enforcement result의 needs a browsing context group switch boolean을 true로 설정한다.
이는 실제로 동작하지만, fenced frames를 염두에 두지 않고 설계된 COOP 메커니즘에 편승하는 대신, 이를 수행하기 위한 별도 메커니즘을 사용하는 것을 고려해야 한다. COOP 메커니즘은 이 명세에 원치 않는 부작용을 주는 방식으로 진화할 수 있기 때문이다.
-
3.8.7.
"_unfencedTop" 내비게이션 대상
Fenced frames는 내비게이트하기 위해 추가 예약 내비게이션 대상 "_unfencedTop"을 사용한다.
이 섹션은 이 새 예약 keyword에 대한 지원을 추가하기 위해 [HTML] 명세의 관련 부분을 패치한다.
_unfencedTop"이라는 새 keyword를 포함한다.
아래 단락을 수정하여 다음 텍스트를 대체한다:
-
"top"은 link 또는 script가 있는 navigable의 top-level traversable을 의미한다,
다음으로:
-
"top"은 link 또는 script가 있는 navigable의 traversable navigable을 의미하고, "outermost top"은 link 또는 script가 있는 navigable의 top-level traversable을 의미한다,
Note: 이 변경은 이 명세가 이전에는 기능적으로 동등했던 traversable navigable과 top-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 |
6.5. 그렇지 않고, name이 ASCII 대소문자 구분 없이 "_unfencedTop"와 일치하고
currentNavigable의 순회 가능 내비게이블이 펜스드 내비게이블이면,
chosen을 currentNavigable의 top-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 navigable의 Document가
notifyEvent()를
호출한 뒤,
fencedframe
요소에서 비동기적으로 fire된다
|
4. 다른 명세와의 상호작용
fencedframe
요소와 navigable 및 browsing context group 같은 핵심 개념과의 상호작용은 필연적으로
여러 영역에 걸쳐 있으므로, 이 명세를 고려하여 term 사용을 재평가해야 하는 여러 명세가 있다.
이 섹션은 우리가 다른 명세에 제안하는 여러 변경을 담는다.
4.1. Prerendering
Prerendering Revamped 명세는 navigable의 loading mode와 그것이 가질 수 있는 값을 정의한다. 우리 명세는 fenced frames를 위한 또 다른 값을 추가한다:
- "
fencedframe" -
이 navigable은
fencedframe의 content를 표시하고 있다
4.2. Content Security Policy
이 소개 섹션은 비규범적이다.
Content Security Policy [CSP]는 일반적으로
navigable container를 호스팅하는
Document와
관련된 웹 콘텐츠가 child navigable 안의 내비게이션 source를 제한하는 데 사용할 수 있다.
[CSP]가
fencedframe
안의 내비게이션 URL을 그 embedder를 운영하는 site에 노출하는 통신 부채널로
사용되는 것을 방지하기 위해,
fencedframe
내비게이션에 영향을 줄 수 있는 유일한 source
expressions는 다음과 같다:
-
scheme-source "
https:" -
host-source "
https://*:*" -
string "
*"
이를 설명하는 우리의 CSP explainer를 보라.
4.2.1. 알고리즘
-
request의 destination이 "
fencedframe"이고, 이 directive의 value가 "https:", "https://*:*", 또는 "*" 중 어느 것도 포함하지 않으면, "Blocked"를 반환한다.
-
request destination이 "
fencedframe"이고, 이 directive의 value가 "https:", "https://*:*", 또는 "*" 중 어느 것도 포함하지 않으면, "Blocked"를 반환한다.
다음으로, [CSPEE] 명세의 동작을 수정한다. embedding frame이 required CSP를 지정하면, fenced frames는 로드되지 않는다. 이는 embedder에서 fenced frame으로 임의의 데이터 흐름을 방지하기 위해 수행된다.
-
context의 required csp가
null이 아니고, request destination이 "fencedframe"이면, "Blocked"를 반환한다.
4.2.2. 새 fenced-frame-src [CSP] directive
fencedframe은
iframe과
다른 요소이므로, frame-src
directive를 사용하는 것만으로는 웹 사이트가 자신의 CSP 규칙을 충분히 제어할 수 없다. 새
[CSP]
directive, fenced-frame-src를 도입한다. 몽키패치된 명세는
아래에 표시된다:
fencedframe의
펜스드 내비게이블에 로드될 수 있는 URL을
제한한다. directive의 name과 value에 대한 구문은 다음 ABNF로 설명된다:
directive-name = "fenced-frame-src" directive-value = serialized-source-list
Content-Security-Policy: fenced-frame-src https://example.com/
다음 코드에 대한 fetch는 제공된 URL이 fenced-frame-src의
source
list와 일치하지 않으므로 network error를 반환한다:
< fencedframe src = "https://example.org/" > </ fencedframe >
Pre-request check와 Post-request check는 frame-src의 check와 동일하다.
Content-Security-Policy: connect-src 'self'; ... worker-src 'self'
이제 다음과 같이 된다:
Content-Security-Policy: connect-src 'self'; ... fenced-frame-src 'self'; ... worker-src 'self'
- "
fenced-frame-src" -
-
<< "fenced-frame-src", "frame-src", "child-src", "default-src" >>를 반환한다.
-
- "
fencedframe" -
-
fenced-frame-src를 반환한다.
-
테스트
- ancestor-throttle.https.html (라이브 테스트) (소스)
- csp-allowed.https.html (라이브 테스트) (소스)
- csp-blocked.https.html (라이브 테스트) (소스)
- csp-fenced-frame-src-allowed.https.html (라이브 테스트) (소스)
- csp-fenced-frame-src-blocked.https.html (라이브 테스트) (소스)
- csp-frame-src-allowed.https.html (라이브 테스트) (소스)
- csp-frame-src-blocked.https.html (라이브 테스트) (소스)
- csp-allowed-transparent.https.html (라이브 테스트) (소스)
- csp-blocked-transparent.https.html (라이브 테스트) (소스)
- csp.https.html (라이브 테스트) (소스)
- cspee.https.html (라이브 테스트) (소스)
- embedder-csp-not-propagate.https.html (라이브 테스트) (소스)
4.3. Permissions Policies
이 소개 하위 섹션은 비규범적이다.
fencedframe
안의 Document들에서
사용할 수 있는 policy-controlled features와 그 계산 방식은
fencedframe이
내비게이트하는 fenced frame
config가
어떻게 구성되는지에 따라 달라진다.
웹 플랫폼에서 FencedFrameConfig
constructor를 통해 생성된 fenced frame config instance는
flexible permissions policy behavior를 가지며,
이 config가 내비게이트하는
fencedframe의
내부 Document는
해당 permission들이 fenced frame
allowed permissions 목록에 포함되는 한 permission을 상속하도록 허용된다. 그 밖의 모든
policy-controlled features는 비활성화된다.
effective enabled permissions를
설정하는 config-generating API를 통해 생성된 fenced frame config instance는
fixed
permissions policy behavior를 가지며,
이 config가 내비게이트하는
fencedframe의
내부 Document는
effective enabled permissions가
해당 Document에서
활성화될 policy-controlled features의 배타적 목록이 되도록 한다
(다른 모든 것은 비활성화된다).
fixed permissions policy behavior를 가진
fenced frame config instance로
fencedframe
내비게이션을 수행하는 동안, 이는 내비게이트 대상인
fenced frame config instance의
effective enabled
permissions를 결과 Document의
permissions policy의 inherited policy와 비교한다. 내비게이션은
inherited policy value가 "Enabled"인
각 상속된 feature가 fenced frame config instance의
effective enabled
permissions에도 나타날 때만 성공한다. 그렇지 않으면,
fencedframe이
임베드된 환경은 fenced frame
config에 부적합한 것으로 간주되고,
내비게이션은 차단된다.
동시에,
fencedframe의
embedder가 해당 내비게이션의 origin에 기반하여 frame 안의 content에 직접 영향을 주지
않도록 보장하기 위해(origin은 cross-site data에서 파생되기 때문에), 이 명세는 여러
[PERMISSIONS-POLICY] 알고리즘을
수정하여
fencedframe
Document의
inherited policy가 그
origin이
embedder의 origin과 same
origin인지 고려하지 않고 계산되도록 한다.
따라서 feature는 그 embedder가 the special value * allowlist를 통해 명시적으로 위임하는 경우에만
fencedframe
안에서 활성화될 수 있다.
위의 모든 것을 고려하면, fixed permissions policy behavior 내비게이션에 대해 다음과 같은 흥미로운 함의가 나온다:
-
effective enabled permissions에 존재하는 feature가 default allowlist로 the special value *를 가지고,
fencedframeembedder에 `Permissions-Policy` header가 제공되지 않으며,allowattribute가 비어 있으면,fencedframe안의 내비게이션은 성공하고, 결과Document는 해당 feature를 사용하도록 허용된다(즉, 활성화된다). -
effective enabled permissions에 존재하는 feature가 default allowlist로
'self'를 가지고,fencedframeembedder에 `Permissions-Policy` header가 제공되지 않으며,allowattribute가 비어 있으면,fencedframe안의 내비게이션은 차단된다.Note: 이는 보통 이 feature가 subframe의
Document가 그 embedder와 same origin인 경우에만 활성화되기 때문이다. 이 명세는 fenced frames에 대해 이러한 검사를 피한다. 그 이유는fencedframe의Document의 origin이 cross-site data에서 파생되기 때문이다. 따라서 우리는 단순히 "fail close"한다. -
effective enabled permissions에 존재하는 feature가 default allowlist로
'self'를 가지고,fencedframe의allowattribute가 해당 feature를 포함하지만 allowlist는 포함하지 않으면,allowattribute 섹션에 설명된 규칙에 따라, feature에 대한 기본 allowlist는'src'가 되며, 이는 embedder가 제공한 내비게이션 URL을 나타내도록 의도된 것이다. 그러나fencedframe을 내비게이트할 때는 그러한 URL이 없다. 내비게이션 URL은 fenced frame config에 의해 결정되기 때문이다. 내비게이션은 차단된다. -
effective enabled permissions에 존재하는 feature가 default allowlist로
'self'를 가지지만,fencedframe의 embedder에 제공된 `Permissions-Policy` header 또는allowattribute가 그 feature의 allowlist를 the special value *로 설정하면, 해당fencedframe안의 내비게이션은 성공하고, 결과Document는 그 feature를 사용하도록 허용된다. -
fencedframe안의 내비게이션이 다른 경우라면 성공할 것이지만,fencedframe안의 내비게이션에 대한 response가 effective enabled permissions 안의 feature에 대해 allowlist를 "none" 또는 그 밖의 호환되지 않는 origin으로 설정하는 `Permissions-Policy` header와 함께 제공되면, 내비게이션은 여전히 성공하지만fencedframe안의Document는 그 feature를 사용하도록 허용되지 않는다.Note: 이는 괜찮다. 특정 feature를 비활성화하기로 결정하는 것은 embedder 환경이 아니라
fencedframe의 content 자체이기 때문이다.
아래 섹션의 패치들은 위 설명 내용에 서술된 결과를 달성하기 위해 적절한 [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 섹션의 이름을 "iframe 및
fencedframe 요소의 allow attribute"로 바꾸고, 섹션을 다음과 같이
다시 작성한다:
iframe
및
fencedframe
요소는 각각 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를 나타낸다.
비어 있지 않을 때,
iframe의
allow
또는
fencedframe의
allow
attribute는 구성될 때
iframe
또는
fencedframe의
container policy에 각 supported feature에 대한 allowlist를 추가하게 된다.
펜스드 내비게이블 컨테이너(container)와 origin(origin)이 주어졌을 때, 이 알고리즘은 새 Permissions Policy를 반환한다.
-
fencedFrameConfig를 container의 노드 문서의 활성 브라우징 컨텍스트의 fenced frame config instance로 둔다.
-
inheritedPolicy를 새 ordered map으로 둔다.
-
fencedFrameConfig가 null이 아니고 fencedFrameConfig의 permissions policy behavior가 fixed이면:
-
For each supported feature에 대해:
-
fencedFrameConfig의 effective enabled permissions가 feature를 포함하면, inheritedPolicy[feature]를 "
Enabled"로 설정한다.그렇지 않으면 inheritedPolicy[feature]를 "
Disabled"로 설정한다.
Note: 이는
allowattribute를 고려하지 않지만, 이것이 호출될 때까지는 Should navigation response to navigation request be blocked by Permissions Policy? 때문에 이미 검사되어 있을 것이다.allow에 지정된 policy가 너무 제한적이면 fenced frame이 로드되지 않았을 것이고, effective enabled permissions에 지정된 것보다 더 허용적인 policy는 무시될 것이다. -
-
-
그렇지 않으면:
-
For each supported feature에 대해:
-
feature가 fenced frame allowed permissions 중 하나와 일치하면, inheritedPolicy[feature]를 feature, container, origin이 주어졌을 때 Define an inherited policy for feature in container at origin을 실행한 결과로 설정한다.
그렇지 않으면 inheritedPolicy[feature]를 "
Disabled"로 설정한다.
-
-
-
policy를 새 permissions policy로 두며, inherited policy는 inheritedPolicy이고 declared policy는 두 개의 새 ordered maps로 초기화된다.
-
policy를 반환한다.
null 또는 element(container), origin(origin), 그리고 기본값이 false인 선택적 boolean matchAll이 주어졌을 때, 이 알고리즘은 새 permissions policy를 반환한다.
단계 1을 다음과 같이 다시 작성한다:
-
Assert: null이 아니면, container는 내비게이블 컨테이너이거나 펜스드 내비게이블 컨테이너이다.
단계 3을 다음과 같이 다시 작성한다:
-
For each supported feature에 대해:
-
isInherited를 feature, container, origin, 그리고 matchAll에 대해 Define an inherited policy for feature in container at origin을 실행한 결과로 둔다.
-
inherited policy[feature]를 isInherited로 설정한다.
-
null, 내비게이블 컨테이너-또는-펜스드 내비게이블 컨테이너(container), origin(origin), 그리고 response (response)가 주어졌을 때, 이 알고리즘은 새 permissions policy를 반환한다.
단계 1을 다음과 같이 다시 작성한다:
-
container가 펜스드 내비게이블 컨테이너이면, policy를 container와 origin이 주어졌을 때 create a permissions policy for a fenced navigable를 실행한 결과로 둔다.
그렇지 않으면, policy를 container와 origin이 주어졌을 때 Create a Permissions Policy for a navigable를 실행한 결과로 둔다.
-
element가
iframe요소도 아니고fencedframe요소도 아니면, 빈 policy directive를 반환한다.
-
navigationParams가 주어졌을 때 should navigation response to navigation request be blocked by Permissions Policy?의 결과가 "
Blocked"이다; -
navigationParams와 sourceSnapshotParams가 주어졌을 때 should navigation response to navigation request be blocked by sandboxing flags?의 결과가 "
Blocked"이다;
Note: 이러한 알고리즘 중 하나라도
"Blocked"를 반환하면,
fencedframe
안의 기존 Document는
남아 있지 않으며, error page가 로드된다.
navigation params(navigationParams)가 주어졌을 때,
이 알고리즘은 "Blocked" 또는
"Allowed"를 반환한다:
-
navigable을 navigationParams의 navigable로 둔다.
-
navigable이 펜스드 내비게이블이 아니면, "
Allowed"를 반환한다. -
origin을 navigationParams의 origin으로 둔다.
-
effective permissions를 navigable의 활성 브라우징 컨텍스트의 fenced frame config instance의 effective enabled permissions로 둔다.
pull request #84에서 생략된 작업에 따르면, config instance는 아직 browsing context에 할당되지 않았다. 대신 instance를 navigationParams 안에 저장하고 여기서 그것을 참조하는 것을 고려해야 한다.
-
permissionsPolicy를 navigable의 fenced navigable container, origin, 그리고 true가 주어졌을 때 creating a permissions policy한 결과로 둔다.
Note: 이는 이 pending 내비게이션에 대한 최종
Document를 내비게이션이 구성할 때 생성될 permissions policy와 거의 동일하다. 차이점은 이 알고리즘이 iframe에서 호출될 때와 마찬가지로,allowattribute에 지정된 모든 permission을 포함한다는 것이다. 해당 permission이 fenced frame config의 effective enabled permissions에 지정되어 있지 않더라도 그렇다. 내비게이션이 실패할지 결정하기에 적절한 시점이므로 지금 이를 만들고 테스트를 실행한 뒤 버린다. 내비게이션이 성공하면, 이는 다시 생성되어Document에 무조건 설치된다. 그러나 재생성은 effective enabled permissions에 포함되지 않은 추가 활성 permission을 포함하지 않으며, 사실상 활성화된 permission을 effective enabled permissions에 지정된 것만으로 잠근다. -
inheritedPolicy를 permissionsPolicy의 inherited policy로 둔다.
-
effective permissions의 각 effective permission에 대해 For each:
-
inheritedPolicy[effective permission]이 "Disabled"이면 "
Blocked"를 반환한다.
-
-
"
Allowed."를 반환한다.
navigation params(navigationParams)와 source snapshot params
(sourceSnapshotParams)가 주어졌을 때, 이 알고리즘은 "Blocked" 또는
"Allowed"를 반환한다:
-
navigable을 navigationParams의 navigable로 둔다.
-
navigable이 펜스드 내비게이블이 아니면, "
Allowed"를 반환한다. -
effectiveSandboxingFlags를 sourceSnapshotParams의 target fenced frame config의 effective sandboxing flags로 둔다.
-
navigationParams의 final sandboxing flag set이 effectiveSandboxingFlags의 subset이 아니면, "
Blocked"를 반환한다.Note: 이는 final sandboxing flag set이 effective sandboxing flags에서 이미 제한되지 않은 feature를 제한할 수 없음을 의미한다. 추가 제한은 통신 채널로 사용될 수 있기 때문이다. 이 시점에서 final sandboxing flag set은 이미 effective sandboxing flags만큼 최소한 제한적으로 설정되어 있을 것이다.
-
그렇지 않으면 "
Allowed"를 반환한다.
feature(feature), null 또는 내비게이블 컨테이너(container), 해당 container 안의 document에 대한 origin(origin), 그리고 기본값이 false인 선택적 boolean matchAll이 주어졌을 때, 이 알고리즘은 해당 feature에 대한 inherited policy를 반환한다.
단계 3을 다음과 같이 다시 작성한다:
-
feature, container의 노드 문서, origin, 그리고 matchAll에 대해 Is feature enabled in document for origin?를 실행한 결과가 "Disabled"이면, "Disabled"를 반환한다.
Note: 동일한 알고리즘에 위임하는 단계 2를
다시 작성하여 matchAll boolean을 전달할 필요는 없다. 단계 2는 feature가
container의 노드 문서에서 활성화되어 있는지 검사하는 것과 관련되어
있으며, container 안에 호스팅된 Document와
관련된 것이 아니기 때문이다.
단계 7을 다음과 같이 다시 작성한다:
-
matchAll이 false이고, feature의 default allowlist가
'self'이며, origin이 container의 노드 문서의 origin과 same origin이면,"Enabled"를 반환한다.
feature(feature), Document
객체(document), origin
(origin), 그리고 기본값이 false인 선택적
boolean
matchAll이 주어졌을 때, 이 알고리즘은
feature가 disabled로 간주되어야 하면 "Disabled"를 반환하고, 그렇지 않으면
"Enabled"를 반환한다.
단계 3을 다음과 같이 다시 작성한다:
-
feature가 policy의 declared policy에 존재하면,
-
matchAll이 false이고, policy의 declared policy 안에서 feature에 대한 allowlist가 origin과 matches이면, "
Enabled"를 반환한다. -
그렇지 않고, matchAll이 true이고, policy의 declared policy 안에서 feature에 대한 allowlist가 the special value *이면, "
Enabled"를 반환한다. -
그렇지 않으면 "
Disabled"를 반환한다.
-
단계 5를 다음과 같이 다시 작성한다:
-
matchAll이 false이고, feature의 default allowlist가
'self'이며, origin이 document의 origin과 same origin이면, "Enabled"를 반환한다.
-
node의 노드 문서의 브라우징 컨텍스트의 fenced frame config instance가 null이 아니면, node의 노드 문서의 브라우징 컨텍스트의 fenced frame config instance의 mapped url을 반환한다.
Note: 이는
allow
attribute에 설정될 수 있는 'src' allowlist가
fenced frame
config를 사용해
fencedframe을
내비게이트할 때(또는 fenced
frame config로 매핑되는 urn으로
iframe을
내비게이트할 때) 동작하도록 보장한다.
테스트
- allow-attribute-src.https.html (라이브 테스트) (소스)
- default-enabled-features-allow-all.https.html (라이브 테스트) (소스)
- default-enabled-features-allow-none.https.html (라이브 테스트) (소스)
- default-enabled-features-allow-self.https.html (라이브 테스트) (소스)
- default-enabled-features-attribute-allow.https.html (라이브 테스트) (소스)
- default-enabled-features-attribute-change.https.html (라이브 테스트) (소스)
- default-enabled-features-attribute-disallow.https.html (라이브 테스트) (소스)
- default-enabled-features-attribution-disabled.https.html (라이브 테스트) (소스)
- default-enabled-features-subframe.https.html (라이브 테스트) (소스)
- default-enabled-features-unset.https.html (라이브 테스트) (소스)
- permission-api-denied-non-standard.https.html (라이브 테스트) (소스)
- permission-api-denied.https.html (라이브 테스트) (소스)
- permission-geolocation.https.html (라이브 테스트) (소스)
- permission-notification.https.html (라이브 테스트) (소스)
4.4. CSSOM View
[CSSOM-VIEW]
명세는
scroll a target into view 알고리즘을 호출하는 scrollIntoView()
메서드를 정의한다. 이는 대상이 보이도록 Element
또는
viewport를 스크롤할 뿐 아니라, 필요하다면 대상이 보이도록
ancestor들도 스크롤하며, 본질적으로 스크롤이 "bubble up"되도록 한다.
이는 child navigable 또는 fenced navigable 안에서 수행된 scrollIntoView()를
그 embedder가 관찰할 수 있음을 의미하며, fenced frame 경계를 가로지르는 담합을 허용한다. 이 섹션은 일부 유용성을
희생하면서 그러한 담합을 방지하기 위해 scroll a target into view 알고리즘을 패치한다.
-
scrolling box의 연관된
Element의 연관된Document의 node navigable의 traversable navigable이 fenced navigable이거나, 또는 scrolling box의 연관된 viewport의 연관된Document의 node navigable의 traversable navigable이 fenced navigable이면, 이를 그렇지 않으면 뒤따를 추가 재귀 인스턴스를 중단시키는 이 알고리즘의 마지막 인스턴스로 둔다.
Note: 이는 스크롤이 fenced frame 경계까지 "bubble up"되는 것은 허용하지만, 이를 넘지는 못하게 한다.
4.5. Iframe credentialless
이 첫 번째 소개 섹션은 비규범적이다.
[IFRAME-CREDENTIALLESS] 명세는 새로운 객체인 page credentialless nonce를 정의한다. 높은 수준에서 partition nonce는 page credentialless nonce와 같은 목적(저장소와 네트워크 파티셔닝)을 수행한다. 그러나 각 fenced frame은 고유한 nonce를 가지는 반면, page credentialless nonce는 traversable navigable의 active window에 scope되는 단일 nonce이며, 모든 descendant credentialless iframes가 공유한다.
fenced frames와 credentialless iframes가 같은 tree 안에 존재하는 경우, 자식의 nonce는 항상 그 부모의 nonce보다 우선한다. 예를 들어:
-
credentialless iframe이 fenced frame의 자식이면, 그 iframe에 대한 리소스를 파티셔닝하는 데 page credentialless nonce가 사용된다.
-
fenced frame이 credentialless iframe의 자식이면, fenced frame의 partition nonce가 리소스를 파티셔닝하는 데 사용된다.
리소스 파티셔닝에 더해, partition nonce는 fenced frames에서 네트워크 접근을 철회하는 데도 사용된다. 다음 monkeypatch들을 [IFRAME-CREDENTIALLESS] 명세에 적용한다.
다음 알고리즘을 추가한다:
-
credentialless가 true이면, 연관된 browsing context의 top-level browsing context의 page credentialless nonce를 반환한다.
-
newFencedFrameNonce가 null이 아니면, newFencedFrameNonce를 반환한다.
-
instance를 연관된 browsing context의 fenced frame config instance로 둔다.
-
instance가 null이 아니면 instance의 partition nonce를 반환하고, 그렇지 않으면 null을 반환한다.
network partition key는 다음으로 구성된 tuple이다:
-
site.
-
null 또는 implementation-defined 값.
-
nonce (null 또는 implementation-defined 값).
create navigation params by fetching에서, 단계 18과 19 사이에 다음과 같은 새 단계를 추가한다:
-
partitionNonce를 browsingContext에 대해 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 instance의 partition nonce를 통해 올바른 partition nonce에 접근할 수 있다.
단계 19를 20으로 번호를 다시 매기고, 단계 20.2.4를 다음과 같이 다시 작성한다:
-
request의 reserved client를 새 environment로 설정한다. 그 id는 고유한 불투명 문자열이고, target browsing context는 navigable의 active browsing context, creation URL은 currentURL, top-level creation URL은 topLevelCreationURL, top-level origin은 topLevelOrigin, 그리고 partition nonce는 partitionNonce.이다.
6.9. partitionNonce를 browsingContext에 대해 effective partition nonce를 계산한 결과로 둔다. 이때 navigationParams의 credentialless와, navigationParams의 fenced frame config instance가 null이면 null, 그렇지 않으면 navigationParams의 fenced frame config instance의 partition nonce가 주어진다.
4.6. WebRTC
[WEBRTC] 명세는 "적절한 실시간 프로토콜 집합을
구현하는 다른 브라우저나 장치로 미디어 및 일반 application data를 보내고 받을 수 있게 하는 WebIDL의 ECMAScript
API"를 정의한다. peers와의 연결을 가능하게 하는 인터페이스는
RTCPeerConnection이다.
이 인터페이스의 생성, 따라서 WebRTC를 통한 peers와의 연결은 fenced frames에서 허용되지 않는다.
RTCPeerConnection
constructor
알고리즘을 수정하여 다음과 같은 새 첫 번째 및 두 번째 단계를 추가한다:
-
navigable을 this의 relevant global object의 navigable로 둔다.
-
navigable이 null이 아니고 navigable의 traversable navigable이 fenced navigable이면, throw a
NotAllowedErrorDOMException.
5. 보안 및 개인정보 고려사항
이 자료는 우리 explainer에서 이 명세로 upstream되는 중이며, 그동안에는 다음 리소스를 참조할 수 있다: