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

Address comments #2 #69

Merged
merged 3 commits into from
Feb 14, 2023
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
42 changes: 21 additions & 21 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,23 @@ To <dfn>open a bucket</dfn> for a |storageKey| given a bucket |name| and optiona

1. Let |bucket| be the [=/storage bucket=] named |name| in |storageKey| or null otherwise.

1. If |bucket| is non-null and |bucket|'s [=bucket expiration=] is less than or equal to now, then:
1. If |bucket| is non-null and |bucket|'s [=StorageBucket/expiration value=] is less than or equal to now, then:

1. Remove |bucket|.

1. Set |bucket| to null.

1. If |bucket| is null, then:

1. Let |bucket| be a new [=/storage bucket=] with name |name|
1. Let |bucket| be a new [=/storage bucket=] with name |name|.

1. Set |bucket|'s [=bucket durability|durability=] to |options|["{{StorageBucketOptions/durability}}"] if it exists.
1. Set |bucket|'s [=StorageBucket/durability value=] to |options|["{{StorageBucketOptions/durability}}"] if it exists.

1. Set |bucket|'s [=bucket quota|quota=] to |quota|.
1. Set |bucket|'s [=StorageBucket/quota value=] to |quota|.

1. If |persisted| is true, set |bucket|'s [=/bucket mode=] to `"persistent"`.

1. Set |bucket|'s [=bucket expiration|expiration=] to |expires|.
1. Set |bucket|'s [=StorageBucket/expiration value|expiration=] to |expires|.

1. Let |storageBucket| be a new {{StorageBucket}}.

Expand All @@ -157,8 +157,8 @@ To <dfn>validate a bucket name</dfn> given string |name|, run the following step

When not null or undefined, {{StorageBucketOptions/durability}} is a hint to the user agent
specifying the desired {{StorageBucket/durability}}. The user agent MAY
create a new {{StorageBucket}} with this [=bucket durability=]. The user agent
MUST NOT modify the [=bucket durability=] of an existing bucket.
create a new {{StorageBucket}} with this [=StorageBucket/durability value=]. The user agent
MUST NOT modify the [=StorageBucket/durability value=] of an existing bucket.

<h3 id="storage-bucket-delete">Deleting a bucket</h3>

Expand Down Expand Up @@ -217,7 +217,7 @@ The <dfn method for="StorageBucketManager">keys()</dfn> method steps are:

1. Let |bucket| be |shelf|'s [=bucket map=][|key|].

1. If |bucket|'s [=bucket expiration=] is less than or equal to now, remove |bucket|.
1. If |bucket|'s [=StorageBucket/expiration value=] is less than or equal to now, remove |bucket|.

1. Otherwise, [=list/append=] |key| to |keys|.

Expand Down Expand Up @@ -307,7 +307,7 @@ The <dfn method for="StorageBucket">persisted()</dfn> method steps are:

<h3 id="storage-bucket-quota">Quota</h3>

A [=/storage bucket=] has a <dfn>bucket quota</dfn>, a number-or-null, initially null.
A [=/storage bucket=] has a <dfn for=StorageBucket>quota value</dfn>, a number-or-null, initially null.
Specifies the upper limit of usage which can be used by the bucket. The user agent MAY further limit
the realized storage space.

Expand Down Expand Up @@ -336,7 +336,7 @@ The <dfn method for="StorageBucket">estimate()</dfn> method steps are:

1. Let |quota| be [=storage quota=] for |shelf|.

1. Set |quota| to |bucket|'s [=bucket quota=] if it is non-null.
1. Set |quota| to |bucket|'s [=StorageBucket/quota value=] if it is non-null.

1. Let |usage| be [=storage usage=] for |bucket|.

Expand All @@ -350,16 +350,16 @@ The <dfn method for="StorageBucket">estimate()</dfn> method steps are:

<aside class="note">

The [=bucket quota=] will be ignored if it exceeds the total amount of space available to the [=/storage shelf=], i.e. site.
The [=StorageBucket/quota value=] will be ignored if it exceeds the total amount of space available to the [=/storage shelf=], i.e. site.
Its intended use is to keep a specific bucket from using up the entire site's storage space.

</aside>

<h3 id="storage-bucket-durability">Durability</h3>

