Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
blu25 committed Sep 20, 2024
1 parent 309c1cf commit e961d33
Showing 1 changed file with 37 additions and 36 deletions.
73 changes: 37 additions & 36 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2778,7 +2778,8 @@ CORP violation report=] algorithm, as leaving it unfenced may cause a privacy le
</div>

<div algorithm=get-initiator-ancestor-root-origin>
To <dfn>get the initiator ancestor root origin</dfn> of a given {{Document}} |sourceDocument|:
To <dfn>get the initiator's fenced grand-ancestor's origin</dfn> of a given {{Document}}
|sourceDocument|:

1. Let |navigable| be |sourceDocument|'s [=node navigable=].

Expand All @@ -2789,45 +2790,44 @@ CORP violation report=] algorithm, as leaving it unfenced may cause a privacy le

1. If |navigable| is null, return null.

1. Otherwise:

1. [=Assert=]: |navigable| is a [=fenced navigable container/fenced navigable=].

1. Set |navigable| to |navigable|'s [=navigable/unfenced parent=].

1. While |navigable| is not null and |navigable| is not a [=fenced navigable container/fenced
navigable=]:

1. Set |navigable| to |navigable|'s [=navigable/parent=].

1. If |navigable| is null, return null.
1. [=Assert=]: |navigable| is a [=fenced navigable container/fenced navigable=].

1. Otherwise, return |navigable|'s [=navigable/active document=]'s [=Document/origin=].
1. Set |navigable| to |navigable|'s [=navigable/unfenced parent=].

*The rest of this section is non-normative*.

Given a {{Document}} embedded inside of a <{fencedframe}>, this algorithm gets the origin
for the fenced frame root's ancestor fenced frame root. If there is no fenced frame root (for
either of fenced frame roots the algorithm looks for), the algorithm will return null. For
example, for the given frame tree structure:
1. While |navigable| is not null and |navigable| is not a [=fenced navigable container/fenced
navigable=]:

```
Main frame (origin A)
<fencedframe> (origin B)
<iframe> (origin C)
<fencedframe> (origin D)
<iframe> (origin E)
<fencedframe> (origin F)
```
1. Set |navigable| to |navigable|'s [=navigable/parent=].

The algorithm will return the following given each document:
1. If |navigable| is null, return null.

- `Main frame (origin A)` will return `null`.
- `<fencedframe> (origin B)` will return `null`.
- `<iframe> (origin C)` will return `null`.
- `<fencedframe> (origin D)` will return `<fencedframe> (origin B)`.
- `<iframe> (origin E)` will return `<fencedframe> (origin B)`.
- `<fencedframe> (origin F)` will return `<fencedframe> (origin D)`.
1. Otherwise, return |navigable|'s [=navigable/active document=]'s [=Document/origin=].

<div id="get-initiator-ancestor-root-origin-example" class="example">
Given a {{Document}} embedded inside of a <{fencedframe}>, this algorithm gets the origin of the
document's nearest fenced frame ancestor's nearest fenced frame ancestor. If no such "fenced
frame grand-ancestor" exists, the algorithm returns null. Therefore, this algorithm only returns
an origin when given a Document that is, at a minimum, in a fenced frame which is itself in a
fenced frame. For example, for the given frame tree structure:

```
Main frame (origin A)
<fencedframe> (origin B)
<iframe> (origin C)
<fencedframe> (origin D)
<iframe> (origin E)
<fencedframe> (origin F)
```

The algorithm will return the following given each document:

- `Main frame (origin A)` will return `null`.
- `<fencedframe> (origin B)` will return `null`.
- `<iframe> (origin C)` will return `null`.
- `<fencedframe> (origin D)` will return `<fencedframe> (origin B)`.
- `<iframe> (origin E)` will return `<fencedframe> (origin B)`.
- `<fencedframe> (origin F)` will return `<fencedframe> (origin D)`.
</div>
</div>

<div algorithm=snapshot-source-snapshot-params>
Expand All @@ -2840,7 +2840,8 @@ CORP violation report=] algorithm, as leaving it unfenced may cause a privacy le

: [=source snapshot params/initiator ancestor root origin=]

:: The result of running [=get the initiator ancestor root origin=] on |sourceDocument|.
:: The result of running [=get the initiator's fenced grand-ancestor's origin=] on
|sourceDocument|.

: [=source snapshot params/attribution reporting enabled=]
:: The result of determining whether |sourceDocument| is [=allowed to use=] the
Expand Down

0 comments on commit e961d33

Please sign in to comment.