Skip to content

Commit e4ab73c

Browse files
authored
Spec: minor fixes (#122)
Fixes some minor issues discovered in the spec, also adds some Issue comments to track some potential future clean ups.
1 parent 4552911 commit e4ab73c

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

spec.bs

+27-8
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ dictionary PADebugModeOptions {
138138
};
139139
</xmp>
140140

141+
Issue: Per the <a href=https://www.w3.org/TR/design-principles/#numeric-types>
142+
Web Platform Design Principles</a>, we should consider switching `long` to
143+
`[EnforceRange] long long`.
144+
145+
Issue: {{PrivateAggregation/enableDebugMode(options)}}'s argument should not
146+
have a default value of `{}`. Alternatively, {{PADebugModeOptions/debugKey}}
147+
should not be required in {{PADebugModeOptions}}.
148+
141149
Each {{PrivateAggregation}} object has the following fields:
142150
<dl dfn-for="PrivateAggregation">
143151
: <dfn>scoping details</dfn> (default null)
@@ -1048,12 +1056,12 @@ steps. They return an [=aggregation coordinator=], null or a {{DOMException}}:
10481056
To <dfn algorithm>obtain the context ID</dfn> given a
10491057
{{SharedStorageRunOperationMethodOptions}} |options|, perform the following
10501058
steps. They return a [=string=], null, or a {{DOMException}}:
1051-
1. If |options|["`privateAggregationConfig`"] does not [=map/exist=], return
1052-
null.
1053-
1. If |options|["`privateAggregationConfig`"]["`contextId`"] does not [=map/
1054-
exist=], return null.
1055-
1. Set |contextId| to
1056-
|options|["`privateAggregationConfig`"]["`contextId`"].
1059+
1. If |options|["{{SharedStorageRunOperationMethodOptions/privateAggregationConfig}}"]
1060+
does not [=map/exist=], return null.
1061+
1. If |options|["{{SharedStorageRunOperationMethodOptions/privateAggregationConfig}}"]["{{SharedStoragePrivateAggregationConfig/contextId}}"]
1062+
does not [=map/exist=], return null.
1063+
1. Let |contextId| be
1064+
|options|["{{SharedStorageRunOperationMethodOptions/privateAggregationConfig}}"]["{{SharedStoragePrivateAggregationConfig/contextId}}"].
10571065
1. If |contextId|'s [=string/length=] is greater than 64, return a new
10581066
{{DOMException}} with name "`DataError`".
10591067
1. Return |contextId|.
@@ -1294,12 +1302,23 @@ event, PAExtendedHistogramContribution contribution)</dfn> method steps are:
12941302
value=], [=exception/throw=] a {{TypeError}}.
12951303
1. If |bucket|["{{PASignalValue/offset}}"] is not a {{bigint}}, [=exception/
12961304
throw=] a {{TypeError}}.
1305+
1. Otherwise, if |contribution|["{{PAExtendedHistogramContribution/bucket}}"] is
1306+
not in the range [0, 2<sup>128</sup>−1], [=exception/throw=] a
1307+
{{TypeError}}.
1308+
1309+
Issue: Make the error type consistent with
1310+
{{PrivateAggregation/contributeToHistogram(contribution)}}.
12971311
1. Let |value| be |contribution|["{{PAExtendedHistogramContribution/value}}"].
12981312
1. If |value| is a {{PASignalValue}}:
12991313
1. If |value|["{{PASignalValue/baseValue}}"] is not a valid [=signal base
13001314
value=], [=exception/throw=] a {{TypeError}}.
13011315
1. If |value|["{{PASignalValue/offset}}"] is a {{bigint}}, [=exception/
13021316
throw=] a {{TypeError}}.
1317+
1. Otherwise, if |contribution|["{{PAHistogramContribution/value}}"] is
1318+
negative, [=exception/throw=] a {{TypeError}}.
1319+
1320+
Issue: Make the error types on validation issues here and above consistent
1321+
with {{PrivateAggregation/contributeToHistogram(contribution)}}.
13031322
1. Let |batchingScope| be null.
13041323
1. If |event| [=string/starts with=] "`reserved.`", set |batchingScope| to the
13051324
result of running |scopingDetails|' [=scoping details/get batching scope
@@ -1973,10 +1992,10 @@ To <dfn>fill in the contribution</dfn> given a
19731992
following steps. They return a {{PAHistogramContribution}}.
19741993
1. Let |bucket| be |contribution|["{{PAExtendedHistogramContribution/bucket}}"].
19751994
1. If |bucket| is a {{PASignalValue}}, set |bucket| to the result of [=filling
1976-
in the signal value=] given |bucket|, 65535 and |leadingBidInfo|.
1995+
in the signal value=] given |bucket|, 2<sup>128</sup>−1 and |leadingBidInfo|.
19771996
1. Let |value| be |contribution|["{{PAExtendedHistogramContribution/value}}"].
19781997
1. If |value| is a {{PASignalValue}}, set |value| to the result of [=filling in
1979-
the signal value=] given |value|, 2<sup>128</sup>−1 and |leadingBidInfo|.
1998+
the signal value=] given |value|, 2<sup>31</sup>−1 and |leadingBidInfo|.
19801999
1. Return a new {{PAHistogramContribution}} with the items:
19812000
: {{PAHistogramContribution/bucket}}
19822001
:: |bucket|

0 commit comments

Comments
 (0)