Re: [WICG/webcomponents] Scoped Custom Element Registry: Moving elements with shadow roots between documents (#907)

@rniwa we were able to debated this topic extensibly during the virtual F2F meeting today (you were missed there for sure). Please, read the notes. Here are my takeaways from the meeting:

1.  General consensus around a non-settable registry as you suggested. definitely seems problematic for other implementers.  the caveat here is the intersection semantics with declarative shadow root, in which case it seems we can take a similar approach to the attach shadow mechanism, a bit in the shadowRoot instance that determines whether or not the registry can be set once (probably via elementInternals). @justinfagnani will work on defining that.
2.  After talking about this topic for about 1hr, it seems that we started leaning toward preserving the registry from the original document. The general issue around releasing memory didn't have legs, and we discussed many potential shortcoming of trying to release the memory without exposing the GC mechanism (it seems that any work there could potentially expose the GC process to user-land).
3. It seems that keeping the original registry associated to the original shadow, even though the internal owner document is changing to the new document can still be achieved in a relative easy manner (according to the other implementers in the room) by lifting some of the restrictions/validations during the construction phase of the elements.
4. Mason from google will be looking into the issue reported for Chrome, in principle, he thinks that what other browsers are doing with respect to resetting the parser is the way to go for this edge case, and hence all built-in elements created by the parsing process should be bound to the new owner-document. It seems that the issue was mostly around customization of built-ins, which is only supported by them.

Do you have any comments around these 4 bullet points? Maybe we can get @leobalter to organize something for a smaller group if you think we need more discussions around this topic.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/907#issuecomment-825234297

Received on Thursday, 22 April 2021 22:59:00 UTC