[whatwg/dom] Clarify null "get-the-parent" note (#908)

Hey,

A user opened an issue asking for non-null "get the parent" in Node.js's EventTarget implementation https://github.com/nodejs/node/issues/34894#issuecomment-716913252 - 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 `EventTarget`s 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  


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/908

Received on Tuesday, 27 October 2020 09:01:55 UTC