Commit d29b6343 authored by Yannic Bonenberger's avatar Yannic Bonenberger Committed by Commit Bot

[IndexedDB] Add request property to IDBCursor

https://w3c.github.io/IndexedDB/#dom-idbcursor-request

Chrome status:
https://chromestatus.com/feature/5432744081358848

Intent to Implement and Ship:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/o6mUiI09BUc/25khjTHYAAAJ

Bug: 943344
Change-Id: I9c7c801ae266c0dd75cd9bc21355913865ecbcc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1585892
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#656396}
parent 67acc8fb
......@@ -72,6 +72,7 @@ class IDBCursor : public ScriptWrappable {
ScriptValue key(ScriptState*);
ScriptValue primaryKey(ScriptState*);
ScriptValue value(ScriptState*);
IDBRequest* request() { return request_.Get(); }
void source(Source&) const;
IDBRequest* update(ScriptState*, const ScriptValue&, ExceptionState&);
......
......@@ -41,6 +41,7 @@ enum IDBCursorDirection {
readonly attribute IDBCursorDirection direction;
[CallWith=ScriptState, CachedAttribute=isKeyDirty] readonly attribute any key;
[CallWith=ScriptState, CachedAttribute=isPrimaryKeyDirty] readonly attribute any primaryKey;
[SameObject] readonly attribute IDBRequest request;
[RaisesException] void advance([EnforceRange] unsigned long count);
[CallWith=ScriptState, ImplementedAs=Continue, RaisesException] void continue([DefaultValue=Undefined] optional any key);
......
This is a testharness.js-based test.
FAIL cursor.request from IDBObjectStore.openCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
FAIL cursor.request from IDBObjectStore.openKeyCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
FAIL cursor.request from IDBIndex.openCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
FAIL cursor.request from IDBIndex.openKeyCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
Harness: the test ran to completion.
......@@ -18,6 +18,7 @@ function cursorRequestTest({ useIndex, useKeyCursor }) {
cursor = req.result;
assert_equals(cursor.request, req, 'cursor.request');
assert_readonly(cursor, 'request');
assert_equals(cursor.request, cursor.request, 'cursor.request does not change');
});
req.transaction.oncomplete = t.step_func(() => {
......
This is a testharness.js-based test.
FAIL cursor.request from IDBObjectStore.openCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
FAIL cursor.request from IDBObjectStore.openKeyCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
FAIL cursor.request from IDBIndex.openCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
FAIL cursor.request from IDBIndex.openKeyCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
Harness: the test ran to completion.
......@@ -549,6 +549,7 @@ interface IDBCursor
getter direction
getter key
getter primaryKey
getter request
getter source
method advance
method constructor
......
......@@ -526,6 +526,7 @@ interface IDBCursor
getter direction
getter key
getter primaryKey
getter request
getter source
method advance
method constructor
......
......@@ -487,6 +487,7 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] getter direction
[Worker] getter key
[Worker] getter primaryKey
[Worker] getter request
[Worker] getter source
[Worker] method advance
[Worker] method constructor
......
......@@ -3455,6 +3455,7 @@ interface IDBCursor
getter direction
getter key
getter primaryKey
getter request
getter source
method advance
method constructor
......
......@@ -482,6 +482,7 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] getter direction
[Worker] getter key
[Worker] getter primaryKey
[Worker] getter request
[Worker] getter source
[Worker] method advance
[Worker] method constructor
......
......@@ -496,6 +496,7 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] getter direction
[Worker] getter key
[Worker] getter primaryKey
[Worker] getter request
[Worker] getter source
[Worker] method advance
[Worker] method constructor
......
......@@ -4044,6 +4044,7 @@ interface IDBCursor
getter direction
getter key
getter primaryKey
getter request
getter source
method advance
method constructor
......
......@@ -491,6 +491,7 @@ Starting worker: resources/global-interface-listing-worker.js
[Worker] getter direction
[Worker] getter key
[Worker] getter primaryKey
[Worker] getter request
[Worker] getter source
[Worker] method advance
[Worker] method constructor
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment