Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Upgrade shadow root contents when defining new CEs (#25337)
* Upgrade shadow root contents when defining new CEs When we've already initialized the the custom element registry, it used to drop the list of shadow roots. When a new CE was defined, we would then only query the host `document` (since we dropped all the shadow roots from the array). Obviously, that query selector won't find CEs inside the shadow tree. So, we need to keep the list of shadow roots, that way we can query inside them when defining new custom elements. Note, this will mean leaking every shadow permenantly. Even if the shadow's host is removed from the document, we'll still have to keep its reference. We could setup a long running interval to find disconnected trees, but it wouldn't be able to tell the difference between a temporarily disconneded shadow and a destoyed shadow. * Fix comment * Remove unused private
- Loading branch information