Re: [webcomponents] Change deepPath() back to path (a FrozenArray<EventTarget> attribute) (#428)

https://github.com/w3c/webcomponents/issues/428#issuecomment-194518614 is very interesting, and I can see why that tipped the balance in favor of a method.

However, the main benefit of `FrozenArray<T>` over the old `T[]` construct, I think, is that `event.path===event.path` will always evaluate to true. But there shouldn't really be any problem in letting `event.path` change when dispatch begins and when dispatch ends. Reverting #373 wouldn't really help, as at the very least it has to change when dispatch *begins*. I can't see this spelled out in explicit terms in WebIDL, but if it is currently disallowed then presumably the spec could be changed.

If the alternatives @hayatoito outlines, **Option A** seems worth exploring. It seems pretty likely that this detail could be changed without breaking the web. To access `event.path` after dispatch would require saving a reference to `event` for later, and most event handlers probably don't do that. It should be easy to add a use counter for, but there is a risk that such a counter would be poisoned by code saving the event *and* later enumerating its properties without caring specifically about `path`.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/428#issuecomment-194666092

Received on Thursday, 10 March 2016 05:02:12 UTC