Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement messageerror event #6654

Merged

Commits on Nov 20, 2022

  1. Implement messageerror event

    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
    cdumez committed Nov 20, 2022
    Copy the full SHA
    5e2beb5 View commit details
    Browse the repository at this point in the history