Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f0adce087927aedb358889dc066681d9dc3b40df
      
https://github.com/WebKit/WebKit/commit/f0adce087927aedb358889dc066681d9dc3b40df
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-06 (Mon, 06 Jul 2026)

  Changed paths:
    A LayoutTests/storage/indexeddb/openkeycursor-key-only-expected.txt
    A LayoutTests/storage/indexeddb/openkeycursor-key-only.html
    A LayoutTests/storage/indexeddb/resources/openkeycursor-key-only.js
    M Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp

  Log Message:
  -----------
  IDBObjectStore.openKeyCursor() with a key value returns a value-carrying 
cursor instead of a key-only cursor
https://bugs.webkit.org/show_bug.cgi?id=318654
rdar://181463337

Reviewed by Sihui Liu.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

IDBObjectStore::openKeyCursor(JSGlobalObject&, JSValue, IDBCursorDirection),
the overload taking a single key value, incorrectly routed through
doOpenCursor() (which creates a CursorType::KeyAndValue cursor) instead of
doOpenKeyCursor() (CursorType::KeyOnly). As a result,
store.openKeyCursor(someKey) returned an IDBCursorWithValue that fetched the
full record value, rather than a key-only cursor exposing only key and
primaryKey.

Only this JSValue overload was affected; the RefPtr<IDBKeyRange> and no-argument
paths already routed to doOpenKeyCursor(). Chrome and Firefox already return a
key-only cursor here, so this aligns WebKit with the other engines and the
IndexedDB specification.

Test: storage/indexeddb/openkeycursor-key-only.html

* LayoutTests/storage/indexeddb/openkeycursor-key-only-expected.txt: Added.
* LayoutTests/storage/indexeddb/openkeycursor-key-only.html: Added.
* LayoutTests/storage/indexeddb/resources/openkeycursor-key-only.js: Added.
(prepareDatabase):
(testKeyOnlyCursor.request.onsuccess):
(testKeyOnlyCursor):
* Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openKeyCursor):

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



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

Reply via email to