Bläddra i källkod

retrieve shadowRoot only if the element is visible

Gildas 6 år sedan
förälder
incheckning
e6c72a5616
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      lib/single-file/single-file-helper.js

+ 1 - 1
lib/single-file/single-file-helper.js

@@ -134,7 +134,7 @@ this.singlefile.lib.helper = this.singlefile.lib.helper || (() => {
 				}
 			}
 			getResourcesInfo(win, doc, element, options, data, elementHidden);
-			if (element.shadowRoot) {
+			if (element.shadowRoot && !elementHidden) {
 				const shadowRootInfo = {};
 				element.setAttribute(SHADOW_ROOT_ATTRIBUTE_NAME, data.shadowRootsData.length);
 				data.shadowRootsData.push(shadowRootInfo);