Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spec] Add interestGroups() #203

Merged
merged 4 commits into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ spec: private-aggregation-api; urlPrefix: https://patcg-individual-drafts.github
text: scoping details; url: #privateaggregation-scoping-details
type: interface
text: PrivateAggregation
spec: protected-audience; urlPrefix: https://wicg.github.io/turtledove/
type: dfn
for: PermissionsPolicy
text: run-ad-auction
text: join-ad-interest-group
text: get storage interest groups for owner
type: interface
text: StorageInterestGroup; url: dictdef-storageinterestgroup
spec: fenced-frame; urlPrefix: https://wicg.github.io/fenced-frame/
type: dfn
text: fenced frame; url: the-fencedframe-element
Expand Down Expand Up @@ -736,6 +744,8 @@ Moreover, each {{SharedStorageWorklet}}'s [=global scopes|list of global scopes=

readonly attribute SharedStorage sharedStorage;
readonly attribute PrivateAggregation privateAggregation;

Promise<sequence<StorageInterestGroup>> interestGroups();
};
</xmp>

Expand Down Expand Up @@ -763,6 +773,28 @@ Moreover, each {{SharedStorageWorklet}}'s [=global scopes|list of global scopes=

Issue(151): The "name" and "operationCtor" cannot be missing here given WebIDL. Should just check for default/empty values.

<div algorithm>
The <dfn method for="SharedStorageWorkletGlobalScope">interestGroups()</dfn> method steps are:

1. Let |promise| be a new [=promise=].
1. If the result of running [=SharedStorageWorkletGlobalScope/check whether addModule is finished=] for {{SharedStorage}}'s associated {{SharedStorageWorkletGlobalScope}} is false, return a [=promise rejected=] with a {{TypeError}}.
1. Let |globalObject| be the [=current realm=]'s [=global object=].
1. Let |context| be |globalObject|'s [=Window/browsing context=].
1. If |context| is null, return a [=promise rejected=] with a {{TypeError}}.
1. Let |document| be |context|'s [=active window=]'s [=associated document=].
1. If |document| is not [=fully active=], return a [=promise rejected=] with a {{TypeError}}.
1. Let |workletDataOrigin| be [=current realm=]'s [=realm/settings object=]'s [=environment settings object/origin=].
1. If the result of running [=Is feature enabled in document for origin?=] on "[=PermissionsPolicy/run-ad-auction=]", |document|, and |workletDataOrigin| returns false, then return a [=promise rejected=] with a {{TypeError}}.
1. If the result of running [=Is feature enabled in document for origin?=] on "[=PermissionsPolicy/join-ad-interest-group=]", |document|, and |workletDataOrigin| returns false, then return a [=promise rejected=] with a {{TypeError}}.
1. Run the following steps [=in parallel=]:
1. Let |interestGroups| be the result of running [=get storage interest groups for owner=] given |workletDataOrigin|.
1. If |interestGroups| is failure:
1. [=Queue a global task=] on the [=DOM manipulation task source=], given |realm|'s [=global object=], to [=reject=] |promise| with a {{TypeError}}.
1. Otherwise:
1. [=Queue a global task=] on the [=DOM manipulation task source=], given |realm|'s [=global object=], to [=resolve=] |promise| with |interestGroups|.
1. Return |promise|.
</div>

<div algorithm>
The <dfn for="SharedStorageWorkletGlobalScope">{{SharedStorageWorkletGlobalScope/sharedStorage}} getter</dfn> steps are:

Expand Down