From 58cbca477120f5de792422ac5dc75b00e0a5bee3 Mon Sep 17 00:00:00 2001 From: Amit Singh Sansoya Date: Tue, 26 Nov 2024 16:55:14 +0530 Subject: [PATCH] Shadowroot support using getHTML (#1795) * Shadowroot support using getHTML * Removing backward compatability for getInnerHTML * Removing checks for innerHTML * Adding back the backward compatability for tests * Fixing Test Coverage --- packages/dom/src/clone-dom.js | 19 +++++++++++++++---- packages/dom/test/serialize-css.test.js | 6 +++--- packages/dom/test/serialize-dom.test.js | 12 ++++++------ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/packages/dom/src/clone-dom.js b/packages/dom/src/clone-dom.js index d63679f54..938d54f21 100644 --- a/packages/dom/src/clone-dom.js +++ b/packages/dom/src/clone-dom.js @@ -54,7 +54,8 @@ export function cloneNodeAndShadow(ctx) { clone.shadowRoot.innerHTML = ''; } else { clone.attachShadow({ - mode: 'open' + mode: 'open', + serializable: true }); } // clone dom elements @@ -84,10 +85,20 @@ export function cloneNodeAndShadow(ctx) { * Use `getInnerHTML()` to serialize shadow dom as