|
|
@@ -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++;
|