Skip to content

Commit

Permalink
Spec deprecatedURNtoURL
Browse files Browse the repository at this point in the history
Addresses #160
  • Loading branch information
JensenPaul authored May 21, 2024
1 parent e67a4f9 commit c3079c9
Showing 1 changed file with 52 additions and 23 deletions.
75 changes: 52 additions & 23 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ spec: RFC8941; urlPrefix: https://www.rfc-editor.org/rfc/rfc8941.html
text: structured header; url: #section-1
for: structured header
text: token; url: name-tokens
text: boolean; url: boolean
spec: permissions-policy; urlPrefix: https://w3c.github.io/webappsec-permissions-policy
type: dfn
text: ASCII-serialized policy directive; url: serialized-policy-directive
Expand Down Expand Up @@ -1437,12 +1436,20 @@ the API {{Window/navigator}}.{{Navigator/deprecatedReplaceInURN()}}, which allow
macros into the [=fenced frame config/mapped url=] corresponding to a given [=urn uuid=] or
{{FencedFrameConfig}}.

Note: To help with ease of adoption,
[until third party cookie deprecation](https://developers.google.com/privacy-sandbox/relevance/protected-audience-api/feature-status#fenced_frames)
we will support the API {{Window/navigator}}.{{Navigator/deprecatedURNtoURL()}}, which returns
the [=fenced frame config/mapped url=] corresponding to a given [=urn uuid=] or
{{FencedFrameConfig}}.

<pre class=idl>
typedef (USVString or FencedFrameConfig) UrnOrConfig;

partial interface Navigator {
Promise&lt;undefined&gt; deprecatedReplaceInURN(
UrnOrConfig urnOrConfig, record&lt;USVString, USVString&gt; replacements);
Promise&lt;USVString&gt; deprecatedURNtoURL(
UrnOrConfig urnOrConfig, optional boolean send_reports = false);
};
</pre>

Expand Down Expand Up @@ -1505,6 +1512,46 @@ partial interface Navigator {
</wpt>
</div>

<div algorithm>
The <dfn method for=Navigator>deprecatedURNtoURL(|urnOrConfig|, |send_reports|)</dfn>
method steps are:

1. Let |urn| be null.

1. If |urnOrConfig| is a {{USVString}}, set |urn| to |urnOrConfig|.

1. Otherwise, set |urn| to |urnOrConfig|'s [=fencedframeconfig/urn=].

1. If |urn| is <span class=XXX>TODO invalid</span>, [=exception/throw=] a {{TypeError}}.

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

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

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

1. Let |mapping| be |global|'s [=associated Document=]'s [=node navigable=]'s
[=navigable/traversable navigable=]'s [=traversable navigable/fenced frame config mapping=].

1. Let |config| be the result of [=fenced frame config mapping/finding a config=] in |mapping|
with |urn|.

1. If |config| is failure, [=queue a global task=] on the [=DOM manipulation task source=]
given |global|, to [=resolve=] |p| with {{undefined}}, and abort these steps.

1. [=Queue a global task=] on the [=DOM manipulation task source=] given |global|, to
[=resolve=] |p| with |config|'s [=fenced frame config/mapped url=]'s [=mapped url/value=].

1. If |send_reports| is true, run steps in |config|'s
[=fenced frame config/on navigate callback=].

1. Return |p|.

<wpt>
/fenced-frame/deprecated-config-apis.https.html
</wpt>
</div>

<h3 id=fence-interface>The {{Fence}} interface</h3>

Several APIs specific to fenced frames are defined on the {{Fence}} interface.
Expand Down Expand Up @@ -2515,25 +2562,6 @@ container/fenced navigable=] will fail, as outlined in [[#navigation-patch]].

</div>

<h4 id=allow-automatic-beacons>The
\`<a http-header><code>Allow-Fenced-Frame-Automatic-Beacons</code></a>\` HTTP response header</h4>

Serving a document resource that gets loaded into a {{Document}} that is not [=same origin=] with
its [=Document/browsing context=]'s [=fenced frame config instance=]'s [=fenced frame config
instance/mapped url=] with the <dfn
http-header><code>Allow-Fenced-Frame-Automatic-Beacons</code></dfn> HTTP response header opts in the
{{Document}} to having automatic beacon events trigger when it performs navigations. This header is
a [=structured header=] whose value must be a [=structured header/boolean=].

<h4 id=allow-cross-origin-reporting>The
\`<a http-header><code>Allow-Cross-Origin-Event-Reporting</code></a>\` HTTP response header</h4>

Serving a document resource that gets loaded into a <{fencedframe}> by a [=fenced frame config
instance=] with the <dfn http-header><code>Allow-Cross-Origin-Event-Reporting</code></dfn> HTTP
response header opts in the {{Document}}'s cross-origin [=child navigables=] to be able to send
{{Fence/reportEvent()}} beacons. This header is a [=structured header=] whose value must be a
[=structured header/boolean=].

<h4 id=coop-coep>COOP, COEP, and cross-origin isolation</h4>

Outside of this specification, the \`<a http-header><code>Cross-Origin-Opener-Policy</code></a>\`
Expand Down Expand Up @@ -2821,7 +2849,8 @@ content in the <{fencedframe}> or its embedder, exactly one of two things will h
1. Set |navigationParams|'s [=navigation params/fenced frame config instance=]'s [=fenced frame
config/cross-origin reporting allowed=] to the result of running [=header list/get a
structured field value=] on |navigationParams|'s [=navigation params/response=]'s
[=response/header list=] given [:Allow-Cross-Origin-Event-Reporting:] and "`item`".
[=response/header list=] given "<code>Allow-Cross-Origin-Event-Reporting</code>" and
"`item`".

1. Set |browsingContext|'s [=browsing context/fenced frame config instance=] to
|navigationParams|'s [=navigation params/fenced frame config instance=].
Expand All @@ -2830,11 +2859,11 @@ content in the <{fencedframe}> or its embedder, exactly one of two things will h

10. Let |automaticBeaconsAllowed| be the result of running [=header list/get a structured field
value=] on |navigationParams|'s [=navigation params/response=]'s [=response/header list=]
given [:Allow-Fenced-Frame-Automatic-Beacons:] and "`item`".
given "<code>Allow-Fenced-Frame-Automatic-Beacons</code>" and "`item`".

Further rewrite step 10 (now step 12) to return a new {{Document}} with an additional parameter:
: [=Document/automatic beacons allowed=]
:: |automaticBeaconsAllowed|.
:: |automaticBeaconsAllowed|
</div>

<span class=XXX>TODO: Call the [=fenced frame config instance/on navigate callback=] at the
Expand Down

0 comments on commit c3079c9

Please sign in to comment.