diff --git a/packages/dom/src/clone-dom.js b/packages/dom/src/clone-dom.js index ac131feb9..4cce590ac 100644 --- a/packages/dom/src/clone-dom.js +++ b/packages/dom/src/clone-dom.js @@ -62,6 +62,14 @@ export function cloneNodeAndShadow(ctx) { } }; + // A comment inside a ` with empty marker comments + // around the binding; serialized as `` they make `display: flex` drop. + withExample('
', { withShadow: false }); + + let liveStyle = document.getElementById('lit-markers'); + liveStyle.append( + '.grid {\n', + document.createComment(''), + ' display: flex; gap: 16px; }', + document.createComment('') + ); + expect(window.getComputedStyle(document.querySelector('.grid')).display).toBe('flex'); + + let $ = parseDOM(serializeDOM(), 'plain'); + let clonedStyle = $('#lit-markers')[0]; + + expect(clonedStyle.innerHTML).not.toContain('