diff --git a/spec.bs b/spec.bs index 997642c9..aa2cac30 100644 --- a/spec.bs +++ b/spec.bs @@ -346,7 +346,7 @@ This is detectable because it can change the set of fields that are read from th 1. Let |permission| be the result of [=checking interest group permissions=] with |interestGroup|'s [=interest group/owner=], |frameOrigin|, and "`join`". 1. If |permission| is false, then [=queue a task=] to [=reject=] |p| with a - "{{NotAllowedError}}" {{DOMException}} and do not run the remaining steps. + "{{NotAllowedError}}" {{DOMException}} and abort these steps. 1. [=Queue a task=] to [=resolve=] |p| with `undefined`. 1. If the browser is currently storing an interest group with `owner` and `name` that matches |interestGroup|, then set the [=interest group/bid counts=], @@ -565,6 +565,8 @@ integer |maxIgs|:

Leaving Interest Groups

+

leaveAdInterestGroup()

+ *This first introductory paragraph is non-normative.* {{Window/navigator}}.{{Navigator/leaveAdInterestGroup()}} removes a user from a particular interest @@ -608,7 +610,7 @@ The leaveAdInterestGroup(group) method steps are "[=join-ad-interest-group=]" [=policy-controlled feature=], then [=exception/throw=] a "{{NotAllowedError}}" {{DOMException}}. - Note: both joining and leaving interest groups use the "join-ad-interest-group" feature. + Note: Both joining and leaving interest groups use the "join-ad-interest-group" feature. 1. Let |owner| be the result of [=parsing an https origin=] with |group|["{{AuctionAdInterestGroupKey/owner}}"]. 1. If |owner| is failure, [=exception/throw=] a {{TypeError}}. @@ -616,7 +618,7 @@ The leaveAdInterestGroup(group) method steps are 1. Let |permission| be the result of [=checking interest group permissions=] with |owner|, |frameOrigin|, and "`leave`". 1. If |permission| is false, then [=queue a task=] to [=reject=] |p| with a - "{{NotAllowedError}}" {{DOMException}} and do not run the remaining steps. + "{{NotAllowedError}}" {{DOMException}} and abort these steps. 1. [=Queue a task=] to [=resolve=] |p| with `undefined`. 1. [=list/Remove=] [=interest groups=] from the [=user agent=]'s [=interest group set=] whose [=interest group/owner=] is |owner| and [=interest group/name=] is @@ -625,6 +627,54 @@ The leaveAdInterestGroup(group) method steps are +

clearOriginJoinedAdInterestGroups()

+ +*This first introductory paragraph is non-normative.* + +{{Window/navigator}}.{{Navigator/clearOriginJoinedAdInterestGroups()}} removes a user from +[=interest groups=] whose [=interest group/joining origin=] is the associated +{{Navigator}}'s [=relevant settings object=]'s [=environment/top-level origin=]. + + + +[SecureContext] +partial interface Navigator { + Promise<undefined> clearOriginJoinedAdInterestGroups( + USVString owner, optional sequence<USVString> interestGroupsToKeep = []); +}; + + +
+ +The clearOriginJoinedAdInterestGroups(|owner|, |interestGroupsToKeep|) +method steps are: + +1. Let |frameOrigin| be [=this=]'s [=relevant settings object=]'s + [=environment settings object/origin=]. +1. [=Assert=] that |frameOrigin| is not an [=opaque origin=] and its [=origin/scheme=] is "`https`". +1. Let |p| be [=a new promise=]. +1. Let |global| be [=this=]'s [=relevant global object=]. +1. If |global|'s [=associated Document=] is not [=allowed to use=] the + "[=join-ad-interest-group=]" [=policy-controlled feature=], then [=exception/throw=] a + "{{NotAllowedError}}" {{DOMException}}. + + Note: Both joining and leaving interest groups use the "join-ad-interest-group" feature. +1. Let |ownerOrigin| be the result of [=parsing an https origin=] with |owner|. +1. If |ownerOrigin| is failure, [=exception/throw=] a {{TypeError}}. +1. Run these steps [=in parallel=]: + 1. Let |permission| be the result of [=checking interest group permissions=] with + |ownerOrigin|, |frameOrigin|, and "`leave`". + 1. If |permission| is false, then [=queue a global task=] on the [=DOM manipulation task source=] + given |global|, [=reject=] |p| with a "{{NotAllowedError}}" {{DOMException}} and abort these steps. + 1. [=Queue a global task=] on the [=DOM manipulation task source=] given |global|, to [=resolve=] |p| + with {{undefined}}. + 1. [=list/Remove=] [=interest groups=] from the [=user agent=]'s [=interest group set=] + whose [=interest group/owner=] is |ownerOrigin|, whose [=interest group/joining origin=] is + |frameOrigin|, and whose [=interest group/name=] is not in |interestGroupsToKeep|. +1. Return |p|. + +
+

Running Ad Auctions

*This first introductory paragraph is non-normative.*