Re: [whatwg/dom] Add Imperative Slot API (#966)

> Ok, this should be updated with the new "weak pointer in both directions" logic. The intention was:
> 
> * you can call `slot.assign()` at any time with any nodes, regardless of where the nodes or the slot lives at the time.
> * Each node can be manually assigned to only a single `<slot>` at any time.
> * If a `<slot>` currently lives inside a shadow tree that is in "manual" mode, then any nodes in its manually assigned nodes list that are currently light-dom direct children of the shadow host will be slotted in. Any other manually assigned nodes that don't meet these criteria will not be slotted, but will also not be removed from the list.
> * If a `<slot>` with manually assigned nodes currently lives inside a shadow tree that is in "name" mode, the manually assigned nodes will be ignored, and nodes will be assigned based on normal "name" assignment rules. Again, nodes will not be removed from the list here.
> * Given the above, both slots and nodes should be able to be moved around the tree and among documents without destroying the slot-to-node relationships established by `slot.assign()`. Nodes will be (re-)assigned to slots if/when they meet the criteria above.

@alice does this match your current understanding / expectation of how element reflection works as well?

-- 
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/pull/966#issuecomment-816957522

Received on Friday, 9 April 2021 20:36:00 UTC