Commit graph

94 commits

Author SHA1 Message Date
stelar7
ced862c460 LibWeb/IDB: Apply default cursor direction
IDBGetAllOptions is supposed to have a default value for direction.
When the value passed is not a potentially valid key range, we
need to default the direction argument, and not assume its set

Spec issue: https://github.com/w3c/IndexedDB/pull/478
2025-10-17 09:42:39 +02:00
stelar7
61185d98aa LibWeb/IDB: Adjust how negative numbers increment the key generator
Directly mapping a negative double to a u64 causes it to wrap around
to the max value. We work around this here by comparing as doubles,
and only incrementing the generator if the new value is greater

Fixes #6455
2025-10-14 10:26:28 +01:00
Luke Wilde
6d83fd92b6 LibWeb/IndexedDB: Add additional debug output for async operations 2025-10-08 17:25:29 +02:00
Luke Wilde
d87c2a55b0 LibWeb/IndexedDB: Remove spin_until from checking finished transactions 2025-10-08 17:25:29 +02:00
Luke Wilde
52b53e52fb LibWeb/IndexedDB: Remove spin_until from waiting for connection closure 2025-10-08 17:25:29 +02:00
Luke Wilde
e6dc52a52b LibWeb/IndexedDB: Remove spin_until from waiting for tasks to complete 2025-10-08 17:25:29 +02:00
Luke Wilde
5c69784ef9 LibWeb/IndexedDB: Remove spin_until from request processing 2025-10-08 17:25:29 +02:00
Julian Dominguez-Schatz
b9153f0ca1 LibWeb/IndexedDB: Allow queryOrOptions to be null in getAllKeys
This fixes a crash on initial load of the page http://demo.actualbudget.org.
Minimal repro of the issue (error in the console without this PR):

<script>
const r = indexedDB.open("t", 1);
r.onupgradeneeded = e => e.target.result.createObjectStore("s", { keyPath: "id" });
r.onsuccess = () => r.result.transaction("s", "readonly").objectStore("s").getAllKeys();
</script>
2025-10-04 20:49:53 +02:00
stelar7
fde5dc7491 LibWeb/IDB: Implement create_a_request_to_retrieve_multiple_items 2025-08-27 16:13:25 +02:00
stelar7
bac1c84241 LibWeb/IDB: Implement retrieve_multiple_items_from_an_index 2025-08-27 16:13:25 +02:00
stelar7
839ffd45f3 LibWeb/IDB: Implement retrieve_multiple_items_from_an_object_store 2025-08-27 16:13:25 +02:00
stelar7
fe5d5639ef LibWeb/IDB: Move Records and give more descriptive names 2025-08-27 16:13:25 +02:00
stelar7
87af53a613 LibWeb/IDB: Implement is_a_potentially_valid_key_range 2025-08-27 16:13:25 +02:00
stelar7
75054aeecd LibWeb/IDB: Allow null errors during abort 2025-08-14 09:31:56 +01:00
stelar7
474b748275 LibWeb/IDB: Check the request error instead of the transaction 2025-08-14 09:31:56 +01:00
Timothy Flynn
70db474cf0 LibJS+LibWeb: Port interned bytecode strings to UTF-16
This was almost a no-op, except we intern JS exception messages. So the
bulk of this patch is porting exception messages to UTF-16.
2025-08-14 10:27:08 +02:00
Timothy Flynn
0efa98a57a LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16
This has quite a lot of fall out. But the majority of it is just type or
UDL substitution, where the changes just fall through to other function
calls.

