这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 197 additions & 33 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -538,45 +538,185 @@ A <dfn export for=fencedframetype>size</dfn> is a struct with non-negative integ
"size">width</dfn> and non-negative integer <dfn export for="size">height</dfn>. <span class=XXX>
TODO: Maybe change the numeric type.</span>

An <dfn export for=fencedframetype>interest group descriptor</dfn> is a struct with <dfn export
for="interest group descriptor">owner</dfn>, which is a string, and <dfn export for="interest group
descriptor">name</dfn>, which is a string.
An <dfn export for=fencedframetype>interest group descriptor</dfn> is a struct with the following
[=struct/items=]:

<dl export dfn-for="interest group descriptor">
: <dfn>owner</dfn>
:: a [=string=]

: <dfn>name</dfn>
:: a [=string=]
</dl>

An <dfn export for=fencedframetype>exhaustive set of sandbox flags</dfn> is a [=sandboxing flag
set=].

A <dfn export for=fencedframetype>fenced frame reporter</dfn> is <span class=XXX>TODO: Specify the type for this.</span>
A <dfn export for=fencedframetype>pending event</dfn> is a struct with the following [=struct/items=]:
<dl export dfn-for="pending event">
: <dfn>destination</dfn>
:: a {{FenceReportingDestination}}

: <dfn>eventType</dfn>
:: a [=string=]

: <dfn>eventData</dfn>
:: a [=string=]
</dl>

A <dfn export for=fencedframetype>fenced frame reporting map</dfn> is a [=map=] whose [=map/keys=]
are {{FenceReportingDestination}}s and whose [=map/values=] are either:
* [=lists=] of [=fencedframetype/pending events=] (which are used to represent events that need to
be reported asynchronously, because the metadata has not been finalized yet); or
* [=maps=] whose [=map/keys=] are [=strings=] and whose [=map/values=] are [=urls=] (which are used
to represent the actual metadata once it is finalized).

Note: This representation is meant to allow config-generating APIs to reduce latency by resolving
the values of reporting destinations asynchronously, after they've already constructed and returned
the fenced frame config (and even after the config has been loaded, and event reports have been
generated inside the fenced frame). When the config-generating API declares the [=fencedframetype/
fenced frame reporting map=], they can mark certain destinations as pending using an empty
[=list=], and then maintain a reference to the map for later. If the fenced frame attempts to
[=report an event=] to a destination while it is still pending, it stores the event in this
[=list=] for later handling. When the config-generating API or its callback eventually [=finalizes
a reporting destination=] through the reference it kept, it will handle all of the pending events
stored in the [=list=]. If the destination is never finalized, then the pending events will never
be sent.

<div algorithm>
In order to <dfn export>report an event</dfn>, run these steps:
In order to <dfn export>finalize a reporting destination</dfn>, given a [=fencedframetype/fenced
frame reporting map=] |reporting map|, a {{FenceReportingDestination}} |destination|, and a
[=map=] |destination map| whose [=map/keys=] are [=strings=] and whose [=map/values=] are
[=urls=], run these steps:

1. <span class=XXX>TODO: fill this in</span>
1. [=Assert=] that |reporting map|[|destination|] is a [=list=] (i.e., that |destination|'s
metadata has not yet been finalized).

1. Let |pending event list| be |reporting map|[|destination|].

1. [=map/Set=] |reporting map|[|destination|] to |destination map|.

1. [=list/For each=] |pending event| of |pending event list|:

1. [=Send a beacon=] with |destination map|, |pending event|'s [=pending event/eventType=],
and |pending event|'s [=pending event/eventData=].
</div>

A <dfn export for=fencedframetype>fenced frame reporting metadata</dfn> is a struct with the
following [=struct/items=]:

<dl export dfn-for="fenced frame reporting metadata">
: <dfn>fenced frame reporting map</dfn>
:: a [=fencedframetype/fenced frame reporting map=]

: <dfn>direct seller is seller</dfn>
:: a boolean
</dl>

A <dfn export for=fencedframetype>fenced frame reporter</dfn> is a struct with the following
[=struct/items=]:
<dl export dfn-for="fenced frame reporter">
: <dfn>fenced frame reporting metadata reference</dfn>
:: a mutable reference to a [=fencedframetype/fenced frame reporting metadata=]
<span class=XXX>TODO: Handle pointers/references in a more spec-y way</span>

: <dfn>automatic beacon data</dfn>
:: null, or a struct with the following [=struct/items=]:
<dl dfn-for="automatic beacon data">
: <dfn>eventData</dfn>
:: a [=string=]

: <dfn>destination</dfn>
:: a [=list=] of {{FenceReportingDestination}}s
</dl>
</dl>

