|
|
@@ -123,21 +123,23 @@ this.cssMinifier = this.cssMinifier || (() => {
|
|
|
return (selectorText || cssRule.selectorText) + "{" + (styleCssText || cssRule.style.cssText) + "}";
|
|
|
}
|
|
|
|
|
|
- function processStyleAttribute(cssStyle, mediaInfo) {
|
|
|
+ function processStyleAttribute(cssStyle, mediaAllInfo) {
|
|
|
let styleCssText = "";
|
|
|
- const styleInfo = mediaInfo.styles.get(cssStyle);
|
|
|
- if (styleInfo) {
|
|
|
- const stylesInfo = parseCss.parseAListOfDeclarations(cssStyle.cssText);
|
|
|
- for (let styleIndex = 0; styleIndex < stylesInfo.length; styleIndex++) {
|
|
|
- const style = stylesInfo[styleIndex];
|
|
|
- if (styleInfo.style.get(style.name)) {
|
|
|
- if (styleCssText) {
|
|
|
- styleCssText += ";";
|
|
|
+ const styleInfos = mediaAllInfo.matchedStyles.get(cssStyle);
|
|
|
+ if (styleInfos) {
|
|
|
+ styleInfos.forEach(styleInfo => {
|
|
|
+ const stylesInfo = parseCss.parseAListOfDeclarations(cssStyle.cssText);
|
|
|
+ for (let styleIndex = 0; styleIndex < stylesInfo.length; styleIndex++) {
|
|
|
+ const style = stylesInfo[styleIndex];
|
|
|
+ if (styleInfo.style.get(style.name)) {
|
|
|
+ if (styleCssText) {
|
|
|
+ styleCssText += ";";
|
|
|
+ }
|
|
|
+ const priority = cssStyle.getPropertyPriority(style.name);
|
|
|
+ styleCssText += style.name + ":" + cssStyle.getPropertyValue(style.name) + (priority && ("!" + priority));
|
|
|
}
|
|
|
- const priority = cssStyle.getPropertyPriority(style.name);
|
|
|
- styleCssText += style.name + ":" + cssStyle.getPropertyValue(style.name) + (priority && ("!" + priority));
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
}
|
|
|
return (styleCssText || cssStyle.cssText);
|
|
|
}
|