By changing property key storage to UTF-16, the main affected areas are:
* NativeFunction names must now be UTF-16
* Bytecode identifiers must now be UTF-16
* Module/binding names must now be UTF-16
2025-08-05 07:07:15 -04:00
stelar7
3815a7c1eb LibWeb: Implement cleanup_indexed_database_transactions 2025-06-18 19:05:41 +12:00
stelar7
9e7fb5efbc LibWeb/IDB: Update spec step wording 2025-05-16 12:10:16 +01:00
stelar7
c1d63b5b28 LibWeb/IDB: Implement queue_a_database_task 2025-05-16 12:10:16 +01:00
stelar7
13674c1b32 LibWeb/IDB: Resolve FIXME regarding removing from indecies 2025-05-14 17:17:29 +02:00
stelar7
46ecf239c4 LibWeb/IDB: Implement storing of index records 2025-05-14 17:17:29 +02:00
stelar7
852323009f LibWeb/IDB: Implement IDBIndex::count 2025-05-14 17:17:29 +02:00
stelar7
b8bb8345a9 LibWeb/IDB: Implement IDBIndex::getAllKeys 2025-05-14 17:17:29 +02:00
stelar7
3fa1d1299c LibWeb/IDB: Implement IDBIndex::getAll 2025-05-14 17:17:29 +02:00
stelar7
47450bc15c LibWeb/IDB: Implement IDBIndex::getKey 2025-05-14 17:17:29 +02:00
stelar7
e74e571b56 LibWeb/IDB: Implement IDBIndex::get 2025-05-14 17:17:29 +02:00
stelar7
a2ecafb968 LibWeb/IDB: Use enum flags in IDBKeyRange 2025-05-13 22:46:43 +12:00
stelar7
927237c736 LibWeb/IDB: Implement retrieve_multiple_keys_from_an_object_store 2025-05-13 08:27:52 +12:00
stelar7
ddaae635ac LibWeb/IDB: Implement retrieve_multiple_values_from_an_object_store 2025-05-13 08:27:52 +12:00
stelar7
c47ddf11ba LibWeb/IDB: Implement retrieve_a_key_from_an_object_store 2025-05-13 08:27:52 +12:00
stelar7
637f35c0eb LibWeb/IDB: Implement clear_an_object_store 2025-05-08 14:13:21 +01:00
stelar7
aa35ced34f LibWeb/IDB: Implement IDBObjectStore::delete 2025-05-08 14:13:21 +01:00
stelar7
1fe6060ff9 LibWeb/IDB: Improve error messages slightly 2025-05-08 14:13:21 +01:00
stelar7
9d5f6108e4 LibWeb/IDB: Implement recent spec changes 2025-05-06 13:30:37 +01:00
stelar7
98d08b27e4 LibWeb/IDB: Implement iterate_a_cursor 2025-05-06 11:16:01 +02:00
Shannon Booth
e476d21ed0 LibJS: Add and use PrimitiveString::length_in_utf16_code_units
I was investigating an optimization in this area, and while it
didn't seem to have a noticable improvement, it still seems
useful to apply this change.
2025-05-03 16:18:47 +02:00
stelar7
18a008d073 LibWeb/IDB: Implement retrieve_a_value_from_an_object_store 2025-04-29 17:06:17 +02:00
stelar7
694375d3ac LibWeb/IDB: Implement count_the_records_in_a_range 2025-04-29 17:06:17 +02:00
stelar7
64d251b36c LibWeb/IDB: Implement convert_a_value_to_a_key_range 2025-04-29 17:06:17 +02:00
stelar7
47d6b568fd LibWeb/IDB: Dont keep trailing separator when splitting key paths 2025-04-28 11:31:31 +02:00
stelar7
577f799240 LibWeb/IDB: Fix a bug where the KeyGenerator was not incremented 2025-04-28 11:31:31 +02:00
stelar7
facfcd87c2 LibWeb/IDB: Introduce an Invalid KeyType
This cleans up the code around failure/invalid/exception a bit
2025-04-28 11:31:31 +02:00
stelar7
5ae069a031 LibWeb/IDB: Use correct state to check for throw condition 2025-04-25 07:23:41 -04:00
stelar7
a06cec7a3c LibWeb/IDB: Implement IDBObjectStore::add_or_put 2025-04-23 12:31:14 -06:00
stelar7
fb17dae42b LibWeb/IDB: Implement store_a_record_into_an_object_store 2025-04-23 12:31:14 -06:00
stelar7
afe7951af4 LibWeb/IDB: Implement delete_records_from_an_object_store 2025-04-23 12:31:14 -06:00
stelar7
7fa3bd00b5 LibWeb/IDB: Implement inject_a_key_into_a_value_using_a_key_path 2025-04-23 12:31:14 -06:00
stelar7
1bdf519b60 LibWeb/IDB: Implement possibly_update_the_key_generator 2025-04-23 12:31:14 -06:00
stelar7
dbe0db0cab LibWeb/IDB: Implement generate_a_key 2025-04-23 12:31:14 -06:00