Skip to content

Commit

Permalink
Merge pull request #203 from WICG/yao-expose-igs-spec
Browse files Browse the repository at this point in the history
[spec] Add interestGroups()
  • Loading branch information
xyaoinum authored Nov 5, 2024
2 parents a514c97 + 5924478 commit 0288370
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,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 @@ -747,6 +755,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 @@ -774,6 +784,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

0 comments on commit 0288370

Please sign in to comment.