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

Clarify null "get-the-parent" note #908

Closed
benjamingr opened this issue Oct 27, 2020 · 2 comments
Closed

Clarify null "get-the-parent" note #908

benjamingr opened this issue Oct 27, 2020 · 2 comments
Labels
clarification Standard could be clearer topic: events

Comments

@benjamingr
Copy link
Member

Hey,

A user opened an issue asking for non-null "get the parent" in Node.js's EventTarget implementation nodejs/node#34894 (comment) - when we quoted:

Note: Because of the defaults stated elsewhere, the returned EventTarget's get the parent algorithm will return null, and it will have no activation behavior, legacy-pre-activation behavior, or legacy-canceled-activation behavior.

Note: In the future we could allow custom get the parent algorithms. Let us know if this would be useful for your programs. For now, all author-created EventTargets do not participate in a tree structure.

Saying to our understanding not only do we not want to implement this but we are forbidden - they replied with:

I also read the note we both quoted as publically exposing a get-the-parent method. Ironically, my interpretation would be more liberal here and would yours more literal. I interpreted it as avoiding polluting the property list and possibly causing conflicts with future changes to the EventTarget spec. That's why I mentioned a WeakMap, or Symbol. Whatever the method is internally should be allowed to be overridden, even if not by users because of this:


While I think specs should probably always be interpreted literally - I think it might make sense to further clarify the spec to mention (in places that refer to "get the parent") that EventTargets created by users always have "null get-the-parent".

I personally think the current text is clear - but people here (like Domenic) have spent a lot of time explaining things I misunderstood before to me :] So I think a user misunderstanding this is a good indication there is improvement potential.

What do you think?

cc @domenic @annevk

@annevk annevk transferred this issue from whatwg/html Oct 27, 2020
@annevk
Copy link
Member

annevk commented Oct 27, 2020

You are correct and that's a very surprising alternative interpretation given what's quoted. Anyway, I guess we'll take PRs to further clarify it.

@annevk annevk added the clarification Standard could be clearer label Oct 27, 2020
@benjamingr
Copy link
Member Author

Re-reading this a month later, I have no idea how it could be interpreted differently since it literally says For now, all author-created EventTargets do not participate in a tree structure.

I tried to come up with a clearer phrasing but couldn't. I think this is probably fine to close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer topic: events
Development

No branches or pull requests

2 participants