<div algorithm>
In order to <dfn export>report a private aggregation event</dfn>, run these steps:
In order to <dfn>send a beacon</dfn> with a [=map=] |destination map| whose [=map/keys=] are
[=strings=] and whose [=map/values=] are [=urls=], a [=string=] |eventType|, and a [=string=]
|eventData|, run these steps:

1. If |destination map|[|eventType|] does not [=map/exist=], return.

1. <span class=XXX>TODO: Fill this in</span>
1. Let |destination url| be |destination map|[|eventType|].

1. Send a beacon with |eventData| to |destination url|.

Issue: Specify the [[FETCH]] integration for sending this request.
</div>

<div algorithm>
In order to <dfn export>set automatic beacon data</dfn>, run these steps:
In order to <dfn>report an event</dfn> using a [=fencedframetype/fenced frame reporter=]
|reporter| with a {{FenceReportingDestination}} |destination|, [=string=] |eventType|, and
[=string=] |eventData|, run these steps:

1. If |destination| is `"direct-seller"`:

1. If |reporter|'s [=fenced frame reporter/fenced frame reporting metadata reference=]'s
[=fenced frame reporting metadata/direct seller is seller=] is true, set |destination| to
`"seller"`.

1. Otherwise, set |destination| to `"component-seller"`.

1. Let |reporting map| be a reference to |reporter|'s [=fenced frame reporter/fenced frame
reporting metadata reference=]'s [=fenced frame reporting metadata/fenced frame reporting
map=].

1. If |reporting map|[|destination|] does not [=map/exist=], return.

1. If |reporting map|[|destination|] is a [=list=]:

1. Let |newEvent| be a new [=fencedframetype/pending event=] with the following:
: [=pending event/destination=]
:: |destination|

1. <span class=XXX>TODO: Fill this in</span>
: [=pending event/eventType=]
:: |eventType|

: [=pending event/eventData=]
:: |eventData|

1. [=list/Append=] |newEvent| to |reporting map|[|destination|].

1. Return.

Note: The pending event will be sent asynchronously.

1. [=Assert=] that |reporting map|[|destination|] is a [=map=] (i.e. that |destination|'s
metadata has been finalized).

1. [=Send a beacon=] with |reporting map|[|destination|], |eventType|, and |eventData|.
</div>

An <dfn export for=fencedframetype>exfiltration budget metadata</dfn> is a struct containing an
<dfn export for="exfiltration budget metadata">origin</dfn>, which is an [=origin=]; and an <dfn
export for="exfiltration budget metadata">amount to debit</dfn>, which is a non-negative valid
floating point number.
<div algorithm>
In order to <dfn>report a private aggregation event</dfn> using a [=fencedframetype/fenced frame
reporter=] |reporter| with a [=string=] |event|, run these steps:

1. |reporter| |event| <span class=XXX>TODO: Fill this in</span>
</div>

An <dfn export for=fencedframetype>exfiltration budget metadata</dfn> is a struct with the following
[=struct/items=]:

<dl export dfn-for="exfiltration budget metadata">
: <dfn>origin</dfn>
:: an [=origin=]

: <dfn>amount to debit</dfn>
:: a non-negative valid floating point number
</dl>

An <dfn export for=fencedframetype>exfiltration budget metadata reference</dfn> is a struct with the
following [=struct/items=]:

An <dfn export for=fencedframetype>exfiltration budget metadata reference</dfn> is a struct
containing an <dfn export for="exfiltration budget metadata reference">origin</dfn>, which is an
[=origin=]; and an <dfn export for="exfiltration budget metadata reference">amount to debit
reference</dfn>, which is a mutable reference to a non-negative valid floating point number.
<span class=XXX>TODO: are mutable references a thing in spec?</span>
<dl export dfn-for="exfiltration budget metadata reference">
: <dfn>origin</dfn>
:: an [=origin=]

An <dfn export for=fencedframetype>embedder shared storage context</dfn> is a string.
: <dfn>amount to debit reference</dfn>
:: a mutable reference to a non-negative valid floating point number
<span class=XXX>TODO: Handle pointers/references in a more specy-y way</span>
</dl>

A <dfn export>partition nonce</dfn> is an [=implementation-defined=] value.

