Re: [whatwg/dom] event.composedPath() may return different results if DOM is modified between two calls (#525)

The current model leads to also very surprising results if one removes a node from closed shadow tree during event dispatch.
Say, there is node A in light dom, B somewhere underneath it in a closed shadow dom, and the C in a (non-closed) shadow dom under B.
Capturing event listener on A won't get any shadow nodes in composedPath(), since C is hidden because it is underneath closed B. Now, if B is removed from its parent, it's root isn't anymore closed shadow root, so also everything in C becomes visible, and now if A has a listener in bubble phase too, the composedPath() becomes very different to what it was during capture phase.
I'd definitely prefer keep returning the same composed path all the time per currentTarget, and the value of the path would be solely based on the initial path.

-- 
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/525#issuecomment-340844680

Received on Tuesday, 31 October 2017 17:44:38 UTC