LibWeb: Implement IDBOpenDBRequest.onblocked

This commit is contained in:
Jamie Mansfield 2024-06-22 11:26:48 +01:00 committed by Andreas Kling
commit 30db7fb323
Notes: sideshowbarker 2024-07-17 18:08:55 +09:00
4 changed files with 20 additions and 1 deletions

View file

@ -1,11 +1,13 @@
/*
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/IDBOpenDBRequestPrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/HTML/EventNames.h>
#include <LibWeb/IndexedDB/IDBOpenDBRequest.h>
namespace Web::IndexedDB {
@ -25,4 +27,16 @@ void IDBOpenDBRequest::initialize(JS::Realm& realm)
WEB_SET_PROTOTYPE_FOR_INTERFACE(IDBOpenDBRequest);
}
// https://w3c.github.io/IndexedDB/#dom-idbopendbrequest-onblocked
void IDBOpenDBRequest::set_onblocked(WebIDL::CallbackType* event_handler)
{
set_event_handler_attribute(HTML::EventNames::blocked, event_handler);
}
// https://w3c.github.io/IndexedDB/#dom-idbopendbrequest-onblocked
WebIDL::CallbackType* IDBOpenDBRequest::onblocked()
{
return event_handler_attribute(HTML::EventNames::blocked);
}
}