mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-04 17:33:04 +00:00
LibWeb/HTML: Do not use macro to implement MessagePort event handlers
This is not really any more code, and will make it easier to implement the custom behaviour specified for the onmessage setter.
This commit is contained in:
parent
43dc0f52a6
commit
f8df624171
Notes:
github-actions[bot]
2025-01-20 12:53:59 +00:00
Author: https://github.com/shannonbooth
Commit: f8df624171
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3129
Reviewed-by: https://github.com/trflynn89
2 changed files with 28 additions and 22 deletions
|
@ -18,10 +18,6 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
#define ENUMERATE_MESSAGE_PORT_EVENT_HANDLERS(E) \
|
||||
E(onmessage, HTML::EventNames::message) \
|
||||
E(onmessageerror, HTML::EventNames::messageerror)
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/web-messaging.html#message-ports
|
||||
class MessagePort final : public DOM::EventTarget
|
||||
, public Bindings::Transferable {
|
||||
|
@ -50,12 +46,11 @@ public:
|
|||
|
||||
void close();
|
||||
|
||||
#undef __ENUMERATE
|
||||
#define __ENUMERATE(attribute_name, event_name) \
|
||||
void set_##attribute_name(WebIDL::CallbackType*); \
|
||||
WebIDL::CallbackType* attribute_name();
|
||||
ENUMERATE_MESSAGE_PORT_EVENT_HANDLERS(__ENUMERATE)
|
||||
#undef __ENUMERATE
|
||||
void set_onmessageerror(GC::Ptr<WebIDL::CallbackType>);
|
||||
GC::Ptr<WebIDL::CallbackType> onmessageerror();
|
||||
|
||||
void set_onmessage(GC::Ptr<WebIDL::CallbackType>);
|
||||
GC::Ptr<WebIDL::CallbackType> onmessage();
|
||||
|
||||
// ^Transferable
|
||||
virtual WebIDL::ExceptionOr<void> transfer_steps(HTML::TransferDataHolder&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue