From 6562a400e8104cf91548daf6308becb1046f3ee9 Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Tue, 18 Jul 2023 09:40:02 -0400 Subject: [PATCH 1/5] Revert "Add webIDL dictionaries for reporting browser signals (#678)" This reverts commit 77601ee38bd7e212ab7561962b307edf9b5c4f15. --- spec.bs | 292 ++++++++++++++++++-------------------------------------- 1 file changed, 93 insertions(+), 199 deletions(-) diff --git a/spec.bs b/spec.bs index db7ee718e..d6e9a4b12 100644 --- a/spec.bs +++ b/spec.bs @@ -41,9 +41,6 @@ spec: WebAssembly; urlPrefix: https://webassembly.github.io/spec/core/ spec: WebAssembly-js-api; urlPrefix: https://webassembly.github.io/spec/js-api/ type: dfn text: compiling a WebAssembly module; url: #compile-a-webassembly-module -spec: WebIDL; urlPrefix: https://webidl.spec.whatwg.org/ - type: dfn - text: convert a Web IDL arguments list to an ECMAScript arguments list; url: #web-idl-arguments-list-converting spec: Fenced Frame; urlPrefix: https://wicg.github.io/fenced-frame/ type: dfn for: browsing context @@ -1063,7 +1060,7 @@ an [=interest group=] |ig|, and a [=moment=] |auctionStartTime|: 1. Let |prevWins| be a new [=sequence=]<{{PreviousWin}}>. 1. [=list/For each] |prevWin| of |ig|'s [=interest group/previous wins=] for all days within the the last 30 days: - 1. Let |timeDelta| be |auctionStartTime| minus |prevWin|'s [=previous win/time=]. + 1. Let |timeDelta| be |auctionStartTime| minus |prevWin|[=previous win/time=]. 1. Set |timeDelta| to 0 if |timeDelta| is negative, |timeDelta|'s nearest second (rounding down) otherwise. 1. Let |prevWinIDL| be a new {{PreviousWin}}. @@ -1375,7 +1372,7 @@ To score and rank a bid given an [=auction config=] |auctionConfig|,
{{ScoringBrowserSignals/interestGroupOwner}}
[=serialization of an origin|Serialized=] |owner|
{{ScoringBrowserSignals/renderURL}} -
The result of running the [=URL serializer=] on |generatedBid|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=] +
[=URL serializer|Serialized=] |generatedBid|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]
{{ScoringBrowserSignals/biddingDurationMsec}}
|generatedBid|'s [=generated bid/bid duration=]
{{ScoringBrowserSignals/bidCurrency}} @@ -1726,7 +1723,6 @@ To round a value given a {{double}} |value|: -
To report result given a [=leading bid info=] |leadingBidInfo| and [=auction config=] or null |winningComponentConfig|: 1. Let |config| be |leadingBidInfo|'s [=leading bid info/auction config=]. @@ -1741,64 +1737,53 @@ null |winningComponentConfig|: 1. Set |bidCurrency| to the result of [=looking up per-buyer currency=] with |config| and |leadingBidInfo|'s [=leading bid info/leading bid=]'s [=generated bid/interest group=]'s [=interest group/owner=]. + 1. Let |browserSignals| be an [=ordered map=] whose [=map/keys=] are [=strings=] and whose + [=map/values=] are {{any}}. + 1. [=map/Set=] |browserSignals|["`topWindowHostname`"] to [=this=]'s + [=relevant settings object=]'s [=environment/top-level origin=]'s [=origin/host=]. 1. Let |winner| be |leadingBidInfo|'s [=leading bid info/leading bid=]. - 1. Let |sellerCurrency| be |leadingBidInfo|'s [=leading bid info/auction config=]'s - [=auction config/seller currency=]. - 1. Let |highestScoringOtherBid| be |leadingBidInfo|'s - [=leading bid info/highest scoring other bid=]'s [=generated bid/bid in seller currency=] (or - 0 if encountered a null). + 1. [=map/Set=] |browserSignals|["`interestGroupOwner`"] to |winner|'s + [=generated bid/interest group=]'s [=interest group/owner=]. + 1. [=map/Set=] |browserSignals|["`renderURL`"] to |winner|'s [=generated bid/ad descriptor=]'s + [=ad descriptor/url=]. + 1. Let |sellerCurrency| be |leadingBidInfo|'s [=leading bid info/auction config=]'s [=auction config/seller currency=]. + 1. [=map/Set=] |browserSignals|["`desirability`"] to |leadingBidInfo|'s + [=leading bid info/top score=]. + 1. [=map/Set=] |browserSignals|["`bid`"] to the result of [=rounding a value=] given + |winner|'s [=generated bid/bid=]'s [=bid with currency/value=]. + 1. [=map/Set=] |browserSignals|["`bidCurrency`"] to the result of [=serializing a currency tag=] + with |bidCurrency|. + 1. If |sellerCurrency| is null: - 1. Set |highestScoringOtherBid| to |leadingBidInfo|'s + 1. [=map/Set=] |browserSignals|["`highestScoringOtherBid`"] to |leadingBidInfo|'s [=leading bid info/highest scoring other bid=]'s [=generated bid/bid=]'s [=bid with currency/value=] (or 0 if encountered a null). - 1. Let |bid| be |winner|'s [=generated bid/bid=]'s [=bid with currency/value=]. - 1. Let |modifiedBid| be null. - 1. If |winner|'s [=generated bid/modified bid=] is not null: - 1. If |leadingBidInfo|'s [=leading bid info/component seller=] is not null: - 1. Set |bid| to |winner|'s [=generated bid/modified bid=]. - 1. Otherwise: - 1. Set |modifiedBid| to |winner|'s [=generated bid/modified bid=]. - 1. Let |browserSignals| be a {{ReportResultBrowserSignals}} with the following fields: -
-
{{topWindowHostname}} -
The result of running the host serializer on [=this=]'s - [=relevant settings object=]'s [=environment/top-level origin=]'s [=origin/host=]. -
{{interestGroupOwner}} -
[=serialization of an origin|Serialized=] |winner|'s [=generated bid/interest group=]'s - [=interest group/owner=]. -
{{renderURL}} -
[=URL serializer|Serialized=] |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=] -
{{bid}} -
[=round a value|Stochastically rounded=] |bid| -
{{bidCurrency}} -
The result of [=serializing a currency tag=] with |bidCurrency| -
{{highestScoringOtherBid}} -
|highestScoringOtherBid| -
{{highestScoringOtherBidCurrency}} -
|sellerCurrency| if it is not null, "`???`" otherwise -
{{topLevelSeller}} -
|leadingBidInfo|'s [=leading bid info/top level seller=] if it is not null, {{undefined}} - otherwise -
{{componentSeller}} -
|leadingBidInfo|'s [=leading bid info/component seller=] if it is not null, {{undefined}} - otherwise -
{{ReportResultBrowserSignals/desirability}} -
[=round a value|Stochastically rounded=] |leadingBidInfo|'s [=leading bid info/top score=] -
{{ReportResultBrowserSignals/topLevelSellerSignals}} -
|leadingBidInfo|'s [=leading bid info/top level seller signals=] if it is not null, - {{undefined}} otherwise -
{{ReportResultBrowserSignals/modifiedBid}} -
[=round a value|Stochastically rounded=] |modifiedBid| if it is not null, {{undefined}} otherwise -
{{ReportResultBrowserSignals/dataVersion}} -
|leadingBidInfo|'s [=leading bid info/scoring data version=] if it is not null, - {{undefined}} otherwise -
+ 1. [=map/Set=] |browserSignals|["`highestScoringOtherBidCurrency`"] to "`???`". + 1. Otherwise: + 1. [=map/Set=] |browserSignals|["`highestScoringOtherBid`"] to |leadingBidInfo|'s + [=leading bid info/highest scoring other bid=]'s [=generated bid/bid in seller currency=] (or + 0 if encountered a null). + 1. [=map/Set=] |browserSignals|["`highestScoringOtherBidCurrency`"] to |sellerCurrency|. + 1. If |leadingBidInfo|'s [=leading bid info/scoring data version=] is not null, [=map/Set=] + |browserSignals|["`dataVersion`"] to it. + 1. If |leadingBidInfo|'s [=leading bid info/top level seller=] is not null, [=map/set=] + |browserSignals|["`topLevelSeller`"] to it. + 1. If |leadingBidInfo|'s [=leading bid info/top level seller signals=] is not null, [=map/set=] + |browserSignals|["`topLevelSellerSignals`"] to it. + 1. If |leadingBidInfo|'s [=leading bid info/component seller=] is not null: + 1. [=map/Set=] |browserSignals|["`componentSeller`"] to |leadingBidInfo|'s + [=leading bid info/component seller=]. + 1. If |winner|'s [=generated bid/modified bid=] is not null, [=map/set=] + |browserSignals|["`bid`"] to it. + 1. Otherwise (if |leadingBidInfo|'s [=leading bid info/component seller=] is null), if |winner|'s + [=generated bid/modified bid=] is not null, [=map/set=] |browserSignals|["`modifiedBid`"] to it. + 1. Set |config| to |leadingBidInfo|'s [=leading bid info/auction config=]. 1. Let |sellerReportingScript| be the result of [=fetching script=] with |config|'s [=auction config/decision logic url=]. - 1. Let « |sellerSignals|, |reportUrl|, |reportingBeaconMap| » be the result of - [=evaluating a reporting script=] with |sellerReportingScript|, "`reportResult`", and - « |config|'s [=auction config/config idl=], |browserSignals| ». - 1. Let |reportingResult| be a [=reporting result=] with the following [=struct/items=]: + 1. Let « |sellerSignals|, |reportUrl|, |reportingBeaconMap| » be the result of [=evaluating a + reporting script=] with |sellerReportingScript|, "`reportResult`", and « |config|, + |browserSignals|». + 1. Let |reportingResult| be a [=reporting result=] with the following [=struct/items=]: : [=reporting result/report url=] :: |reportUrl| @@ -1809,61 +1794,70 @@ null |winningComponentConfig|: [=leading bid info/component seller reporting result=] to |reportingResult|. 1. Otherwise, set |leadingBidInfo|'s [=leading bid info/seller reporting result=] to |reportingResult|. - 1. [=map/Remove=] |browserSignals|["`desirability`"]. + 1. [=map/Remove=] |browserSignals|["`dataVersion`"]. 1. [=map/Remove=] |browserSignals|["`modifiedBid`"]. 1. [=map/Remove=] |browserSignals|["`topLevelSellerSignals`"]. - 1. [=map/Remove=] |browserSignals|["`dataVersion`"]. - - Note: Remove fields specific to {{ReportResultBrowserSignals}} which only sellers can learn about, - so that they are not passed to "`reportWin()`". - 1. TODO: Store |reportUrl| and |reportingBeaconMap| in [=fenced frame config=] as appropriate. 1. Return « |sellerSignals|, |browserSignals| ».
-To report win given a [=leading bid info=] |leadingBidInfo|, a [=string=] |sellerSignals| -and a {{ReportingBrowserSignals}} |browserSignals|: +To report win given a [=leading bid info=] |leadingBidInfo|, a [=string=] +|sellerSignals| and an [=ordered map=] |browserSignals| whose [=map/keys=] are [=strings=] and whose +[=map/values=] are {{any}}: 1. Let |config| be |leadingBidInfo|'s [=leading bid info/auction config=]. 1. Let |winner| be |leadingBidInfo|'s [=leading bid info/leading bid=]. 1. Let |perBuyerSignals| be |config|'s [=auction config/per buyer signals=]. 1. Let |buyer| be |winner|'s [=generated bid/interest group=]'s [=interest group/owner=]. + 1. Let |sellerCurrency| be |config|'s [=auction config/seller currency=]. + 1. Let |perBuyerCurrency| be result of [=looking up per-buyer currency=] with |config| and |buyer|. + 1. Let |serializedPerBuyerCurrency| be the result of [=serializing a currency tag=] applied to |perBuyerCurrency|. 1. Let |perBuyerSignalsForBuyer| be |perBuyerSignals|[|buyer|] if that member [=map/exists=], and null otherwise. - 1. Let |reportWinBrowserSignals| be a {{ReportWinBrowserSignals}} with the members that - are declared on {{ReportingBrowserSignals}} initialized to their values in |browserSignals|. - 1. Let |interestGroupName| be {{undefined}}. - 1. If the result of [=query reporting ID k-anonymity count=] given |winner|'s - [=generated bid/interest group=] and |winner|'s [=generated bid/ad descriptor=]'s - [=ad descriptor/url=] is true: - 1. Set |interestGroupName| to |winner|'s [=generated bid/interest group=] [=interest group/name=]. - 1. Add the following fields to |reportWinBrowserSignals|: -
-
{{ReportWinBrowserSignals/dataVersion}} -
|leadingBidInfo|'s [=leading bid info/bidding data version=] if it is not null, - {{undefined}} otherwise. -
{{ReportWinBrowserSignals/adCost}} -
[=Round a value|Rounded=] |winner|’s [=generated bid/ad cost=] -
{{ReportWinBrowserSignals/seller}} -
[=serialization of an origin|Serialized=] |config|'s [=auction config/seller=] -
{{ReportWinBrowserSignals/madeHighestScoringOtherBid}} -
Set to true if |leadingBidInfo|'s [=leading bid info/highest scoring other bid owner=] is - not null, and |buyer| is [=same origin=] with |leadingBidInfo|'s - [=leading bid info/highest scoring other bid owner=], false otherwise -
{{ReportWinBrowserSignals/interestGroupName}} -
TODO: set this. -
{{ReportWinBrowserSignals/modelingSignals}} -
|winner|'s [=generated bid/modeling signals=] if it is not null, {{undefined}} otherwise - (TODO: noise and bucket this signal) -
+ 1. [=map/Remove=] |browserSignals|["`desirability`"]. + 1. If the result of [=query reporting ID k-anonymity count=] given |winner|'s [=generated bid/interest group=] + + and |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=] is true: + + 1. [=map/Set=] |browserSignals|["`interestGroupName`"] to |winner|'s + [=generated bid/interest group=] [=interest group/name=]. + 1. [=map/Set=] |browserSignals|["`bid`"] to the result of [=rounding a value=] + given |winner|'s [=generated bid/bid=]'s [=bid with currency/value=]. + 1. [=map/Set=] |browserSignals|["`bidCurrency`"] to |serializedPerBuyerCurrency|. + 1. [=map/Set=] |browserSignals|["`madeHighestScoringOtherBid`"] to false. + 1. Let |highestScoringOtherBidOwner| be |leadingBidInfo|'s + [=leading bid info/highest scoring other bid owner=]. + 1. If |highestScoringOtherBidOwner| is not null, and |buyer| is [=same origin=] with + |highestScoringOtherBidOwner|: + 1. [=map/Set=] |browserSignals|["`madeHighestScoringOtherBid`"] to true. + 1. If |sellerCurrency| is null: + 1. [=map/Set=] |browserSignals|["`highestScoringOtherBid`"] to the result of [=rounding a value=] + given |leadingBidInfo|'s [=leading bid info/highest scoring other bid=]'s [=generated bid/bid=]'s + [=bid with currency/value=] (or 0 if encountered a null). + 1. [=map/Set=] |browserSignals|["`highestScoringOtherBidCurrency`"] to "`???`". + 1. Otherwise: + 1. [=map/Set=] |browserSignals|["`highestScoringOtherBid`"] to |leadingBidInfo|'s + [=leading bid info/highest scoring other bid=]'s [=generated bid/bid in seller currency=] (or + 0 if encountered a null). (TODO: This get rounded). + 1. [=map/Set=] |browserSignals|["`highestScoringOtherBidCurrency`"] to |sellerCurrency|. + 1. If |leadingBidInfo|'s [=leading bid info/bidding data version=] is not null: + 1. [=map/Set=] |browserSignals|["`dataVersion`"] to |leadingBidInfo|'s + [=leading bid info/bidding data version=]. + 1. [=map/Set=] |browserSignals|["`adCost`"] to |winner|'s [=generated bid/ad cost=]. + 1. [=map/Set=] |browserSignals|["`seller`"] to |config|'s [=auction config/seller=]. + 1. If |leadingBidInfo|'s [=leading bid info/top level seller=] is not null: + 1. [=map/Set=] |browserSignals|["`topLevelSeller`"] to |leadingBidInfo|'s + [=leading bid info/top level seller=]. + 1. If |winner|'s [=generated bid/modeling signals=] is not null: + 1. [=map/Set=] |browserSignals|["`modelingSignals`"] to |winner|'s + [=generated bid/modeling signals=]. 1. Let |buyerReportingScript| be the result of [=fetching script=] with |winner|'s [=generated bid/interest group=]'s [=interest group/bidding url=]. 1. Let « ignored, |resultUrl|, |reportingBeaconMap| » be the result of [=evaluating a - reporting script=] with |buyerReportingScript|, "`reportWin`", and - « |leadingBidInfo|'s [=leading bid info/auction config=]'s [=auction config/config idl=]'s - {{AuctionAdConfig/auctionSignals}}, |perBuyerSignalsForBuyer|, |sellerSignals|, - |reportWinBrowserSignals| ». + reporting script=] with |buyerReportingScript|, "`reportWin`", and « |leadingBidInfo|'s + [=leading bid info/auction config=]'s [=auction config/auction signals=], + |perBuyerSignalsForBuyer|, |sellerSignals|, |browserSignals| ». 1. Set |leadingBidInfo|'s [=leading bid info/buyer reporting result=] to a [=reporting result=] with the following [=struct/items=]: : [=reporting result/report url=] @@ -2179,11 +2173,8 @@ of the following global objects: 1. Let |realm| be the result of [=creating a new script runner realm=] given {{InterestGroupReportingScriptRunnerGlobalScope}}. 1. Let |global| be |realm|'s [=realm/global object=]. - 1. Let |argumentsJS| be the result of [=converting a Web IDL arguments list to an ECMAScript - arguments list|converting=] |arguments| to an ECMAScript arguments list. If this - [=exception/throws=] an exception, return « "null", null, null ». 1. Let |result| be the result of [=evaluating a script=] with |realm|, |script|, - |functionName|, |argumentsJS|, and 50 milliseconds. + |functionName|, |arguments|, and 50 milliseconds. 1. If |result| is an [=ECMAScript/abrupt completion=], return « "null", null, null ». 1. Let |resultJSON| be "null". 1. If |functionName| is "`reportResult`", then set |resultJSON| to the result of @@ -2791,103 +2782,6 @@ Note: {{ScoringBrowserSignals}}'s {{ScoringBrowserSignals/adComponents}} is {{un [=generated bid/ad component descriptors=] is null or [=list/is empty|an empty list=]. It cannot be an [=list/is empty|empty list=]. - - -dictionary ReportingBrowserSignals { - required DOMString topWindowHostname; - required USVString interestGroupOwner; - required USVString renderURL; - required double bid; - required double highestScoringOtherBid; - - DOMString bidCurrency; - DOMString highestScoringOtherBidCurrency; - USVString topLevelSeller; - USVString componentSeller; -}; - - -{{ReportingBrowserSignals}} includes browser signals both `reportResult()` and `reportWin()` get. -
-
{{ReportingBrowserSignals/topWindowHostname}} -
[=environment/Top-level origin=]'s [=origin/host=] -
{{ReportingBrowserSignals/interestGroupOwner}} -
The winning [=interest group=]'s [=interest group/owner=]. -
{{ReportingBrowserSignals/renderURL}} -
The render URL returned by "`generateBid()`". It is - [=query reporting ID k-anonymity count|k-anonymous=] -
{{ReportingBrowserSignals/bid}} -
[=round a value|Stochastically rounded=] winning bid. This is always in the bidder's own - currency -
{{ReportingBrowserSignals/highestScoringOtherBid}} -
The [=round a value|stochastically rounded value=] of the bid that got the second highest score, or 0 if it's - - not available. 0 for top-level auctions with components -
{{ReportingBrowserSignals/bidCurrency}} -
The currency the {{ReportingBrowserSignals/bid}} is in -
{{ReportingBrowserSignals/highestScoringOtherBidCurrency}} -
The currency the {{ReportingBrowserSignals/highestScoringOtherBid}} is in -
{{ReportingBrowserSignals/topLevelSeller}} -
Copied from [=leading bid info/top level seller=] -
{{ReportingBrowserSignals/componentSeller}} -
Copied from [=leading bid info/component seller=] -
- - - -dictionary ReportResultBrowserSignals : ReportingBrowserSignals { - required double desirability; - - DOMString topLevelSellerSignals; - double modifiedBid; - unsigned long dataVersion; -}; - - -
-
{{ReportResultBrowserSignals/desirability}} -
The [=round a value|stochastically rounded value=] of the score returned by "`scoreAd()`" for - the winning bid -
{{ReportResultBrowserSignals/topLevelSellerSignals}} -
Metadata returned by the top-level seller's "`reportResult()`", as JSON -
{{ReportResultBrowserSignals/modifiedBid}} -
The [=round a value|stochastically rounded value=] of the bid value returned by the component - seller's "`scoreAd()`" method -
{{ReportResultBrowserSignals/dataVersion}} -
Set to the value of the [:Data-Version:] header from the trusted - scoring signals server, if any. -
- - - -dictionary ReportWinBrowserSignals : ReportingBrowserSignals { - double adCost; - USVString seller; - boolean madeHighestScoringOtherBid; - DOMString interestGroupName; - unsigned short modelingSignals; - unsigned long dataVersion; -}; - - -
-
{{ReportWinBrowserSignals/adCost}} -
[=round a value|Stochastically rounded=] winner's [=generated bid/ad cost=]. -
{{ReportWinBrowserSignals/seller}} -
The origin of the seller running the ad auction -
{{ReportWinBrowserSignals/madeHighestScoringOtherBid}} -
True if the interest group owner was the only bidder that made bids with the second highest - score -
{{ReportWinBrowserSignals/interestGroupName}} -
Only set if the tuple of interest group owner, name, bidding script URL and ad creative URL - were [=query reporting ID k-anonymity count|jointly k-anonymous=] -
{{ReportWinBrowserSignals/modelingSignals}} -
A 0-4095 integer (12-bits) passed to `reportWin()`, with noising -
{{ReportWinBrowserSignals/dataVersion}} -
Only set if the Data-Version header was provided in the response headers from the trusted - bidding signals server -
-

Interest group

An interest group is a [=struct=] with the following [=struct/items=]: @@ -3234,8 +3128,8 @@ the seller. [=interest group/ad components=] field. : ad cost :: Null or a {{double}}. Advertiser click or conversion cost passed from `generateBid()` to - `reportWin()`. Negative values will be ignored and not passed. Will be - [=round a value|stochastically rounded=] when passed. + `reportWin()`. Invalid values, such as negative, infinite, and NaN values, will be ignored and not + passed. Only the lowest 12 bits will be passed. : modeling signals :: Null or an {{unsigned short}}. A 0-4095 integer (12-bits) passed to `reportWin()`, with noising. : interest group From 1bfdd25d5b95f7452b7d0a8f9a946b9f114c4ea2 Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Tue, 18 Jul 2023 09:41:01 -0400 Subject: [PATCH 2/5] Revert "Fix a number of imprecisions in GenerateBidOutput handling: (#664)" This reverts commit 66cc6c278ed3ee179a79f7a068b11a8d793bda7f. --- spec.bs | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/spec.bs b/spec.bs index d6e9a4b12..623d51c24 100644 --- a/spec.bs +++ b/spec.bs @@ -2141,9 +2141,11 @@ of the following global objects: 1. Let |generatedBidIDL| be the result of [=converted to an IDL value|converting=] |result|'s \[[Value]] to a {{GenerateBidOutput}}. 1. If no exception was [=exception/thrown=] in the previous step: - 1. Set |generatedBid| to the result of [=converting GenerateBidOutput to generated bid=] with |generatedBidIDL|, |ig|, |expectedCurrency|, |isComponentAuction|, and |global|'s [=InterestGroupBiddingScriptRunnerGlobalScope/group has ad components=]. - 1. Otherwise, set |generatedBid| to failure. - 1. If |generatedBid| is a [=generated bid=] and |generatedBid|'s [=generated bid/bid=]'s [=bid with currency/value=] ≤ 0, set |generatedBid| to failure. + 1. Let |groupHasAdComponents| be true. + 1. If |ig|'s [=interest group/ad components=] is null, set |groupHasAdComponents| be false. + 1. Let |possibleGeneratedBid| be the result of [=converting GenerateBidOutput to generated bid=] + with |generatedBidIDL|, |ig|, |expectedCurrency|, |isComponentAuction|, and |groupHasAdComponents|. + 1. If |possibleGeneratedBid| is not failure, set |generatedBid| to it. 1. If |generatedBid| is null, set it to failure. 1. If |generatedBid| is not failure: 1. Set |generatedBid|'s [=generated bid/bid duration=] to |duration|. @@ -2259,25 +2261,26 @@ interface InterestGroupScriptRunnerGlobalScope { InterestGroupBiddingScriptRunnerGlobalScope)] interface InterestGroupBiddingScriptRunnerGlobalScope : InterestGroupScriptRunnerGlobalScope { - boolean setBid(optional GenerateBidOutput generateBidOutput = {}); + boolean setBid(); + boolean setBid(GenerateBidOutput generateBidOutput); undefined setPriority(double priority); undefined setPrioritySignalsOverride(DOMString key, double priority); }; dictionary AdRender { required DOMString url; - DOMString width; - DOMString height; + required DOMString width; + required DOMString height; }; dictionary GenerateBidOutput { - double bid = -1; + required double bid; DOMString bidCurrency; - (DOMString or AdRender) render; + required (DOMString or AdRender) render; any ad; sequence<(DOMString or AdRender)> adComponents; double adCost; - unrestricted double modelingSignals; + double modelingSignals; boolean allowComponentAuction = false; }; @@ -2302,20 +2305,24 @@ Each {{InterestGroupBiddingScriptRunnerGlobalScope}} has a +
+ The setBid() method steps are: + + 1. Set [=this=]'s [=relevant global object=]'s [=InterestGroupBiddingScriptRunnerGlobalScope/bid=] + to null. + 1. Return true. +
To convert GenerateBidOutput to generated bid given a {{GenerateBidOutput}} |generateBidOutput|, an [=interest group=] |ig|, a [=currency tag=] |expectedCurrency|, a [=boolean=] |isComponentAuction| and a [=boolean=] |groupHasAdComponents|: - 1. Let |bid| be a new [=generated bid=]. - 1. If |generateBidOutput|["{{GenerateBidOutput/bid}}"] ≤ 0: - 1. Set |bid|'s [=generated bid/bid=] to a [=bid with currency=] with [=bid with currency/value=] |generateBidOutput|["{{GenerateBidOutput/bid}}"] and [=bid with currency/currency=] null. - 1. Return |bid|. - 1. If |generateBidOutput|["{{GenerateBidOutput/render}}"] does not [=map/exist=], return failure. + 1. If |generateBidOutput|["{{GenerateBidOutput/bid}}"] is less than or equal to 0, return failure. 1. If |isComponentAuction| is true, and |generateBidOutput|["{{GenerateBidOutput/allowComponentAuction}}"] is false: 1. Return failure. + 1. Let |bid| be a new [=generated bid=]. 1. Let |bidCurrency| be null. 1. If |generateBidOutput|["{{GenerateBidOutput/bidCurrency}}"] is specified: 1. If the result of [=checking whether a string is a valid currency tag=] on @@ -2367,8 +2374,8 @@ To convert GenerateBidOutput to generated bid given a {{GenerateBidOu |generateBidOutput|["{{GenerateBidOutput/adCost}}"]. 1. If |generateBidOutput|["{{GenerateBidOutput/modelingSignals}}"] [=map/exists=]: 1. Let |modelingSignals| be |generateBidOutput|["{{GenerateBidOutput/modelingSignals}}"]. - 1. If |modelingSignals| ≥ 0 and |modelingSignals| < 4096: - 1. Set |bid|'s [=generated bid/modeling signals=] to the result of [=converted to an IDL value|converting=] the ECMAScript value represented by |modelingSignals| to an {{unsigned short}}. + 1. If |modelingSignals| is greater than or equal to 0 and less than 4096: + 1. Set |bid|'s [=generated bid/modeling signals=] to |modelingSignals|. 1. Return |bid|.
@@ -2396,6 +2403,7 @@ To convert GenerateBidOutput to generated bid given a {{GenerateBidOu To convert an ad render given an {{AdRender}} |adRender|, an [=interest group=] |ig|, and a [=boolean=] |isComponent|: + 1. If |adRender|["{{AdRender/url}}"] does not [=map/exist=], return false. 1. Let |adUrl| be the result of running the [=URL parser=] on |adRender|["{{AdRender/url}}"]. 1. If |adUrl| is failure, return failure. 1. If [=validating an ad url=] given |adUrl|, |ig|, and |isComponent| returns false, return failure. @@ -2445,9 +2453,10 @@ To convert GenerateBidOutput to generated bid given a {{GenerateBidOu [=InterestGroupBiddingScriptRunnerGlobalScope/is component auction=], and [=this=]'s [=relevant global object=]'s [=InterestGroupBiddingScriptRunnerGlobalScope/group has ad components=]. - 1. If |bidToSet| is failure, [=exception/throw=] a {{TypeError}}. + 1. If |bidToSet| is failure, return false. 1. Set [=this=]'s [=relevant global object=]'s [=InterestGroupBiddingScriptRunnerGlobalScope/bid=] to |bidToSet|. + 1. Return true.
From 6695a6acca6f88c564367672e33fa5a03c7555ae Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Tue, 18 Jul 2023 09:47:08 -0400 Subject: [PATCH 3/5] Remove advisement anchor --- spec.bs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spec.bs b/spec.bs index 623d51c24..6cc5e7257 100644 --- a/spec.bs +++ b/spec.bs @@ -2073,10 +2073,6 @@ execution environment. In particular, they: 1. If !|global|.\[[HasProperty]]("`Temporal`") is true, then perform !|global|.\[[Delete]]("`Temporal`"). - Advisement: This is not the best way to perform such API neutering (see tc39/ecma262#1357), - but at the moment it's the way that host environments do this. - Note: Removing time-referencing APIs from the |global| object is imperative for privacy, as a script might otherwise be able to more easily exfiltrate data by using more accurate time measurements. From 70d9782efe4f3888200e5ae9601dbbc7cb45b770 Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Tue, 18 Jul 2023 09:50:51 -0400 Subject: [PATCH 4/5] Remove more anchors --- spec.bs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/spec.bs b/spec.bs index 6cc5e7257..273d5abbc 100644 --- a/spec.bs +++ b/spec.bs @@ -153,9 +153,6 @@ a user accessible to `generateBid()` methods, otherwise. The joinAdInterestGroup(|group|) method steps are:
-Temporarily, Chromium does not include the required keyword -for {{GenerateBidInterestGroup/lifetimeMs}}, and instead starts this algorithm with the step - 1. If |group|["{{GenerateBidInterestGroup/lifetimeMs}}"] does not [=map/exist=], throw a {{TypeError}}. This is detectable because it can change the set of fields that are read from the argument when a @@ -1700,9 +1697,6 @@ To build trusted scoring signals url given a [=URL=] |signalsUrl|, an To serialize an integer, represent it as a string of the shortest possible decimal number. -Issue: This would ideally be replaced by a more descriptive algorithm in Infra. See -infra/201 -
@@ -1995,7 +1989,7 @@ threshold when responding to [=query k-anonymity count=]. *This introduction sub-section is non-normative*. This specification defines a new type of script execution environment called a [=script runner=]. On -the surface, these are similar to Worklets +the surface, these are similar to in that they too are used for running scripts independent of the *main* execution environment with a flexible implementation model. From 4f839f6801cc84501b320ddd60fbc4f55b70e2a5 Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Tue, 18 Jul 2023 10:09:10 -0400 Subject: [PATCH 5/5] Replace a bunch of anchors --- spec.bs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/spec.bs b/spec.bs index 273d5abbc..4184f76f8 100644 --- a/spec.bs +++ b/spec.bs @@ -2205,12 +2205,10 @@ of the following global objects: 1. Let |evaluationStatus| be the result of [$ScriptEvaluation$](result). - 1. If |evaluationStatus| is an [=ECMAScript/abrupt completion=], jump to the step labeled return. + 1. If |evaluationStatus| is an [=ECMAScript/abrupt completion=], jump to the step labeled test. 1. Let |F| be [$Get$](|global|, |functionName|). If that returns a [=ECMAScript/throw completion=], - set |finalCompletion| to |F| and jump to the step labeled return. + set |finalCompletion| to |F| and jump to the step labeled test. 1. Set |finalCompletion| be [=ECMAScript/Completion Record|Completion=]([$Call$](F, `undefined`, |arguments|)). @@ -2616,20 +2614,20 @@ The updateAdInterestGroups() method steps are:
1. If |value| is a {{double}}, set |ig|'s [=interest group/priority=] to |value|. - 1. Otherwise, jump to the step labeled Abort update. + 1. Otherwise, jump to the step labeled test.
"`enableBiddingSignalsPrioritization`"
1. If |value| is a {{boolean}}, set |ig|'s [=interest group/enable bidding signals prioritization=] to |value|. - 1. Otherwise, jump to the step labeled Abort update. + 1. Otherwise, jump to the step labeled test.
"`priorityVector`"
1. If |value| is null or an [=ordered map=] whose [=map/keys=] are [=strings=] and whose [=map/values=] are {{double}}, set |ig|'s [=interest group/priority vector=] to |value|. - 1. Otherwise, jump to the step labeled Abort update. + 1. Otherwise, jump to the step labeled test.
"`prioritySignalsOverrides`"
@@ -2638,13 +2636,13 @@ The updateAdInterestGroups() method steps are: 1. [=map/For each=] |pvKey| → |pvValue| of |value|: 1. If |pvValue| is null, [=map/remove=] |ig|'s [=interest group/priority signals overrides=][|pvKey|]. 1. Otherwise, [=map/set=] |ig|'s [=interest group/priority signals overrides=][|pvKey|] to |pvValue|. - 1. Otherwise, jump to the step labeled Abort update. + 1. Otherwise, jump to the step labeled test.
"`executionMode`"
1. If |value| is "`compatibility`" or "`group-by-origin`", set |ig|'s [=interest group/execution mode=] to |value|. - 1. Otherwise, jump to the step labeled Abort update. + 1. Otherwise, jump to the step labeled test.
"`biddingLogicURL`"
"`biddingWasmHelperURL`" @@ -2673,7 +2671,7 @@ The updateAdInterestGroups() method steps are: 1. Let |parsedURL| be the result of running the [=URL parser=] on |value|. 1. If |key| is not |groupMember|, [=iteration/continue=]. - 1. Jump to the step labeled Abort update + 1. Jump to the step labeled test. if any of the following conditions hold: * |parsedURL| is failure; * |parsedURL|'s [=url/origin=] is not [=same origin=] with |ig|'s @@ -2686,7 +2684,7 @@ The updateAdInterestGroups() method steps are:
1. If |value| is a [=list=] of [=strings=], set |ig|'s [=interest group/trusted bidding signals keys=] to |value|. - 1. Otherwise, jump to the step labeled Abort update. + 1. Otherwise, jump to the step labeled test.
"`ads`"
"`adComponents`" @@ -2705,12 +2703,12 @@ The updateAdInterestGroups() method steps are: 1. If |key| is not |groupMember|, [=iteration/continue=]. 1. If |value| is not a [=list=] of {{AuctionAd}}, jump to the step - labeled Abort update. + labeled test. 1. [=list/For each=] |ad| of |value|: 1. Let |igAd| be a new [=interest group ad=]. 1. Let |renderURL| be the result of running the [=URL parser=] on |ad|["{{AuctionAd/renderURL}}"]. - 1. Jump to the step labeled Abort update + 1. Jump to the step labeled test. if any of the following conditions hold: * |renderURL| is failure; * |renderURL| [=url/scheme=] is not "`https`"; @@ -2720,7 +2718,7 @@ The updateAdInterestGroups() method steps are: |igAd|'s [=interest group ad/metadata=] be the result of [=serializing a JavaScript value to a JSON string=], given |ad|["{{AuctionAd/metadata}}"]. If this [=exception/throws=], jump to the step - labeled Abort update. + labeled test. 1. [=list/Append=] |igAd| to |ig|'s |interestGroupField|.