mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Add oncontrollerchange to ServiceWorkerContainer
This commit is contained in:
parent
2667726b74
commit
4df280689b
Notes:
github-actions[bot]
2024-09-07 09:40:08 +00:00
Author: https://github.com/ADKaster
Commit: 4df280689b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1293
Reviewed-by: https://github.com/awesomekling
4 changed files with 25 additions and 28 deletions
|
@ -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&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue