Skip to content

Commit

Permalink
Add cursor.request (#257)
Browse files Browse the repository at this point in the history
Define new |request| attribute on IDBCursor. Discussed in #255

WPT PR ready to land: web-platform-tests/wpt#15820

Implementations pending, but this should be fairly straightforward so going ahead with landing this (and tests) optimistically.
  • Loading branch information
jakearchibald authored and inexorabletash committed Feb 1, 2021
1 parent b862679 commit 24c0b0f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion index.bs
Expand Up @@ -4617,6 +4617,7 @@ interface IDBCursor {
readonly attribute IDBCursorDirection direction;
readonly attribute any key;
readonly attribute any primaryKey;
readonly attribute IDBRequest request;

void advance([EnforceRange] unsigned long count);
void continue(optional any key);
Expand Down Expand Up @@ -4657,12 +4658,16 @@ enum IDBCursorDirection {
Returns the [=cursor/effective key=] of the cursor.
Throws a "{{InvalidStateError}}" {{DOMException}} if the cursor is advancing or is finished.
</dd>
<dt><var>cursor</var> . {{IDBCursor/request}}
<dd>
Returns the [=cursor/request=] that was used to obtain this cursor.
</dd>
</dl>
</div>


The <dfn attribute for=IDBCursor>source</dfn> attribute's getter must
return the [=cursor/source=] of this [=cursor=]. This
return the [=cursor/source=] of the [=cursor=]. This
attribute never returns null or throws an exception, even if the
cursor is currently being iterated, has iterated past its end, or its
[=/transaction=] is not [=transaction/active=].
Expand Down Expand Up @@ -4690,6 +4695,15 @@ object is modified, those modifications will be seen by anyone
inspecting the value of the cursor. However modifying such an object
does not modify the contents of the database.

The <dfn attribute for=IDBCursor>request</dfn> attribute's getter must
return the [=cursor/request=] of the [=cursor=].

<aside class=advisement>
&#x1F6A7;
The {{IDBCursor/request}} attribute is new in this edition.
&#x1F6A7;
</aside>

<div class=note>
The following methods advance a [=cursor=]. Once the cursor has
advanced, a <a event>`success`</a> event will be fired at the
Expand Down Expand Up @@ -7184,6 +7198,7 @@ For the revision history of the second edition, see [that document's Revision Hi
* Updated [partial interface definition](#global-scope) since {{WindowOrWorkerGlobalScope}} is now a `mixin` ([PR #238](https://github.com/w3c/IndexedDB/pull/238)).
* Added {{IDBFactory/databases()}} method. ([Issue #31](https://github.com/w3c/IndexedDB/issues/31))
* Added {{IDBTransaction/commit()}} method. ([Issue #234](https://github.com/w3c/IndexedDB/issues/234))
* Added {{IDBCursor/request}} attribute. ([Issue #255](https://github.com/w3c/IndexedDB/issues/255))

<!-- ============================================================ -->
# Acknowledgements # {#acknowledgements}
Expand All @@ -7204,6 +7219,7 @@ for his general authoring advice.

Special thanks to
Chris Anderson,
Jake Archibald,
Andreas Butler,
Pablo Castro,
Victor Costan,
Expand Down

0 comments on commit 24c0b0f

Please sign in to comment.