mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb/IDB: Implement iterate_a_cursor
This commit is contained in:
parent
93d7a29306
commit
98d08b27e4
Notes:
github-actions[bot]
2025-05-06 09:18:19 +00:00
Author: https://github.com/stelar7
Commit: 98d08b27e4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4524
Reviewed-by: https://github.com/gmta ✅
7 changed files with 391 additions and 1 deletions
|
@ -101,4 +101,19 @@ JS::Value IDBIndex::key_path() const
|
|||
});
|
||||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#index-referenced-value
|
||||
HTML::SerializationRecord IDBIndex::get_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_index
|
||||
->object_store()
|
||||
->records()
|
||||
.first_matching([&](auto const& store_record) {
|
||||
return Key::equals(store_record.key, index_record.value);
|
||||
})
|
||||
.value()
|
||||
.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue