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:
Zaggy1024
2026-03-05 22:11:48 -06:00
committed by Gregory Bertilson
parent 96d98f5189
commit 2c48aa0b67
Notes: github-actions[bot] 2026-03-21 05:00:44 +00:00
8 changed files with 39 additions and 15 deletions

View File

@@ -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 transactions get the parent algorithm returns the transactions connection.
return m_connection.ptr();
}
void IDBTransaction::set_onabort(WebIDL::CallbackType* event_handler)
{
set_event_handler_attribute(HTML::EventNames::abort, event_handler);