mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb/IDB: Implement IDBObjectStore::add_or_put
This commit is contained in:
parent
fb17dae42b
commit
a06cec7a3c
Notes:
github-actions[bot]
2025-04-23 18:37:02 +00:00
Author: https://github.com/stelar7
Commit: a06cec7a3c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4317
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/kennethmyhra ✅
3 changed files with 99 additions and 21 deletions
|
@ -1400,32 +1400,13 @@ WebIDL::ExceptionOr<GC::Ptr<Key>> store_a_record_into_an_object_store(JS::Realm&
|
|||
}
|
||||
}
|
||||
|
||||
// 5. If index’s multiEntry flag is false, or if index key is not an array key
|
||||
// FIXME: 5. If index’s multiEntry flag is false, or if index key is not an array key
|
||||
// then store a record in index containing index key as its key and key as its value.
|
||||
// The record is stored in index’s list of records such that the list is sorted primarily on the records keys,
|
||||
// and secondarily on the records values, in ascending order.
|
||||
if (!index_multi_entry || !index_key_is_array) {
|
||||
// FIXME:
|
||||
// Record index_record = {
|
||||
// .key = index_key_value,
|
||||
// .value = MUST(HTML::structured_serialize_for_storage(realm.vm(), key)),
|
||||
// };
|
||||
// index->store_a_record(index_record);
|
||||
}
|
||||
|
||||
// 6. If index’s multiEntry flag is true and index key is an array key,
|
||||
// // FIXME: 6. If index’s multiEntry flag is true and index key is an array key,
|
||||
// then for each subkey of the subkeys of index key store a record in index containing subkey as its key and key as its value.
|
||||
if (index_multi_entry && index_key_is_array) {
|
||||
for (auto const& subkey : index_key_value->subkeys()) {
|
||||
(void)subkey;
|
||||
// FIXME:
|
||||
// Record index_record = {
|
||||
// .key = *subkey,
|
||||
// .value = MUST(HTML::structured_serialize_for_storage(realm.vm(), key)),
|
||||
// };
|
||||
// index->store_a_record(index_record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 6. Return key.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue