소스 검색

always get computed style

Gildas 5 년 전
부모
커밋
96e1c0c5f1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/single-file/single-file-helper.js

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

@@ -159,8 +159,8 @@ this.singlefile.lib.helper = this.singlefile.lib.helper || (() => {
 		elements.forEach(element => {
 			let elementHidden, elementKept, computedStyle;
 			if (!options.autoSaveExternalSave && (options.removeHiddenElements || options.removeUnusedFonts || options.compressHTML)) {
+				computedStyle = win.getComputedStyle(element);
 				if (element instanceof win.HTMLElement) {
-					computedStyle = win.getComputedStyle(element);
 					if (options.removeHiddenElements) {
 						elementKept = ((ascendantHidden || element.closest("html > head")) && KEPT_TAG_NAMES.includes(element.tagName)) || element.closest("details");
 						if (!elementKept) {