mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibWeb: Implement IDBRequest::ready_state()
This commit is contained in:
parent
a4b876b43e
commit
29ddaa76e7
Notes:
github-actions[bot]
2024-11-26 13:52:33 +00:00
Author: https://github.com/stelar7
Commit: 29ddaa76e7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2236
Reviewed-by: https://github.com/gmta ✅
3 changed files with 13 additions and 2 deletions
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
|
||||
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/IDBRequestPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/HTML/EventNames.h>
|
||||
#include <LibWeb/IndexedDB/IDBRequest.h>
|
||||
|
@ -58,4 +58,11 @@ WebIDL::CallbackType* IDBRequest::onerror()
|
|||
return event_handler_attribute(HTML::EventNames::error);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#dom-idbrequest-readystate
|
||||
[[nodiscard]] Bindings::IDBRequestReadyState IDBRequest::ready_state() const
|
||||
{
|
||||
// The readyState getter steps are to return "pending" if this's done flag is false, and "done" otherwise.
|
||||
return m_done ? Bindings::IDBRequestReadyState::Done : Bindings::IDBRequestReadyState::Pending;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue