Re: [whatwg/dom] Shadow: Specify when `slotchange` fires (#447)

> Maybe it’s worth thinking about exposing removedNodes in the slotchage event somehow. The event comes from an internal MutationObserver, so that data should be available, no? Probably a discussion for a new issue.

Yeah, it is a discussion for a new issue, but I have to say it is difficult. For a historical and the performance reason, Blink calculates slot's assigned nodes *lazily*. That means Blink tries to *detect* a slotchange is being happened at DOM mutation timing, but Blink doesn't calculate each slot's assigned nodes at this timing. The calculation of assigned nodes is delayed until some triger would happen later, like `slot.assignedNodes()` is called in an event listener 
I guess this might sound strange to some of you, but this is an important performance optimization, which I would like to preserve, so that we don't have to remove slotchange from DOM Standard due to the performance reasons. :)

-- 
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/447#issuecomment-303003747

Received on Monday, 22 May 2017 05:39:32 UTC