mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb/IDB: Implement IDBCursor::primary_key
This commit is contained in:
parent
141093e032
commit
8f876e824b
Notes:
github-actions[bot]
2025-05-08 13:14:51 +00:00
Author: https://github.com/stelar7
Commit: 8f876e824b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4650
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 9 additions and 1 deletions
|
@ -162,4 +162,11 @@ WebIDL::ExceptionOr<void> IDBCursor::continue_(JS::Value key)
|
|||
});
|
||||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#dom-idbcursor-primarykey
|
||||
JS::Value IDBCursor::primary_key() const
|
||||
{
|
||||
// The primaryKey getter steps are to return the result of converting a key to a value with the cursor’s current effective key.
|
||||
return convert_a_key_to_a_value(realm(), effective_key());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
[[nodiscard]] GC::Ref<IDBTransaction> transaction();
|
||||
[[nodiscard]] CursorSource internal_source();
|
||||
[[nodiscard]] GC::Ref<Key> effective_key() const;
|
||||
[[nodiscard]] JS::Value primary_key() const;
|
||||
|
||||
void set_request(GC::Ptr<IDBRequest> request) { m_request = request; }
|
||||
void set_position(GC::Ptr<Key> position) { m_position = position; }
|
||||
|
|
|
@ -5,7 +5,7 @@ interface IDBCursor {
|
|||
[ImplementedAs=source_handle] readonly attribute (IDBObjectStore or IDBIndex) source;
|
||||
readonly attribute IDBCursorDirection direction;
|
||||
readonly attribute any key;
|
||||
[FIXME] readonly attribute any primaryKey;
|
||||
readonly attribute any primaryKey;
|
||||
[SameObject] readonly attribute IDBRequest request;
|
||||
[FIXME] undefined advance([EnforceRange] unsigned long count);
|
||||
undefined continue(optional any key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue