diff options
Diffstat (limited to 'devtools/server/actors/utils/stylesheets-manager.js')
-rw-r--r-- | devtools/server/actors/utils/stylesheets-manager.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/devtools/server/actors/utils/stylesheets-manager.js b/devtools/server/actors/utils/stylesheets-manager.js index 838e5be602..a9c0705e8d 100644 --- a/devtools/server/actors/utils/stylesheets-manager.js +++ b/devtools/server/actors/utils/stylesheets-manager.js @@ -640,10 +640,14 @@ class StyleSheetsManager extends EventEmitter { return win; }; - const styleSheetRules = - InspectorUtils.getAllStyleSheetCSSStyleRules(styleSheet); - const ruleCount = styleSheetRules.length; - // We need to go through nested rules to extract all the rules we're interested in + // This returns the following type of at-rules: + // - CSSMediaRule + // - CSSContainerRule + // - CSSSupportsRule + // - CSSLayerBlockRule + // New types can be added from InpsectorUtils.cpp `CollectAtRules` + const { atRules: styleSheetRules, ruleCount } = + InspectorUtils.getStyleSheetRuleCountAndAtRules(styleSheet); const atRules = []; for (const rule of styleSheetRules) { const className = ChromeUtils.getClassName(rule); @@ -703,7 +707,10 @@ class StyleSheetsManager extends EventEmitter { }); } } - return { ruleCount, atRules }; + return { + ruleCount, + atRules, + }; } /** |