Skip to content

Commit

Permalink
Add clearOriginJoinedAdInterestGroup to spec.bs (#844)
Browse files Browse the repository at this point in the history
* Add clearOriginJoinedAdInterestGroup to spec.bs

This adds the explainer changes from explainer PR #829 / issue  #475 to the spec.

* Update spec.bs

Some cleanups - more likely to follow.

* Update spec.bs

* Update spec.bs

* Update spec.bs

Fix error?

* Update spec.bs

* Update spec.bs

* Update spec.bs

* Update spec.bs

* Update spec.bs

* Update spec.bs

* Update spec.bs

* Update spec.bs

* Update spec.bs

* Update spec.bs
  • Loading branch information
MattMenke2 authored Oct 26, 2023
1 parent 07960ec commit dd1e801
Showing 1 changed file with 53 additions and 3 deletions.
56 changes: 53 additions & 3 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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=],
Expand Down Expand Up @@ -565,6 +565,8 @@ integer |maxIgs|:

<h2 id="leaving-interest-groups">Leaving Interest Groups</h2>

<h3 id="leaveadinterestgroup">leaveAdInterestGroup()</h3>

*This first introductory paragraph is non-normative.*

{{Window/navigator}}.{{Navigator/leaveAdInterestGroup()}} removes a user from a particular interest
Expand Down Expand Up @@ -608,15 +610,15 @@ The <dfn for=Navigator method>leaveAdInterestGroup(group)</dfn> 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}}.
1. Run these steps [=in parallel=]:
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
Expand All @@ -625,6 +627,54 @@ The <dfn for=Navigator method>leaveAdInterestGroup(group)</dfn> method steps are

</div>

<h3 id="clearoriginjoinedAdInterestGroups">clearOriginJoinedAdInterestGroups()</h3>

*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=].


<xmp class="idl">
[SecureContext]
partial interface Navigator {
Promise<undefined> clearOriginJoinedAdInterestGroups(
USVString owner, optional sequence<USVString> interestGroupsToKeep = []);
};
</xmp>

<div algorithm>

The <dfn for=Navigator method>clearOriginJoinedAdInterestGroups(|owner|, |interestGroupsToKeep|)</dfn>
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|.

</div>

<h2 id="running-ad-auctions">Running Ad Auctions</h2>

*This first introductory paragraph is non-normative.*
Expand Down

0 comments on commit dd1e801

Please sign in to comment.