diff --git a/index.bs b/index.bs
index 1f58729..449b146 100644
--- a/index.bs
+++ b/index.bs
@@ -697,7 +697,7 @@ To compare two keys |a| and |b|, run these steps:
1. Let |length| be the lesser of |va|'s length and |vb|'s length.
2. Let |i| be 0.
- 3. While |i| is less than |length|, run these substeps:
+ 3. While |i| is less than |length|, then:
1. Let |u| be the code unit of |va| at index |i|.
2. Let |v| be the code unit of |vb| at index |i|.
3. If |u| is greater than |v| then return 1.
@@ -712,7 +712,7 @@ To compare two keys |a| and |b|, run these steps:
1. Let |length| be the lesser of |va|'s length and |vb|'s length.
2. Let |i| be 0.
- 3. While |i| is less than |length|, run these substeps:
+ 3. While |i| is less than |length|, then:
1. Let |u| be the {{octet}} in |va| at index |i|.
2. Let |v| be the {{octet}} in |vb| at index |i|.
@@ -729,7 +729,7 @@ To compare two keys |a| and |b|, run these steps:
1. Let |length| be the lesser of |va|'s length and |vb|'s length.
2. Let |i| be 0.
- 3. While |i| is less than |length|, run these substeps:
+ 3. While |i| is less than |length|, then:
1. Let |u| be the [=/key=] in |va| at index |i|.
2. Let |v| be the [=/key=] in |vb| at index |i|.
@@ -1170,7 +1170,7 @@ The following constraints define when a [=/transaction=] can be
To cleanup Indexed Database transactions,
-run the following steps for each [=/transaction=]
+run these steps for each [=/transaction=]
with [=transaction/cleanup event loop=] matching the current
[=event loop=].
@@ -1565,7 +1565,7 @@ in the call to store the record, a key is generated.
- To generate a key for an [=/object store=] |store|, run the following steps:
+ To generate a key for an [=/object store=] |store|, run these steps:
1. Let |generator| be the [=key generator=] associated with |store|.
@@ -1586,7 +1586,7 @@ be updated.
To possibly update the key generator for an [=/object store=] |store| with |key|,
- run the following steps:
+ run these steps:
1. If the [=key/type=] of |key| is not number, abort these steps.
@@ -2133,7 +2133,7 @@ events, in [[!DOM]].
To fire a version change event named |e| at |target| given
- |oldVersion| and |newVersion|, run the following steps:
+ |oldVersion| and |newVersion|, run these steps:
1. Let |event| be the result of [=creating an event=] using
{{IDBVersionChangeEvent}}.
@@ -2235,7 +2235,7 @@ when invoked, must run these steps:
4. Let |request| be a new [=open request=].
-5. Run the following substeps in parallel:
+5. Run these steps [=in parallel=]:
1. Let |result| be the result of running the steps to
[=open a database=], with |origin|,
@@ -2252,7 +2252,7 @@ when invoked, must run these steps:
[=database/version=] equal to 1.
- 2. [=Queue a task=] to run these substeps:
+ 2. [=Queue a task=] to run these steps:
1. If |result| is an error, set the [=request/error=]
of |request| to |result| and [=fire an event=] named
@@ -2302,13 +2302,13 @@ when invoked, must run these steps:
3. Let |request| be a new [=open request=].
-4. Run the following substeps in parallel:
+4. Run these steps [=in parallel=]:
1. Let |result| be the result of running the steps to
[=delete a database=], with |origin|,
|name|, and |request|.
- 2. [=Queue a task=] to run these substeps:
+ 2. [=Queue a task=] to run these steps:
1. If |result| is an error set the [=request/error=] of
|request| to |result| and [=fire an event=]
named error at |request| with
@@ -2964,7 +2964,7 @@ when invoked, must run these steps:
generator=] and |key| was not given, [=throw=] a
"{{DataError}}" {{DOMException}}.
-8. If |key| was given, run these substeps:
+8. If |key| was given, then:
1. Let |r| be the result of running the steps to [=convert a
value to a key=] with |key|. Rethrow any exceptions.
@@ -2986,7 +2986,7 @@ when invoked, must run these steps:
if the difference in behavior is not observable.
-11. If |store| uses [=in-line keys=], run these substeps:
+11. If |store| uses [=in-line keys=], then:
1. Let |kpk| be the result of running the steps to [=extract a
key from a value using a key path=] with |clone| and
@@ -2997,7 +2997,7 @@ when invoked, must run these steps:
3. If |kpk| is not failure, let |key| be |kpk|.
- 4. Otherwise (|kpk| is failure), run these substeps:
+ 4. Otherwise (|kpk| is failure):
1. If |store| does not have a [=key generator=], [=throw=]
a "{{DataError}}" {{DOMException}}.
@@ -3043,7 +3043,7 @@ when invoked, must run these steps:
generator=] and |key| was not given, [=throw=] a
"{{DataError}}" {{DOMException}}.
-8. If |key| was given, run these substeps:
+8. If |key| was given, then:
1. Let |r| be the result of running the steps to [=convert a
value to a key=] with |key|. Rethrow any exceptions.
@@ -3065,7 +3065,7 @@ when invoked, must run these steps:
if the difference in behavior is not observable.
-11. If |store| uses [=in-line keys=], run these substeps:
+11. If |store| uses [=in-line keys=], then:
1. Let |kpk| be the result of running the steps to [=extract a
key from a value using a key path=] with |clone| and
@@ -3077,7 +3077,7 @@ when invoked, must run these steps:
3. If |kpk| is not failure, let |key| be
|kpk|.
- 4. Otherwise (|kpk| is failure), run these substeps:
+ 4. Otherwise (|kpk| is failure):
1. If |store| does not have a [=key generator=], [=throw=]
a "{{DataError}}" {{DOMException}}.
@@ -4741,7 +4741,7 @@ invoked, must run these steps:
the cursor is being iterated or has iterated past its end,
[=throw=] an "{{InvalidStateError}}" {{DOMException}}.
-5. If |key| is given, run these substeps:
+5. If |key| is given, then:
1. Let |r| be the result of running the steps to [=convert a
value to a key=] with |key|. Rethrow any exceptions.
@@ -4938,7 +4938,7 @@ invoked, must run these steps:
9. If the [=effective object store=] of this cursor uses [=in-line
- keys=], run these substeps:
+ keys=], then:
1. Let |kpk| be the result of running the steps to
[=extract a key from a value using a key path=] with
@@ -5091,7 +5091,7 @@ enum IDBTransactionMode {
The objectStoreNames
-attribute's getter must run the following steps:
+attribute's getter must run these steps:
1. If this [=/transaction=] is an [=upgrade transaction=],
return a {{DOMStringList}} associated with a [=sorted name list=] of the [=object-store/names=]
@@ -5259,8 +5259,7 @@ database |name|, a database |version|, and a |request|.
9. Set |connection|'s [=connection/version=] to |version|.
-10. If |db|'s [=database/version=] is less than |version|, run
- these substeps:
+10. If |db|'s [=database/version=] is less than |version|, then:
1. Let |openConnections| be the set of all [=/connections=],
except |connection|, associated with |db|.
@@ -5433,7 +5432,7 @@ This algorithm takes one argument, the |transaction| to commit.
appropriate for the error, for example "{{QuotaExceededError}}" or
"{{UnknownError}}" {{DOMException}}.
-3. [=Queue a task=] to run the these substeps
+3. [=Queue a task=] to run these steps:
1. [=Fire an event=] named complete at |transaction|.
@@ -5484,7 +5483,7 @@ takes two arguments: the |transaction| to abort, and |error|.
4. For each |request| in |transaction|'s [=request list=] with
[=request/done flag=] unset, abort the steps to [=asynchronously
execute a request=] for |request| and [=queue a task=] to
- run these substeps:
+ run these steps:
1. Set the [=request/done flag=] on |request|.
2. Set the [=request/result=] of |request| to undefined.
@@ -5501,7 +5500,7 @@ takes two arguments: the |transaction| to abort, and |error|.
or if it was the last remaining request that failed.
-5. [=Queue a task=] to run the following substeps:
+5. [=Queue a task=] to run these steps:
1. [=Fire an event=] named abort at |transaction|
with its {{Event/bubbles}} attribute initialized to true.
@@ -5538,37 +5537,38 @@ created [=request=] belongs to is [=transaction/aborted=] using the steps to
4. Add |request| to the end of |transaction|'s [=request list=].
-5. Return |request| and queue up the execution of the remaining steps
- in this algorithm.
+5. Run these steps [=in parallel=]:
-6. Wait until all previously added [=requests=] in |transaction|
- have their [=request/done flag=] set.
+ 1. Wait until all previously added [=requests=] in |transaction|
+ have their [=request/done flag=] set.
-7. Let |result| be the result of performing |operation|.
+ 2. Let |result| be the result of performing |operation|.
-8. If |result| is an error, then revert all changes made by
- |operation|.
+ 3. If |result| is an error, then revert all changes made by
+ |operation|.
-
+
-9. [=Queue a task=] to run these substeps:
+ 4. [=Queue a task=] to run these steps:
- 1. Set the [=request/done flag=] on |request|.
+ 1. Set the [=request/done flag=] on |request|.
+
+ 2. If |result| is an error, then:
- 2. If |result| is an error, then run these substeps:
+ 1. Set the [=request/result=] of |request| to undefined.
+ 2. Set the [=request/error=] of |request| to |result|.
+ 3. [=Fire an error event=] at |request|.
- 1. Set the [=request/result=] of |request| to undefined.
- 2. Set the [=request/error=] of |request| to |result|.
- 3. [=Fire an error event=] at |request|.
+ 3. Otherwise:
- 3. Otherwise, run these substeps:
+ 1. Set the [=request/result=] of |request| to |result|.
+ 2. Set the [=request/error=] of |request| to undefined.
+ 3. [=Fire a success event=] at |request|.
- 1. Set the [=request/result=] of |request| to |result|.
- 2. Set the [=request/error=] of |request| to undefined.
- 3. [=Fire a success event=] at |request|.
+6. Return |request|.
@@ -5607,7 +5607,7 @@ for the [=database=], and a |request|.
considered part of the [=/transaction=], and so if the
transaction is [=transaction/aborted=], this change is reverted.
-7. [=Queue a task=] to run the following steps:
+7. [=Queue a task=] to run these steps:
1. Set |request|'s [=request/result=] to |connection|.
2. Set |request|'s [=request/transaction=] to |transaction|.
@@ -5674,7 +5674,7 @@ are as follows.
5. For each [=/object store handle=] |handle| associated with
|transaction|, including those for [=/object stores=] that
- were created or deleted during |transaction|, run these substeps:
+ were created or deleted during |transaction|:
1. If |handle|'s [=object-store-handle/object store=] was not
newly created during |transaction|, set |handle|'s
@@ -5701,7 +5701,7 @@ are as follows.
6. For each [=index handle=] |handle| associated with |transaction|,
including those for [=/indexes=] that were created or deleted
- during |transaction|, run these substeps:
+ during |transaction|:
1. If |handle|'s [=index-handle/index=] was not newly created
during |transaction|, set |handle|'s [=index-handle/name=] to
@@ -5737,7 +5737,7 @@ are as follows.
To fire a success event at a |request|,
-the implementation must run the following steps:
+the implementation must run these steps:
1. Let |event| be the result of [=creating an event=] using {{Event}}.
@@ -5770,7 +5770,7 @@ the implementation must run the following steps:
To fire an error event at a |request|,
-the implementation must run the following steps:
+the implementation must run these steps:
1. Let |event| be the result of [=creating an event=] using {{Event}}.
@@ -5815,7 +5815,7 @@ the implementation must run the following steps:
To make a clone of |value| in |targetRealm|,
- the implementation must run the following steps:
+ the implementation must run these steps:
1. Let |serialized| be [=?=] StructuredSerializeForStorage(|value|).
@@ -5852,9 +5852,9 @@ The steps to store a record into an object store with
|store|, |value|, an optional |key|, and a |no-overwrite flag| are as
follows.
-1. If |store| uses a [=key generator=], run these substeps:
+1. If |store| uses a [=key generator=], then:
- 1. If |key| is undefined, run these substeps:
+ 1. If |key| is undefined, then:
1. Let |key| be the result of running the steps to
[=generate a key=] for |store|.
@@ -5886,7 +5886,7 @@ follows.
[=object-store/list of records=] such that the list is sorted
according to the key of the records in [=ascending=] order.
-5. For each |index| which [=reference=] |store|, run these substeps:
+5. For each |index| which [=reference=] |store|:
1. Let |index key| be the result of running the steps to
[=extract a key from a value using a key path=] with
@@ -5894,7 +5894,7 @@ follows.
[=multiEntry flag=].
2. If |index key| is an exception, or invalid, or failure, take no
- further actions for this index, and continue these substeps
+ further actions for |index|, and continue these steps
for the next index.