소스 검색

always ignore web components stylesheets

Gildas 6 년 전
부모
커밋
5962bacada
1개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 8 6
      lib/single-file/modules/css-matched-rules.js

+ 8 - 6
lib/single-file/modules/css-matched-rules.js

@@ -41,12 +41,14 @@ this.matchedRules = this.matchedRules || (() => {
 			stylesheets.forEach(stylesheetInfo => {
 				const cssRules = stylesheetInfo.stylesheet.children;
 				if (cssRules) {
-					if (stylesheetInfo.mediaText && stylesheetInfo.mediaText != MEDIA_ALL) {
-						const mediaInfo = createMediaInfo(stylesheetInfo.mediaText);
-						this.mediaAllInfo.medias.set("style-" + sheetIndex + "-" + stylesheetInfo.mediaText, mediaInfo);
-						getMatchedElementsRules(doc, cssRules, mediaInfo, sheetIndex, styles, matchedElementsCache, workStyleElement);
-					} else if (!stylesheetInfo.scoped) {
-						getMatchedElementsRules(doc, cssRules, this.mediaAllInfo, sheetIndex, styles, matchedElementsCache, workStyleElement);
+					if (!stylesheetInfo.scoped) {
+						if (stylesheetInfo.mediaText && stylesheetInfo.mediaText != MEDIA_ALL) {
+							const mediaInfo = createMediaInfo(stylesheetInfo.mediaText);
+							this.mediaAllInfo.medias.set("style-" + sheetIndex + "-" + stylesheetInfo.mediaText, mediaInfo);
+							getMatchedElementsRules(doc, cssRules, mediaInfo, sheetIndex, styles, matchedElementsCache, workStyleElement);
+						} else {
+							getMatchedElementsRules(doc, cssRules, this.mediaAllInfo, sheetIndex, styles, matchedElementsCache, workStyleElement);
+						}
 					}
 				}
 				sheetIndex++;