Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a244eb057f532f4cacc4971da778b9a0f4a4b7fc
      
https://github.com/WebKit/WebKit/commit/a244eb057f532f4cacc4971da778b9a0f4a4b7fc
  Author: Rupin Mittal <[email protected]>
  Date:   2026-04-01 (Wed, 01 Apr 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllRecords.any-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllRecords.any.serviceworker-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllRecords.any.sharedworker-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllRecords.any.worker-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions.any-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions.any.serviceworker-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions.any.sharedworker-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions.any.worker-expected.txt
    M Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
    M Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp

  Log Message:
  -----------
  [IndexedDB API] Implement IDBObjectStore::getAllRecords()
https://bugs.webkit.org/show_bug.cgi?id=311275
rdar://173871211

Reviewed by Sihui Liu.

The IndexedDB API (https://w3c.github.io/IndexedDB/#object-store-interface) has
specified a new function getAllRecords() on IDBObjectStore. This takes in an
IDBGetAllOptions and returns an array of IDBRecords which contain the key,
primaryKey, and value of the record. Both the key and primary key are the same
(the key of the record).

This patch implements this.

https://commits.webkit.org/310374@main implemented this for IDBIndex. That patch
already added much of the infrastructure we need (GetAllType::Records and 
IDBRecord).

The spec (https://w3c.github.io/IndexedDB/#dom-idbobjectstore-getallrecords) 
says to run
these steps: 
https://w3c.github.io/IndexedDB/#create-a-request-to-retrieve-multiple-items

This follows the same steps as getAll() and getAllKeys().

We carry out steps 1-9 by calling doGetAllShared() with this new type. Since 
the input
passed in is already IDBGetAllOptions, we obtain the query, count, and direction
directly from it (step 9).

doGetAllShared() calls requestGetAllObjectStoreRecords which stores in the
IDBGetAllRecordsData object that our type is Records. This is already plumbed 
all
the way down to SQLiteIDBBackingStore::getAllObjectStoreRecords().

We modify getAllObjectStoreRecords() to ensure that it adds the primarykey and
the value to the IDBGetAllResult in the case of Records.

Then, when the JS accesses the result of the IDBRequest returned by 
getAllRecords(),
JSIDBRequestCustom will create the IDBRecords from the IDBGetAllResult and
JSIDBRecordCustom will allow the JS to access the key, primaryKey, and value 
fields.
The previous patch mentioned above added this functionality.

* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllRecords.any-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllRecords.any.serviceworker-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllRecords.any.sharedworker-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllRecords.any.worker-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions.any-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions.any.serviceworker-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions.any.sharedworker-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-conversion-exceptions.any.worker-expected.txt:
* Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::doGetAllShared):
(WebCore::IDBObjectStore::getAllRecords):
* Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):

Canonical link: https://commits.webkit.org/310412@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to