mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05: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:
parent
f8df624171
commit
9f0660c8f0
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
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue