From 10e4af68c9984a42ad6bae7055431bd5ea2970bb Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Wed, 23 Aug 2023 15:12:31 +0000 Subject: [PATCH 01/15] in progress --- spec.bs | 97 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 69 insertions(+), 28 deletions(-) diff --git a/spec.bs b/spec.bs index 541e9bc..e43e34a 100644 --- a/spec.bs +++ b/spec.bs @@ -679,11 +679,8 @@ A pending event is a [=struct=] with the f : destination :: a {{FenceReportingDestination}} - : eventType - :: a [=string=] - - : eventData - :: a [=string=] + : event + :: a [=fencedframetype/destination event=] A fenced frame reporting map is a [=map=] whose [=map/keys=] @@ -756,19 +753,40 @@ A fenced frame reporter is a [=struct=] wi +A destination enum event is a [=struct=] with the following +[=struct/items=]: +
+ : type + :: a [=string=] + + : data + :: a [=string=] +
+ +A destination URL event is a [=URL=]. + +A destination event is either a +[=fencedframetype/destination enum event=] or a [=fencedframetype/destination URL event=]. +
In order to send a beacon 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: + [=strings=] and whose [=map/values=] are [=urls=], and a [=fencedframetype/destination event=] + |event|, run these steps: + + 1. Let |destination url| be an empty [=string=]. + 1. If |event| is a [=fencedframetype/destination enum event=]: + 1. If |destination map|[|eventType|] does not [=map/exist=], return. - 1. If |destination map|[|eventType|] does not [=map/exist=], return. + 1. Set |destination url| to |destination map|[|eventType|]. - 1. Let |destination url| be |destination map|[|eventType|]. + 1. Otherwise: + 1. Assert that |event| is a [=fencedframetype/destination URL event=]. + 1. Set |destination url| to |event|. 1. Let |request| be a new [=request=] with the following properties: : [=request/method=] - :: `POST` + :: `POST` if |event| is a [=fencedframetype/destination enum event=], otherwise `GET`. : [=request/URL=] :: |destination url| @@ -778,7 +796,8 @@ A fenced frame reporter is a [=struct=] wi [=header/value=] is `"text/plain"`. : [=request/body=] - :: A [=body=] whose [=body/source=] is |eventData|. + :: If |event| is a [=fencedframetype/destination enum event=], a [=body=] whose [=body/source=] + is |event|'s [=destination enum event/data=], otherwise null. : [=request/client=] :: null @@ -814,8 +833,8 @@ A fenced frame reporter is a [=struct=] wi
In order to report an event using a [=fencedframetype/fenced frame reporter=] - |reporter| with a {{FenceReportingDestination}} |destination|, [=string=] |eventType|, and - [=string=] |eventData|, run these steps: + |reporter| with a {{FenceReportingDestination}} |destination|, and a + [=fencedframetype/destination event=] |event|, run these steps: 1. If |destination| is `"direct-seller"`: @@ -837,11 +856,8 @@ A fenced frame reporter is a [=struct=] wi : [=pending event/destination=] :: |destination| - : [=pending event/eventType=] - :: |eventType| - - : [=pending event/eventData=] - :: |eventData| + : [=pending event/event=] + :: |event| 1. [=list/Append=] |newEvent| to |reporting map|[|destination|]. @@ -852,7 +868,7 @@ A fenced frame reporter is a [=struct=] wi 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|. + 1. [=Send a beacon=] with |reporting map|[|destination|] and |event|.
@@ -1237,10 +1253,18 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. }; dictionary FenceEvent { - required DOMString eventType; - required DOMString eventData; - required sequence<FenceReportingDestination> destination; + // This dictionary has two mutually exclusive modes: + // + // When reporting to a preregistered destination (specified by enum), the following properties + // are used: + DOMString eventType; + DOMString eventData; + sequence<FenceReportingDestination> destination; boolean once = false; + + // When reporting to a custom destination URL (with substitution of macros defined by the + // Protected Audience buyer), the following property is used: + USVString destinationURL; }; typedef (FenceEvent or DOMString) ReportEventType; @@ -1270,11 +1294,25 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 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}}: - 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}}. + 1. If |event| has a {{FenceEvent/destinationURL}}: + 1. If |event| has a {{FenceEvent/destination}} or a {{FenceEvent/eventType}} or a + {{FenceEvent/eventData}}: + 1. Return a syntax error. + 1. If |event|'s {{FenceEvent/destinationURL}} is not a valid URL or is not https: + 1. Return a syntax error. + + 1. Otherwise: + 1. If |event| does not have a {{FenceEvent/destination}} or |event| does not have a + {{FenceEvent/eventType}}: + 1. Return a syntax error. + + 1. [=list/for each=] |destination| of |event|'s {{FenceEvent/destination}}: + + 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}} (or the empty string if it is not defined). /fenced-frame/fence-report-event.https.html @@ -1284,6 +1322,9 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
The setReportEventDataForAutomaticBeacons(|event|) method steps are: + 1. If |event| does not have a {{FenceEvent/destination}} or |event| does not have a + {{FenceEvent/eventType}}: + 1. Return a syntax error. 1. If |event|'s {{FenceEvent/eventType}} is not `"reserved.top_navigation"`, return. @@ -1302,7 +1343,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. reporter/automatic beacon data=] to a [=struct=] with the following [=struct/items=]: : [=automatic beacon data/eventData=] - :: |event|'s {{FenceEvent/eventData}} + :: |event|'s {{FenceEvent/eventData}} if defined, otherwise empty string : [=automatic beacon data/destination=] :: |event|'s {{FenceEvent/destination}} @@ -1435,7 +1476,7 @@ successful [=navigate|navigation=] to a [=top-level traversable=]. instance=]. 1. If |config| is null, abort these steps. - + Note: Since this algorithm is called unconditionally for all navigations, this is used to catch cases where a [=navigate|navigation=] to a [=top-level traversable=] does not originate from a <{fencedframe}>. From 9fd7dde94e071435236ab73eedf271dc9d14a168 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Wed, 23 Aug 2023 17:19:19 +0000 Subject: [PATCH 02/15] fix compile error --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index e43e34a..3096471 100644 --- a/spec.bs +++ b/spec.bs @@ -1272,7 +1272,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. [Exposed=Window] interface Fence { undefined reportEvent(ReportEventType event); - undefined setReportEventDataForAutomaticBeacons(FenceEvent event); + undefined setReportEventDataForAutomaticBeacons(optional FenceEvent event); sequence<FencedFrameConfig> getNestedConfigs(); }; From 0ccdd773caf25eb37beda28270ba676465f01518 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Wed, 23 Aug 2023 18:13:50 +0000 Subject: [PATCH 03/15] flesh out spec --- spec.bs | 58 ++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/spec.bs b/spec.bs index 3096471..7607daf 100644 --- a/spec.bs +++ b/spec.bs @@ -683,11 +683,22 @@ A pending event is a [=struct=] with the f :: a [=fencedframetype/destination event=] +A reporting destination info is a [=struct=] with the +following [=struct/items=]: + +
+ : reporting url map + :: a [=map=] whose [=map/keys=] are [=strings=] and whose [=map/values=] are [=urls=] + + : reporting macro map + :: null, or a [=map=] whose [=map/keys=] are [=strings=] and whose [=map/values=] are [=strings=] +
+ A fenced frame reporting map 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 + * [=fencedframetype/reporting destination infos=] (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 @@ -704,21 +715,26 @@ be sent.
In order to finalize a reporting destination, 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: + frame reporting map=] |reporting map|, a {{FenceReportingDestination}} |destination|, a [=map=] + |destination map| whose [=map/keys=] are [=strings=] and whose [=map/values=] are [=urls=], and + |macro map|, which is either null or a [=map=] whose [=map/keys=] are [=strings=] and whose + [=map/values=] are [=strings=], run these steps: 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. [=map/Set=] |reporting map|[|destination|] to a [=struct=] with the following [=struct/items=]: + : [=reporting destination info/reporting url map=] + :: |destination map| + + : [=reporting destination info/reporting macro map=] + :: |macro 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=]. + 1. [=Send a beacon=] with |destination map| and |pending event|'s [=pending event/event=].
A fenced frame reporting metadata is a [=struct=] with the @@ -769,19 +785,24 @@ A destination event is either a [=fencedframetype/destination enum event=] or a [=fencedframetype/destination URL event=].
- In order to send a beacon with a [=map=] |destination map| whose [=map/keys=] are - [=strings=] and whose [=map/values=] are [=urls=], and a [=fencedframetype/destination event=] - |event|, run these steps: + In order to send a beacon with a [=fencedframetype/reporting destination info=] + |destination info| and a [=fencedframetype/destination event=] |event|, run these steps: 1. Let |destination url| be an empty [=string=]. 1. If |event| is a [=fencedframetype/destination enum event=]: - 1. If |destination map|[|eventType|] does not [=map/exist=], return. + 1. Let |destination map| be |destination info|'s + [=reporting destination info/reporting url map=]. + 1. |destination map|[|eventType|] does not [=map/exist=], return. 1. Set |destination url| to |destination map|[|eventType|]. 1. Otherwise: 1. Assert that |event| is a [=fencedframetype/destination URL event=]. + 1. Let |macro map| be |destination info|'s [=reporting destination info/reporting macro map=]. + 1. If |macro map| is null, return. 1. Set |destination url| to |event|. + 1. TODO: Substitute macros from |macro map| into |destination url|. + 1. TODO: Check allowed origins. 1. Let |request| be a new [=request=] with the following properties: @@ -1302,6 +1323,10 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. Return a syntax error. 1. If |event|'s {{FenceEvent/destinationURL}} is not a valid URL or is not https: 1. Return a syntax error. + 1. Run [=report an event=] using |instance|'s [=fenced frame config instance/fenced frame + reporter=] with {{FenceReportingDestination/buyer}} and a + [=fencedframetype/destination URL event=] that is event|'s + {{FenceEvent/destinationURL}}. 1. Otherwise: 1. If |event| does not have a {{FenceEvent/destination}} or |event| does not have a @@ -1311,11 +1336,18 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. [=list/for each=] |destination| of |event|'s {{FenceEvent/destination}}: 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}} (or the empty string if it is not defined). + reporter=] with |destination| and a [=fencedframetype/destination enum event=] with the + following [=struct/items=]: + + : [=destination enum event/type=] + :: |event|'s {{FenceEvent/eventType}} + + : [=destination enum event/data=] + :: |event|'s {{FenceEvent/eventData}} (or the empty string if it is not defined). /fenced-frame/fence-report-event.https.html + /fenced-frame/fence-report-event-destination-url.https.html
From 940660a91ce0316729f3406f330250162415c57b Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Wed, 23 Aug 2023 19:55:12 +0000 Subject: [PATCH 04/15] try to fix idl error --- spec.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.bs b/spec.bs index 7607daf..a94417f 100644 --- a/spec.bs +++ b/spec.bs @@ -1292,8 +1292,8 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. [Exposed=Window] interface Fence { - undefined reportEvent(ReportEventType event); - undefined setReportEventDataForAutomaticBeacons(optional FenceEvent event); + undefined reportEvent(optional ReportEventType event = {}); + undefined setReportEventDataForAutomaticBeacons(optional FenceEvent event = {}); sequence<FencedFrameConfig> getNestedConfigs(); }; From b5d09c999f2ef04644f526e3456919ec687a3a36 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Wed, 23 Aug 2023 20:35:08 +0000 Subject: [PATCH 05/15] fix method step todos --- spec.bs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spec.bs b/spec.bs index a94417f..2f4aa83 100644 --- a/spec.bs +++ b/spec.bs @@ -1320,9 +1320,12 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. If |event| has a {{FenceEvent/destinationURL}}: 1. If |event| has a {{FenceEvent/destination}} or a {{FenceEvent/eventType}} or a {{FenceEvent/eventData}}: - 1. Return a syntax error. - 1. If |event|'s {{FenceEvent/destinationURL}} is not a valid URL or is not https: - 1. Return a syntax error. + 1. [=exception/Throw=] a {{TypeError}}. + 1. Let |destinationURL| be the result of running the [=URL parser=] on + {{FenceEvent/destinationURL}}. + 1. [=exception/Throw=] a {{TypeError}} if any of the following conditions hold: + * |destinationURL| is failure; + * |destinationURL| [=url/scheme=] is not "`https`"; 1. Run [=report an event=] using |instance|'s [=fenced frame config instance/fenced frame reporter=] with {{FenceReportingDestination/buyer}} and a [=fencedframetype/destination URL event=] that is event|'s @@ -1331,7 +1334,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. Otherwise: 1. If |event| does not have a {{FenceEvent/destination}} or |event| does not have a {{FenceEvent/eventType}}: - 1. Return a syntax error. + 1. [=exception/Throw=] a {{TypeError}}. 1. [=list/for each=] |destination| of |event|'s {{FenceEvent/destination}}: @@ -1356,7 +1359,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. method steps are: 1. If |event| does not have a {{FenceEvent/destination}} or |event| does not have a {{FenceEvent/eventType}}: - 1. Return a syntax error. + 1. [=exception/Throw=] a {{TypeError}}. 1. If |event|'s {{FenceEvent/eventType}} is not `"reserved.top_navigation"`, return. From 265ac7fc06c76043b41d57a43178f2e1e2676c09 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Wed, 23 Aug 2023 21:59:30 +0000 Subject: [PATCH 06/15] finish? --- spec.bs | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/spec.bs b/spec.bs index 2f4aa83..4f9ad9d 100644 --- a/spec.bs +++ b/spec.bs @@ -746,6 +746,12 @@ following [=struct/items=]: : direct seller is seller :: a boolean + + : allowed reporting origins + :: null or a [=list=] of [=origins=] + + : attempted custom url report to disallowed origin + :: a boolean, initially false A fenced frame reporter is a [=struct=] with the following @@ -802,7 +808,6 @@ A destination event is either a 1. If |macro map| is null, return. 1. Set |destination url| to |event|. 1. TODO: Substitute macros from |macro map| into |destination url|. - 1. TODO: Check allowed origins. 1. Let |request| be a new [=request=] with the following properties: @@ -857,17 +862,29 @@ A destination event is either a |reporter| with a {{FenceReportingDestination}} |destination|, and a [=fencedframetype/destination event=] |event|, run these steps: + 1. Let |metadata| be |reporter|'s + [=fenced frame reporter/fenced frame reporting metadata reference=]. + 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. If |metadata|'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 |event| is a [=fencedframetype/destination enum event=]: + 1. If |event|'s [=url/origin=] is not [=same origin=] with any of the entries in + |metadata|'s [=fenced frame reporting metadata/allowed reporting origins=]: + 1. Set |metadata|'s + [=fenced frame reporting metadata/attempted custom url report to disallowed origin=] to + true. + + 1. If |metadata|'s + [=fenced frame reporting metadata/attempted custom url report to disallowed origin=] is + true, return. + + 1. Let |reporting map| be a reference to |metadata|'s + [=fenced frame reporting metadata/fenced frame reporting map=]. 1. If |reporting map|[|destination|] does not [=map/exist=], return. From d903287fb23ced0b519ff026d0fb2468564d7c05 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Wed, 23 Aug 2023 22:15:14 +0000 Subject: [PATCH 07/15] fix line break --- spec.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 4f9ad9d..2c24539 100644 --- a/spec.bs +++ b/spec.bs @@ -812,7 +812,8 @@ A destination event is either a 1. Let |request| be a new [=request=] with the following properties: : [=request/method=] - :: `POST` if |event| is a [=fencedframetype/destination enum event=], otherwise `GET`. + :: `POST` if |event| is a [=fencedframetype/destination enum event=], otherwise + `GET`. : [=request/URL=] :: |destination url| From 32f733a1f1fcd6fd547292529127d93c72aff5f7 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Tue, 29 Aug 2023 16:07:22 +0000 Subject: [PATCH 08/15] address qingxin's comments --- spec.bs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spec.bs b/spec.bs index 2c24539..7385a8d 100644 --- a/spec.bs +++ b/spec.bs @@ -745,13 +745,13 @@ following [=struct/items=]: :: a [=fencedframetype/fenced frame reporting map=] : direct seller is seller - :: a boolean + :: a [=boolean=] : allowed reporting origins :: null or a [=list=] of [=origins=] : attempted custom url report to disallowed origin - :: a boolean, initially false + :: a [=boolean=], initially false A fenced frame reporter is a [=struct=] with the following @@ -798,7 +798,8 @@ A destination event is either a 1. If |event| is a [=fencedframetype/destination enum event=]: 1. Let |destination map| be |destination info|'s [=reporting destination info/reporting url map=]. - 1. |destination map|[|eventType|] does not [=map/exist=], return. + 1. Let |eventType| be |event|'s [=destination enum event/type=]. + 1. If |destination map|[|eventType|] does not [=map/exist=], return. 1. Set |destination url| to |destination map|[|eventType|]. @@ -873,7 +874,7 @@ A destination event is either a 1. Otherwise, set |destination| to `"component-seller"`. - 1. If |event| is a [=fencedframetype/destination enum event=]: + 1. If |event| is a [=fencedframetype/destination URL event=]: 1. If |event|'s [=url/origin=] is not [=same origin=] with any of the entries in |metadata|'s [=fenced frame reporting metadata/allowed reporting origins=]: 1. Set |metadata|'s @@ -1346,7 +1347,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. * |destinationURL| [=url/scheme=] is not "`https`"; 1. Run [=report an event=] using |instance|'s [=fenced frame config instance/fenced frame reporter=] with {{FenceReportingDestination/buyer}} and a - [=fencedframetype/destination URL event=] that is event|'s + [=fencedframetype/destination URL event=] that is |event|'s {{FenceEvent/destinationURL}}. 1. Otherwise: From 3bf3c0e126a110628dedcc449e43c0d54f0abd48 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Wed, 6 Sep 2023 20:09:53 +0000 Subject: [PATCH 09/15] address comments --- spec.bs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spec.bs b/spec.bs index 7385a8d..9604373 100644 --- a/spec.bs +++ b/spec.bs @@ -745,7 +745,7 @@ following [=struct/items=]: :: a [=fencedframetype/fenced frame reporting map=] : direct seller is seller - :: a [=boolean=] + :: a [=boolean=], initially true : allowed reporting origins :: null or a [=list=] of [=origins=] @@ -808,7 +808,8 @@ A destination event is either a 1. Let |macro map| be |destination info|'s [=reporting destination info/reporting macro map=]. 1. If |macro map| is null, return. 1. Set |destination url| to |event|. - 1. TODO: Substitute macros from |macro map| into |destination url|. + 1. Let |destination url| be the result of [=fencedframeutil/substituting macros=] with + |macro map| into |destination url|. 1. Let |request| be a new [=request=] with the following properties: @@ -1293,17 +1294,18 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. }; dictionary FenceEvent { - // This dictionary has two mutually exclusive modes: + // This dictionary has two mutually exclusive modes that aren't represented as + // distinct IDL types due to distinguishability issues: // - // When reporting to a preregistered destination (specified by enum), the following properties - // are used: + // When reporting to a preregistered destination (specified by enum), the following + // properties are used: DOMString eventType; DOMString eventData; sequence<FenceReportingDestination> destination; boolean once = false; - // When reporting to a custom destination URL (with substitution of macros defined by the - // Protected Audience buyer), the following property is used: + // When reporting to a custom destination URL (with substitution of macros defined by + // the Protected Audience buyer), the following property is used: USVString destinationURL; }; From 8d50fa8080447bb6b322638240d1a60326830acb Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Fri, 8 Sep 2023 16:09:22 -0400 Subject: [PATCH 10/15] urls => URLs --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 9604373..68de7c0 100644 --- a/spec.bs +++ b/spec.bs @@ -688,7 +688,7 @@ following [=struct/items=]:
: reporting url map - :: a [=map=] whose [=map/keys=] are [=strings=] and whose [=map/values=] are [=urls=] + :: a [=map=] whose [=map/keys=] are [=strings=] and whose [=map/values=] are [=URLs=] : reporting macro map :: null, or a [=map=] whose [=map/keys=] are [=strings=] and whose [=map/values=] are [=strings=] From dfe069e98c92400a30eec4837317bbc1e58c620e Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Fri, 8 Sep 2023 16:46:48 -0400 Subject: [PATCH 11/15] Editorial and formatting stuff --- spec.bs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/spec.bs b/spec.bs index 68de7c0..1c17964 100644 --- a/spec.bs +++ b/spec.bs @@ -795,19 +795,28 @@ A destination event is either a |destination info| and a [=fencedframetype/destination event=] |event|, run these steps: 1. Let |destination url| be an empty [=string=]. - 1. If |event| is a [=fencedframetype/destination enum event=]: + + 1. If |event| is a [=fencedframetype/destination enum 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. If |destination map|[|eventType|] does not [=map/exist=], return. 1. Set |destination url| to |destination map|[|eventType|]. 1. Otherwise: - 1. Assert that |event| is a [=fencedframetype/destination URL event=]. + + 1. [=Assert=]: |event| is a [=fencedframetype/destination URL event=]. + 1. Let |macro map| be |destination info|'s [=reporting destination info/reporting macro map=]. + 1. If |macro map| is null, return. + 1. Set |destination url| to |event|. + 1. Let |destination url| be the result of [=fencedframeutil/substituting macros=] with |macro map| into |destination url|. @@ -1341,12 +1350,17 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. If |event| has a {{FenceEvent/destinationURL}}: 1. If |event| has a {{FenceEvent/destination}} or a {{FenceEvent/eventType}} or a {{FenceEvent/eventData}}: + 1. [=exception/Throw=] a {{TypeError}}. + 1. Let |destinationURL| be the result of running the [=URL parser=] on {{FenceEvent/destinationURL}}. + 1. [=exception/Throw=] a {{TypeError}} if any of the following conditions hold: + * |destinationURL| is failure; * |destinationURL| [=url/scheme=] is not "`https`"; + 1. Run [=report an event=] using |instance|'s [=fenced frame config instance/fenced frame reporter=] with {{FenceReportingDestination/buyer}} and a [=fencedframetype/destination URL event=] that is |event|'s @@ -1355,6 +1369,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. Otherwise: 1. If |event| does not have a {{FenceEvent/destination}} or |event| does not have a {{FenceEvent/eventType}}: + 1. [=exception/Throw=] a {{TypeError}}. 1. [=list/for each=] |destination| of |event|'s {{FenceEvent/destination}}: From dedfe04675d0b3ba1aa5edd13f9b4683cb820689 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Tue, 26 Sep 2023 12:10:00 -0400 Subject: [PATCH 12/15] f->F --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 473c48c..28404f9 100644 --- a/spec.bs +++ b/spec.bs @@ -1452,7 +1452,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. [=exception/Throw=] a {{TypeError}}. - 1. [=list/for each=] |destination| of |event|'s {{FenceEvent/destination}}: + 1. [=list/For each=] |destination| of |event|'s {{FenceEvent/destination}}: 1. Run [=report an event=] using |instance|'s [=fenced frame config instance/fenced frame reporter=] with |destination| and a [=fencedframetype/destination enum event=] with the From 65a9b6124982ef66f82139ff01fd4a71dd7b1527 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Tue, 26 Sep 2023 12:18:18 -0400 Subject: [PATCH 13/15] Update spec.bs --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 28404f9..2096d47 100644 --- a/spec.bs +++ b/spec.bs @@ -748,7 +748,7 @@ following [=struct/items=]: :: a [=boolean=], initially true : allowed reporting origins - :: null or a [=list=] of [=origins=] + :: null or a [=list=] of [=origins=]. Used to filter [=fencedframetype/destination URL event=] reports. : attempted custom url report to disallowed origin :: a [=boolean=], initially false From e9ac602c3b766cfe9842db180d71611a2ba7aa1f Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Tue, 26 Sep 2023 12:19:48 -0400 Subject: [PATCH 14/15] Update spec.bs --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 2096d47..7de545e 100644 --- a/spec.bs +++ b/spec.bs @@ -748,7 +748,7 @@ following [=struct/items=]: :: a [=boolean=], initially true : allowed reporting origins - :: null or a [=list=] of [=origins=]. Used to filter [=fencedframetype/destination URL event=] reports. + :: null or a [=list=] of [=origins=]. An origin must be present in this list to be the destination of a [=fencedframetype/destination URL event=] report. : attempted custom url report to disallowed origin :: a [=boolean=], initially false From 29bc78141631f0eb220c5db7a8a0a44d06cdc52c Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Tue, 26 Sep 2023 12:20:13 -0400 Subject: [PATCH 15/15] Update spec.bs --- spec.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 7de545e..23734c1 100644 --- a/spec.bs +++ b/spec.bs @@ -748,7 +748,8 @@ following [=struct/items=]: :: a [=boolean=], initially true : allowed reporting origins - :: null or a [=list=] of [=origins=]. An origin must be present in this list to be the destination of a [=fencedframetype/destination URL event=] report. + :: null or a [=list=] of [=origins=]. An origin must be present in this list to be the + destination of a [=fencedframetype/destination URL event=] report. : attempted custom url report to disallowed origin :: a [=boolean=], initially false