Skip to content

Commit

Permalink
Spec: minor fixes
Browse files Browse the repository at this point in the history
Fixes some minor issues discovered in the spec, also adds some Issue
comments to track some potential future clean ups.
  • Loading branch information
alexmturner committed Mar 28, 2024
1 parent 4552911 commit cea103a
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Exposed interface {#exposed-interface}
SecureContext]
interface PrivateAggregation {
undefined contributeToHistogram(PAHistogramContribution contribution);
undefined enableDebugMode(optional PADebugModeOptions options = {});
undefined enableDebugMode(optional PADebugModeOptions options);
};

dictionary PAHistogramContribution {
Expand All @@ -138,6 +138,10 @@ dictionary PADebugModeOptions {
};
</xmp>

Issue: Per the <a href=https://www.w3.org/TR/design-principles/#numeric-types>
Web Platform Design Principles</a>, we should consider switching `long` to
`[EnforceRange] long long`.

Each {{PrivateAggregation}} object has the following fields:
<dl dfn-for="PrivateAggregation">
: <dfn>scoping details</dfn> (default null)
Expand Down Expand Up @@ -1294,12 +1298,23 @@ event, PAExtendedHistogramContribution contribution)</dfn> method steps are:
value=], [=exception/throw=] a {{TypeError}}.
1. If |bucket|["{{PASignalValue/offset}}"] is not a {{bigint}}, [=exception/
throw=] a {{TypeError}}.
1. Otherwise, if |contribution|["{{PAExtendedHistogramContribution/bucket}}"] is
not in the range [0, 2<sup>128</sup>−1], [=exception/throw=] a
{{TypeError}}.

Issue: Make the error type consistent with
{{PrivateAggregation/contributeToHistogram(contribution)}}.
1. Let |value| be |contribution|["{{PAExtendedHistogramContribution/value}}"].
1. If |value| is a {{PASignalValue}}:
1. If |value|["{{PASignalValue/baseValue}}"] is not a valid [=signal base
value=], [=exception/throw=] a {{TypeError}}.
1. If |value|["{{PASignalValue/offset}}"] is a {{bigint}}, [=exception/
throw=] a {{TypeError}}.
1. Otherwise, if |contribution|["{{PAHistogramContribution/value}}"] is
negative, [=exception/throw=] a {{TypeError}}.

Issue: Make the error types on validation issues here and above consistent
with {{PrivateAggregation/contributeToHistogram(contribution)}}.
1. Let |batchingScope| be null.
1. If |event| [=string/starts with=] "`reserved.`", set |batchingScope| to the
result of running |scopingDetails|' [=scoping details/get batching scope
Expand Down Expand Up @@ -1973,10 +1988,10 @@ To <dfn>fill in the contribution</dfn> given a
following steps. They return a {{PAHistogramContribution}}.
1. Let |bucket| be |contribution|["{{PAExtendedHistogramContribution/bucket}}"].
1. If |bucket| is a {{PASignalValue}}, set |bucket| to the result of [=filling
in the signal value=] given |bucket|, 65535 and |leadingBidInfo|.
in the signal value=] given |bucket|, 2<sup>128</sup>−1 and |leadingBidInfo|.
1. Let |value| be |contribution|["{{PAExtendedHistogramContribution/value}}"].
1. If |value| is a {{PASignalValue}}, set |value| to the result of [=filling in
the signal value=] given |value|, 2<sup>128</sup>−1 and |leadingBidInfo|.
the signal value=] given |value|, 65535 and |leadingBidInfo|.
1. Return a new {{PAHistogramContribution}} with the items:
: {{PAHistogramContribution/bucket}}
:: |bucket|
Expand Down

0 comments on commit cea103a

Please sign in to comment.