-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
topic: custom elementsRelates to custom elements (as defined in DOM and HTML)Relates to custom elements (as defined in DOM and HTML)
Description
What is the issue with the HTML Standard?
As spec-ed the scoped document set holds a strong list of documents in the custom element registry. As far as I can tell, documents are never removed from this set so holding onto a CustomElementRegistry would leak documents (even if they had no relevant children to upgrade!).
e.g. In the following example, the created document leaks as long as registry lives:
const registry = new CustomElementRegistry();
const document = Document.parseHTMLUnsafe(`<!doctype html><x-foo></x-foo>`);
registry.initialize(document.querySelector("x-foo"));Given the only usage of the "scoped document set" is to upgrade relevant elements in a document whose custom element registry is already the registry we're calling .define on, can't we just hold a weak set of elements which need upgrading? (And simply build the set of documents during upgrade?).
Metadata
Metadata
Assignees
Labels
topic: custom elementsRelates to custom elements (as defined in DOM and HTML)Relates to custom elements (as defined in DOM and HTML)