You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
FAIL HTMLBodyElement interface: attribute onmessageerror assert_true: The prototype object must have a property "onmessageerror" expected true got false
PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onhashchange" with the proper type
610
610
PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onlanguagechange" with the proper type
611
611
PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onmessage" with the proper type
612
-
FAIL HTMLBodyElement interface: document.createElement("body") must inherit property "onmessageerror" with the proper type assert_inherits: property "onmessageerror" not found in prototype chain
612
+
PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onmessageerror" with the proper type
613
613
PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onoffline" with the proper type
614
614
PASS HTMLBodyElement interface: document.createElement("body") must inherit property "ononline" with the proper type
615
615
PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onpagehide" with the proper type
FAIL Window interface: attribute onmessageerror assert_own_property: The global object must have a property "onmessageerror" expected property "onmessageerror" missing
4529
+
PASS Window interface: attribute onmessageerror
4530
4530
PASS Window interface: attribute onoffline
4531
4531
PASS Window interface: attribute ononline
4532
4532
PASS Window interface: attribute onpagehide
@@ -4681,7 +4681,7 @@ PASS Window interface: window must inherit property "onbeforeunload" with the pr
4681
4681
PASS Window interface: window must inherit property "onhashchange" with the proper type
4682
4682
PASS Window interface: window must inherit property "onlanguagechange" with the proper type
4683
4683
PASS Window interface: window must inherit property "onmessage" with the proper type
4684
-
FAIL Window interface: window must inherit property "onmessageerror" with the proper type assert_own_property: expected property "onmessageerror" missing
4684
+
PASS Window interface: window must inherit property "onmessageerror" with the proper type
4685
4685
PASS Window interface: window must inherit property "onoffline" with the proper type
4686
4686
PASS Window interface: window must inherit property "ononline" with the proper type
4687
4687
PASS Window interface: window must inherit property "onpagehide" with the proper type
FAIL HTMLFrameSetElement interface: attribute onmessageerror assert_true: The prototype object must have a property "onmessageerror" expected true got false
@@ -5225,7 +5225,7 @@ PASS HTMLFrameSetElement interface: document.createElement("frameset") must inhe
5225
5225
PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onhashchange" with the proper type
5226
5226
PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onlanguagechange" with the proper type
5227
5227
PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onmessage" with the proper type
5228
-
FAIL HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onmessageerror" with the proper type assert_inherits: property "onmessageerror" not found in prototype chain
5228
+
PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onmessageerror" with the proper type
5229
5229
PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onoffline" with the proper type
5230
5230
PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "ononline" with the proper type
5231
5231
PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onpagehide" with the proper type
FAIL DedicatedWorkerGlobalScope interface: attribute onmessageerror assert_own_property: The global object must have a property "onmessageerror" expected property "onmessageerror" missing
PASS DedicatedWorkerGlobalScope interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError
PASS DedicatedWorkerGlobalScope interface: calling postMessage(any, optional StructuredSerializeOptions) on self with too few arguments must throw TypeError
662
662
PASS DedicatedWorkerGlobalScope interface: self must inherit property "close()" with the proper type
663
663
PASS DedicatedWorkerGlobalScope interface: self must inherit property "onmessage" with the proper type
664
-
FAIL DedicatedWorkerGlobalScope interface: self must inherit property "onmessageerror" with the proper type assert_own_property: expected property "onmessageerror" missing
664
+
PASS DedicatedWorkerGlobalScope interface: self must inherit property "onmessageerror" with the proper type
665
665
FAIL DedicatedWorkerGlobalScope interface: self must inherit property "requestAnimationFrame(FrameRequestCallback)" with the proper type assert_own_property: expected property "requestAnimationFrame" missing
666
666
FAIL DedicatedWorkerGlobalScope interface: calling requestAnimationFrame(FrameRequestCallback) on self with too few arguments must throw TypeError assert_own_property: expected property "requestAnimationFrame" missing
667
667
FAIL DedicatedWorkerGlobalScope interface: self must inherit property "cancelAnimationFrame(unsigned long)" with the proper type assert_own_property: expected property "cancelAnimationFrame" missing
Copy file name to clipboardExpand all lines: LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window-expected.txt
FAIL shadowed messageerror (document.body) assert_equals: alternative body should reflect expected (function) function "() => 0" but got (undefined) undefined
FAIL shadowed messageerror removal (document.body) assert_equals: body should reflect changes to itself expected (object) null but got (undefined) undefined
FAIL shadowed messageerror (document.createElement("body")) assert_equals: body should reflect expected (function) function "() => 0" but got (undefined) undefined
FAIL shadowed messageerror removal (document.createElement("body")) assert_equals: alternative body should reflect changes to itself expected (object) null but got (undefined) undefined
Copy file name to clipboardExpand all lines: LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-windowless-body-expected.txt
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,8 @@ PASS Return null when getting the languagechange event handler of a windowless b
23
23
PASS Ignore setting of languagechange window event handlers on windowless body
24
24
PASS Return null when getting the message event handler of a windowless body
25
25
PASS Ignore setting of message window event handlers on windowless body
26
-
FAIL Return null when getting the messageerror event handler of a windowless body assert_equals: expected (object) null but got (undefined) undefined
27
-
FAIL Ignore setting of messageerror window event handlers on windowless body assert_equals: expected (object) null but got (function) function "function () { return "Handler attached to windowless element"; }"
26
+
PASS Return null when getting the messageerror event handler of a windowless body
27
+
PASS Ignore setting of messageerror window event handlers on windowless body
28
28
PASS Return null when getting the offline event handler of a windowless body
29
29
PASS Ignore setting of offline window event handlers on windowless body
30
30
PASS Return null when getting the online event handler of a windowless body
@@ -132,8 +132,8 @@ PASS Return null when getting the languagechange event handler of a windowless f
132
132
PASS Ignore setting of languagechange window event handlers on windowless frameset
133
133
PASS Return null when getting the message event handler of a windowless frameset
134
134
PASS Ignore setting of message window event handlers on windowless frameset
135
-
FAIL Return null when getting the messageerror event handler of a windowless frameset assert_equals: expected (object) null but got (undefined) undefined
136
-
FAIL Ignore setting of messageerror window event handlers on windowless frameset assert_equals: expected (object) null but got (function) function "function () { return "Handler attached to windowless element"; }"
135
+
PASS Return null when getting the messageerror event handler of a windowless frameset
136
+
PASS Ignore setting of messageerror window event handlers on windowless frameset
137
137
PASS Return null when getting the offline event handler of a windowless frameset
138
138
PASS Ignore setting of offline window event handlers on windowless frameset
139
139
PASS Return null when getting the online event handler of a windowless frameset
FAIL The default value of onmessageerror is null assert_equals: body expected (object) null but got (undefined) undefined
3
-
FAIL The onmessageerror content attribute must be compiled into the onmessageerror property assert_equals: The onmessageerror property must be a function expected "function" but got "undefined"
4
-
FAIL The onmessageerror content attribute must execute when an event is dispatched on the window assert_true: Dispatching the event must run the code expected true got false
2
+
PASS The default value of onmessageerror is null
3
+
PASS The onmessageerror content attribute must be compiled into the onmessageerror property
4
+
PASS The onmessageerror content attribute must execute when an event is dispatched on the window
0 commit comments