Skip to content

Commit

Permalink
Add SharedWorkers to spec
Browse files Browse the repository at this point in the history
This is the final part for the initial draft
  • Loading branch information
arichiv authored Mar 19, 2024
1 parent cf22ecd commit 4451cb3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/
text: localStorage; url: #dom-localstorage
text: broadcast channel; url: #broadcasting-to-other-browsing-contexts
text: new broadcastchannel; url: #dom-broadcastchannel
text: shared workers; url: #shared-workers-and-the-sharedworker-interface
spec: storage-access; urlPrefix: https://privacycg.github.io/storage-access/
type: dfn
for: environment
Expand Down Expand Up @@ -134,6 +135,7 @@ dictionary StorageAccessTypes {
boolean createObjectURL = false;
boolean revokeObjectURL = false;
boolean BroadcastChannel = false;
boolean SharedWorker = false;
};

interface StorageAccessHandle {
Expand All @@ -147,6 +149,7 @@ interface StorageAccessHandle {
DOMString createObjectURL((Blob or MediaSource) obj);
undefined revokeObjectURL(DOMString url);
BroadcastChannel BroadcastChannel(DOMString name);
SharedWorker SharedWorker(USVString scriptURL, optional (DOMString or SharedWorkerOptions) options = {});
};

partial interface Document {
Expand All @@ -169,7 +172,7 @@ For now {{Document/hasStorageAccess()}} is not considered deprecated, but that <
When invoked on {{Document}} |doc|, the <dfn export method for=Document><code>requestStorageAccess(types)</code></dfn> method must run these steps:

1. Let |p| be [=a new promise=].
1. If |types|.{{StorageAccessTypes/all}} is `false` and |types|.{{StorageAccessTypes/cookies}} is `false` and |types|.{{StorageAccessTypes/sessionStorage}} is `false` and |types|.{{StorageAccessTypes/localStorage}} is `false` and |types|.{{StorageAccessTypes/indexedDB}} is `false` and |types|.{{StorageAccessTypes/locks}} is `false` and |types|.{{StorageAccessTypes/caches}} is `false` and |types|.{{StorageAccessTypes/getDirectory}} is `false` and |types|.{{StorageAccessTypes/estimate}} is `false` and |types|.{{StorageAccessTypes/createObjectURL}} is `false` and |types|.{{StorageAccessTypes/revokeObjectURL}} is `false` and |types|.{{StorageAccessTypes/BroadcastChannel}} is `false`:
1. If |types|.{{StorageAccessTypes/all}} is `false` and |types|.{{StorageAccessTypes/cookies}} is `false` and |types|.{{StorageAccessTypes/sessionStorage}} is `false` and |types|.{{StorageAccessTypes/localStorage}} is `false` and |types|.{{StorageAccessTypes/indexedDB}} is `false` and |types|.{{StorageAccessTypes/locks}} is `false` and |types|.{{StorageAccessTypes/caches}} is `false` and |types|.{{StorageAccessTypes/getDirectory}} is `false` and |types|.{{StorageAccessTypes/estimate}} is `false` and |types|.{{StorageAccessTypes/createObjectURL}} is `false` and |types|.{{StorageAccessTypes/revokeObjectURL}} is `false` and |types|.{{StorageAccessTypes/BroadcastChannel}} is `false` and |types|.{{StorageAccessTypes/SharedWorker}} is `false`:
1. [=/Reject=] |p| with an "{{InvalidStateError}}" {{DOMException}}.
1. Return |p|.
1. Let |requestUnpartitionedCookieAccess| be `true` if |types|.{{StorageAccessTypes/all}} is `true` or |types|.{{StorageAccessTypes/cookies}} is `true`, and `false` otherwise.
Expand Down Expand Up @@ -289,7 +292,7 @@ When invoked on {{StorageAccessHandle}} |handle| with {{StorageAccessTypes}} |ty
1. Throw an "{{InvalidStateError}}" {{DOMException}}.
1. Return the invocation of [=new BroadcastChannel=] with |name|.

<h4 id="shared-worker">Shared Worker</h4>
<h4 id="shared-worker">[=Shared Workers=]</h4>

TBD

Expand Down

0 comments on commit 4451cb3

Please sign in to comment.