|
|
@@ -25,7 +25,7 @@ this.RulesMatcher = this.RulesMatcher || (() => {
|
|
|
const MEDIA_ALL = "all";
|
|
|
const PRIORITY_IMPORTANT = "important";
|
|
|
|
|
|
- return class {
|
|
|
+ class RulesMatcher {
|
|
|
constructor(doc) {
|
|
|
this.doc = doc;
|
|
|
this.mediaAllInfo = createMediaInfo(MEDIA_ALL);
|
|
|
@@ -51,6 +51,12 @@ this.RulesMatcher = this.RulesMatcher || (() => {
|
|
|
getMatchedRules(element) {
|
|
|
this.mediaAllInfo.elements.get(element);
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ create(doc) {
|
|
|
+ return new RulesMatcher(doc);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
function getMatchedElementsRules(doc, cssRules, mediaInfo, sheetIndex) {
|