浏览代码

moved test upper

Gildas 6 年之前
父节点
当前提交
bfde8c57c8
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      lib/single-file/modules/css-matched-rules.js

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

@@ -39,9 +39,9 @@ this.matchedRules = this.matchedRules || (() => {
 			const workStyleElement = doc.createElement("style");
 			doc.body.appendChild(workStyleElement);
 			stylesheets.forEach(stylesheetInfo => {
-				const cssRules = stylesheetInfo.stylesheet.children;
-				if (cssRules) {
-					if (!stylesheetInfo.scoped) {
+				if (!stylesheetInfo.scoped) {
+					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);