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

How about overloading the constructor of an `EventTarget` to allow assignment of a parentNode?

```webidl
[Exposed=*]
interface EventTarget {
  constructor(parent?: EventTarget);
}
```

If the `parent` is `undefined` or `null` then the `EventTarget` is considered to have no parent, otherwise assert that `parent` is `EventTarget`. For `Node`, `ShadowRoot` and `Document`, the `constructor` remains as-is and they continue to use their custom `get the parent` algos.

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

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

Received on Monday, 9 October 2023 10:50:37 UTC