Skip to content

Commit

Permalink
Add clearOriginJoinedAdInterestGroup to spec.bs
Browse files Browse the repository at this point in the history
This adds the explainer changes from explainer PR WICG#829 / issue  WICG#475 to the spec.
  • Loading branch information
MattMenke2 committed Oct 5, 2023
1 parent ae53482 commit e6f9c9d
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ To <dfn>build an interest group permissions url</dfn> given a [=origin=] |ownerO

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

<h3 id="leaveadinterestgroup">leaveAdInterestGroup</h3>
{{Window/navigator}}.{{Navigator/leaveAdInterestGroup()}} removes a user from a particular interest
group.

Expand Down Expand Up @@ -509,6 +510,49 @@ are:

</div>

<h3 id="clearoriginjoinedAdInterestGroups">clearOriginJoinedAdInterestGroups</h3>
{{Window/navigator}}.{{Navigator/clearOriginJoinedAdInterestGroups()}} removes a user from
[=interest groups=] with the current page's [=interest group/joining 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(group)</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. If [=this=]'s [=relevant global object=]'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 |owner| be the result of [=parsing an https origin=] with |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.
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|, [=interest group/joining origin=] is [=this=]'s
[=relevant settings object=]'s [=environment/top-level origin=], and
[=interest group/name=] is not in |interestGroupsToKeep|.
1. Return |p|.

</div>

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

When a website or someone working on behalf of the website (e.g. a supply side platform, SSP) wants
Expand Down

0 comments on commit e6f9c9d

Please sign in to comment.