diff --git a/spec.bs b/spec.bs index 65aa289..aeb6dab 100644 --- a/spec.bs +++ b/spec.bs @@ -1875,13 +1875,13 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. If [=this=]'s [=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 return. + origin=], and if |event|'s {{FenceEvent/crossOriginExposed}} is false, then return. 1. If |instance|'s [=fenced frame config instance/fenced frame reporter=] is null, then return. 1. Set [=this=]'s [=relevant global object=]'s [=associated Document=]'s [=Document/automatic - beacon data map=][|event|'s {{FenceEvent/eventType}}] to an [=fencedframetype/automatic beacon - data=] with the following [=struct/items=]: + beacon data mapping=][|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 and |instance|'s [=fenced frame config @@ -2239,22 +2239,26 @@ event|event-level beacon=] when a fenced frame initiates a successful [=navigate instance/is ad component=] is false, and |sourceSnapshotParams|'s [=source snapshot params/initiator ancestor root referrer policy=] otherwise. - 1. Let |beacon data| be |sourceSnapshotParams|'s [=source snapshot params/automatic beacon data - map=][|eventType|]. + 1. Let |isCrossOrigin| be true if |sourceOrigin| is not [=same origin=] with |config|'s [=fenced + frame config instance/mapped url=]'s [=url/origin=], false otherwise. + + 1. Let |beaconMapping| be |sourceSnapshotParams|'s [=source snapshot params/snapshot automatic + beacon store=]'s [=snapshot automatic beacon store/data mapping=] if |isCrossOrigin| is false, + |sourceSnapshotParams|'s [=source snapshot params/snapshot automatic beacon store=]'s + [=snapshot automatic beacon store/cross-origin exposed data mapping=] otherwise. - 1. Let |has header opt in| be |sourceSnapshotParams|'s [=source snapshot params/automatic beacons - allowed=]. + 1. Let |beaconData| be |beaconMapping|[|eventType|]. - 1. If |beacon data| is null and |has header opt in| is false, abort these steps. + 1. Let |automaticBeaconsAllowed| be |sourceSnapshotParams|'s [=source snapshot params/automatic + beacons allowed=]. - 1. Let |is cross origin| be true if |sourceOrigin| is not [=same origin=] with |config|'s [=fenced - frame config instance/mapped url=]'s [=url/origin=], false otherwise. + Note: This tracks whether there was an opt-in via the [:Allow-Fenced-Frame-Automatic-Beacons:] + header. Automatic beacons can still be sent out while this value is false for either + same-origin documents or documents that opt-in via setting data. - 1. If |is cross origin| is true and |has header opt in| is false, abort these steps. + 1. If |beaconData| is null and |automaticBeaconsAllowed| is false, abort these steps. - 1. Let |should send beacon with data| be true if |beacon data| is not null and either - |is cross origin| is false or |beacon data|'s [=automatic beacon data/crossOriginExposed=] is - true, false otherwise. + 1. If |isCrossOrigin| is true and |automaticBeaconsAllowed| is false, abort these steps. 1. [=list/For each=] |destination| of |config|'s [=fenced frame config instance/fenced frame reporter=]'s [=fenced frame reporter/fenced frame reporting metadata reference=]'s @@ -2268,10 +2272,8 @@ event|event-level beacon=] when a fenced frame initiates a successful [=navigate :: |eventType| : [=automatic beacon event/data=] - :: |beacon data|'s [=automatic beacon data/eventData=] if |should send beacon with data| is - true, |beacon data|'s [=automatic beacon data/destinations=] [=list/contains=] - |destination|, and |config|'s [=fenced frame config instance/is ad component=] is false, - the empty string otherwise. + :: The empty string if |beaconData| is null, |beaconData|'s [=automatic beacon + data/eventData=] otherwise. : [=automatic beacon event/attributionReportingEnabled=] :: |sourceSnapshotParams|'s [=source snapshot params/attribution reporting enabled=] @@ -2279,8 +2281,8 @@ event|event-level beacon=] when a fenced frame initiates a successful [=navigate : [=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 |sourceSnapshotParams|'s - [=source snapshot params/automatic beacon data map=][|eventType|] to null. + 1. If |beaconData|'s [=automatic beacon data/once=] is true, set |beaconMapping|[|eventType|] to + null. /fenced-frame/automatic-beacon-anchor-click-handler.https.html @@ -2296,6 +2298,9 @@ event|event-level beacon=] when a fenced frame initiates a successful [=navigate /fenced-frame/automatic-beacon-cross-origin-no-data.https.html /fenced-frame/automatic-beacon-cross-origin-no-opt-in.https.html /fenced-frame/automatic-beacon-use-ancestor-data.https.html + /fenced-frame/automatic-beacon-data-cross-origin-ancestor.sub.https.html + /fenced-frame/automatic-beacon-data-set-by-sibling.https.html + /fenced-frame/automatic-beacon-data-multiple-ancestors.https.html @@ -2371,9 +2376,23 @@ An automatic beacon data is a [=struct=] with the :: a [=boolean=] -Each {{Document}} object has an associated automatic beacon data map, which -is a [=map=] whose [=map/keys=] are [=fencedframetype/automatic beacon event type=]s and whose -[=map/values=] are null or an [=fencedframetype/automatic beacon data=] +An automatic beacon data mapping is a [=map=] whose [=map/keys=] are +[=fencedframetype/automatic beacon event type=]s and whose [=map/values=] are null or an +[=fencedframetype/automatic beacon data=]. + +An snapshot automatic beacon store is a [=struct=] with the +following [=struct/items=]: + +
+ : data mapping + :: an [=fencedframetype/automatic beacon data mapping=] + + : cross-origin exposed data mapping + :: an [=fencedframetype/automatic beacon data mapping=] +
+ +Each {{Document}} object has an associated automatic beacon data mapping, +which is an [=fencedframetype/automatic beacon data mapping=]. Each {{Document}} object has an associated automatic beacons allowed, which is a [=boolean=], initially false. @@ -3073,41 +3092,47 @@ CORP violation report=] algorithm, as leaving it unfenced may cause a privacy le : automatic beacons allowed :: an [=boolean=]. - : automatic beacon data map - :: a [=map=] whose [=map/keys=] are [=fencedframetype/automatic beacon event type=]s and whose - [=map/values=] are null or an [=fencedframetype/automatic beacon data=] + : snapshot automatic beacon store + :: an [=fencedframetype/snapshot automatic beacon store=].
- To get the automatic beacon data mapping to use given a {{Document}} |sourceDocument|: + To snapshot the automatic beacon data mapping given a {{Document}} |sourceDocument|: 1. [=Assert=] these steps are running on |sourceDocument|'s [=event loop=]. - 1. Let |automatic beacon data map| be a new empty [=Document/automatic beacon data map=]. + 1. Let |info| be a new empty [=fencedframetype/snapshot automatic beacon store=]. + + 1. Let |mapping| be |info|'s [=snapshot automatic beacon store/data mapping=]. + + 1. Let |crossOriginMapping| be |info|'s [=snapshot automatic beacon store/cross-origin exposed + data mapping=]. 1. Let |current navigable| be |sourceDocument|'s [=node navigable=]. 1. [=iteration/While=] |current navigable| is not null: 1. [=map/iterate|For each=] |type| → |data| of |current navigable|'s [=navigable/active - document=]'s [=Document/automatic beacon data map=]: + document=]'s [=Document/automatic beacon data mapping=]: - 1. If |automatic beacon data map|[|type|] does not [=map/exist=], set - |automatic beacon data map|[|type|] to |data|. + 1. If |mapping|[|type|] does not [=map/exist=], set |mapping|[|type|] to |data|. Note: This guarantees that the first ancestor that contains automatic beacon data for a specific type will be usable by the document initiating the navigation. This will also prevent an ancestor blocking a document from using data set in a higher ancestor. + 1. If |crossOriginMapping|[|type|] does not [=map/exist=] and |data|'s [=automatic beacon + data/crossOriginExposed=] is true, set |crossOriginMapping|[|type|] to |data|. + 1. Set |current navigable| to |current navigable|'s [=navigable/parent=]. - 1. Return |automatic beacon data map|. + 1. Return |info|. - Note: The returned map is meant to hold references to the original {{Document}}'s - [=Document/automatic beacon data map=]s that were used to build |automatic beacon data map|. These - are later modified in [=attempt to send an automatic beacon=] to clear out any beacon data with - [=automatic beacon data/once=] set to true. + Note: The maps stored in |info| are meant to hold references to the original {{Document}}'s + [=Document/automatic beacon data mapping=]s that were used to build |info|. These are later + modified in [=attempt to send an automatic beacon=] to clear out any beacon data with [=automatic + beacon data/once=] set to true.
@@ -3192,8 +3217,8 @@ CORP violation report=] algorithm, as leaving it unfenced may cause a privacy le : [=source snapshot params/automatic beacons allowed=] :: |sourceDocument|'s [=Document/automatic beacons allowed=] - : [=source snapshot params/automatic beacon data map=] - :: The result of running [=get the automatic beacon data mapping to use=] on |sourceDocument|. + : [=source snapshot params/snapshot automatic beacon store=] + :: The result of running [=snapshot the automatic beacon data mapping=] on |sourceDocument|.