[webkit-changes] [WebKit/WebKit] 54a7b9: [IndexedDB] An array keyPath should yield an array...

Chris Dumez noreply at github.com
Wed May 24 09:59:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 54a7b93842dd440a06ca58f89e15c4206c129772
      https://github.com/WebKit/WebKit/commit/54a7b93842dd440a06ca58f89e15c4206c129772
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-05-24 (Wed, 24 May 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.js
    M LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.worker-expected.txt
    M Source/WebCore/Modules/indexeddb/shared/IndexKey.cpp
    M Source/WebCore/Modules/indexeddb/shared/IndexKey.h
    M Source/WebCore/bindings/js/IDBBindingUtilities.cpp

  Log Message:
  -----------
  [IndexedDB] An array keyPath should yield an array key
https://bugs.webkit.org/show_bug.cgi?id=257238

Reviewed by Sihui Liu.

An array keyPath should yield an array key, to match the behavior of Blink and Gecko.

* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.js:
* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.worker-expected.txt:
Resync WPT test from upstream to get test coverage. Without this change, the
second subtest was failing with WebKit (but passing with Blink & Gecko).

* Source/WebCore/Modules/indexeddb/shared/IndexKey.cpp:
(WebCore::IndexKey::IndexKey):
(WebCore::IndexKey::asOneKey const):
(WebCore::IndexKey::multiEntry const):
* Source/WebCore/Modules/indexeddb/shared/IndexKey.h:
(WebCore::IndexKey::isNull const):
* Source/WebCore/bindings/js/IDBBindingUtilities.cpp:
(WebCore::createKeyPathArray):
(WebCore::generateIndexKeyForValue):
IndexKey was losing was storing the key as a Vector unconditionally and thus
was losing the information about whether or not the key was a vector or not.
To address the issue, we now use a `std::variant<std::nullptr_t, IDBKeyData, Vector<IDBKeyData>>`
with nullptr_t being the null state that this class supports.

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




More information about the webkit-changes mailing list