mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Implement IDB's "get the parent" algorithms
This allows events to bubble up through request -> transaction -> connection, and gives us a bunch of WPT subtest passes.
This commit is contained in:
committed by
Gregory Bertilson
parent
96d98f5189
commit
2c48aa0b67
Notes:
github-actions[bot]
2026-03-21 05:00:44 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/2c48aa0b677 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8295
@@ -8,6 +8,7 @@
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Crypto/Crypto.h>
|
||||
#include <LibWeb/HTML/EventNames.h>
|
||||
#include <LibWeb/IndexedDB/IDBDatabase.h>
|
||||
#include <LibWeb/IndexedDB/IDBIndex.h>
|
||||
#include <LibWeb/IndexedDB/IDBObjectStore.h>
|
||||
#include <LibWeb/IndexedDB/IDBTransaction.h>
|
||||
@@ -60,6 +61,13 @@ void IDBTransaction::visit_edges(Visitor& visitor)
|
||||
}
|
||||
}
|
||||
|
||||
DOM::EventTarget* IDBTransaction::get_parent(DOM::Event const&)
|
||||
{
|
||||
// https://w3c.github.io/IndexedDB/#transaction-construct
|
||||
// A transaction’s get the parent algorithm returns the transaction’s connection.
|
||||
return m_connection.ptr();
|
||||
}
|
||||
|
||||
void IDBTransaction::set_onabort(WebIDL::CallbackType* event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::abort, event_handler);
|
||||
|
||||
Reference in New Issue
Block a user