-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add tests for the messageerror IDL and content attributes #5567
Conversation
Follows whatwg/html#2530. As explained there, the circumstances in which this would actually be fired by the UA are not tested in this PR, waiting instead for #5003. As a side effect this syncs various IDL snippets with the HTML Standard.
Notifying @annevk, @aogilvie, @ayg, @jdm, @mkruisselbrink, and @zqzhang. (Learn how reviewing works.) |
LintPassed |
*This report has been truncated because the total content is 2989260 characters in length, which is in excess of GitHub.com's limit for comments (65536 characters). Firefox (nightly channel)Testing web-platform-tests at revision de241dd All results3 tests ran/html/dom/interfaces.html
|
*This report has been truncated because the total content is 3016726 characters in length, which is in excess of GitHub.com's limit for comments (65536 characters). Chrome (unstable channel)Testing web-platform-tests at revision de241dd All results3 tests ran/html/dom/interfaces.html
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also adds onrejectionhandled and onunhandledrejection and aligns IDL around transferable changes, but that all looks reasonable.
The messageerror event is used when deserialization fails. E.g., when an ArrayBuffer object cannot be allocated. This also removes StructuredCloneWithTransfer as deserializing errors now need to be handled on their own. Tests: web-platform-tests/wpt#5567. Service workers follow-up: w3c/ServiceWorker#1116. Fixes part of #2260 and fixes #935.
The messageerror event is used when deserialization fails. E.g., when an ArrayBuffer object cannot be allocated. This also removes StructuredCloneWithTransfer as deserializing errors now need to be handled on their own. Tests: web-platform-tests/wpt#5567. Service workers follow-up: w3c/ServiceWorker#1116. Fixes part of #2260 and fixes #935.
|
||
document.body.setAttribute("onmessageerror", "window.messageErrorHappened = true;") | ||
|
||
document.body.dispatchEvent(new Event("messageerror")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about this test -- if I try the same thing with onmessage
and message
instead, it doesn't fire on Chrome or Firefox. Is there something special about the messageerror event here? Or am I missing something?
(BTW, it works fine if the event is dispatched on window instead of document.body)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it doesn't work with message, that's likely a sign this test is bad. I'll look into it first thing on Monday. The fix might indeed just be dispatching on window.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, cool. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test appears to be just invalid, yeah. I'll submit a PR removing it.
This is a follow-up to #5567. As pointed out in https://github.com/w3c/web-platform-tests/pull/5567/files#r114040410, this test is invalid. messageerror (and message) have their corresponding event handler content attributes on document.body, but with the actual event handler belonging to Window.
This is a follow-up to #5567. As pointed out in https://github.com/w3c/web-platform-tests/pull/5567/files#r114040410, this test is invalid. messageerror (and message) have their corresponding event handler content attributes on document.body, but with the actual event handler belonging to Window.
The messageerror event is used when deserialization fails. E.g., when an ArrayBuffer object cannot be allocated. This also removes StructuredCloneWithTransfer as deserializing errors now need to be handled on their own. Tests: web-platform-tests/wpt#5567. Service workers follow-up: w3c/ServiceWorker#1116. Fixes part of whatwg#2260 and fixes whatwg#935.
The messageerror event is used when deserialization fails. E.g., when an ArrayBuffer object cannot be allocated. This also removes StructuredCloneWithTransfer as deserializing errors now need to be handled on their own. Tests: web-platform-tests/wpt#5567. Service workers follow-up: w3c/ServiceWorker#1116. Fixes part of whatwg#2260 and fixes whatwg#935.
This event is not currently wired up anywhere, but will be used in a subsequent CL. The idea is that when posting a message that cannot be decoded by the receiver, the receiver will dispatch a messageerror event instead of a message event. Spec changes: whatwg/html#2530 web platform tests: web-platform-tests/wpt#5567 Intent-to-implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/Z_XzejHJTrs BUG=chromium:714842 Review-Url: https://codereview.chromium.org/2860483002 Cr-Commit-Position: refs/heads/master@{#471491}
The messageerror event is used when deserialization fails. E.g., when an ArrayBuffer object cannot be allocated. This also removes StructuredCloneWithTransfer as deserializing errors now need to be handled on their own. Tests: web-platform-tests/wpt#5567. Service workers follow-up: w3c/ServiceWorker#1116. Fixes part of whatwg#2260 and fixes whatwg#935.
Follows whatwg/html#2530. As explained there, the circumstances in which this would actually be fired by the UA are not tested in this PR, waiting instead for #5003.
As a side effect this syncs various IDL snippets with the HTML Standard.
FYI @binji @mtrofin on the Blink side, @lars-t-hansen on the Gecko side.
This change is