mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 20:29:42 +00:00
LibWeb/HTML: Start MessagePort's port messsge queue in onmessage setter
...Which doesn't do anything given start() itself doesn't do anything, but this is a subtle enough point of the spec that it seems worthwhile to implement now for whenever this does become meaningful.
This commit is contained in:
@@ -454,6 +454,11 @@ GC::Ptr<WebIDL::CallbackType> MessagePort::onmessageerror()
|
||||
void MessagePort::set_onmessage(GC::Ptr<WebIDL::CallbackType> value)
|
||||
{
|
||||
set_event_handler_attribute(EventNames::message, value);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/web-messaging.html#message-ports:handler-messageeventtarget-onmessage
|
||||
// The first time a MessagePort object's onmessage IDL attribute is set, the port's port message queue must be enabled,
|
||||
// as if the start() method had been called.
|
||||
start();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/web-messaging.html#handler-messageeventtarget-onmessage
|
||||
|
||||
Reference in New Issue
Block a user