Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec disableUntrustedNetwork API surface #146

Closed
wants to merge 13 commits into from
60 changes: 57 additions & 3 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ A <dfn export>fenced frame config</dfn> is a [=struct=] with the following [=str

: <dfn>embedder shared storage context</dfn>
:: null, or a [=string=]

: <dfn>is ad component</dfn>
:: A [=boolean=], initially false.

Expand Down Expand Up @@ -1315,8 +1315,11 @@ A <dfn export>fenced frame config instance</dfn> is a [=struct=] with the follow

: <dfn>embedder shared storage context</dfn>
:: null, or a [=string=]

: <dfn>is ad component</dfn>
:: A [=boolean=]

: <dfn>has disabled untrusted network</dfn>
:: A [=boolean=], initially false.

: <dfn>cross-origin reporting allowed</dfn>
Expand Down Expand Up @@ -1402,10 +1405,13 @@ A <dfn export>fenced frame config instance</dfn> is a [=struct=] with the follow

: [=fenced frame config instance/embedder shared storage context=]
:: |config|'s [=fenced frame config/embedder shared storage context=]

: [=fenced frame config instance/is ad component=]
:: |config|'s [=fenced frame config/is ad component=]

: [=fenced frame config instance/has disabled untrusted network=]
:: false

: [=fenced frame config instance/cross-origin reporting allowed=]
:: |config|'s [=fenced frame config/cross-origin reporting allowed=]
</div>
Expand Down Expand Up @@ -1688,6 +1694,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
undefined reportEvent(optional ReportEventType event = {});
undefined setReportEventDataForAutomaticBeacons(optional FenceEvent event = {});
sequence&lt;FencedFrameConfig&gt; getNestedConfigs();
Promise&lt;undefined&gt; disableUntrustedNetwork();
undefined notifyEvent(Event event);
};
</pre>
Expand Down Expand Up @@ -1881,6 +1888,53 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
</wpt>
</div>

<div algorithm>
The <dfn method for=Fence>disableUntrustedNetwork()</dfn> method steps are:

1. Let |p| be [=a new promise=].

1. Let |instance| be [=this=]'s [=relevant global object=]'s [=Window/browsing context=]'s
[=browsing context/fenced frame config instance=].

1. If |instance| is null, then [=resolve=] |p| with {{undefined}} and return |p|.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I am so sorry but I feel like I've asked when this can be null before, and I cannot for the life of me find the previous comments with the answer to this. This method is only accessible when instance is non-null, right? https://wicg.github.io/fenced-frame/#dom-window-fence. So is this condition needed? /cc @blu25 who might also know.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the discussion from my PR about the same line: #169 (comment)

I think all of these should be fine to remove (or assert if you feel strongly about that) since a condition for getting access to window.fence is that the browsing context must have a fenced frame config instance.


1. If the [=relevant settings object=]'s [=environment settings object/origin=] and
|instance|'s [=fenced frame config instance/mapped url=]'s [=url/origin=] are not [=same
origin=], then [=reject=] |p| with a {{TypeError}}.

1. If [=this=]'s [=relevant global object=]'s [=Window/navigable=]'s [=navigable/traversable
navigable=] is not a [=fenced navigable container/fenced navigable=], then [=resolve=] |p| with
{{undefined}} and return |p|.

1. Let |global| be [=this=]'s [=relevant global object=].

1. Run the following steps [=in parallel=]:

1. Let |fencedFrameNonce| be |instance|'s [=fenced frame config instance/partition nonce=].

1. Let |credentiallessNonce| be

Issue: the page credentialless nonce
(<a href="https://github.com/WICG/fenced-frame/issues/191">WICG/fenced-frame#191</a>)

1. Revoke the partition nonces |fencedFrameNonce| and |credentiallessNonce|.

Issue: Spec the revocation process.
(<a href="https://github.com/WICG/fenced-frame/issues/151">WICG/fenced-frame#151</a>)

1. Set |instance|'s [=fenced frame config instance/has disabled untrusted network=] to true.

1. Wait on all nested fenced frames to disable network too.

Issue: Spec this waiting more formally.
(<a href="https://github.com/WICG/fenced-frame/issues/168">WICG/fenced-frame#168</a>)

1. [=Queue a global task=] on the [=DOM manipulation task source=] given |global|, to
[=resolve=] |p| with {{undefined}}.

1. Return |p|.
</div>

<div algorithm>
The <dfn method for=Fence>notifyEvent(|event|)</dfn> method steps are:

Expand Down
Loading