mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02: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:
Notes:
github-actions[bot]
2025-01-20 12:53:52 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/9f0660c8f0d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3129 Reviewed-by: https://github.com/trflynn89
@@ -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