Expand Down Expand Up @@ -641,10 +781,10 @@ A <dfn export>fenced frame config</dfn> is a struct with the following [=struct/
"`Disabled`", the navigation to this config will fail. Any [=policy-controlled feature=] *not*
in this list will not be "`Disabled`" in the <{fencedframe}> that navigates to this config.

: <dfn>fenced frame reporter</dfn>
: <dfn>fenced frame reporting metadata</dfn>
:: null, or a struct with the following fields:
: <dfn for="fenced frame reporter">value</dfn>
:: a [=fencedframetype/fenced frame reporter=]
: <dfn for="fenced frame reporting metadata">value</dfn>
:: a [=fencedframetype/fenced frame reporting metadata=]

: <dfn for="fenced frame reporter">visibility</dfn>
:: a [=visibility=]
Expand All @@ -666,7 +806,7 @@ A <dfn export>fenced frame config</dfn> is a struct with the following [=struct/
:: a [=visibility=]

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

<h4 id=fenced-frame-config-instance-struct>The [=fenced frame config instance=] [=struct=]</h4>
Expand All @@ -692,7 +832,7 @@ A <dfn export>fenced frame config instance</dfn> is a struct with the following
: <dfn>effective enabled permissions</dfn>
:: null, or a [=list=] of [=policy-controlled features=]

: <dfn>fenced frame reporter</dfn> TODO: including automatic beacon info
: <dfn>fenced frame reporter</dfn>
:: null, or a [=fencedframetype/fenced frame reporter=]

: <dfn>exfiltration budget metadata reference</dfn>
Expand All @@ -706,7 +846,7 @@ A <dfn export>fenced frame config instance</dfn> is a struct with the following
:: a [=partition nonce=]

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

<div algorithm>
Expand Down Expand Up @@ -737,13 +877,26 @@ A <dfn export>fenced frame config instance</dfn> is a struct with the following
permissions/value=]

: [=fenced frame config instance/fenced frame reporter=]
:: |config|'s <span class=XXX>TODO: Fill this in</span>
::
1. If |config|'s [=fenced frame config/fenced frame reporting metadata=]'s [=fenced frame
reporting metadata/value=] is null, set to null.

1. Otherwise, set to a [=fencedframetype/fenced frame reporter=] with the following
members:

: [=fenced frame reporter/fenced frame reporting metadata reference=]
:: a reference to |config|'s [=fenced frame config/fenced frame reporting metadata=]'s
[=fenced frame reporting metadata/value=]

: [=fenced frame reporter/automatic beacon data=]
:: null

: [=fenced frame config instance/exfiltration budget metadata reference=]
::
1. If |config|'s [=fenced frame config/exfiltration budget metadata=] is null, set to null.

1. Otherwise, set to a [=fencedframetype/exfiltration budget metadata reference=]:

: [=exfiltration budget metadata reference/origin=]
:: |config|'s [=fenced frame config/exfiltration budget metadata=]'s [=exfiltration
budget metadata/value=]'s [=exfiltration budget metadata/origin=]
Expand Down Expand Up @@ -922,11 +1075,14 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.

1. If |instance|'s [=fenced frame config instance/fenced frame reporter=] is null, then return.

1. If |event| is a {{DOMString}}, run [=report a private aggregation event=] with |event| and
|instance|'s [=fenced frame config instance/fenced frame reporter=].
1. If |event| is a {{DOMString}}, run [=report a private aggregation event=] using |instance|'s
[=fenced frame config instance/fenced frame reporter=] with |event|.

1. If |event| is a {{FenceEvent}}, [=list/for each=] |destination| of |event|'s {{FenceEvent/destination}}:

1. If |event| is a {{FenceEvent}}, run [=report an event=] with |event| and |instance|'s
[=fenced frame config instance/fenced frame reporter=].
1. Run [=report an event=] using |instance|'s [=fenced frame config instance/fenced frame
reporter=] with |destination|, |event|'s {{FenceEvent/eventType}}, and |event|'s
{{FenceEvent/eventData}}.

<wpt>
/fenced-frame/fence-report-event.https.html
Expand All @@ -937,6 +1093,8 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
The <dfn method for=Fence>setReportEventDataForAutomaticBeacons(|event|)</dfn>
method steps are:

1. If |event|'s {{FenceEvent/eventType}} is not `"reserved.top_navigation"`, return.

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

Expand All @@ -948,8 +1106,14 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.

1. If |instance|'s [=fenced frame config instance/fenced frame reporter=] is null, then return.

1. Run [=set automatic beacon data=] with |event| and |instance|'s
[=fenced frame config instance/fenced frame reporter=].
1. Set |instance|'s [=fenced frame config instance/fenced frame reporter=]'s [=fenced frame
reporter/automatic beacon data=] to a struct with the following members:

: eventData
:: |event|'s {{FenceEvent/eventData}}

: destination
:: |event|'s {{FenceEvent/destination}}

<wpt>
/fenced-frame/set-automatic-beacon.https.html
Expand Down