Re: [whatwg/dom] Allow custom "get the parent" algorithms for EventTargets (#583)

It would help implementers (at least Mozilla) if there were a bit more concrete proposal here.

It sounds like the use cases require effectively a DOM node tree, without the objects being actual nodes, but some other types of EventTargets.  And one should be able to modify the tree using similar concepts as DOM tree.
And when dealing with mutations, the operations need to ensure one doesn't cause any cycles.

Minimal API from Event handling point of view would be something like setParentEventTarget(EventTarget? parent).
That should throw if 'this' is some other native EventTarget than EventTarget itself, or if parent is found in the parent chain or parent is 'this'. Calling setParentEventTarget(null) would be left to the user of the API - like the rest of the possible tree operations.
And event target path doesn't care about bubble or capture. The path is path, and how an event propagates through it depends on the properties of the event itself.

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

Message ID: <whatwg/dom/issues/583/1408726229@github.com>

Received on Monday, 30 January 2023 14:32:12 UTC