mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb/IDB: Implement recent spec changes
This commit is contained in:
Notes:
github-actions[bot]
2025-05-06 12:31:37 +00:00
Author: https://github.com/stelar7 Commit: https://github.com/LadybirdBrowser/ladybird/commit/9d5f6108e40 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4620 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -57,4 +57,18 @@ bool Index::has_record_with_key(GC::Ref<Key> key)
|
||||
return index != m_records.end();
|
||||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#index-referenced-value
|
||||
HTML::SerializationRecord Index::referenced_value(IndexRecord const& index_record) const
|
||||
{
|
||||
// Records in an index are said to have a referenced value.
|
||||
// This is the value of the record in the index’s referenced object store which has a key equal to the index’s record’s value.
|
||||
return m_object_store
|
||||
->records()
|
||||
.first_matching([&](auto const& store_record) {
|
||||
return Key::equals(store_record.key, index_record.value);
|
||||
})
|
||||
.value()
|
||||
.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user