-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
agenda+To be discussed at a triage meetingTo be discussed at a triage meetingtopic: 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?
Currently, the fragment parser uses the custom element registry of its context element when parsing.
(https://html.spec.whatwg.org/multipage/parsing.html#html-fragment-parsing-algorithm step 8)
This has some observable side effects that might not be ideal.
Specifically, the custom element is upgraded and its constructor is invoked at fragment-parse time rather than at connection time.
It is observable in the following scenarios:
- setting
innerHTMLon a disconnected element with a registry upgrades its custom elements and calls the constructors - When creating a contextual fragment, the elements are upgraded based on the context but the fragment might be added to a different element in the end
- If there is any change in the registry between parsing time and connection time, the first one wins.
- More acutely - see Custom element registry can call constructor of sanitizer-removed elements WICG/sanitizer-api#381. Elements are upgraded before the sanitizer gets to remove them.
Not sure how to go about this, since it's the only way those element-scoped registries are respected.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agenda+To be discussed at a triage meetingTo be discussed at a triage meetingtopic: custom elementsRelates to custom elements (as defined in DOM and HTML)Relates to custom elements (as defined in DOM and HTML)