From 4451cb3bd8dde7a1027c442367c6422dcb53218e Mon Sep 17 00:00:00 2001 From: Ari Chivukula Date: Tue, 19 Mar 2024 13:04:04 -0400 Subject: [PATCH] Add SharedWorkers to spec This is the final part for the initial draft --- spec.bs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec.bs b/spec.bs index fcb0a41..0c2b914 100644 --- a/spec.bs +++ b/spec.bs @@ -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 @@ -134,6 +135,7 @@ dictionary StorageAccessTypes { boolean createObjectURL = false; boolean revokeObjectURL = false; boolean BroadcastChannel = false; + boolean SharedWorker = false; }; interface StorageAccessHandle { @@ -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 { @@ -169,7 +172,7 @@ For now {{Document/hasStorageAccess()}} is not considered deprecated, but that < When invoked on {{Document}} |doc|, the requestStorageAccess(types) 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. @@ -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|. -

Shared Worker

+

[=Shared Workers=]

TBD