LibWeb: Add oncontrollerchange to ServiceWorkerContainer

This commit is contained in:
Andrew Kaster 2024-09-04 15:16:30 -06:00 committed by Andreas Kling
commit 4df280689b
Notes: github-actions[bot] 2024-09-07 09:40:08 +00:00
4 changed files with 25 additions and 28 deletions

View file

@ -9,6 +9,11 @@
#include <LibWeb/DOM/EventTarget.h>
#define ENUMERATE_SERVICE_WORKER_CONTAINER_EVENT_HANDLERS(E) \
E(oncontrollerchange, HTML::EventNames::controllerchange) \
E(onmessage, HTML::EventNames::message) \
E(onmessageerror, HTML::EventNames::messageerror)
namespace Web::HTML {
class ServiceWorkerContainer : public DOM::EventTarget {
@ -19,10 +24,12 @@ public:
[[nodiscard]] static JS::NonnullGCPtr<ServiceWorkerContainer> create(JS::Realm& realm);
virtual ~ServiceWorkerContainer() override = default;
WebIDL::CallbackType* onmessage();
void set_onmessage(WebIDL::CallbackType*);
WebIDL::CallbackType* onmessageerror();
void set_onmessageerror(WebIDL::CallbackType*);
#undef __ENUMERATE
#define __ENUMERATE(attribute_name, event_name) \
void set_##attribute_name(WebIDL::CallbackType*); \
WebIDL::CallbackType* attribute_name();
ENUMERATE_SERVICE_WORKER_CONTAINER_EVENT_HANDLERS(__ENUMERATE)
#undef __ENUMERATE
private:
explicit ServiceWorkerContainer(JS::Realm&);