This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Define a way to construct an EventTarget with a modifiable parent chain. Suggestion from smaug: [Constuctor] interface EventReceiver : EventTarget { attribute EventTarget parent; }
How were we going to deal with cycles here?
Modifying the event parent seems problematic. If we instead pass the parent to the constructor there will never be a problem as far as I can tell.
Why is modifying the parent problematic? Nodes can be moved around and that isn't problematic.
Though, I'm not sure we need to support modifying .parent.
The problem is that when you do event dispatch you need to compute the ancestor chain. If parent becomes settable, A can be a parent of B and B can be a parent of A, which thus far has been impossible and would require the introduction of cycle detection.
Of course there would have to be cycle detection. Nodes have it too.
My suggestion is that we make it more explicit in the specification that EventTarget has an associated "event parent" concept (we need that anyway). We then allow that concept to be set through the constructor: [Constructor(optional EventTarget = null)] interface EventTarget ... If we want we could expose that concept on the interface, but I don't think we need to do that right away. For nodes this is already covered by parentNode, for custom EventTarget objects this could be manually managed.
This does not seem high priority given the other things we have going on. JavaScript will prolly provide this in due course.
https://github.com/whatwg/dom/issues/441