Skip to content

Commit

Permalink
Associate event definitions with the interfaces they fire at (#387)
Browse files Browse the repository at this point in the history
* Associate event definitions with the interfaces they fire at as other specs do. Also helps with extracting machine readable data.
* Disambiguate attribute from event for error in IDBRequest
  • Loading branch information
dontcallmedom authored Jun 29, 2022
1 parent bb2eb85 commit 5b4184c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,12 @@ running.
A [=/connection=]'s [=get the parent=] algorithm returns
null.

An event with type <dfn event>`versionchange`</dfn> will be fired at an open
An event with type <dfn event for=IDBDatabase>`versionchange`</dfn> will be fired at an open
[=/connection=] if an attempt is made to upgrade or delete the
[=/database=]. This gives the [=/connection=] the opportunity to close
to allow the upgrade or delete to proceed.

An event with type <dfn event>`close`</dfn> will be fired at a [=/connection=] if the connection is [=/close a database connection|closed=] abnormally.
An event with type <dfn event for=IDBDatabase>`close`</dfn> will be fired at a [=/connection=] if the connection is [=/close a database connection|closed=] abnormally.

</div>

Expand Down Expand Up @@ -1137,10 +1137,10 @@ They will return true if any transactions were cleaned up, or false otherwise.
each [=/transaction=].
</aside>

An event with type <dfn event>`complete`</dfn> is fired at
An event with type <dfn event for=IDBTransaction>`complete`</dfn> is fired at
a [=/transaction=] that has successfully [=transaction/committed=].

An event with type <dfn event>`abort`</dfn> is fired at
An event with type <dfn event for=IDBTransaction>`abort`</dfn> is fired at
a [=/transaction=] that has [=transaction/aborted=].

<!-- ============================================================ -->
Expand Down Expand Up @@ -1245,12 +1245,12 @@ request=].
When a request is made, a new [=/request=] is returned with its [=request/done
flag=] set to false. If a request completes successfully, its [=request/done flag=]
is set to true, its [=request/result=] is set to the result of the request,
and an event with type <dfn event>`success`</dfn> is fired at the
and an event with type <dfn event for=IDBRequest>`success`</dfn> is fired at the
[=/request=].

If an error occurs while performing the operation, the request's [=request/done flag=]
is set to true, the request's [=request/error=] is set to the error, and an event with
type <dfn event>`error`</dfn> is fired at the request.
type <dfn event for=IDBRequest>`error`</dfn> is fired at the request.

A [=/request=]'s [=get the parent=] algorithm returns the request's
[=request/transaction=].
Expand All @@ -1273,7 +1273,7 @@ A [=/request=]'s [=get the parent=] algorithm returns the request's
An <dfn>open request</dfn> is a special type of [=/request=] used
when opening a [=/connection=] or deleting a [=/database=].
In addition to <a event for=request>`success`</a> and <a event for=request>`error`</a> events,
<dfn event>`blocked`</dfn> and <dfn event>`upgradeneeded`</dfn> events may be fired at an [=request/open
<dfn event for=IDBOpenDBRequest>`blocked`</dfn> and <dfn event for=IDBOpenDBRequest>`upgradeneeded`</dfn> events may be fired at an [=request/open
request=] to indicate progress.

The [=request/source=] of an [=request/open request=]
Expand Down Expand Up @@ -2003,7 +2003,7 @@ enum IDBRequestReadyState {
or `undefined` if the request failed. Throws a
"{{InvalidStateError}}" {{DOMException}} if the request is still pending.

: |request| . {{IDBRequest/error}}
: |request| . <a attribute for=IDBRequest>error</a>
::
When a request is completed, returns the [=request/error=] (a
{{DOMException}}), or null if the request succeeded. Throws
Expand Down Expand Up @@ -2912,7 +2912,7 @@ and false otherwise.
If {{IDBObjectStore/put()}} is used, any existing [=object-store/record=]
with the [=/key=] will be replaced. If {{IDBObjectStore/add()}}
is used, and if a [=object-store/record=] with the [=/key=] already exists
the |request| will fail, with |request|'s {{IDBRequest/error}}
the |request| will fail, with |request|'s <a attribute for=IDBRequest>error</a>
set to a "{{ConstraintError}}" {{DOMException}}.

If successful, |request|'s {{IDBRequest/result}} will be the
Expand Down

0 comments on commit 5b4184c

Please sign in to comment.