Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arichiv committed Mar 18, 2024
1 parent 523b017 commit 8382285
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Complain About: accidental-2119 true

<pre class=link-defaults>
spec:html; type:dfn; for:site; text:same site
spec:url; type:interface; text:URL
</pre>
<pre class="anchors">
spec: html; urlPrefix: https://html.spec.whatwg.org/
Expand Down Expand Up @@ -49,6 +50,11 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
spec: file-system; urlPrefix: https://fs.spec.whatwg.org/
type: dfn
text: File System; url:
spec: file-api; urlPrefix: https://www.w3.org/TR/FileAPI/
type: dfn
text: File API; url:
text: createObjectURL; url: #dfn-createObjectURL
text: revokeObjectURL; url: #dfn-revokeObjectURL
</pre>

<pre class=biblio>
Expand Down Expand Up @@ -122,6 +128,8 @@ dictionary StorageAccessTypes {
boolean caches = false;
boolean getDirectory = false;
boolean estimate = false;
boolean createObjectURL = false;
boolean revokeObjectURL = false;
};

interface StorageAccessHandle {
Expand All @@ -132,6 +140,8 @@ interface StorageAccessHandle {
readonly attribute CacheStorage caches;
Promise&lt;FileSystemDirectoryHandle> getDirectory();
Promise&lt;StorageEstimate> estimate();
DOMString createObjectURL((Blob or MediaSource) obj);
undefined revokeObjectURL(DOMString url);
};

partial interface Document {
Expand All @@ -152,7 +162,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`:
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`:
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 @@ -249,9 +259,19 @@ When invoked on {{StorageAccessHandle}} |handle| with {{StorageAccessTypes}} |ty
1. [=/Resolve=] |p| with |e|.
1. Return |p|.

<h4 id="file-api">File API</h4>
<h4 id="file-api">[=File API=]</h4>

TBD
When invoked on {{StorageAccessHandle}} |handle| with {{StorageAccessTypes}} |types|, {{Document}} |docForSAA|, and {{Blob}} or {{MediaSource}} |obj|, the <dfn export getter for=StorageAccessHandle><code>createObjectURL</code></dfn> getter must run these steps:

1. If |types|.{{StorageAccessTypes/all}} is `false` and |types|.{{StorageAccessTypes/createObjectURL}} is `false`:
1. Throw an "{{InvalidStateError}}" {{DOMException}}.
1. Return the invocation of [=/createObjectURL=] on |docForSAA|.{{URL}} with |obj|.

When invoked on {{StorageAccessHandle}} |handle| with {{StorageAccessTypes}} |types|, {{Document}} |docForSAA|, and {{DOMString}} |url|, the <dfn export getter for=StorageAccessHandle><code>revokeObjectURL</code></dfn> getter must run these steps:

1. If |types|.{{StorageAccessTypes/all}} is `false` and |types|.{{StorageAccessTypes/revokeObjectURL}} is `false`:
1. Throw an "{{InvalidStateError}}" {{DOMException}}.
1. Return the invocation of [=/revokeObjectURL=] on |docForSAA|.{{URL}} with |url|.

<h4 id="broadcast-channel">Broadcast Channel</h4>

Expand Down

0 comments on commit 8382285

Please sign in to comment.