https://bugs.webkit.org/show_bug.cgi?id=171216
rdar://96467919
Reviewed by Darin Adler.
Implement messageerror event:
- whatwg/html#2530
Previously, WebKit would fire a `message` event with its `data` being null,
whenever data deserialization would fail. This wasn't as per specification and
did not match other browser engines. We're supposed to fire a `messageerror`
event instead.
This patch addresses the issue.
* LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-windowless-body-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/wasm/serialization/module/broadcastchannel-success-and-failure-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/wasm/serialization/module/window-sharedworker-failure-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webmessaging/messageerror-expected.txt:
* Source/WebCore/bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::deserialize):
* Source/WebCore/bindings/js/SerializedScriptValue.h:
* Source/WebCore/dom/BroadcastChannel.cpp:
(WebCore::BroadcastChannel::dispatchMessage):
* Source/WebCore/dom/MessageEvent.cpp:
(WebCore::MessageEvent::create):
* Source/WebCore/dom/MessageEvent.h:
* Source/WebCore/dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):
* Source/WebCore/dom/MessagePort.idl:
* Source/WebCore/html/HTMLAttributeNames.in:
* Source/WebCore/page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
* Source/WebCore/page/WindowEventHandlers.idl:
* Source/WebCore/workers/DedicatedWorkerGlobalScope.idl:
* Source/WebCore/workers/Worker.idl:
* Source/WebCore/workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
* Source/WebCore/workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::startMessages):
(WebCore::ServiceWorkerContainer::postMessage):
* Source/WebCore/workers/service/ServiceWorkerContainer.h:
* Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:
(WebCore::fireMessageEvent):
Canonical link: https://commits.webkit.org/256896@main