Unlike elements, document fragments “dissolve” when they are added to the DOM. Their self-destructive nature makes them difficult to use as stable representations of a fragment of a document; for example, you can add event listeners to a document fragment, but when the document fragment is attached to the DOM, the fragment empties and so the event listeners will never fire.
This restores the previous behavior of the html tagged template literal: if the template literal results in multiple top-level nodes, these nodes are wrapped in an implicit DIV. Likewise, the svg tagged template literal uses an implicit G.
Unlike elements, document fragments “dissolve” when they are added to the DOM. Their self-destructive nature makes them difficult to use as stable representations of a fragment of a document; for example, you can add event listeners to a document fragment, but when the document fragment is attached to the DOM, the fragment empties and so the event listeners will never fire.
This restores the previous behavior of the html tagged template literal: if the template literal results in multiple top-level nodes, these nodes are wrapped in an implicit DIV. Likewise, the svg tagged template literal uses an implicit G.