diff --git a/spec.bs b/spec.bs
index 8b413e73..894ce238 100644
--- a/spec.bs
+++ b/spec.bs
@@ -761,6 +761,30 @@ following [=struct/items=]:
:: a [=boolean=], initially false
+An automatic beacon event type is either "`reserved.top_navigation_start`", "`reserved.top_navigation_commit`", or "`reserved.top_navigation`".
+
+Advisement: [=automatic beacon event type/reserved.top_navigation=]
is an earlier
+naming of [=automatic beacon event type/reserved.top_navigation_commit=]
. While they
+both do the same thing, [=automatic beacon event type/reserved.top_navigation=]
will be
+removed in the future and should not be used for new code.
+
+An automatic beacon data is a [=struct=] with the following
+[=struct/items=]:
+
+
In order to
send a beacon with a [=fencedframetype/reporting destination info=]
@@ -815,12 +847,14 @@ A
destination event is either a
1. Let |useParallelQueue| be false.
- 1. If |event| is a [=fencedframetype/destination enum event=], then:
+ 1. If |event| is either a [=fencedframetype/destination enum event=] or an
+ [=fencedframetype/automatic beacon event=], then:
1. Let |destination map| be |destination info|'s
[=reporting destination info/reporting url map=].
- 1. Let |eventType| be |event|'s [=destination enum event/type=].
+ 1. Let |eventType| be either |event|'s [=destination enum event/type|destination type=], or
+ [=automatic beacon event/type|automatic type=], depending on which variant |event| is.
1. If |destination map|[|eventType|] does not [=map/exist=], return.
@@ -830,8 +864,9 @@ A
destination event is either a
of [=getting supported registrars=] is not [=list/is empty|empty=] and |event|'s
[=destination enum event/attributionReportingContextOrigin=] [=check if an origin is suitable|is suitable=]:
- 1. If |event|'s [=destination enum event/type=] is `"reserved.top_navigation"`,
- set |attributionReportingEligibility| to "
[=eligibility/navigation-source=]
".
+ 1. If |event|'s {{FenceEvent/eventType}} matches one of the [=fencedframetype/automatic
+ beacon event type=] values, set |attributionReportingEligibility| to
+ "
[=eligibility/navigation-source=]
".
1. Otherwise, set |attributionReportingEligibility| to "
[=eligibility/event-source=]
".
@@ -1176,8 +1211,8 @@ A
fenced frame config instance is a [=struct=] with the follow
:: 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 reporter/automatic beacon data map=]
+ :: an empty [=map=]
: [=fenced frame config instance/exfiltration budget metadata reference=]
::
@@ -1530,7 +1565,8 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
{{FenceEvent/eventType}}:
1. [=exception/Throw=] a {{TypeError}}.
- 1. If |event|'s {{FenceEvent/eventType}} is not `"reserved.top_navigation"`, return.
+ 1. If |event|'s {{FenceEvent/eventType}} does not match one of the [=fencedframetype/automatic
+ beacon event type=] values, return.
1. Let |instance| be [=this=]'s [=relevant global object=]'s [=Window/browsing context=]'s
[=browsing context/fenced frame config instance=].
@@ -1544,7 +1580,8 @@ 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. Set |instance|'s [=fenced frame config instance/fenced frame reporter=]'s [=fenced frame
- reporter/automatic beacon data=] to a [=struct=] with the following [=struct/items=]:
+ reporter/automatic beacon data map=][|event|'s {{FenceEvent/eventType}}] to an
+ [=fencedframetype/automatic beacon data=] with the following [=struct/items=]:
: [=automatic beacon data/eventData=]
:: |event|'s {{FenceEvent/eventData}} if defined, otherwise empty string
@@ -1658,17 +1695,17 @@ table](https://fetch.spec.whatwg.org/#destination-table) to illustrate that <{fe
A side effect of the fenced boundary model is that ads will lose the ability to know if a click
resulted in a successful navigation. This is because the page loaded from a top-level [=navigate|
navigation=] originating from a fenced frame will not be allowed to report to the fenced frame that
-it loaded (through something like
window.[=Window/opener=]
). Instead, we introduce a
-special event-level [=destination enum event/type|reporting type=], `reserved.top_navigation`, which
-automatically sends an [=report an event|event-level beacon=] when a fenced frame initiates a
-successful [=navigate|navigation=] to a [=top-level traversable=].
+it loaded (through something like
window.[=Window/opener=]
). Instead, we introduce
+special event-level [=automatic beacon event/type|reporting type=]s,
[=automatic beacon event
+type/reserved.top_navigation_start=]
and
[=automatic beacon event
+type/reserved.top_navigation_commit=]
, which automatically sends an [=report an
+event|event-level beacon=] when a fenced frame initiates a successful [=navigate|navigation=] to a
+[=top-level traversable=].
To attempt to send an automatic beacon given a [=source snapshot params=]
- |sourceSnapshotParams|, an [=origin=] |sourceOrigin|, a {{Document}} |targetDocument|, and a
- [=string=] |eventType|, run these steps:
-
- 1. [=Assert=]: |eventType| is "`reserved.top_navigation`".
+ |sourceSnapshotParams|, an [=origin=] |sourceOrigin|, a {{Document}} |targetDocument|, and an
+ [=fencedframetype/automatic beacon event type=] |eventType|, run these steps:
1. If |targetDocument|'s [=node navigable=]'s [=traversable navigable=] is not a [=top-level
traversable=], abort these steps.
@@ -1686,7 +1723,7 @@ successful [=navigate|navigation=] to a [=top-level traversable=].
<{fencedframe}>.
1. Let |beacon data| be |config|'s [=fenced frame config instance/fenced frame reporter=]'s
- [=fenced frame reporter/automatic beacon data=].
+ [=fenced frame reporter/automatic beacon data map=][|eventType|].
1. If |beacon data| is null, abort these steps.
@@ -1698,27 +1735,28 @@ successful [=navigate|navigation=] to a [=top-level traversable=].
[=fencedframetype/fenced frame reporting map=]'s [=map/keys=]:
1. Run [=report an event=] using |config|'s [=fenced frame config instance/fenced frame
- reporter=] with |destination| and a [=fencedframetype/destination enum event=] with the
+ reporter=] with |destination| and an [=fencedframetype/automatic beacon event=] with the
following [=struct/items=]:
- : [=destination enum event/type=]
+ : [=automatic beacon event/type=]
:: |eventType|
- : [=destination enum event/data=]
+ : [=automatic beacon event/data=]
:: |beacon data|'s [=automatic beacon data/eventData=] if |beacon data|'s [=automatic beacon
data/destinations=] [=list/contains=] |destination|, the empty string otherwise.
- : [=destination enum event/attributionReportingEnabled=]
+ : [=automatic beacon event/attributionReportingEnabled=]
:: |sourceSnapshotParams|'s [=source snapshot params/attribution reporting enabled=]
- : [=destination enum event/attributionReportingContextOrigin=]
+ : [=automatic beacon event/attributionReportingContextOrigin=]
:: |sourceSnapshotParams|'s [=source snapshot params/attribution reporting context origin=]
1. If |beacon data|'s [=automatic beacon data/once=] is true, set |config|'s [=fenced frame
- config instance/fenced frame reporter=]'s [=fenced frame reporter/automatic beacon data=] to
- null.
+ config instance/fenced frame reporter=]'s [=fenced frame reporter/automatic beacon data
+ map=][|eventType|] to null.
+ /fenced-frame/automatic-beacon-anchor-click-handler.https.html
/fenced-frame/automatic-beacon-click-handler.https.html
/fenced-frame/automatic-beacon-two-events-clear.https.html
/fenced-frame/automatic-beacon-two-events-persist.https.html
@@ -1728,13 +1766,29 @@ successful [=navigate|navigation=] to a [=top-level traversable=].
-
+
+ Modify [[HTML]]'s [=navigate=] algorithm. Add a new step after step 4 that reads:
+
+ 5. [=Attempt to send an automatic beacon=] given sourceSnapshotParams, initiatorOriginSnapshot, navigable’s associated {{Document}},
+ and [=automatic beacon event type/reserved.top_navigation_start=]
.
+
+
+
Modify [[HTML]]'s [=attempt to populate the history entry's document=] algorithm. In step 6,
substep 11, add a new step after step 5 that reads:
- 6. if failure is false, then [=attempt to send an automatic beacon=] given sourceSnapshotParams, entry's [=document state=]'s [=document
- state/initiator origin=], document, and "`reserved.top_navigation`".
+ 6. If failure is false, then:
+
+ 1. [=Attempt to send an automatic beacon=] given sourceSnapshotParams, entry's [=document state=]'s [=document
+ state/initiator origin=], document, and [=automatic beacon event
+ type/reserved.top_navigation_commit=]
.
+
+ 1. [=Attempt to send an automatic beacon=] given sourceSnapshotParams, entry's [=document state=]'s [=document
+ state/initiator origin=], document, and [=automatic beacon event
+ type/reserved.top_navigation=]
.
HTML Integration
@@ -2394,7 +2448,7 @@ CORP violation report=] algorithm, as leaving it unfenced may cause a privacy le
Note: The [=source snapshot params/initiator fenced frame config instance=] is the [=fenced frame
config instance=] that's loaded into a navigation initiator's [=browsing context=], if any exists.
It is used by the [=attempt to send an automatic beacon=] algorithm to retrieve the [=fenced frame
- reporter/automatic beacon data=] to be sent out if the <{fencedframe}>-initiated navigation
+ reporter/automatic beacon data map=] to be sent out if the <{fencedframe}>-initiated navigation
succeeds. The [=source snapshot params/target fenced frame config=] on the other hand, is the
non-[=instantiate a config|instantiated=] [=fenced frame config=] that will be loaded into a a
<{fencedframe}> element for navigations targeting fenced frames. These fields do not interact