From 24c0b0f45fceea4b0233e215642178318dcb87fd Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Thu, 14 Mar 2019 22:48:58 +0000 Subject: [PATCH] Add cursor.request (#257) Define new |request| attribute on IDBCursor. Discussed in https://github.com/w3c/IndexedDB/issues/255 WPT PR ready to land: https://github.com/web-platform-tests/wpt/pull/15820 Implementations pending, but this should be fairly straightforward so going ahead with landing this (and tests) optimistically. --- index.bs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index e19ed4c..4f06902 100644 --- a/index.bs +++ b/index.bs @@ -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); @@ -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. +
cursor . {{IDBCursor/request}} +
+ Returns the [=cursor/request=] that was used to obtain this cursor. +
The source 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=]. @@ -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 request attribute's getter must +return the [=cursor/request=] of the [=cursor=]. + + +
The following methods advance a [=cursor=]. Once the cursor has advanced, a `success` event will be fired at the @@ -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} @@ -7204,6 +7219,7 @@ for his general authoring advice. Special thanks to Chris Anderson, +Jake Archibald, Andreas Butler, Pablo Castro, Victor Costan,