A [=/storage bucket=] has a <dfn>bucket durability</dfn>, a {{StorageBucketDurability}}.
A [=/storage bucket=] has a <dfn for=StorageBucket>durability value</dfn>, a {{StorageBucketDurability}}.
The user agent MAY initialize this value to "{{StorageBucketDurability/strict}}" or
"{{StorageBucketDurability/relaxed}}". The user agent SHOULD ignore the [=bucket durability=]
"{{StorageBucketDurability/relaxed}}". The user agent SHOULD ignore the [=StorageBucket/durability value=]
for operations that otherwise specify durability behavior.

<div algorithm>
Expand All @@ -374,7 +374,7 @@ The <dfn method for="StorageBucket">durability()</dfn> method steps are:

1. If |bucket| has been removed, [=reject=] |p| with an {{InvalidStateError}}.

1. Otherwise, [=/resolve=] |p| with |bucket|'s [=bucket durability=].
1. Otherwise, [=/resolve=] |p| with |bucket|'s [=StorageBucket/durability value=].

1. Return |p|.

Expand All @@ -383,8 +383,8 @@ The <dfn method for="StorageBucket">durability()</dfn> method steps are:
<aside class="note">

The durability reflects whether the user agent will prioritize performance or durability when completing operations on data in the bucket.
Some operations, such as {{IDBTransaction}}s, can specify a durability which will override the [=bucket durability=]. The default
[=bucket durability=] is left to the user agent. Durability can be specified when a bucket is initially created, but not changed later.
Some operations, such as {{IDBTransaction}}s, can specify a durability which will override the [=StorageBucket/durability value=]. The default
[=StorageBucket/durability value=] is left to the user agent. Durability can be specified when a bucket is initially created, but not changed later.
The {{StorageBucket/durability()}} method should report what the user agent will actually do. The value is one of the following:

: "{{StorageBucketDurability/strict}}"
Expand All @@ -396,7 +396,7 @@ The {{StorageBucket/durability()}} method should report what the user agent will

<h3 id="storage-bucket-expiration">Expiration</h3>

A [=/storage bucket=] has a <dfn>bucket expiration</dfn>, which is either null or a [=duration=], initially null.
A [=/storage bucket=] has an <dfn for="StorageBucket">expiration value</dfn>, which is either null or a [=duration=], initially null.
Specifies the upper limit of a bucket lifetime.

User agents MUST remove any bucket that has expired when {{StorageBucketManager/keys}} is called.
Expand All @@ -416,7 +416,7 @@ The <dfn method for="StorageBucket">setExpires(|expires|)</dfn> method steps are

1. If |bucket| has been removed, [=reject=] |p| with an {{InvalidStateError}}.

1. Otherwise, set |bucket|'s [=bucket expiration=] to |expires| and [=/resolve=] |p|.
1. Otherwise, set |bucket|'s [=StorageBucket/expiration value=] to |expires| and [=/resolve=] |p|.

1. Return |p|.

Expand All @@ -434,7 +434,7 @@ The <dfn method for="StorageBucket">expires()</dfn> method steps are:

1. If |bucket| has been removed, [=reject=] |p| with an {{InvalidStateError}}.

1. Otherwise, [=/resolve=] |p| with |bucket|'s [=bucket expiration=].
1. Otherwise, [=/resolve=] |p| with |bucket|'s [=StorageBucket/expiration value=].

1. Return |p|.

Expand Down Expand Up @@ -470,13 +470,13 @@ A {{StorageBucket}} has an {{IDBFactory}} object, initially null. The <dfn attri

<div algorithm>

The user agent MUST consider the [=bucket durability=] when evaluating the <a spec="IndexedDB">durability hint</a> |durability|
The user agent MUST consider the [=StorageBucket/durability value=] when evaluating the <a spec="IndexedDB">durability hint</a> |durability|
of an {{IDBTransaction}} |transaction|. To <dfn>calculate the effective <a spec="IndexedDB">durability hint</a></dfn> for
|transaction| with associated |bucket|:

1. If |durability| is not "{{IDBTransactionDurability/default}}", then return |durability|.

1. If |bucket|'s [=bucket durability=] is "{{StorageBucketDurability/strict}}", then return "{{IDBTransactionDurability/strict}}".
1. If |bucket|'s [=StorageBucket/durability value=] is "{{StorageBucketDurability/strict}}", then return "{{IDBTransactionDurability/strict}}".

1. Return "{{IDBTransactionDurability/relaxed}}".

Expand Down