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

messageerror event should use ExtendableMessageEvent #1193

Open
bakulf opened this issue Sep 12, 2017 · 4 comments
Open

messageerror event should use ExtendableMessageEvent #1193

bakulf opened this issue Sep 12, 2017 · 4 comments

Comments

@bakulf
Copy link

bakulf commented Sep 12, 2017

Spec says:

If this throws an exception, catch it, fire an event named messageerror at destination, using MessageEvent, with the origin attribute initialized to origin and the source attribute initialized to source, and then abort these steps.

but MessageEvent.source cannot contain the source if it is a Client. We should probably use ExtendableMessageEvent instead.

@jakearchibald
Copy link
Contributor

Agreed!

@mkruisselbrink
Copy link
Collaborator

For the first place this sentence occurs (where the actual message uses ExtendableMessageEvent) definitely. For Client.postMessage using MessageEvent is correct (and consistent with the rest of the algorithm) of course.

@domenic
Copy link
Contributor

domenic commented Sep 12, 2017

Is the event really intended to be extendable?

If not, perhaps adding Client to the enum at https://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces would be a better choice.

@jungkees
Copy link
Collaborator

I think it'd make sense to allow lifetime extensions to messageerror events. Otherwise, we can't guarantee that the event handlers will run to completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants